From buildbot at python.org Sun Feb 1 00:07:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 31 Jan 2009 23:07:56 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090131230756.323A81E4002@bag.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/150 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: benjamin.peterson BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Sun Feb 1 00:17:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 31 Jan 2009 23:17:14 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090131231714.424541E400C@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/195 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_epoll make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun Feb 1 00:24:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 31 Jan 2009 23:24:52 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090131232452.7A5C91E4002@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/208 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_distutils test_posix ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 43, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.x.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.x.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 Sun Feb 1 00:43:25 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 1 Feb 2009 00:43:25 +0100 (CET) Subject: [Python-checkins] r69157 - python/trunk/Python/compile.c Message-ID: <20090131234325.58BEE1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 1 00:43:25 2009 New Revision: 69157 Log: add explanatory comment Modified: python/trunk/Python/compile.c Modified: python/trunk/Python/compile.c ============================================================================== --- python/trunk/Python/compile.c (original) +++ python/trunk/Python/compile.c Sun Feb 1 00:43:25 2009 @@ -3769,6 +3769,8 @@ return NULL; while (PyDict_Next(dict, &pos, &k, &v)) { i = PyInt_AS_LONG(v); + /* The keys of the dictionary are tuples. (see compiler_add_o) + The object we want is always first, though. */ k = PyTuple_GET_ITEM(k, 0); Py_INCREF(k); assert((i - offset) < size); From buildbot at python.org Sun Feb 1 00:45:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 31 Jan 2009 23:45:07 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 2.6 Message-ID: <20090131234507.9B95F1E4002@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/84 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 buildbot at python.org Sun Feb 1 00:47:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 31 Jan 2009 23:47:20 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090131234720.3DDF41E4002@bag.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/1782 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: david.goodger,gregory.p.smith BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Sun Feb 1 00:54:38 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 1 Feb 2009 00:54:38 +0100 (CET) Subject: [Python-checkins] r69158 - python/trunk/Python/compile.c Message-ID: <20090131235438.47A951E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 1 00:54:38 2009 New Revision: 69158 Log: more flags which only work for function blocks Modified: python/trunk/Python/compile.c Modified: python/trunk/Python/compile.c ============================================================================== --- python/trunk/Python/compile.c (original) +++ python/trunk/Python/compile.c Sun Feb 1 00:54:38 2009 @@ -3794,13 +3794,11 @@ flags |= CO_NESTED; if (ste->ste_generator) flags |= CO_GENERATOR; + if (ste->ste_varargs) + flags |= CO_VARARGS; + if (ste->ste_varkeywords) + flags |= CO_VARKEYWORDS; } - if (ste->ste_varargs) - flags |= CO_VARARGS; - if (ste->ste_varkeywords) - flags |= CO_VARKEYWORDS; - if (ste->ste_generator) - flags |= CO_GENERATOR; /* (Only) inherit compilerflags in PyCF_MASK */ flags |= (c->c_flags->cf_flags & PyCF_MASK); From python-checkins at python.org Sun Feb 1 01:16:01 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sun, 1 Feb 2009 01:16:01 +0100 (CET) Subject: [Python-checkins] r69159 - python/trunk/Doc/library/binascii.rst Message-ID: <20090201001601.BF31C1E4002@bag.python.org> Author: gregory.p.smith Date: Sun Feb 1 01:16:01 2009 New Revision: 69159 Log: Update doc wording as suggested in issue4903. Modified: python/trunk/Doc/library/binascii.rst Modified: python/trunk/Doc/library/binascii.rst ============================================================================== --- python/trunk/Doc/library/binascii.rst (original) +++ python/trunk/Doc/library/binascii.rst Sun Feb 1 01:16:01 2009 @@ -120,17 +120,17 @@ To generate the same numeric value across all Python versions and platforms use crc32(data) & 0xffffffff. If you are only using the checksum in packed binary format this is not necessary as the - return value will have the correct 32bit binary representation + return value is the correct 32bit binary representation regardless of sign. .. versionchanged:: 2.6 - The return value will always be in the range [-2**31, 2**31-1] + The return value is in the range [-2**31, 2**31-1] regardless of platform. In the past the value would be signed on some platforms and unsigned on others. Use & 0xffffffff on the value if you want it to match 3.0 behavior. .. versionchanged:: 3.0 - The return value will always be unsigned and in the range [0, 2**32-1] + The return value is unsigned and in the range [0, 2**32-1] regardless of platform. From python-checkins at python.org Sun Feb 1 01:19:42 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sun, 1 Feb 2009 01:19:42 +0100 (CET) Subject: [Python-checkins] r69160 - python/branches/release26-maint/Doc/library/binascii.rst Message-ID: <20090201001942.699281E4002@bag.python.org> Author: gregory.p.smith Date: Sun Feb 1 01:19:42 2009 New Revision: 69160 Log: #documentation update for issue4903 - svn merge -c68535 http://svn.python.org/projects/python/trunk svn merge -c69159 http://svn.python.org/projects/python/trunk Modified: python/branches/release26-maint/Doc/library/binascii.rst Modified: python/branches/release26-maint/Doc/library/binascii.rst ============================================================================== --- python/branches/release26-maint/Doc/library/binascii.rst (original) +++ python/branches/release26-maint/Doc/library/binascii.rst Sun Feb 1 01:19:42 2009 @@ -120,17 +120,17 @@ To generate the same numeric value across all Python versions and platforms use crc32(data) & 0xffffffff. If you are only using the checksum in packed binary format this is not necessary as the - return value will have the correct 32bit binary representation + return value is the correct 32bit binary representation regardless of sign. .. versionchanged:: 2.6 - The return value will always be in the range [-2**31, 2**31-1] + The return value is in the range [-2**31, 2**31-1] regardless of platform. In the past the value would be signed on some platforms and unsigned on others. Use & 0xffffffff on the value if you want it to match 3.0 behavior. .. versionchanged:: 3.0 - The return value will always be unsigned and in the range [0, 2**32-1] + The return value is unsigned and in the range [0, 2**32-1] regardless of platform. From python-checkins at python.org Sun Feb 1 01:24:21 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sun, 1 Feb 2009 01:24:21 +0100 (CET) Subject: [Python-checkins] r69161 - python/trunk/Doc/library/zlib.rst Message-ID: <20090201002421.3FFC21E4002@bag.python.org> Author: gregory.p.smith Date: Sun Feb 1 01:24:21 2009 New Revision: 69161 Log: wording for for issue4903. Modified: python/trunk/Doc/library/zlib.rst Modified: python/trunk/Doc/library/zlib.rst ============================================================================== --- python/trunk/Doc/library/zlib.rst (original) +++ python/trunk/Doc/library/zlib.rst Sun Feb 1 01:24:21 2009 @@ -48,16 +48,16 @@ To generate the same numeric value across all Python versions and platforms use adler32(data) & 0xffffffff. If you are only using the checksum in packed binary format this is not necessary as the - return value will have the correct 32bit binary representation + return value is the correct 32bit binary representation regardless of sign. .. versionchanged:: 2.6 - The return value will always be in the range [-2**31, 2**31-1] - regardless of platform. In older versions the value would be + The return value is in the range [-2**31, 2**31-1] + regardless of platform. In older versions the value is signed on some platforms and unsigned on others. .. versionchanged:: 3.0 - The return value will always be unsigned and in the range [0, 2**32-1] + The return value is unsigned and in the range [0, 2**32-1] regardless of platform. @@ -98,16 +98,16 @@ To generate the same numeric value across all Python versions and platforms use crc32(data) & 0xffffffff. If you are only using the checksum in packed binary format this is not necessary as the - return value will have the correct 32bit binary representation + return value is the correct 32bit binary representation regardless of sign. .. versionchanged:: 2.6 - The return value will always be in the range [-2**31, 2**31-1] + The return value is in the range [-2**31, 2**31-1] regardless of platform. In older versions the value would be signed on some platforms and unsigned on others. .. versionchanged:: 3.0 - The return value will always be unsigned and in the range [0, 2**32-1] + The return value is unsigned and in the range [0, 2**32-1] regardless of platform. From python-checkins at python.org Sun Feb 1 01:25:16 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sun, 1 Feb 2009 01:25:16 +0100 (CET) Subject: [Python-checkins] r69162 - python/branches/release26-maint/Doc/library/zlib.rst Message-ID: <20090201002516.EFA771E400C@bag.python.org> Author: gregory.p.smith Date: Sun Feb 1 01:25:16 2009 New Revision: 69162 Log: merge 69161 wording update. Modified: python/branches/release26-maint/Doc/library/zlib.rst Modified: python/branches/release26-maint/Doc/library/zlib.rst ============================================================================== --- python/branches/release26-maint/Doc/library/zlib.rst (original) +++ python/branches/release26-maint/Doc/library/zlib.rst Sun Feb 1 01:25:16 2009 @@ -48,16 +48,16 @@ To generate the same numeric value across all Python versions and platforms use adler32(data) & 0xffffffff. If you are only using the checksum in packed binary format this is not necessary as the - return value will have the correct 32bit binary representation + return value is the correct 32bit binary representation regardless of sign. .. versionchanged:: 2.6 - The return value will always be in the range [-2**31, 2**31-1] - regardless of platform. In older versions the value would be + The return value is in the range [-2**31, 2**31-1] + regardless of platform. In older versions the value is signed on some platforms and unsigned on others. .. versionchanged:: 3.0 - The return value will always be unsigned and in the range [0, 2**32-1] + The return value is unsigned and in the range [0, 2**32-1] regardless of platform. @@ -98,16 +98,16 @@ To generate the same numeric value across all Python versions and platforms use crc32(data) & 0xffffffff. If you are only using the checksum in packed binary format this is not necessary as the - return value will have the correct 32bit binary representation + return value is the correct 32bit binary representation regardless of sign. .. versionchanged:: 2.6 - The return value will always be in the range [-2**31, 2**31-1] + The return value is in the range [-2**31, 2**31-1] regardless of platform. In older versions the value would be signed on some platforms and unsigned on others. .. versionchanged:: 3.0 - The return value will always be unsigned and in the range [0, 2**32-1] + The return value is unsigned and in the range [0, 2**32-1] regardless of platform. From buildbot at python.org Sun Feb 1 01:27:43 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 00:27:43 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.0 Message-ID: <20090201002743.943321E4002@bag.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/84 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: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_codecs test_io test_traceback ====================================================================== ERROR: test_basics (test.test_codecs.BasicUnicodeTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_codecs.py", line 1344, in test_basics encodedresult += encoder.encode(c) File "E:\cygwin\home\db3l\buildarea\3.0.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.0.bolen-windows\build\lib\test\test_codecs.py", line 1429, in test_decoder_state self.check_state_handling_decode(encoding, u, u.encode(encoding)) File "E:\cygwin\home\db3l\buildarea\3.0.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.0.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: testBasicIO (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_io.py", line 939, in testBasicIO self.assertEquals(f.write("abc"), 3) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1496, in write b = encoder.encode(s) File "E:\cygwin\home\db3l\buildarea\3.0.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: testEncodingErrorsReading (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_io.py", line 774, in testEncodingErrorsReading self.assertRaises(UnicodeError, t.read) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1730, in read decoder.decode(self.buffer.read(), final=True)) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.0.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: testEncodingErrorsWriting (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_io.py", line 792, in testEncodingErrorsWriting self.assertRaises(UnicodeError, t.write, "\xff") File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1496, in write b = encoder.encode(s) File "E:\cygwin\home\db3l\buildarea\3.0.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: testNewlinesInput (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_io.py", line 900, in testNewlinesInput self.assertEquals(txt.readlines(), expected) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 538, in readlines return list(self) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1746, in __next__ line = self.readline() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1819, in readline while self._read_chunk(): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.0.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: testNewlinesOutput (test.test_io.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_io.py", line 925, in testNewlinesOutput txt.write(data) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1496, in write b = encoder.encode(s) File "E:\cygwin\home\db3l\buildarea\3.0.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.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_io.py", line 1161, in test_issue1395_1 c = txt.read(1) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1739, in read eof = not self._read_chunk() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.0.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.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_io.py", line 1173, in test_issue1395_2 c = txt.read(4) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1739, in read eof = not self._read_chunk() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.0.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.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_io.py", line 1183, in test_issue1395_3 reads = txt.read(4) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1739, in read eof = not self._read_chunk() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.0.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.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_io.py", line 1194, in test_issue1395_4 reads = txt.read(4) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1739, in read eof = not self._read_chunk() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.0.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.TextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_io.py", line 1202, in test_issue1395_5 reads = txt.read(4) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1739, in read eof = not self._read_chunk() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1567, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1301, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.0.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_encoded_file (test.test_traceback.SyntaxTracebackCases) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_traceback.py", line 145, in test_encoded_file do_test("", "foo", "ascii", 3) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_traceback.py", line 117, in do_test """.format(firstlines, message)) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\io.py", line 1496, in write b = encoder.encode(s) File "E:\cygwin\home\db3l\buildarea\3.0.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 python-checkins at python.org Sun Feb 1 01:29:45 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sun, 1 Feb 2009 01:29:45 +0100 (CET) Subject: [Python-checkins] r69163 - in python/branches/release30-maint/Doc/library: binascii.rst zlib.rst Message-ID: <20090201002945.470361E4002@bag.python.org> Author: gregory.p.smith Date: Sun Feb 1 01:29:45 2009 New Revision: 69163 Log: wording update for issue4903 Modified: python/branches/release30-maint/Doc/library/binascii.rst python/branches/release30-maint/Doc/library/zlib.rst Modified: python/branches/release30-maint/Doc/library/binascii.rst ============================================================================== --- python/branches/release30-maint/Doc/library/binascii.rst (original) +++ python/branches/release30-maint/Doc/library/binascii.rst Sun Feb 1 01:29:45 2009 @@ -120,11 +120,11 @@ To generate the same numeric value across all Python versions and platforms use crc32(data) & 0xffffffff. If you are only using the checksum in packed binary format this is not necessary as the - return value will have the correct 32bit binary representation + return value is the correct 32bit binary representation regardless of sign. .. versionchanged:: 3.0 - The return value will always be unsigned and in the range [0, 2**32-1] + The return value is unsigned and in the range [0, 2**32-1] regardless of platform. Modified: python/branches/release30-maint/Doc/library/zlib.rst ============================================================================== --- python/branches/release30-maint/Doc/library/zlib.rst (original) +++ python/branches/release30-maint/Doc/library/zlib.rst Sun Feb 1 01:29:45 2009 @@ -48,11 +48,11 @@ To generate the same numeric value across all Python versions and platforms use adler32(data) & 0xffffffff. If you are only using the checksum in packed binary format this is not necessary as the - return value will have the correct 32bit binary representation + return value is the correct 32bit binary representation regardless of sign. .. versionchanged:: 3.0 - The return value will always be unsigned and in the range [0, 2**32-1] + The return value is unsigned and in the range [0, 2**32-1] regardless of platform. @@ -93,11 +93,11 @@ To generate the same numeric value across all Python versions and platforms use crc32(data) & 0xffffffff. If you are only using the checksum in packed binary format this is not necessary as the - return value will have the correct 32bit binary representation + return value is the correct 32bit binary representation regardless of sign. .. versionchanged:: 3.0 - The return value will always be unsigned and in the range [0, 2**32-1] + The return value is unsigned and in the range [0, 2**32-1] regardless of platform. From buildbot at python.org Sun Feb 1 01:29:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 00:29:56 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20090201002956.8A3C21E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%203.0/builds/95 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 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_calendar test_email test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Feb 1 01:30:50 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sun, 1 Feb 2009 01:30:50 +0100 (CET) Subject: [Python-checkins] r69164 - in python/branches/py3k/Doc/library: binascii.rst zlib.rst Message-ID: <20090201003050.4D3CA1E4002@bag.python.org> Author: gregory.p.smith Date: Sun Feb 1 01:30:50 2009 New Revision: 69164 Log: documentation wording fix for issue4903 Modified: python/branches/py3k/Doc/library/binascii.rst python/branches/py3k/Doc/library/zlib.rst Modified: python/branches/py3k/Doc/library/binascii.rst ============================================================================== --- python/branches/py3k/Doc/library/binascii.rst (original) +++ python/branches/py3k/Doc/library/binascii.rst Sun Feb 1 01:30:50 2009 @@ -120,11 +120,11 @@ To generate the same numeric value across all Python versions and platforms use crc32(data) & 0xffffffff. If you are only using the checksum in packed binary format this is not necessary as the - return value will have the correct 32bit binary representation + return value is the correct 32bit binary representation regardless of sign. .. versionchanged:: 3.0 - The return value will always be unsigned and in the range [0, 2**32-1] + The return value is unsigned and in the range [0, 2**32-1] regardless of platform. Modified: python/branches/py3k/Doc/library/zlib.rst ============================================================================== --- python/branches/py3k/Doc/library/zlib.rst (original) +++ python/branches/py3k/Doc/library/zlib.rst Sun Feb 1 01:30:50 2009 @@ -48,11 +48,11 @@ To generate the same numeric value across all Python versions and platforms use adler32(data) & 0xffffffff. If you are only using the checksum in packed binary format this is not necessary as the - return value will have the correct 32bit binary representation + return value is the correct 32bit binary representation regardless of sign. .. versionchanged:: 3.0 - The return value will always be unsigned and in the range [0, 2**32-1] + The return value is unsigned and in the range [0, 2**32-1] regardless of platform. @@ -93,11 +93,11 @@ To generate the same numeric value across all Python versions and platforms use crc32(data) & 0xffffffff. If you are only using the checksum in packed binary format this is not necessary as the - return value will have the correct 32bit binary representation + return value is the correct 32bit binary representation regardless of sign. .. versionchanged:: 3.0 - The return value will always be unsigned and in the range [0, 2**32-1] + The return value is unsigned and in the range [0, 2**32-1] regardless of platform. From python-checkins at python.org Sun Feb 1 01:37:13 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 1 Feb 2009 01:37:13 +0100 (CET) Subject: [Python-checkins] r69165 - in python/branches/py3k/Lib/importlib: NOTES test/builtin/test_loader.py Message-ID: <20090201003713.8FB701E4002@bag.python.org> Author: brett.cannon Date: Sun Feb 1 01:37:13 2009 New Revision: 69165 Log: Move built-in loader tests to importlib.test.abc.LoaderTests. Modified: python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/test/builtin/test_loader.py Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sun Feb 1 01:37:13 2009 @@ -1,9 +1,8 @@ to do ///// -* Use test.loader_tests +* Use test.abc.LoaderTests - + builtin + frozen + extension + source Modified: python/branches/py3k/Lib/importlib/test/builtin/test_loader.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/builtin/test_loader.py (original) +++ python/branches/py3k/Lib/importlib/test/builtin/test_loader.py Sun Feb 1 01:37:13 2009 @@ -1,5 +1,6 @@ import importlib from importlib import machinery +from .. import abc from .. import support import sys @@ -7,7 +8,7 @@ import unittest -class LoaderTests(unittest.TestCase): +class LoaderTests(abc.LoaderTests): """Test load_module() for built-in modules.""" @@ -26,13 +27,32 @@ load_module = staticmethod(lambda name: machinery.BuiltinImporter.load_module(name)) - def test_load_module(self): + def test_module(self): # Common case. with support.uncache(self.name): module = self.load_module(self.name) self.verify(module) - def test_nonexistent(self): + def test_package(self): + # Built-in modules cannot be a package. + pass + + def test_lacking_parent(self): + # Built-in modules cannot be a package. + pass + + def test_state_after_failure(self): + # Not way to force an imoprt failure. + pass + + def test_module_reuse(self): + # Test that the same module is used in a reload. + with support.uncache(self.name): + module1 = self.load_module(self.name) + module2 = self.load_module(self.name) + self.assert_(module1 is module2) + + def test_unloadable(self): name = 'dssdsdfff' assert name not in sys.builtin_module_names self.assertRaises(ImportError, self.load_module, name) From python-checkins at python.org Sun Feb 1 01:49:41 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 1 Feb 2009 01:49:41 +0100 (CET) Subject: [Python-checkins] r69166 - in python/branches/py3k/Lib/importlib: NOTES test/extension/test_loader.py Message-ID: <20090201004941.9BF541E4002@bag.python.org> Author: brett.cannon Date: Sun Feb 1 01:49:41 2009 New Revision: 69166 Log: Move extension module loader tests over to importlib.test.abc.LoaderTests. Modified: python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/test/extension/test_loader.py Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sun Feb 1 01:49:41 2009 @@ -4,7 +4,6 @@ * Use test.abc.LoaderTests + frozen - + extension + source * Reorganize support code. Modified: python/branches/py3k/Lib/importlib/test/extension/test_loader.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/extension/test_loader.py (original) +++ python/branches/py3k/Lib/importlib/test/extension/test_loader.py Sun Feb 1 01:49:41 2009 @@ -1,12 +1,13 @@ import importlib from . import test_path_hook +from .. import abc from .. import support import sys import unittest -class LoaderTests(unittest.TestCase): +class LoaderTests(abc.LoaderTests): """Test load_module() for extension modules.""" @@ -16,7 +17,7 @@ False) return loader.load_module(fullname) - def test_success(self): + def test_module(self): with support.uncache(test_path_hook.NAME): module = self.load_module(test_path_hook.NAME) for attr, value in [('__name__', test_path_hook.NAME), @@ -24,7 +25,25 @@ self.assertEqual(getattr(module, attr), value) self.assert_(test_path_hook.NAME in sys.modules) - def test_failure(self): + def test_package(self): + # Extensions are not found in packages. + pass + + def test_lacking_parent(self): + # Extensions are not found in packages. + pass + + def test_module_reuse(self): + with support.uncache(test_path_hook.NAME): + module1 = self.load_module(test_path_hook.NAME) + module2 = self.load_module(test_path_hook.NAME) + self.assert_(module1 is module2) + + def test_state_after_failure(self): + # No easy way to trigger a failure after a successful import. + pass + + def test_unloadable(self): self.assertRaises(ImportError, self.load_module, 'asdfjkl;') From buildbot at python.org Sun Feb 1 02:27:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 01:27:22 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090201012723.055571E4002@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/90 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,david.goodger,gregory.p.smith 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 Feb 1 02:34:14 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 1 Feb 2009 02:34:14 +0100 (CET) Subject: [Python-checkins] r69167 - in python/branches/py3k/Lib/importlib: NOTES _bootstrap.py test/frozen/test_loader.py Message-ID: <20090201013414.2FEB41E4002@bag.python.org> Author: brett.cannon Date: Sun Feb 1 02:34:13 2009 New Revision: 69167 Log: Fix importlib.machinery.FrozenImporter.load_module() to set __package__ properly. Discovered by also moving the loader tests over to importlib.test.abc.LoaderTests. Modified: python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/_bootstrap.py python/branches/py3k/Lib/importlib/test/frozen/test_loader.py Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sun Feb 1 02:34:13 2009 @@ -3,7 +3,6 @@ * Use test.abc.LoaderTests - + frozen + source * Reorganize support code. Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Sun Feb 1 02:34:13 2009 @@ -137,7 +137,12 @@ """Load a frozen module.""" if cls.find_module(fullname) is None: raise ImportError("{0} is not a frozen module".format(fullname)) - return imp.init_frozen(fullname) + module = imp.init_frozen(fullname) + if hasattr(module, '__path__'): + module.__package__ = module.__name__ + elif '.' in module.__name__: + module.__package__ = module.__name__.rsplit('.', 1)[0] + return module class ChainedImporter(object): Modified: python/branches/py3k/Lib/importlib/test/frozen/test_loader.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/frozen/test_loader.py (original) +++ python/branches/py3k/Lib/importlib/test/frozen/test_loader.py Sun Feb 1 02:34:13 2009 @@ -1,26 +1,59 @@ from importlib import machinery -from ..builtin import test_loader +from .. import abc +from .. import support -class LoaderTests(test_loader.LoaderTests): +class LoaderTests(abc.LoaderTests): - name = '__phello__' - load_module = staticmethod(lambda name: - machinery.FrozenImporter.load_module(name)) - verification = {'__name__': '__phello__', '__file__': '', - '__package__': None, '__path__': ['__phello__']} - - -class SubmoduleLoaderTests(LoaderTests): - - name = '__phello__.spam' - verification = {'__name__': '__phello__.spam', '__file__': '', - '__package__': None} + def test_module(self): + with support.uncache('__hello__'): + module = machinery.FrozenImporter.load_module('__hello__') + check = {'__name__': '__hello__', '__file__': '', + '__package__': None} + for attr, value in check.items(): + self.assertEqual(getattr(module, attr), value) + + def test_package(self): + with support.uncache('__phello__'): + module = machinery.FrozenImporter.load_module('__phello__') + check = {'__name__': '__phello__', '__file__': '', + '__package__': '__phello__', '__path__': ['__phello__']} + for attr, value in check.items(): + attr_value = getattr(module, attr) + self.assertEqual(attr_value, value, + "for __phello__.%s, %r != %r" % + (attr, attr_value, value)) + + def test_lacking_parent(self): + with support.uncache('__phello__', '__phello__.spam'): + module = machinery.FrozenImporter.load_module('__phello__.spam') + check = {'__name__': '__phello__.spam', '__file__': '', + '__package__': '__phello__'} + for attr, value in check.items(): + attr_value = getattr(module, attr) + self.assertEqual(attr_value, value, + "for __phello__.spam.%s, %r != %r" % + (attr, attr_value, value)) + + def test_module_reuse(self): + with support.uncache('__hello__'): + module1 = machinery.FrozenImporter.load_module('__hello__') + module2 = machinery.FrozenImporter.load_module('__hello__') + self.assert_(module1 is module2) + + def test_state_after_failure(self): + # No way to trigger an error in a frozen module. + pass + + def test_unloadable(self): + assert machinery.FrozenImporter.find_module('_not_real') is None + self.assertRaises(ImportError, machinery.FrozenImporter.load_module, + '_not_real') def test_main(): from test.support import run_unittest - run_unittest(LoaderTests, SubmoduleLoaderTests) + run_unittest(LoaderTests) if __name__ == '__main__': From python-checkins at python.org Sun Feb 1 03:05:11 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 1 Feb 2009 03:05:11 +0100 (CET) Subject: [Python-checkins] r69168 - in python/branches/py3k/Lib/importlib: NOTES test/source/test_loader.py test/source/test_reload.py Message-ID: <20090201020511.9C9541E4002@bag.python.org> Author: brett.cannon Date: Sun Feb 1 03:05:11 2009 New Revision: 69168 Log: Move source loader tests (including reload tests) over to importlib.test.abc.LoaderTests. Removed: python/branches/py3k/Lib/importlib/test/source/test_reload.py Modified: python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/test/source/test_loader.py Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sun Feb 1 03:05:11 2009 @@ -1,10 +1,6 @@ to do ///// -* Use test.abc.LoaderTests - - + source - * Reorganize support code. + Separate general support code and importer-specific (e.g. source) support Modified: python/branches/py3k/Lib/importlib/test/source/test_loader.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/test_loader.py (original) +++ python/branches/py3k/Lib/importlib/test/source/test_loader.py Sun Feb 1 03:05:11 2009 @@ -1,4 +1,5 @@ import importlib +from .. import abc from .. import support import imp @@ -16,11 +17,80 @@ """ # [basic] - def test_basic(self): + def test_module(self): with support.create_modules('_temp') as mapping: loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) - loader.load_module('_temp') + module = loader.load_module('_temp') self.assert_('_temp' in sys.modules) + check = {'__name__': '_temp', '__file__': mapping['_temp'], + '__package__': None} + for attr, value in check.items(): + self.assertEqual(getattr(module, attr), value) + + def test_package(self): + with support.create_modules('_pkg.__init__') as mapping: + loader = importlib._PyFileLoader('_pkg', mapping['_pkg.__init__'], + True) + module = loader.load_module('_pkg') + self.assert_('_pkg' in sys.modules) + check = {'__name__': '_pkg', '__file__': mapping['_pkg.__init__'], + '__path__': [os.path.dirname(mapping['_pkg.__init__'])], + '__package__': '_pkg'} + for attr, value in check.items(): + self.assertEqual(getattr(module, attr), value) + + + def test_lacking_parent(self): + with support.create_modules('_pkg.__init__', '_pkg.mod')as mapping: + loader = importlib._PyFileLoader('_pkg.mod', mapping['_pkg.mod'], + False) + module = loader.load_module('_pkg.mod') + self.assert_('_pkg.mod' in sys.modules) + check = {'__name__': '_pkg.mod', '__file__': mapping['_pkg.mod'], + '__package__': '_pkg'} + for attr, value in check.items(): + self.assertEqual(getattr(module, attr), value) + + def fake_mtime(self, fxn): + """Fake mtime to always be higher than expected.""" + return lambda name: fxn(name) + 1 + + def test_module_reuse(self): + with support.create_modules('_temp') as mapping: + loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + module = loader.load_module('_temp') + module_id = id(module) + module_dict_id = id(module.__dict__) + with open(mapping['_temp'], 'w') as file: + file.write("testing_var = 42\n") + # For filesystems where the mtime is only to a second granularity, + # everything that has happened above can be too fast; + # force an mtime on the source that is guaranteed to be different + # than the original mtime. + loader.source_mtime = self.fake_mtime(loader.source_mtime) + module = loader.load_module('_temp') + self.assert_('testing_var' in module.__dict__, + "'testing_var' not in " + "{0}".format(list(module.__dict__.keys()))) + self.assertEqual(module, sys.modules['_temp']) + self.assertEqual(id(module), module_id) + self.assertEqual(id(module.__dict__), module_dict_id) + + def test_state_after_failure(self): + # A failed reload should leave the original module intact. + attributes = ('__file__', '__path__', '__package__') + value = '' + name = '_temp' + with support.create_modules(name) as mapping: + orig_module = imp.new_module(name) + for attr in attributes: + setattr(orig_module, attr, value) + with open(mapping[name], 'w') as file: + file.write('+++ bad syntax +++') + loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + self.assertRaises(SyntaxError, loader.load_module, name) + for attr in attributes: + self.assertEqual(getattr(orig_module, attr), value) # [syntax error] def test_bad_syntax(self): Deleted: python/branches/py3k/Lib/importlib/test/source/test_reload.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/test_reload.py Sun Feb 1 03:05:11 2009 +++ (empty file) @@ -1,71 +0,0 @@ -"""Test reload support. - -Reload support requires two things. One is that if module is loaded that -already exists in sys.modules then it is reused. And two, if a reload fails the -pre-existing module is left in a sane state. - -""" -import imp -import sys -import types -import unittest -import importlib -from .. import support - - -class ReloadTests(unittest.TestCase): - - name = '_temp' - - def load_module(self, mapping): - return importlib._PyFileLoader(self.name, mapping[self.name], False) - - def fake_mtime(self, fxn): - """Fake mtime to always be higher than expected.""" - return lambda name: fxn(name) + 1 - - def test_module_reuse(self): - with support.create_modules(self.name) as mapping: - loader = self.load_module(mapping) - module = loader.load_module(self.name) - module_id = id(module) - module_dict_id = id(module.__dict__) - with open(mapping[self.name], 'w') as file: - file.write("testing_var = 42\n") - # For filesystems where the mtime is only to a second granularity, - # everything that has happened above can be too fast; - # force an mtime on the source that is guaranteed to be different - # than the original mtime. - loader.source_mtime = self.fake_mtime(loader.source_mtime) - module = loader.load_module(self.name) - self.assert_('testing_var' in module.__dict__, - "'testing_var' not in " - "{0}".format(list(module.__dict__.keys()))) - self.assertEqual(module, sys.modules[self.name]) - self.assertEqual(id(module), module_id) - self.assertEqual(id(module.__dict__), module_dict_id) - - def test_bad_reload(self): - # A failed reload should leave the original module intact. - attributes = ('__file__', '__path__', '__package__') - value = '' - with support.create_modules(self.name) as mapping: - orig_module = imp.new_module(self.name) - for attr in attributes: - setattr(orig_module, attr, value) - with open(mapping[self.name], 'w') as file: - file.write('+++ bad syntax +++') - loader = self.load_module(mapping) - self.assertRaises(SyntaxError, loader.load_module, self.name) - for attr in attributes: - self.assertEqual(getattr(orig_module, attr), value) - - - -def test_main(): - from test.support import run_unittest - run_unittest(ReloadTests) - - -if __name__ == '__main__': - test_main() From python-checkins at python.org Sun Feb 1 03:56:16 2009 From: python-checkins at python.org (guilherme.polo) Date: Sun, 1 Feb 2009 03:56:16 +0100 (CET) Subject: [Python-checkins] r69169 - python/trunk/Lib/test/test_tcl.py Message-ID: <20090201025616.AEAC51E4002@bag.python.org> Author: guilherme.polo Date: Sun Feb 1 03:56:16 2009 New Revision: 69169 Log: Restore Tkinter.Tk._loadtk so this test doesn't fail for problems related to ttk. Modified: python/trunk/Lib/test/test_tcl.py Modified: python/trunk/Lib/test/test_tcl.py ============================================================================== --- python/trunk/Lib/test/test_tcl.py (original) +++ python/trunk/Lib/test/test_tcl.py Sun Feb 1 03:56:16 2009 @@ -4,9 +4,15 @@ import os import _tkinter from test import test_support -from Tkinter import Tcl +from Tkinter import Tk, Tcl from _tkinter import TclError +# Restore Tkinter.Tk._loadtk that may have been overridden by ttk. +# If this is not done then this test may fail for reasons related +# to ttk only (like failing to load the tile package). +from ttk import __loadtk__ +Tk._loadtk = __loadtk__ + class TkinterTest(unittest.TestCase): From buildbot at python.org Sun Feb 1 04:08:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 03:08:25 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090201030825.3475C1E4002@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/4568 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: gregory.p.smith,guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Killed sincerely, -The Buildbot From python-checkins at python.org Sun Feb 1 04:08:31 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 1 Feb 2009 04:08:31 +0100 (CET) Subject: [Python-checkins] r69170 - in python/branches/py3k/Lib/importlib: NOTES test/source/test_case_sensitivity.py test/source/test_finder.py test/source/test_loader.py test/source/test_path_hook.py test/source/test_source_encoding.py test/source/util.py test/support.py Message-ID: <20090201030831.B8C701E400C@bag.python.org> Author: brett.cannon Date: Sun Feb 1 04:08:31 2009 New Revision: 69170 Log: Split out support code that is specific to source tests out of importlib.test.support to importlib.test.source.util. Added: python/branches/py3k/Lib/importlib/test/source/util.py Modified: python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/test/source/test_case_sensitivity.py python/branches/py3k/Lib/importlib/test/source/test_finder.py python/branches/py3k/Lib/importlib/test/source/test_loader.py python/branches/py3k/Lib/importlib/test/source/test_path_hook.py python/branches/py3k/Lib/importlib/test/source/test_source_encoding.py python/branches/py3k/Lib/importlib/test/support.py Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sun Feb 1 04:08:31 2009 @@ -3,9 +3,6 @@ * Reorganize support code. - + Separate general support code and importer-specific (e.g. source) support - code. - - Create support modules for each subdirectory (as needed). + Add a file loader mock that returns monotonically increasing mtime. - Use in source/test_reload. - Use in source/test_load_module_mixed. 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 Sun Feb 1 04:08:31 2009 @@ -1,6 +1,7 @@ """Test case-sensitivity (PEP 235).""" import importlib from .. import support +from . import util as source_util import os import sys from test import support as test_support @@ -25,7 +26,8 @@ """Look for a module with matching and non-matching sensitivity.""" sensitive_pkg = 'sensitive.{0}'.format(self.name) insensitive_pkg = 'insensitive.{0}'.format(self.name.lower()) - with support.create_modules(insensitive_pkg, sensitive_pkg) as mapping: + context = source_util.create_modules(insensitive_pkg, sensitive_pkg) + with context as mapping: sensitive_path = os.path.join(mapping['.root'], 'sensitive') insensitive_path = os.path.join(mapping['.root'], 'insensitive') return self.find(sensitive_path), self.find(insensitive_path) Modified: python/branches/py3k/Lib/importlib/test/source/test_finder.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/test_finder.py (original) +++ python/branches/py3k/Lib/importlib/test/source/test_finder.py Sun Feb 1 04:08:31 2009 @@ -1,6 +1,7 @@ import importlib from .. import abc from .. import support +from . import util as source_util import os import py_compile import unittest @@ -45,7 +46,7 @@ """ if create is None: create = {test} - with support.create_modules(*create) as mapping: + with source_util.create_modules(*create) as mapping: if compile_: for name in compile_: py_compile.compile(mapping[name]) @@ -76,14 +77,14 @@ # [sub module] def test_module_in_package(self): - with support.create_modules('pkg.__init__', 'pkg.sub') as mapping: + with source_util.create_modules('pkg.__init__', 'pkg.sub') as mapping: pkg_dir = os.path.dirname(mapping['pkg.__init__']) loader = self.import_(pkg_dir, 'pkg.sub') self.assert_(hasattr(loader, 'load_module')) # [sub package] def test_package_in_package(self): - context = support.create_modules('pkg.__init__', 'pkg.sub.__init__') + context = source_util.create_modules('pkg.__init__', 'pkg.sub.__init__') with context as mapping: pkg_dir = os.path.dirname(mapping['pkg.__init__']) loader = self.import_(pkg_dir, 'pkg.sub') @@ -91,7 +92,7 @@ # [sub empty] def test_empty_sub_directory(self): - context = support.create_modules('pkg.__init__', 'pkg.sub.__init__') + context = source_util.create_modules('pkg.__init__', 'pkg.sub.__init__') with warnings.catch_warnings(): warnings.simplefilter("error", ImportWarning) with context as mapping: @@ -109,7 +110,7 @@ def test_failure(self): - with support.create_modules('blah') as mapping: + with source_util.create_modules('blah') as mapping: nothing = self.import_(mapping['.root'], 'sdfsadsadf') self.assert_(nothing is None) Modified: python/branches/py3k/Lib/importlib/test/source/test_loader.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/test_loader.py (original) +++ python/branches/py3k/Lib/importlib/test/source/test_loader.py Sun Feb 1 04:08:31 2009 @@ -1,6 +1,7 @@ import importlib from .. import abc from .. import support +from . import util as source_util import imp import os @@ -18,7 +19,7 @@ # [basic] def test_module(self): - with support.create_modules('_temp') as mapping: + with source_util.create_modules('_temp') as mapping: loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) module = loader.load_module('_temp') self.assert_('_temp' in sys.modules) @@ -28,7 +29,7 @@ self.assertEqual(getattr(module, attr), value) def test_package(self): - with support.create_modules('_pkg.__init__') as mapping: + with source_util.create_modules('_pkg.__init__') as mapping: loader = importlib._PyFileLoader('_pkg', mapping['_pkg.__init__'], True) module = loader.load_module('_pkg') @@ -41,7 +42,7 @@ def test_lacking_parent(self): - with support.create_modules('_pkg.__init__', '_pkg.mod')as mapping: + with source_util.create_modules('_pkg.__init__', '_pkg.mod')as mapping: loader = importlib._PyFileLoader('_pkg.mod', mapping['_pkg.mod'], False) module = loader.load_module('_pkg.mod') @@ -56,7 +57,7 @@ return lambda name: fxn(name) + 1 def test_module_reuse(self): - with support.create_modules('_temp') as mapping: + with source_util.create_modules('_temp') as mapping: loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) module = loader.load_module('_temp') module_id = id(module) @@ -81,7 +82,7 @@ attributes = ('__file__', '__path__', '__package__') value = '' name = '_temp' - with support.create_modules(name) as mapping: + with source_util.create_modules(name) as mapping: orig_module = imp.new_module(name) for attr in attributes: setattr(orig_module, attr, value) @@ -94,7 +95,7 @@ # [syntax error] def test_bad_syntax(self): - with support.create_modules('_temp') as mapping: + with source_util.create_modules('_temp') as mapping: with open(mapping['_temp'], 'w') as file: file.write('=') loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) @@ -109,12 +110,12 @@ def tearDown(self): sys.dont_write_bytecode = False - @support.writes_bytecode + @source_util.writes_bytecode def run_test(self, assertion): - with support.create_modules('_temp') as mapping: + with source_util.create_modules('_temp') as mapping: loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) loader.load_module('_temp') - bytecode_path = support.bytecode_path(mapping['_temp']) + bytecode_path = source_util.bytecode_path(mapping['_temp']) assertion(bytecode_path) def test_bytecode_written(self): @@ -137,10 +138,10 @@ # [bad magic] def test_bad_magic(self): - with support.create_modules('_temp') as mapping: + with source_util.create_modules('_temp') as mapping: py_compile.compile(mapping['_temp']) os.unlink(mapping['_temp']) - bytecode_path = support.bytecode_path(mapping['_temp']) + bytecode_path = source_util.bytecode_path(mapping['_temp']) with open(bytecode_path, 'r+b') as file: file.seek(0) file.write(b'\x00\x00\x00\x00') @@ -164,7 +165,7 @@ def run_test(self, test, *create, pkg=False): create += (test,) - with support.create_modules(*create) as mapping: + with source_util.create_modules(*create) as mapping: for name in create: py_compile.compile(mapping[name]) if pkg: @@ -217,11 +218,11 @@ self.assert_(module_name in sys.modules) # [bad magic] - @support.writes_bytecode + @source_util.writes_bytecode def test_bad_magic(self): - with support.create_modules('_temp') as mapping: + with source_util.create_modules('_temp') as mapping: py_compile.compile(mapping['_temp']) - bytecode_path = support.bytecode_path(mapping['_temp']) + bytecode_path = source_util.bytecode_path(mapping['_temp']) with open(bytecode_path, 'r+b') as bytecode_file: bytecode_file.seek(0) bytecode_file.write(b'\x00\x00\x00\x00') @@ -230,12 +231,12 @@ self.assertEqual(bytecode_file.read(4), imp.get_magic()) # [bad timestamp] - @support.writes_bytecode + @source_util.writes_bytecode def test_bad_bytecode(self): zeros = b'\x00\x00\x00\x00' - with support.create_modules('_temp') as mapping: + with source_util.create_modules('_temp') as mapping: py_compile.compile(mapping['_temp']) - bytecode_path = support.bytecode_path(mapping['_temp']) + bytecode_path = source_util.bytecode_path(mapping['_temp']) with open(bytecode_path, 'r+b') as bytecode_file: bytecode_file.seek(4) bytecode_file.write(zeros) @@ -248,8 +249,8 @@ # [bad marshal] def test_bad_marshal(self): - with support.create_modules('_temp') as mapping: - bytecode_path = support.bytecode_path(mapping['_temp']) + with source_util.create_modules('_temp') as mapping: + bytecode_path = source_util.bytecode_path(mapping['_temp']) source_mtime = os.path.getmtime(mapping['_temp']) source_timestamp = importlib._w_long(source_mtime) with open(bytecode_path, 'wb') as bytecode_file: Modified: python/branches/py3k/Lib/importlib/test/source/test_path_hook.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/test_path_hook.py (original) +++ python/branches/py3k/Lib/importlib/test/source/test_path_hook.py Sun Feb 1 04:08:31 2009 @@ -1,5 +1,5 @@ import importlib -from .. import support +from . import util import unittest @@ -9,7 +9,7 @@ def test_success(self): # XXX Only work on existing directories? - with support.create_modules('dummy') as mapping: + with util.create_modules('dummy') as mapping: self.assert_(hasattr(importlib.FileImporter(mapping['.root']), 'find_module')) Modified: python/branches/py3k/Lib/importlib/test/source/test_source_encoding.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/test_source_encoding.py (original) +++ python/branches/py3k/Lib/importlib/test/source/test_source_encoding.py Sun Feb 1 04:08:31 2009 @@ -1,5 +1,6 @@ import importlib from .. import support +from . import util as source_util import codecs import re @@ -32,7 +33,7 @@ module_name = '_temp' def run_test(self, source): - with support.create_modules(self.module_name) as mapping: + with source_util.create_modules(self.module_name) as mapping: with open(mapping[self.module_name], 'wb')as file: file.write(source) loader = importlib._PyFileLoader(self.module_name, @@ -93,7 +94,7 @@ module_name = '_temp' source_lines = [b"a = 42", b"b = -13", b''] source = line_ending.join(source_lines) - with support.create_modules(module_name) as mapping: + with source_util.create_modules(module_name) as mapping: with open(mapping[module_name], 'wb') as file: file.write(source) loader = importlib._PyFileLoader(module_name, mapping[module_name], Added: python/branches/py3k/Lib/importlib/test/source/util.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/source/util.py Sun Feb 1 04:08:31 2009 @@ -0,0 +1,88 @@ +from .. import support as util +import contextlib +import imp +import os +import os.path +import sys +import tempfile +from test import support as support + + +def writes_bytecode(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: + return fxn + + +def bytecode_path(source_path): + for suffix, _, type_ in imp.get_suffixes(): + if type_ == imp.PY_COMPILED: + bc_suffix = suffix + break + else: + raise ValueError("no bytecode suffix is defined") + return os.path.splitext(source_path)[0] + bc_suffix + + + at contextlib.contextmanager +def create_modules(*names): + """Temporarily create each named module with an attribute (named 'attr') + that contains the name passed into the context manager that caused the + creation of the module. + + All files are created in a temporary directory specified by + tempfile.gettempdir(). This directory is inserted at the beginning of + sys.path. When the context manager exits all created files (source and + bytecode) are explicitly deleted. + + No magic is performed when creating packages! This means that if you create + a module within a package you must also create the package's __init__ as + well. + + """ + source = 'attr = {0!r}' + created_paths = [] + mapping = {} + try: + temp_dir = tempfile.gettempdir() + mapping['.root'] = temp_dir + import_names = set() + for name in names: + if not name.endswith('__init__'): + import_name = name + else: + import_name = name[:-len('.__init__')] + import_names.add(import_name) + if import_name in sys.modules: + del sys.modules[import_name] + name_parts = name.split('.') + file_path = temp_dir + for directory in name_parts[:-1]: + file_path = os.path.join(file_path, directory) + if not os.path.exists(file_path): + os.mkdir(file_path) + created_paths.append(file_path) + file_path = os.path.join(file_path, name_parts[-1] + '.py') + with open(file_path, 'w') as file: + file.write(source.format(name)) + created_paths.append(file_path) + mapping[name] = file_path + uncache_manager = util.uncache(*import_names) + uncache_manager.__enter__() + state_manager = util.import_state(path=[temp_dir]) + state_manager.__enter__() + yield mapping + finally: + state_manager.__exit__(None, None, None) + uncache_manager.__exit__(None, None, None) + # Reverse the order for path removal to unroll directory creation. + for path in reversed(created_paths): + if file_path.endswith('.py'): + support.unlink(path) + support.unlink(path + 'c') + support.unlink(path + 'o') + else: + os.rmdir(path) Modified: python/branches/py3k/Lib/importlib/test/support.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/support.py (original) +++ python/branches/py3k/Lib/importlib/test/support.py Sun Feb 1 04:08:31 2009 @@ -6,7 +6,6 @@ import os.path from test.support import unlink import sys -from tempfile import gettempdir using___import__ = False @@ -28,14 +27,6 @@ update_wrapper(inner, fxn) return inner -def writes_bytecode(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: - return fxn - def case_insensitive_tests(class_): """Class decorator that nullifies tests that require a case-insensitive @@ -102,67 +93,6 @@ setattr(sys, attr, value) - at contextmanager -def create_modules(*names): - """Temporarily create each named module with an attribute (named 'attr') - that contains the name passed into the context manager that caused the - creation of the module. - - All files are created in a temporary directory specified by - tempfile.gettempdir(). This directory is inserted at the beginning of - sys.path. When the context manager exits all created files (source and - bytecode) are explicitly deleted. - - No magic is performed when creating packages! This means that if you create - a module within a package you must also create the package's __init__ as - well. - - """ - source = 'attr = {0!r}' - created_paths = [] - mapping = {} - try: - temp_dir = gettempdir() - mapping['.root'] = temp_dir - import_names = set() - for name in names: - if not name.endswith('__init__'): - import_name = name - else: - import_name = name[:-len('.__init__')] - import_names.add(import_name) - if import_name in sys.modules: - del sys.modules[import_name] - name_parts = name.split('.') - file_path = temp_dir - for directory in name_parts[:-1]: - file_path = os.path.join(file_path, directory) - if not os.path.exists(file_path): - os.mkdir(file_path) - created_paths.append(file_path) - file_path = os.path.join(file_path, name_parts[-1] + '.py') - with open(file_path, 'w') as file: - file.write(source.format(name)) - created_paths.append(file_path) - mapping[name] = file_path - uncache_manager = uncache(*import_names) - uncache_manager.__enter__() - state_manager = import_state(path=[temp_dir]) - state_manager.__enter__() - yield mapping - finally: - state_manager.__exit__(None, None, None) - uncache_manager.__exit__(None, None, None) - # Reverse the order for path removal to unroll directory creation. - for path in reversed(created_paths): - if file_path.endswith('.py'): - unlink(path) - unlink(path + 'c') - unlink(path + 'o') - else: - os.rmdir(path) - - class mock_modules: """A mock importer/loader.""" @@ -221,13 +151,3 @@ raise ImportError return importer return hook - - -def bytecode_path(source_path): - for suffix, _, type_ in imp.get_suffixes(): - if type_ == imp.PY_COMPILED: - bc_suffix = suffix - break - else: - raise ValueError("no bytecode suffix is defined") - return os.path.splitext(source_path)[0] + bc_suffix From buildbot at python.org Sun Feb 1 04:33:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 03:33:20 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090201033320.5E6AE1E4002@bag.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/1786 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: gregory.p.smith,guilherme.polo BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Sun Feb 1 04:47:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 03:47:26 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090201034726.7D2E51E4002@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/210 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: 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.x.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 43, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.x.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.x.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 Sun Feb 1 04:51:54 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 1 Feb 2009 04:51:54 +0100 (CET) Subject: [Python-checkins] r69171 - python/branches/py3k/Lib/importlib/test/__init__.py Message-ID: <20090201035154.BD3E51E4002@bag.python.org> Author: brett.cannon Date: Sun Feb 1 04:51:54 2009 New Revision: 69171 Log: Do not execute the .pyc/.pyo files as well as the .py files. Modified: python/branches/py3k/Lib/importlib/test/__init__.py Modified: python/branches/py3k/Lib/importlib/test/__init__.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/__init__.py (original) +++ python/branches/py3k/Lib/importlib/test/__init__.py Sun Feb 1 04:51:54 2009 @@ -9,7 +9,8 @@ if name.startswith('.'): continue path = os.path.join(directory, name) - if os.path.isfile(path) and name.startswith('test_'): + if (os.path.isfile(path) and name.startswith('test_') and + name.endswith('.py')): submodule_name = os.path.splitext(name)[0] module_name = "{0}.{1}".format(package, submodule_name) __import__(module_name, level=0) @@ -20,6 +21,8 @@ __import__(package_name, level=0) package_tests = getattr(sys.modules[package_name], 'test_suite')() suite.addTest(package_tests) + else: + continue return suite From python-checkins at python.org Sun Feb 1 05:00:06 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 1 Feb 2009 05:00:06 +0100 (CET) Subject: [Python-checkins] r69172 - in python/branches/py3k/Lib/importlib: NOTES test/builtin/test_finder.py test/builtin/test_loader.py test/extension/test_case_sensitivity.py test/extension/test_loader.py test/frozen/support.py test/frozen/test_loader.py test/import_/test___package__.py test/import_/test_caching.py test/import_/test_fromlist.py test/import_/test_meta_path.py test/import_/test_packages.py test/import_/test_path.py test/import_/test_relative_imports.py test/source/test_case_sensitivity.py test/source/test_finder.py test/source/test_loader.py test/source/test_path_hook.py test/source/test_source_encoding.py test/source/util.py test/support.py test/test_api.py test/util.py Message-ID: <20090201040006.54FF41E4002@bag.python.org> Author: brett.cannon Date: Sun Feb 1 05:00:05 2009 New Revision: 69172 Log: Rename importlib.test.support to importlib.test.util. Added: python/branches/py3k/Lib/importlib/test/util.py - copied unchanged from r69170, /python/branches/py3k/Lib/importlib/test/support.py Removed: python/branches/py3k/Lib/importlib/test/frozen/support.py python/branches/py3k/Lib/importlib/test/support.py Modified: python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/test/builtin/test_finder.py python/branches/py3k/Lib/importlib/test/builtin/test_loader.py python/branches/py3k/Lib/importlib/test/extension/test_case_sensitivity.py python/branches/py3k/Lib/importlib/test/extension/test_loader.py python/branches/py3k/Lib/importlib/test/frozen/test_loader.py python/branches/py3k/Lib/importlib/test/import_/test___package__.py python/branches/py3k/Lib/importlib/test/import_/test_caching.py python/branches/py3k/Lib/importlib/test/import_/test_fromlist.py python/branches/py3k/Lib/importlib/test/import_/test_meta_path.py python/branches/py3k/Lib/importlib/test/import_/test_packages.py python/branches/py3k/Lib/importlib/test/import_/test_path.py python/branches/py3k/Lib/importlib/test/import_/test_relative_imports.py python/branches/py3k/Lib/importlib/test/source/test_case_sensitivity.py python/branches/py3k/Lib/importlib/test/source/test_finder.py python/branches/py3k/Lib/importlib/test/source/test_loader.py python/branches/py3k/Lib/importlib/test/source/test_path_hook.py python/branches/py3k/Lib/importlib/test/source/test_source_encoding.py python/branches/py3k/Lib/importlib/test/source/util.py python/branches/py3k/Lib/importlib/test/test_api.py Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sun Feb 1 05:00:05 2009 @@ -3,6 +3,10 @@ * Reorganize support code. + + Separate out support code for extensions out of test_support_hook. + + Move util.import_ and utill.mock_modules to import_, importlib_only, + mock_path_hook? + + Add a file loader mock that returns monotonically increasing mtime. - Use in source/test_reload. - Use in source/test_load_module_mixed. Modified: python/branches/py3k/Lib/importlib/test/builtin/test_finder.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/builtin/test_finder.py (original) +++ python/branches/py3k/Lib/importlib/test/builtin/test_finder.py Sun Feb 1 05:00:05 2009 @@ -1,6 +1,6 @@ from importlib import machinery from .. import abc -from .. import support +from .. import util import sys import unittest @@ -14,7 +14,7 @@ def test_module(self): # Common case. - with support.uncache(self.name): + with util.uncache(self.name): self.assert_(machinery.BuiltinImporter.find_module(self.name)) def test_package(self): @@ -40,7 +40,7 @@ def test_ignore_path(self): # The value for 'path' should always trigger a failed import. - with support.uncache(self.name): + with util.uncache(self.name): loader = machinery.BuiltinImporter.find_module(self.name, ['pkg']) self.assert_(loader is None) Modified: python/branches/py3k/Lib/importlib/test/builtin/test_loader.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/builtin/test_loader.py (original) +++ python/branches/py3k/Lib/importlib/test/builtin/test_loader.py Sun Feb 1 05:00:05 2009 @@ -1,7 +1,7 @@ import importlib from importlib import machinery from .. import abc -from .. import support +from .. import util import sys import types @@ -29,7 +29,7 @@ def test_module(self): # Common case. - with support.uncache(self.name): + with util.uncache(self.name): module = self.load_module(self.name) self.verify(module) @@ -47,7 +47,7 @@ def test_module_reuse(self): # Test that the same module is used in a reload. - with support.uncache(self.name): + with util.uncache(self.name): module1 = self.load_module(self.name) module2 = self.load_module(self.name) self.assert_(module1 is module2) 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 Sun Feb 1 05:00:05 2009 @@ -1,12 +1,12 @@ import sys -from test import support as test_support +from test import support import unittest import importlib -from .. import support +from .. import util from . import test_path_hook - at support.case_insensitive_tests + at util.case_insensitive_tests class ExtensionModuleCaseSensitivityTest(unittest.TestCase): def find_module(self): @@ -17,13 +17,13 @@ return finder.find_module(bad_name) def test_case_sensitive(self): - with test_support.EnvironmentVarGuard() as env: + with support.EnvironmentVarGuard() as env: env.unset('PYTHONCASEOK') loader = self.find_module() self.assert_(loader is None) def test_case_insensitivity(self): - with test_support.EnvironmentVarGuard() as env: + with support.EnvironmentVarGuard() as env: env.set('PYTHONCASEOK', '1') loader = self.find_module() self.assert_(hasattr(loader, 'load_module')) @@ -32,7 +32,7 @@ def test_main(): - test_support.run_unittest(ExtensionModuleCaseSensitivityTest) + support.run_unittest(ExtensionModuleCaseSensitivityTest) if __name__ == '__main__': Modified: python/branches/py3k/Lib/importlib/test/extension/test_loader.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/extension/test_loader.py (original) +++ python/branches/py3k/Lib/importlib/test/extension/test_loader.py Sun Feb 1 05:00:05 2009 @@ -1,7 +1,7 @@ import importlib from . import test_path_hook from .. import abc -from .. import support +from .. import util import sys import unittest @@ -18,7 +18,7 @@ return loader.load_module(fullname) def test_module(self): - with support.uncache(test_path_hook.NAME): + with util.uncache(test_path_hook.NAME): module = self.load_module(test_path_hook.NAME) for attr, value in [('__name__', test_path_hook.NAME), ('__file__', test_path_hook.FILEPATH)]: @@ -34,7 +34,7 @@ pass def test_module_reuse(self): - with support.uncache(test_path_hook.NAME): + with util.uncache(test_path_hook.NAME): module1 = self.load_module(test_path_hook.NAME) module2 = self.load_module(test_path_hook.NAME) self.assert_(module1 is module2) Deleted: python/branches/py3k/Lib/importlib/test/frozen/support.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/frozen/support.py Sun Feb 1 05:00:05 2009 +++ (empty file) @@ -1,24 +0,0 @@ -import sys - - -class Null: - - """Just absorb what is given.""" - - def __getattr__(self): - return lambda *args, **kwargs: None - - -class SilenceStdout: - - """Silence sys.stdout.""" - - def setUp(self): - """Substitute sys.stdout with something that does not print to the - screen thanks to what bytecode is frozen.""" - sys.stdout = Null() - super().setUp() - - def tearDown(self): - sys.stdout = sys.__stdout__ - super().tearDown() Modified: python/branches/py3k/Lib/importlib/test/frozen/test_loader.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/frozen/test_loader.py (original) +++ python/branches/py3k/Lib/importlib/test/frozen/test_loader.py Sun Feb 1 05:00:05 2009 @@ -1,12 +1,12 @@ from importlib import machinery from .. import abc -from .. import support +from .. import util class LoaderTests(abc.LoaderTests): def test_module(self): - with support.uncache('__hello__'): + with util.uncache('__hello__'): module = machinery.FrozenImporter.load_module('__hello__') check = {'__name__': '__hello__', '__file__': '', '__package__': None} @@ -14,7 +14,7 @@ self.assertEqual(getattr(module, attr), value) def test_package(self): - with support.uncache('__phello__'): + with util.uncache('__phello__'): module = machinery.FrozenImporter.load_module('__phello__') check = {'__name__': '__phello__', '__file__': '', '__package__': '__phello__', '__path__': ['__phello__']} @@ -25,7 +25,7 @@ (attr, attr_value, value)) def test_lacking_parent(self): - with support.uncache('__phello__', '__phello__.spam'): + with util.uncache('__phello__', '__phello__.spam'): module = machinery.FrozenImporter.load_module('__phello__.spam') check = {'__name__': '__phello__.spam', '__file__': '', '__package__': '__phello__'} @@ -36,7 +36,7 @@ (attr, attr_value, value)) def test_module_reuse(self): - with support.uncache('__hello__'): + with util.uncache('__hello__'): module1 = machinery.FrozenImporter.load_module('__hello__') module2 = machinery.FrozenImporter.load_module('__hello__') self.assert_(module1 is module2) Modified: python/branches/py3k/Lib/importlib/test/import_/test___package__.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test___package__.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test___package__.py Sun Feb 1 05:00:05 2009 @@ -5,7 +5,7 @@ """ import unittest -from .. import support +from .. import util class Using__package__(unittest.TestCase): @@ -34,19 +34,19 @@ def test_using___package__(self): # [__package__] - with support.mock_modules('pkg.__init__', 'pkg.fake') as importer: - with support.import_state(meta_path=[importer]): - support.import_('pkg.fake') - module = support.import_('', globals={'__package__': 'pkg.fake'}, + with util.mock_modules('pkg.__init__', 'pkg.fake') as importer: + with util.import_state(meta_path=[importer]): + util.import_('pkg.fake') + module = util.import_('', globals={'__package__': 'pkg.fake'}, fromlist=['attr'], level=2) self.assertEquals(module.__name__, 'pkg') def test_using___name__(self): # [__name__] - with support.mock_modules('pkg.__init__', 'pkg.fake') as importer: - with support.import_state(meta_path=[importer]): - support.import_('pkg.fake') - module = support.import_('', + with util.mock_modules('pkg.__init__', 'pkg.fake') as importer: + with util.import_state(meta_path=[importer]): + util.import_('pkg.fake') + module = util.import_('', globals={'__name__': 'pkg.fake', '__path__': []}, fromlist=['attr'], level=2) @@ -54,12 +54,12 @@ def test_bad__package__(self): globals = {'__package__': ''} - self.assertRaises(SystemError, support.import_,'', globals, {}, + self.assertRaises(SystemError, util.import_,'', globals, {}, ['relimport'], 1) def test_bunk__package__(self): globals = {'__package__': 42} - self.assertRaises(ValueError, support.import_, '', globals, {}, + self.assertRaises(ValueError, util.import_, '', globals, {}, ['relimport'], 1) @@ -77,26 +77,26 @@ # [top-level] def test_top_level(self): - with support.mock_modules('top_level') as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules('top_level') as mock: + with util.import_state(meta_path=[mock]): del mock['top_level'].__package__ - module = support.import_('top_level') + module = util.import_('top_level') self.assert_(module.__package__ is None) # [package] def test_package(self): - with support.mock_modules('pkg.__init__') as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules('pkg.__init__') as mock: + with util.import_state(meta_path=[mock]): del mock['pkg'].__package__ - module = support.import_('pkg') + module = util.import_('pkg') self.assertEqual(module.__package__, 'pkg') # [submodule] def test_submodule(self): - with support.mock_modules('pkg.__init__', 'pkg.mod') as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules('pkg.__init__', 'pkg.mod') as mock: + with util.import_state(meta_path=[mock]): del mock['pkg.mod'].__package__ - pkg = support.import_('pkg.mod') + pkg = util.import_('pkg.mod') module = getattr(pkg, 'mod') self.assertEqual(module.__package__, 'pkg') Modified: python/branches/py3k/Lib/importlib/test/import_/test_caching.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_caching.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_caching.py Sun Feb 1 05:00:05 2009 @@ -1,6 +1,5 @@ """Test that sys.modules is used properly by import.""" -from ..support import import_, mock_modules, importlib_only, import_state - +from .. import util import sys from types import MethodType import unittest @@ -24,11 +23,11 @@ # [use cache] module_to_use = "some module found!" sys.modules['some_module'] = module_to_use - module = import_('some_module') + module = util.import_('some_module') self.assertEqual(id(module_to_use), id(module)) def create_mock(self, *names, return_=None): - mock = mock_modules(*names) + mock = util.mock_modules(*names) original_load = mock.load_module def load_module(self, fullname): original_load(fullname) @@ -38,31 +37,31 @@ # __import__ inconsistent between loaders and built-in import when it comes # to when to use the module in sys.modules and when not to. - @importlib_only + @util.importlib_only def test_using_cache_after_loader(self): # [from cache on return] with self.create_mock('module') as mock: - with import_state(meta_path=[mock]): - module = import_('module') + with util.import_state(meta_path=[mock]): + module = util.import_('module') self.assertEquals(id(module), id(sys.modules['module'])) # See test_using_cache_after_loader() for reasoning. - @importlib_only + @util.importlib_only def test_using_cache_for_assigning_to_attribute(self): # [from cache to attribute] with self.create_mock('pkg.__init__', 'pkg.module') as importer: - with import_state(meta_path=[importer]): - module = import_('pkg.module') + with util.import_state(meta_path=[importer]): + module = util.import_('pkg.module') self.assert_(hasattr(module, 'module')) self.assert_(id(module.module), id(sys.modules['pkg.module'])) # See test_using_cache_after_loader() for reasoning. - @importlib_only + @util.importlib_only def test_using_cache_for_fromlist(self): # [from cache for fromlist] with self.create_mock('pkg.__init__', 'pkg.module') as importer: - with import_state(meta_path=[importer]): - module = import_('pkg', fromlist=['module']) + with util.import_state(meta_path=[importer]): + module = util.import_('pkg', fromlist=['module']) self.assert_(hasattr(module, 'module')) self.assertEquals(id(module.module), id(sys.modules['pkg.module'])) Modified: python/branches/py3k/Lib/importlib/test/import_/test_fromlist.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_fromlist.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_fromlist.py Sun Feb 1 05:00:05 2009 @@ -1,6 +1,5 @@ """Test that the semantics relating to the 'fromlist' argument are correct.""" -from ..support import import_, mock_modules, import_state - +from .. import util import unittest class ReturnValue(unittest.TestCase): @@ -16,16 +15,16 @@ def test_return_from_import(self): # [import return] - with mock_modules('pkg.__init__', 'pkg.module') as importer: - with import_state(meta_path=[importer]): - module = import_('pkg.module') + with util.mock_modules('pkg.__init__', 'pkg.module') as importer: + with util.import_state(meta_path=[importer]): + module = util.import_('pkg.module') self.assertEquals(module.__name__, 'pkg') def test_return_from_from_import(self): # [from return] - with mock_modules('pkg.__init__', 'pkg.module')as importer: - with import_state(meta_path=[importer]): - module = import_('pkg.module', fromlist=['attr']) + with util.mock_modules('pkg.__init__', 'pkg.module')as importer: + with util.import_state(meta_path=[importer]): + module = util.import_('pkg.module', fromlist=['attr']) self.assertEquals(module.__name__, 'pkg.module') @@ -48,59 +47,59 @@ def test_object(self): # [object case] - with mock_modules('module') as importer: - with import_state(meta_path=[importer]): - module = import_('module', fromlist=['attr']) + with util.mock_modules('module') as importer: + with util.import_state(meta_path=[importer]): + module = util.import_('module', fromlist=['attr']) self.assertEquals(module.__name__, 'module') def test_unexistent_object(self): # [bad object] - with mock_modules('module') as importer: - with import_state(meta_path=[importer]): - module = import_('module', fromlist=['non_existent']) + with util.mock_modules('module') as importer: + with util.import_state(meta_path=[importer]): + module = util.import_('module', fromlist=['non_existent']) self.assertEquals(module.__name__, 'module') self.assert_(not hasattr(module, 'non_existent')) def test_module_from_package(self): # [module] - with mock_modules('pkg.__init__', 'pkg.module') as importer: - with import_state(meta_path=[importer]): - module = import_('pkg', fromlist=['module']) + with util.mock_modules('pkg.__init__', 'pkg.module') as importer: + with util.import_state(meta_path=[importer]): + module = util.import_('pkg', fromlist=['module']) self.assertEquals(module.__name__, 'pkg') self.assert_(hasattr(module, 'module')) self.assertEquals(module.module.__name__, 'pkg.module') def test_no_module_from_package(self): # [no module] - with mock_modules('pkg.__init__') as importer: - with import_state(meta_path=[importer]): - module = import_('pkg', fromlist='non_existent') + with util.mock_modules('pkg.__init__') as importer: + with util.import_state(meta_path=[importer]): + module = util.import_('pkg', fromlist='non_existent') self.assertEquals(module.__name__, 'pkg') self.assert_(not hasattr(module, 'non_existent')) def test_empty_string(self): - with mock_modules('pkg.__init__', 'pkg.mod') as importer: - with import_state(meta_path=[importer]): - module = import_('pkg.mod', fromlist=['']) + with util.mock_modules('pkg.__init__', 'pkg.mod') as importer: + with util.import_state(meta_path=[importer]): + module = util.import_('pkg.mod', fromlist=['']) self.assertEquals(module.__name__, 'pkg.mod') def test_using_star(self): # [using *] - with mock_modules('pkg.__init__', 'pkg.module') as mock: - with import_state(meta_path=[mock]): + with util.mock_modules('pkg.__init__', 'pkg.module') as mock: + with util.import_state(meta_path=[mock]): mock['pkg'].__all__ = ['module'] - module = import_('pkg', fromlist=['*']) + module = util.import_('pkg', fromlist=['*']) self.assertEquals(module.__name__, 'pkg') self.assert_(hasattr(module, 'module')) self.assertEqual(module.module.__name__, 'pkg.module') def test_star_with_others(self): # [using * with others] - context = mock_modules('pkg.__init__', 'pkg.module1', 'pkg.module2') + context = util.mock_modules('pkg.__init__', 'pkg.module1', 'pkg.module2') with context as mock: - with import_state(meta_path=[mock]): + with util.import_state(meta_path=[mock]): mock['pkg'].__all__ = ['module1'] - module = import_('pkg', fromlist=['module2', '*']) + module = util.import_('pkg', fromlist=['module2', '*']) self.assertEquals(module.__name__, 'pkg') self.assert_(hasattr(module, 'module1')) self.assert_(hasattr(module, 'module2')) Modified: python/branches/py3k/Lib/importlib/test/import_/test_meta_path.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_meta_path.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_meta_path.py Sun Feb 1 05:00:05 2009 @@ -1,5 +1,4 @@ -from ..support import import_state, mock_modules, import_ - +from .. import util from contextlib import nested from types import MethodType import unittest @@ -16,24 +15,25 @@ def test_first_called(self): # [first called] mod = 'top_level' - first = mock_modules(mod) - second = mock_modules(mod) - with nested(mock_modules(mod), mock_modules(mod)) as (first, second): + first = util.mock_modules(mod) + second = util.mock_modules(mod) + context = nested(util.mock_modules(mod), util.mock_modules(mod)) + with context as (first, second): first.modules[mod] = 42 second.modules[mod] = -13 - with import_state(meta_path=[first, second]): - self.assertEquals(import_(mod), 42) + with util.import_state(meta_path=[first, second]): + self.assertEquals(util.import_(mod), 42) def test_continuing(self): # [continuing] mod_name = 'for_real' - first = mock_modules('nonexistent') - second = mock_modules(mod_name) + first = util.mock_modules('nonexistent') + second = util.mock_modules(mod_name) with nested(first, second): first.find_module = lambda self, fullname, path=None: None second.modules[mod_name] = 42 - with import_state(meta_path=[first, second]): - self.assertEquals(import_(mod_name), 42) + with util.import_state(meta_path=[first, second]): + self.assertEquals(util.import_(mod_name), 42) class CallSignature(unittest.TestCase): @@ -54,11 +54,11 @@ # [no path] mod_name = 'top_level' assert '.' not in mod_name - with mock_modules(mod_name) as importer: + with util.mock_modules(mod_name) as importer: log, wrapped_call = self.log(importer.find_module) importer.find_module = MethodType(wrapped_call, importer) - with import_state(meta_path=[importer]): - import_(mod_name) + with util.import_state(meta_path=[importer]): + util.import_(mod_name) assert len(log) == 1 args = log[0][0] kwargs = log[0][1] @@ -74,12 +74,12 @@ mod_name = pkg_name + '.module' path = [42] assert '.' in mod_name - with mock_modules(pkg_name+'.__init__', mod_name) as importer: + with util.mock_modules(pkg_name+'.__init__', mod_name) as importer: importer.modules[pkg_name].__path__ = path log, wrapped_call = self.log(importer.find_module) importer.find_module = MethodType(wrapped_call, importer) - with import_state(meta_path=[importer]): - import_(mod_name) + with util.import_state(meta_path=[importer]): + util.import_(mod_name) assert len(log) == 2 args = log[1][0] kwargs = log[1][1] Modified: python/branches/py3k/Lib/importlib/test/import_/test_packages.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_packages.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_packages.py Sun Feb 1 05:00:05 2009 @@ -1,7 +1,7 @@ +from .. import util import sys import unittest import importlib -from .. import support class ParentModuleTests(unittest.TestCase): @@ -9,15 +9,15 @@ """Importing a submodule should import the parent modules.""" def test_import_parent(self): - with support.mock_modules('pkg.__init__', 'pkg.module') as mock: - with support.import_state(meta_path=[mock]): - module = support.import_('pkg.module') + with util.mock_modules('pkg.__init__', 'pkg.module') as mock: + with util.import_state(meta_path=[mock]): + module = util.import_('pkg.module') self.assert_('pkg' in sys.modules) def test_bad_parent(self): - with support.mock_modules('pkg.module') as mock: - with support.import_state(meta_path=[mock]): - self.assertRaises(ImportError, support.import_, 'pkg.module') + with util.mock_modules('pkg.module') as mock: + with util.import_state(meta_path=[mock]): + self.assertRaises(ImportError, util.import_, 'pkg.module') def test_main(): Modified: python/branches/py3k/Lib/importlib/test/import_/test_path.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_path.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_path.py Sun Feb 1 05:00:05 2009 @@ -1,6 +1,4 @@ -from ..support import (mock_modules, import_state, import_, mock_path_hook, - importlib_only, uncache) - +from .. import util from contextlib import nested from imp import new_module import sys @@ -32,7 +30,7 @@ def order_test(self, to_import, entry, search_path, path=[]): # [order] log = [] - class LogFindModule(mock_modules): + class LogFindModule(util.mock_modules): def find_module(self, fullname): log.append(self) return super().find_module(fullname) @@ -42,12 +40,12 @@ hitter = LogFindModule(to_import) with nested(misser, hitter): cache = dict(zip(search_path, (misser, hitter))) - with import_state(path=path, path_importer_cache=cache): - import_(to_import) + with util.import_state(path=path, path_importer_cache=cache): + util.import_(to_import) self.assertEquals(log[0], misser) self.assertEquals(log[1], hitter) - @importlib_only # __import__ uses PyDict_GetItem(), bypassing log. + @util.importlib_only # __import__ uses PyDict_GetItem(), bypassing log. def cache_use_test(self, to_import, entry, path=[]): # [cache check], [cache use] log = [] @@ -56,11 +54,11 @@ log.append(item) return super(LoggingDict, self).__getitem__(item) - with mock_modules(to_import) as importer: + with util.mock_modules(to_import) as importer: cache = LoggingDict() cache[entry] = importer - with import_state(path=[entry], path_importer_cache=cache): - module = import_(to_import, fromlist=['a']) + with util.import_state(path=[entry], path_importer_cache=cache): + module = util.import_(to_import, fromlist=['a']) self.assert_(module is importer[to_import]) self.assertEquals(len(cache), 1) self.assertEquals([entry], log) @@ -71,11 +69,11 @@ def logging_hook(entry): log.append(entry) raise ImportError - with mock_modules(to_import) as importer: - hitter = mock_path_hook(entry, importer=importer) + with util.mock_modules(to_import) as importer: + hitter = util.mock_path_hook(entry, importer=importer) path_hooks = [logging_hook, logging_hook, hitter] - with import_state(path_hooks=path_hooks, path=path): - import_(to_import) + with util.import_state(path_hooks=path_hooks, path=path): + util.import_(to_import) self.assertEquals(sys.path_importer_cache[entry], importer) self.assertEquals(len(log), 2) @@ -90,7 +88,7 @@ raise ImportError try: - import_(to_import) + util.import_(to_import) except ImportError: pass @@ -113,7 +111,7 @@ def test_path_argument(self): name = 'total junk' - with uncache(name): + with util.uncache(name): self.path_argument_test(name) @@ -122,13 +120,13 @@ """Tests for __path__.""" def run_test(self, test, entry, path, *args): - with mock_modules('pkg.__init__') as importer: + with util.mock_modules('pkg.__init__') as importer: importer['pkg'].__path__ = path importer.load_module('pkg') test('pkg.hit', entry, *args) - @importlib_only # XXX Unknown reason why this fails. + @util.importlib_only # XXX Unknown reason why this fails. def test_order(self): self.run_test(self.order_test, 'second', ('first', 'second'), ['first', 'second']) @@ -146,7 +144,7 @@ module.__path__ = ['random __path__'] name = 'pkg.whatever' sys.modules['pkg'] = module - with uncache('pkg', name): + with util.uncache('pkg', name): self.path_argument_test(name) Modified: python/branches/py3k/Lib/importlib/test/import_/test_relative_imports.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_relative_imports.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_relative_imports.py Sun Feb 1 05:00:05 2009 @@ -1,7 +1,5 @@ """Test relative imports (PEP 328).""" - -from ..support import uncache, import_, mock_modules, import_state - +from .. import util import sys import unittest @@ -65,10 +63,10 @@ uncache_names.append(name) else: uncache_names.append(name[:-len('.__init__')]) - with mock_modules(*create) as importer: - with import_state(meta_path=[importer]): + with util.mock_modules(*create) as importer: + with util.import_state(meta_path=[importer]): for global_ in globals_: - with uncache(*uncache_names): + with util.uncache(*uncache_names): callback(global_) @@ -77,8 +75,8 @@ create = 'pkg.__init__', 'pkg.mod2' globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.mod1'} def callback(global_): - import_('pkg') # For __import__(). - module = import_('', global_, fromlist=['mod2'], level=1) + util.import_('pkg') # For __import__(). + module = util.import_('', global_, fromlist=['mod2'], level=1) self.assertEqual(module.__name__, 'pkg') self.assert_(hasattr(module, 'mod2')) self.assertEqual(module.mod2.attr, 'pkg.mod2') @@ -89,8 +87,8 @@ create = 'pkg.__init__', 'pkg.mod2' globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.mod1'} def callback(global_): - import_('pkg') # For __import__(). - module = import_('mod2', global_, fromlist=['attr'], level=1) + util.import_('pkg') # For __import__(). + module = util.import_('mod2', global_, fromlist=['attr'], level=1) self.assertEqual(module.__name__, 'pkg.mod2') self.assertEqual(module.attr, 'pkg.mod2') self.relative_import_test(create, globals_, callback) @@ -101,8 +99,8 @@ globals_ = ({'__package__': 'pkg'}, {'__name__': 'pkg', '__path__': ['blah']}) def callback(global_): - import_('pkg') # For __import__(). - module = import_('', global_, fromlist=['module'], + util.import_('pkg') # For __import__(). + module = util.import_('', global_, fromlist=['module'], level=1) self.assertEqual(module.__name__, 'pkg') self.assert_(hasattr(module, 'module')) @@ -114,8 +112,8 @@ create = 'pkg.__init__', 'pkg.module' globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.module'} def callback(global_): - import_('pkg') # For __import__(). - module = import_('', global_, fromlist=['attr'], level=1) + util.import_('pkg') # For __import__(). + module = util.import_('', global_, fromlist=['attr'], level=1) self.assertEqual(module.__name__, 'pkg') self.relative_import_test(create, globals_, callback) @@ -126,7 +124,7 @@ globals_ = ({'__package__': 'pkg.subpkg1'}, {'__name__': 'pkg.subpkg1', '__path__': ['blah']}) def callback(global_): - module = import_('', global_, fromlist=['subpkg2'], level=2) + module = util.import_('', global_, fromlist=['subpkg2'], level=2) self.assertEqual(module.__name__, 'pkg') self.assert_(hasattr(module, 'subpkg2')) self.assertEqual(module.subpkg2.attr, 'pkg.subpkg2.__init__') @@ -141,8 +139,8 @@ {'__name__': 'pkg.pkg1.pkg2.pkg3.pkg4.pkg5', '__path__': ['blah']}) def callback(global_): - import_(globals_[0]['__package__']) - module = import_('', global_, fromlist=['attr'], level=6) + util.import_(globals_[0]['__package__']) + module = util.import_('', global_, fromlist=['attr'], level=6) self.assertEqual(module.__name__, 'pkg') self.relative_import_test(create, globals_, callback) @@ -152,8 +150,8 @@ globals_ = ({'__package__': 'pkg'}, {'__name__': 'pkg', '__path__': ['blah']}) def callback(global_): - import_('pkg') - self.assertRaises(ValueError, import_, '', global_, + util.import_('pkg') + self.assertRaises(ValueError, util.import_, '', global_, fromlist=['top_level'], level=2) self.relative_import_test(create, globals_, callback) @@ -162,14 +160,14 @@ create = ['top_level', 'pkg.__init__', 'pkg.module'] globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.module'} def callback(global_): - import_('pkg') - self.assertRaises(ValueError, import_, '', global_, + util.import_('pkg') + self.assertRaises(ValueError, util.import_, '', global_, fromlist=['top_level'], level=2) self.relative_import_test(create, globals_, callback) def test_empty_name_w_level_0(self): # [empty name] - self.assertRaises(ValueError, import_, '') + self.assertRaises(ValueError, util.import_, '') def test_import_from_different_package(self): # Test importing from a different package than the caller. @@ -183,8 +181,9 @@ '__runpy_pkg__.uncle.cousin.nephew'] globals_ = {'__package__': '__runpy_pkg__.__runpy_pkg__'} def callback(global_): - import_('__runpy_pkg__.__runpy_pkg__') - module = import_('uncle.cousin', globals_, {}, fromlist=['nephew'], + util.import_('__runpy_pkg__.__runpy_pkg__') + module = util.import_('uncle.cousin', globals_, {}, + fromlist=['nephew'], level=2) self.assertEqual(module.__name__, '__runpy_pkg__.uncle.cousin') self.relative_import_test(create, globals_, callback) 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 Sun Feb 1 05:00:05 2009 @@ -1,6 +1,6 @@ """Test case-sensitivity (PEP 235).""" import importlib -from .. import support +from .. import util from . import util as source_util import os import sys @@ -8,7 +8,7 @@ import unittest - at support.case_insensitive_tests + at util.case_insensitive_tests class CaseSensitivityTest(unittest.TestCase): """PEP 235 dictates that on case-preserving, case-insensitive file systems Modified: python/branches/py3k/Lib/importlib/test/source/test_finder.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/test_finder.py (original) +++ python/branches/py3k/Lib/importlib/test/source/test_finder.py Sun Feb 1 05:00:05 2009 @@ -1,6 +1,5 @@ import importlib from .. import abc -from .. import support from . import util as source_util import os import py_compile Modified: python/branches/py3k/Lib/importlib/test/source/test_loader.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/test_loader.py (original) +++ python/branches/py3k/Lib/importlib/test/source/test_loader.py Sun Feb 1 05:00:05 2009 @@ -1,6 +1,5 @@ import importlib from .. import abc -from .. import support from . import util as source_util import imp Modified: python/branches/py3k/Lib/importlib/test/source/test_path_hook.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/test_path_hook.py (original) +++ python/branches/py3k/Lib/importlib/test/source/test_path_hook.py Sun Feb 1 05:00:05 2009 @@ -1,5 +1,5 @@ import importlib -from . import util +from . import util as source_util import unittest @@ -9,7 +9,7 @@ def test_success(self): # XXX Only work on existing directories? - with util.create_modules('dummy') as mapping: + with source_util.create_modules('dummy') as mapping: self.assert_(hasattr(importlib.FileImporter(mapping['.root']), 'find_module')) Modified: python/branches/py3k/Lib/importlib/test/source/test_source_encoding.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/test_source_encoding.py (original) +++ python/branches/py3k/Lib/importlib/test/source/test_source_encoding.py Sun Feb 1 05:00:05 2009 @@ -1,5 +1,4 @@ import importlib -from .. import support from . import util as source_util import codecs 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 Sun Feb 1 05:00:05 2009 @@ -1,11 +1,11 @@ -from .. import support as util +from .. import util import contextlib import imp import os import os.path import sys import tempfile -from test import support as support +from test import support def writes_bytecode(fxn): Deleted: python/branches/py3k/Lib/importlib/test/support.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/support.py Sun Feb 1 05:00:05 2009 +++ (empty file) @@ -1,153 +0,0 @@ -from importlib import Import - -from contextlib import contextmanager -from functools import update_wrapper -import imp -import os.path -from test.support import unlink -import sys - - -using___import__ = False - -def import_(*args, **kwargs): - """Delegate to allow for injecting different implementations of import.""" - if using___import__: - return __import__(*args, **kwargs) - return Import()(*args, **kwargs) - -def importlib_only(fxn): - """Decorator to mark which tests are not supported by the current - implementation of __import__().""" - def inner(*args, **kwargs): - if using___import__: - return - else: - return fxn(*args, **kwargs) - update_wrapper(inner, fxn) - return inner - - -def case_insensitive_tests(class_): - """Class decorator that nullifies tests that require a case-insensitive - file system.""" - if sys.platform not in ('win32', 'darwin', 'cygwin'): - return object() - else: - return class_ - - - at contextmanager -def uncache(*names): - """Uncache a module from sys.modules. - - A basic sanity check is performed to prevent uncaching modules that either - cannot/shouldn't be uncached. - - """ - for name in names: - if name in ('sys', 'marshal', 'imp'): - raise ValueError( - "cannot uncache {0} as it will break _importlib".format(name)) - try: - del sys.modules[name] - except KeyError: - pass - try: - yield - finally: - for name in names: - try: - del sys.modules[name] - except KeyError: - pass - - at contextmanager -def import_state(**kwargs): - """Context manager to manage the various importers and stored state in the - sys module. - - The 'modules' attribute is not supported as the interpreter state stores a - pointer to the dict that the interpreter uses internally; - reassigning to sys.modules does not have the desired effect. - - """ - originals = {} - try: - for attr, default in (('meta_path', []), ('path', []), - ('path_hooks', []), - ('path_importer_cache', {})): - originals[attr] = getattr(sys, attr) - if attr in kwargs: - new_value = kwargs[attr] - del kwargs[attr] - else: - new_value = default - setattr(sys, attr, new_value) - if len(kwargs): - raise ValueError( - 'unrecognized arguments: {0}'.format(kwargs.keys())) - yield - finally: - for attr, value in originals.items(): - setattr(sys, attr, value) - - -class mock_modules: - - """A mock importer/loader.""" - - def __init__(self, *names): - self.modules = {} - for name in names: - if not name.endswith('.__init__'): - import_name = name - else: - import_name = name[:-len('.__init__')] - if '.' not in name: - package = None - elif import_name == name: - package = name.rsplit('.', 1)[0] - else: - package = import_name - module = imp.new_module(import_name) - module.__loader__ = self - module.__file__ = '' - module.__package__ = package - module.attr = name - if import_name != name: - module.__path__ = [''] - self.modules[import_name] = module - - def __getitem__(self, name): - return self.modules[name] - - def find_module(self, fullname, path=None): - if fullname not in self.modules: - return None - else: - return self - - def load_module(self, fullname): - if fullname not in self.modules: - raise ImportError - else: - sys.modules[fullname] = self.modules[fullname] - return self.modules[fullname] - - def __enter__(self): - self._uncache = uncache(*self.modules.keys()) - self._uncache.__enter__() - return self - - def __exit__(self, *exc_info): - self._uncache.__exit__(None, None, None) - - -def mock_path_hook(*entries, importer): - """A mock sys.path_hooks entry.""" - def hook(entry): - if entry not in entries: - raise ImportError - return importer - return hook Modified: python/branches/py3k/Lib/importlib/test/test_api.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/test_api.py (original) +++ python/branches/py3k/Lib/importlib/test/test_api.py Sun Feb 1 05:00:05 2009 @@ -1,6 +1,6 @@ import unittest import importlib -from . import support +from . import util class ImportModuleTests(unittest.TestCase): @@ -9,8 +9,8 @@ def test_module_import(self): # Test importing a top-level module. - with support.mock_modules('top_level') as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules('top_level') as mock: + with util.import_state(meta_path=[mock]): module = importlib.import_module('top_level') self.assertEqual(module.__name__, 'top_level') @@ -19,8 +19,8 @@ pkg_name = 'pkg' pkg_long_name = '{0}.__init__'.format(pkg_name) name = '{0}.mod'.format(pkg_name) - with support.mock_modules(pkg_long_name, name) as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules(pkg_long_name, name) as mock: + with util.import_state(meta_path=[mock]): module = importlib.import_module(name) self.assertEqual(module.__name__, name) @@ -31,8 +31,8 @@ module_name = 'mod' absolute_name = '{0}.{1}'.format(pkg_name, module_name) relative_name = '.{0}'.format(module_name) - with support.mock_modules(pkg_long_name, absolute_name) as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules(pkg_long_name, absolute_name) as mock: + with util.import_state(meta_path=[mock]): module = importlib.import_module(relative_name, pkg_name) self.assertEqual(module.__name__, absolute_name) @@ -42,8 +42,8 @@ pkg_name = 'pkg' pkg_long_name = '{0}.__init__'.format(pkg_name) name = '{0}.mod'.format(pkg_name) - with support.mock_modules(pkg_long_name, name) as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules(pkg_long_name, name) as mock: + with util.import_state(meta_path=[mock]): module = importlib.import_module(name, pkg_name) self.assertEqual(module.__name__, name) From buildbot at python.org Sun Feb 1 05:22:08 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 04:22:08 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090201042208.5BDF41E4002@bag.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/156 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: brett.cannon BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Sun Feb 1 05:28:04 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 1 Feb 2009 05:28:04 +0100 (CET) Subject: [Python-checkins] r69173 - in python/branches/py3k/Lib/importlib: NOTES test/import_/test___package__.py test/import_/test_caching.py test/import_/test_fromlist.py test/import_/test_meta_path.py test/import_/test_packages.py test/import_/test_path.py test/import_/test_relative_imports.py test/import_/util.py test/util.py Message-ID: <20090201042804.A91511E4002@bag.python.org> Author: brett.cannon Date: Sun Feb 1 05:28:04 2009 New Revision: 69173 Log: Move import semantic util code to importlib.test.import_.util. Added: python/branches/py3k/Lib/importlib/test/import_/util.py Modified: python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/test/import_/test___package__.py python/branches/py3k/Lib/importlib/test/import_/test_caching.py python/branches/py3k/Lib/importlib/test/import_/test_fromlist.py python/branches/py3k/Lib/importlib/test/import_/test_meta_path.py python/branches/py3k/Lib/importlib/test/import_/test_packages.py python/branches/py3k/Lib/importlib/test/import_/test_path.py python/branches/py3k/Lib/importlib/test/import_/test_relative_imports.py python/branches/py3k/Lib/importlib/test/util.py Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sun Feb 1 05:28:04 2009 @@ -3,10 +3,6 @@ * Reorganize support code. - + Separate out support code for extensions out of test_support_hook. - + Move util.import_ and utill.mock_modules to import_, importlib_only, - mock_path_hook? - + Add a file loader mock that returns monotonically increasing mtime. - Use in source/test_reload. - Use in source/test_load_module_mixed. Modified: python/branches/py3k/Lib/importlib/test/import_/test___package__.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test___package__.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test___package__.py Sun Feb 1 05:28:04 2009 @@ -6,6 +6,7 @@ """ import unittest from .. import util +from . import util as import_util class Using__package__(unittest.TestCase): @@ -36,8 +37,8 @@ # [__package__] with util.mock_modules('pkg.__init__', 'pkg.fake') as importer: with util.import_state(meta_path=[importer]): - util.import_('pkg.fake') - module = util.import_('', globals={'__package__': 'pkg.fake'}, + import_util.import_('pkg.fake') + module = import_util.import_('', globals={'__package__': 'pkg.fake'}, fromlist=['attr'], level=2) self.assertEquals(module.__name__, 'pkg') @@ -45,8 +46,8 @@ # [__name__] with util.mock_modules('pkg.__init__', 'pkg.fake') as importer: with util.import_state(meta_path=[importer]): - util.import_('pkg.fake') - module = util.import_('', + import_util.import_('pkg.fake') + module = import_util.import_('', globals={'__name__': 'pkg.fake', '__path__': []}, fromlist=['attr'], level=2) @@ -54,12 +55,12 @@ def test_bad__package__(self): globals = {'__package__': ''} - self.assertRaises(SystemError, util.import_,'', globals, {}, + self.assertRaises(SystemError, import_util.import_,'', globals, {}, ['relimport'], 1) def test_bunk__package__(self): globals = {'__package__': 42} - self.assertRaises(ValueError, util.import_, '', globals, {}, + self.assertRaises(ValueError, import_util.import_, '', globals, {}, ['relimport'], 1) @@ -80,7 +81,7 @@ with util.mock_modules('top_level') as mock: with util.import_state(meta_path=[mock]): del mock['top_level'].__package__ - module = util.import_('top_level') + module = import_util.import_('top_level') self.assert_(module.__package__ is None) # [package] @@ -88,7 +89,7 @@ with util.mock_modules('pkg.__init__') as mock: with util.import_state(meta_path=[mock]): del mock['pkg'].__package__ - module = util.import_('pkg') + module = import_util.import_('pkg') self.assertEqual(module.__package__, 'pkg') # [submodule] @@ -96,7 +97,7 @@ with util.mock_modules('pkg.__init__', 'pkg.mod') as mock: with util.import_state(meta_path=[mock]): del mock['pkg.mod'].__package__ - pkg = util.import_('pkg.mod') + pkg = import_util.import_('pkg.mod') module = getattr(pkg, 'mod') self.assertEqual(module.__package__, 'pkg') Modified: python/branches/py3k/Lib/importlib/test/import_/test_caching.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_caching.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_caching.py Sun Feb 1 05:28:04 2009 @@ -1,5 +1,6 @@ """Test that sys.modules is used properly by import.""" from .. import util +from . import util as import_util import sys from types import MethodType import unittest @@ -23,7 +24,7 @@ # [use cache] module_to_use = "some module found!" sys.modules['some_module'] = module_to_use - module = util.import_('some_module') + module = import_util.import_('some_module') self.assertEqual(id(module_to_use), id(module)) def create_mock(self, *names, return_=None): @@ -37,31 +38,31 @@ # __import__ inconsistent between loaders and built-in import when it comes # to when to use the module in sys.modules and when not to. - @util.importlib_only + @import_util.importlib_only def test_using_cache_after_loader(self): # [from cache on return] with self.create_mock('module') as mock: with util.import_state(meta_path=[mock]): - module = util.import_('module') + module = import_util.import_('module') self.assertEquals(id(module), id(sys.modules['module'])) # See test_using_cache_after_loader() for reasoning. - @util.importlib_only + @import_util.importlib_only def test_using_cache_for_assigning_to_attribute(self): # [from cache to attribute] with self.create_mock('pkg.__init__', 'pkg.module') as importer: with util.import_state(meta_path=[importer]): - module = util.import_('pkg.module') + module = import_util.import_('pkg.module') self.assert_(hasattr(module, 'module')) self.assert_(id(module.module), id(sys.modules['pkg.module'])) # See test_using_cache_after_loader() for reasoning. - @util.importlib_only + @import_util.importlib_only def test_using_cache_for_fromlist(self): # [from cache for fromlist] with self.create_mock('pkg.__init__', 'pkg.module') as importer: with util.import_state(meta_path=[importer]): - module = util.import_('pkg', fromlist=['module']) + module = import_util.import_('pkg', fromlist=['module']) self.assert_(hasattr(module, 'module')) self.assertEquals(id(module.module), id(sys.modules['pkg.module'])) Modified: python/branches/py3k/Lib/importlib/test/import_/test_fromlist.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_fromlist.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_fromlist.py Sun Feb 1 05:28:04 2009 @@ -1,5 +1,6 @@ """Test that the semantics relating to the 'fromlist' argument are correct.""" from .. import util +from . import util as import_util import unittest class ReturnValue(unittest.TestCase): @@ -17,14 +18,14 @@ # [import return] with util.mock_modules('pkg.__init__', 'pkg.module') as importer: with util.import_state(meta_path=[importer]): - module = util.import_('pkg.module') + module = import_util.import_('pkg.module') self.assertEquals(module.__name__, 'pkg') def test_return_from_from_import(self): # [from return] with util.mock_modules('pkg.__init__', 'pkg.module')as importer: with util.import_state(meta_path=[importer]): - module = util.import_('pkg.module', fromlist=['attr']) + module = import_util.import_('pkg.module', fromlist=['attr']) self.assertEquals(module.__name__, 'pkg.module') @@ -49,14 +50,14 @@ # [object case] with util.mock_modules('module') as importer: with util.import_state(meta_path=[importer]): - module = util.import_('module', fromlist=['attr']) + module = import_util.import_('module', fromlist=['attr']) self.assertEquals(module.__name__, 'module') def test_unexistent_object(self): # [bad object] with util.mock_modules('module') as importer: with util.import_state(meta_path=[importer]): - module = util.import_('module', fromlist=['non_existent']) + module = import_util.import_('module', fromlist=['non_existent']) self.assertEquals(module.__name__, 'module') self.assert_(not hasattr(module, 'non_existent')) @@ -64,7 +65,7 @@ # [module] with util.mock_modules('pkg.__init__', 'pkg.module') as importer: with util.import_state(meta_path=[importer]): - module = util.import_('pkg', fromlist=['module']) + module = import_util.import_('pkg', fromlist=['module']) self.assertEquals(module.__name__, 'pkg') self.assert_(hasattr(module, 'module')) self.assertEquals(module.module.__name__, 'pkg.module') @@ -73,14 +74,14 @@ # [no module] with util.mock_modules('pkg.__init__') as importer: with util.import_state(meta_path=[importer]): - module = util.import_('pkg', fromlist='non_existent') + module = import_util.import_('pkg', fromlist='non_existent') self.assertEquals(module.__name__, 'pkg') self.assert_(not hasattr(module, 'non_existent')) def test_empty_string(self): with util.mock_modules('pkg.__init__', 'pkg.mod') as importer: with util.import_state(meta_path=[importer]): - module = util.import_('pkg.mod', fromlist=['']) + module = import_util.import_('pkg.mod', fromlist=['']) self.assertEquals(module.__name__, 'pkg.mod') def test_using_star(self): @@ -88,7 +89,7 @@ with util.mock_modules('pkg.__init__', 'pkg.module') as mock: with util.import_state(meta_path=[mock]): mock['pkg'].__all__ = ['module'] - module = util.import_('pkg', fromlist=['*']) + module = import_util.import_('pkg', fromlist=['*']) self.assertEquals(module.__name__, 'pkg') self.assert_(hasattr(module, 'module')) self.assertEqual(module.module.__name__, 'pkg.module') @@ -99,7 +100,7 @@ with context as mock: with util.import_state(meta_path=[mock]): mock['pkg'].__all__ = ['module1'] - module = util.import_('pkg', fromlist=['module2', '*']) + module = import_util.import_('pkg', fromlist=['module2', '*']) self.assertEquals(module.__name__, 'pkg') self.assert_(hasattr(module, 'module1')) self.assert_(hasattr(module, 'module2')) Modified: python/branches/py3k/Lib/importlib/test/import_/test_meta_path.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_meta_path.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_meta_path.py Sun Feb 1 05:28:04 2009 @@ -1,4 +1,5 @@ from .. import util +from . import util as import_util from contextlib import nested from types import MethodType import unittest @@ -22,7 +23,7 @@ first.modules[mod] = 42 second.modules[mod] = -13 with util.import_state(meta_path=[first, second]): - self.assertEquals(util.import_(mod), 42) + self.assertEquals(import_util.import_(mod), 42) def test_continuing(self): # [continuing] @@ -33,7 +34,7 @@ first.find_module = lambda self, fullname, path=None: None second.modules[mod_name] = 42 with util.import_state(meta_path=[first, second]): - self.assertEquals(util.import_(mod_name), 42) + self.assertEquals(import_util.import_(mod_name), 42) class CallSignature(unittest.TestCase): @@ -58,7 +59,7 @@ log, wrapped_call = self.log(importer.find_module) importer.find_module = MethodType(wrapped_call, importer) with util.import_state(meta_path=[importer]): - util.import_(mod_name) + import_util.import_(mod_name) assert len(log) == 1 args = log[0][0] kwargs = log[0][1] @@ -79,7 +80,7 @@ log, wrapped_call = self.log(importer.find_module) importer.find_module = MethodType(wrapped_call, importer) with util.import_state(meta_path=[importer]): - util.import_(mod_name) + import_util.import_(mod_name) assert len(log) == 2 args = log[1][0] kwargs = log[1][1] Modified: python/branches/py3k/Lib/importlib/test/import_/test_packages.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_packages.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_packages.py Sun Feb 1 05:28:04 2009 @@ -1,4 +1,5 @@ from .. import util +from . import util as import_util import sys import unittest import importlib @@ -11,13 +12,14 @@ def test_import_parent(self): with util.mock_modules('pkg.__init__', 'pkg.module') as mock: with util.import_state(meta_path=[mock]): - module = util.import_('pkg.module') + module = import_util.import_('pkg.module') self.assert_('pkg' in sys.modules) def test_bad_parent(self): with util.mock_modules('pkg.module') as mock: with util.import_state(meta_path=[mock]): - self.assertRaises(ImportError, util.import_, 'pkg.module') + self.assertRaises(ImportError, + import_util.import_, 'pkg.module') def test_main(): Modified: python/branches/py3k/Lib/importlib/test/import_/test_path.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_path.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_path.py Sun Feb 1 05:28:04 2009 @@ -1,4 +1,5 @@ from .. import util +from . import util as import_util from contextlib import nested from imp import new_module import sys @@ -41,11 +42,11 @@ with nested(misser, hitter): cache = dict(zip(search_path, (misser, hitter))) with util.import_state(path=path, path_importer_cache=cache): - util.import_(to_import) + import_util.import_(to_import) self.assertEquals(log[0], misser) self.assertEquals(log[1], hitter) - @util.importlib_only # __import__ uses PyDict_GetItem(), bypassing log. + @import_util.importlib_only # __import__ uses PyDict_GetItem(), bypassing log. def cache_use_test(self, to_import, entry, path=[]): # [cache check], [cache use] log = [] @@ -58,7 +59,7 @@ cache = LoggingDict() cache[entry] = importer with util.import_state(path=[entry], path_importer_cache=cache): - module = util.import_(to_import, fromlist=['a']) + module = import_util.import_(to_import, fromlist=['a']) self.assert_(module is importer[to_import]) self.assertEquals(len(cache), 1) self.assertEquals([entry], log) @@ -70,10 +71,10 @@ log.append(entry) raise ImportError with util.mock_modules(to_import) as importer: - hitter = util.mock_path_hook(entry, importer=importer) + hitter = import_util.mock_path_hook(entry, importer=importer) path_hooks = [logging_hook, logging_hook, hitter] with util.import_state(path_hooks=path_hooks, path=path): - util.import_(to_import) + import_util.import_(to_import) self.assertEquals(sys.path_importer_cache[entry], importer) self.assertEquals(len(log), 2) @@ -88,7 +89,7 @@ raise ImportError try: - util.import_(to_import) + import_util.import_(to_import) except ImportError: pass @@ -126,7 +127,7 @@ test('pkg.hit', entry, *args) - @util.importlib_only # XXX Unknown reason why this fails. + @import_util.importlib_only # XXX Unknown reason why this fails. def test_order(self): self.run_test(self.order_test, 'second', ('first', 'second'), ['first', 'second']) Modified: python/branches/py3k/Lib/importlib/test/import_/test_relative_imports.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_relative_imports.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_relative_imports.py Sun Feb 1 05:28:04 2009 @@ -1,5 +1,6 @@ """Test relative imports (PEP 328).""" from .. import util +from . import util as import_util import sys import unittest @@ -75,8 +76,8 @@ create = 'pkg.__init__', 'pkg.mod2' globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.mod1'} def callback(global_): - util.import_('pkg') # For __import__(). - module = util.import_('', global_, fromlist=['mod2'], level=1) + import_util.import_('pkg') # For __import__(). + module = import_util.import_('', global_, fromlist=['mod2'], level=1) self.assertEqual(module.__name__, 'pkg') self.assert_(hasattr(module, 'mod2')) self.assertEqual(module.mod2.attr, 'pkg.mod2') @@ -87,8 +88,9 @@ create = 'pkg.__init__', 'pkg.mod2' globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.mod1'} def callback(global_): - util.import_('pkg') # For __import__(). - module = util.import_('mod2', global_, fromlist=['attr'], level=1) + import_util.import_('pkg') # For __import__(). + module = import_util.import_('mod2', global_, fromlist=['attr'], + level=1) self.assertEqual(module.__name__, 'pkg.mod2') self.assertEqual(module.attr, 'pkg.mod2') self.relative_import_test(create, globals_, callback) @@ -99,8 +101,8 @@ globals_ = ({'__package__': 'pkg'}, {'__name__': 'pkg', '__path__': ['blah']}) def callback(global_): - util.import_('pkg') # For __import__(). - module = util.import_('', global_, fromlist=['module'], + import_util.import_('pkg') # For __import__(). + module = import_util.import_('', global_, fromlist=['module'], level=1) self.assertEqual(module.__name__, 'pkg') self.assert_(hasattr(module, 'module')) @@ -112,8 +114,8 @@ create = 'pkg.__init__', 'pkg.module' globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.module'} def callback(global_): - util.import_('pkg') # For __import__(). - module = util.import_('', global_, fromlist=['attr'], level=1) + import_util.import_('pkg') # For __import__(). + module = import_util.import_('', global_, fromlist=['attr'], level=1) self.assertEqual(module.__name__, 'pkg') self.relative_import_test(create, globals_, callback) @@ -124,7 +126,8 @@ globals_ = ({'__package__': 'pkg.subpkg1'}, {'__name__': 'pkg.subpkg1', '__path__': ['blah']}) def callback(global_): - module = util.import_('', global_, fromlist=['subpkg2'], level=2) + module = import_util.import_('', global_, fromlist=['subpkg2'], + level=2) self.assertEqual(module.__name__, 'pkg') self.assert_(hasattr(module, 'subpkg2')) self.assertEqual(module.subpkg2.attr, 'pkg.subpkg2.__init__') @@ -139,8 +142,8 @@ {'__name__': 'pkg.pkg1.pkg2.pkg3.pkg4.pkg5', '__path__': ['blah']}) def callback(global_): - util.import_(globals_[0]['__package__']) - module = util.import_('', global_, fromlist=['attr'], level=6) + import_util.import_(globals_[0]['__package__']) + module = import_util.import_('', global_, fromlist=['attr'], level=6) self.assertEqual(module.__name__, 'pkg') self.relative_import_test(create, globals_, callback) @@ -150,8 +153,8 @@ globals_ = ({'__package__': 'pkg'}, {'__name__': 'pkg', '__path__': ['blah']}) def callback(global_): - util.import_('pkg') - self.assertRaises(ValueError, util.import_, '', global_, + import_util.import_('pkg') + self.assertRaises(ValueError, import_util.import_, '', global_, fromlist=['top_level'], level=2) self.relative_import_test(create, globals_, callback) @@ -160,14 +163,14 @@ create = ['top_level', 'pkg.__init__', 'pkg.module'] globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.module'} def callback(global_): - util.import_('pkg') - self.assertRaises(ValueError, util.import_, '', global_, + import_util.import_('pkg') + self.assertRaises(ValueError, import_util.import_, '', global_, fromlist=['top_level'], level=2) self.relative_import_test(create, globals_, callback) def test_empty_name_w_level_0(self): # [empty name] - self.assertRaises(ValueError, util.import_, '') + self.assertRaises(ValueError, import_util.import_, '') def test_import_from_different_package(self): # Test importing from a different package than the caller. @@ -181,8 +184,8 @@ '__runpy_pkg__.uncle.cousin.nephew'] globals_ = {'__package__': '__runpy_pkg__.__runpy_pkg__'} def callback(global_): - util.import_('__runpy_pkg__.__runpy_pkg__') - module = util.import_('uncle.cousin', globals_, {}, + import_util.import_('__runpy_pkg__.__runpy_pkg__') + module = import_util.import_('uncle.cousin', globals_, {}, fromlist=['nephew'], level=2) self.assertEqual(module.__name__, '__runpy_pkg__.uncle.cousin') Added: python/branches/py3k/Lib/importlib/test/import_/util.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/import_/util.py Sun Feb 1 05:28:04 2009 @@ -0,0 +1,33 @@ +import functools +import importlib + + +using___import__ = False + + +def import_(*args, **kwargs): + """Delegate to allow for injecting different implementations of import.""" + if using___import__: + return __import__(*args, **kwargs) + return importlib.Import()(*args, **kwargs) + + +def importlib_only(fxn): + """Decorator to mark which tests are not supported by the current + implementation of __import__().""" + def inner(*args, **kwargs): + if using___import__: + return + else: + return fxn(*args, **kwargs) + functools.update_wrapper(inner, fxn) + return inner + + +def mock_path_hook(*entries, importer): + """A mock sys.path_hooks entry.""" + def hook(entry): + if entry not in entries: + raise ImportError + return importer + return hook 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 Sun Feb 1 05:28:04 2009 @@ -1,33 +1,10 @@ -from importlib import Import - from contextlib import contextmanager -from functools import update_wrapper import imp import os.path from test.support import unlink import sys -using___import__ = False - -def import_(*args, **kwargs): - """Delegate to allow for injecting different implementations of import.""" - if using___import__: - return __import__(*args, **kwargs) - return Import()(*args, **kwargs) - -def importlib_only(fxn): - """Decorator to mark which tests are not supported by the current - implementation of __import__().""" - def inner(*args, **kwargs): - if using___import__: - return - else: - return fxn(*args, **kwargs) - update_wrapper(inner, fxn) - return inner - - def case_insensitive_tests(class_): """Class decorator that nullifies tests that require a case-insensitive file system.""" @@ -142,12 +119,3 @@ def __exit__(self, *exc_info): self._uncache.__exit__(None, None, None) - - -def mock_path_hook(*entries, importer): - """A mock sys.path_hooks entry.""" - def hook(entry): - if entry not in entries: - raise ImportError - return importer - return hook From python-checkins at python.org Sun Feb 1 06:04:08 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 1 Feb 2009 06:04:08 +0100 (CET) Subject: [Python-checkins] r69174 - python/branches/py3k/Lib/importlib/NOTES Message-ID: <20090201050408.1B9131E4002@bag.python.org> Author: brett.cannon Date: Sun Feb 1 06:04:06 2009 New Revision: 69174 Log: Remove an outdated todo item from importlib. Modified: python/branches/py3k/Lib/importlib/NOTES Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sun Feb 1 06:04:06 2009 @@ -1,12 +1,6 @@ to do ///// -* Reorganize support code. - - + Add a file loader mock that returns monotonically increasing mtime. - - Use in source/test_reload. - - Use in source/test_load_module_mixed. - * API simplification? + read_source -> get_data/source_path From python-checkins at python.org Sun Feb 1 06:12:58 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sun, 1 Feb 2009 06:12:58 +0100 (CET) Subject: [Python-checkins] r69175 - sandbox/trunk/dbm_sqlite/alt/time_sqlite.py Message-ID: <20090201051258.9AFCB1E4002@bag.python.org> Author: raymond.hettinger Date: Sun Feb 1 06:12:58 2009 New Revision: 69175 Log: First draft of timing bench. Added: sandbox/trunk/dbm_sqlite/alt/time_sqlite.py (contents, props changed) Added: sandbox/trunk/dbm_sqlite/alt/time_sqlite.py ============================================================================== --- (empty file) +++ sandbox/trunk/dbm_sqlite/alt/time_sqlite.py Sun Feb 1 06:12:58 2009 @@ -0,0 +1,102 @@ +''' Testbench and timing routines to figure-out the fastest schema for shelves. + +With unique index or primary key or no index. + Insertion speed (do we pay a high price for reindexing on every commit) + Individual Lookup speed (regular value, masked key, uncommitted key) + Speed of replacing vs inserting. + + Speed of: + 'select *' + 'select * order by key' + 'select * order by rowid' + + Do 'select key', 'select *', and 'select value' all produce the same order? + +Delayed commits: + How much insertion speed is gained by n-period commits + How much does that slow-down searches + Should iterators force a commit before iterating + +Do 'select key', 'select *', and 'select value' all produce the same order? + +Same tests, but first fragment the snot out of the db. + +What about deletions and fragmentation? +Cost and effects of vacuuming. +BLOB vs TEXT + +''' + +from random import * +from string import ascii_letters +import sqlite3 +import os +from time import clock + +MAKE_shelf = ('''\ + DROP INDEX IF EXISTS keyndx; DROP TABLE IF EXISTS shelf; + CREATE TABLE IF NOT EXISTS shelf (key TEXT NOT NULL, value TEXT NOT NULL); +''', 'UNINDEXED') +MAKE_shelf_PRIMARY = ('''\ + DROP INDEX IF EXISTS keyndx; DROP TABLE IF EXISTS shelf; + CREATE TABLE IF NOT EXISTS shelf (key PRIMARY KEY, value TEXT NOT NULL); +''', 'PRIMARY') +MAKE_shelf_UNIQUE = ('''\ + DROP INDEX IF EXISTS keyndx; DROP TABLE IF EXISTS shelf; + CREATE TABLE IF NOT EXISTS shelf (key TEXT NOT NULL, value TEXT NOT NULL); + CREATE UNIQUE INDEX IF NOT EXISTS keyndx ON shelf (key); +''', 'UNIQ') + +SELECTORS = [ + 'SELECT * FROM shelf', + 'SELECT * FROM shelf ORDER BY key', + 'SELECT * FROM shelf ORDER BY rowid', + 'SELECT key FROM shelf', + 'SELECT value FROM shelf', + 'SELECT key, value FROM shelf', +] + +def populate(n=100, m=5): + items = [] + for i in range(n): + key = bytes(''.join(choice(ascii_letters) for j in range(m)), 'utf-8') + val = bytes(''.join(choice(ascii_letters) for j in range(m)), 'utf-8') + items += [(key, val)] + if len(set(k for k,v in items)) != n: + return populate(n, m) + return items + +def setup(BUILDER, items=None): + filename = 'tmpshl' + try: + os.remove(filename) + except OSError: + pass + conn = sqlite3.connect(filename) + conn.text_factory = bytes + conn.executescript(BUILDER) + if items: + UPDATE_ITEMS = 'REPLACE INTO shelf (key, value) VALUES (?, ?)' + conn.executemany(UPDATE_ITEMS, items) + conn.commit() + return conn + +def timeit(conn, stmt, n=20): + conn.execute(stmt) # precompile + start = clock() + for i in range(n): + conn.execute(stmt).fetchall() + return '%.2f' % (clock() - start) + + +seed('xyzpdqbingo') +items = populate(2000) +for stmt in SELECTORS: + print(stmt) + for builder, name in [MAKE_shelf, MAKE_shelf_PRIMARY, MAKE_shelf_UNIQUE]: + conn = setup(builder, items) + print(sorted(timeit(conn, stmt, n=100) for i in range(6)), name) + print() + + + From buildbot at python.org Sun Feb 1 06:28:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 05:28:52 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090201052852.524EB1E4002@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/228 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: brett.cannon BUILD FAILED: failed svn sincerely, -The Buildbot From python-checkins at python.org Sun Feb 1 06:33:17 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 1 Feb 2009 06:33:17 +0100 (CET) Subject: [Python-checkins] r69176 - in python/branches/py3k/Lib/importlib: NOTES _bootstrap.py Message-ID: <20090201053317.58B5F1E4002@bag.python.org> Author: brett.cannon Date: Sun Feb 1 06:33:17 2009 New Revision: 69176 Log: Expose source_path and bytecode_path on _PyFileLoader. Modified: python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/_bootstrap.py Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sun Feb 1 06:33:17 2009 @@ -3,8 +3,7 @@ * API simplification? - + read_source -> get_data/source_path - + read_bytecode -> get_data/bytecode_path + + Use *_path() along with get_data + write_bytecode -> complete set of bytes for bytecode instead of individual arguments. Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Sun Feb 1 06:33:17 2009 @@ -341,13 +341,15 @@ else: return None - def _source_path(self): + @check_name + def source_path(self, fullname): """Return the path to an existing source file for the module, or None if one cannot be found.""" # Not a property so that it is easy to override. return self._find_path(imp.PY_SOURCE) - def _bytecode_path(self): + @check_name + def bytecode_path(self, fullname): """Return the path to a bytecode file, or None if one does not exist.""" # Not a property for easy overriding. @@ -357,8 +359,9 @@ @get_module def load_module(self, module): """Load a Python source or bytecode module.""" - source_path = self._source_path() - bytecode_path = self._bytecode_path() + name = module.__name__ + source_path = self.source_path(name) + bytecode_path = self.bytecode_path(name) code_object = self.get_code(module.__name__) module.__file__ = source_path if source_path else bytecode_path module.__loader__ = self @@ -376,7 +379,7 @@ def source_mtime(self, name): """Return the modification time of the source for the specified module.""" - source_path = self._source_path() + source_path = self.source_path(name) if not source_path: return None return int(_os.stat(source_path).st_mtime) @@ -389,7 +392,7 @@ laoder cannot handle the specified module. """ - source_path = self._source_path() + source_path = self._source_path(name) if source_path is None: return None import tokenize @@ -407,7 +410,7 @@ The returned path is used by 'compile' for error messages. """ - source_path = self._source_path() + source_path = self.source_path(fullname) if source_path is None: return None with closing(_fileio._FileIO(source_path, 'r')) as bytes_file: @@ -422,7 +425,7 @@ the module. Returns None if there is no bytecode. """ - path = self._bytecode_path() + path = self.bytecode_path(name) if path is None: return None file = _fileio._FileIO(path, 'r') @@ -443,7 +446,7 @@ cannot be handled by the loader. """ - bytecode_path = self._bytecode_path() + bytecode_path = self.bytecode_path(name) if not bytecode_path: bytecode_path = self._base_path + suffix_list(imp.PY_COMPILED)[0] file = _fileio._FileIO(bytecode_path, 'w') From python-checkins at python.org Sun Feb 1 06:43:31 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 1 Feb 2009 06:43:31 +0100 (CET) Subject: [Python-checkins] r69177 - in python/branches/py3k/Lib/importlib: NOTES _bootstrap.py Message-ID: <20090201054331.662711E4002@bag.python.org> Author: brett.cannon Date: Sun Feb 1 06:43:31 2009 New Revision: 69177 Log: Ditch read_source() and read_bytecode() and replace with *_path() and get_data(). Modified: python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/_bootstrap.py Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sun Feb 1 06:43:31 2009 @@ -3,7 +3,6 @@ * API simplification? - + Use *_path() along with get_data + write_bytecode -> complete set of bytes for bytecode instead of individual arguments. Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Sun Feb 1 06:43:31 2009 @@ -403,40 +403,6 @@ return open(source_path, encoding=encoding).read() @check_name - def read_source(self, fullname): - """Return the source for the specified module as bytes along with the - path where the source came from. - - The returned path is used by 'compile' for error messages. - - """ - source_path = self.source_path(fullname) - if source_path is None: - return None - with closing(_fileio._FileIO(source_path, 'r')) as bytes_file: - return bytes_file.read(), source_path - - @check_name - def read_bytecode(self, name): - """Return the magic number, timestamp, and the module bytecode for the - module. - - Raises ImportError (just like get_source) if the laoder cannot handle - the module. Returns None if there is no bytecode. - - """ - path = self.bytecode_path(name) - if path is None: - return None - file = _fileio._FileIO(path, 'r') - try: - with closing(file) as bytecode_file: - data = bytecode_file.read() - return data[:4], marshal._r_long(data[4:8]), data[8:] - except AttributeError: - return None - - @check_name def write_bytecode(self, name, magic, timestamp, data): """Write out 'data' for the specified module using the specific timestamp, returning a boolean @@ -462,7 +428,6 @@ else: raise - # XXX Take an optional argument to flag whether to write bytecode? @check_name def get_code(self, name): """Return the code object for the module. @@ -492,9 +457,12 @@ # number is bad? source_timestamp = self.source_mtime(name) # Try to use bytecode if it is available. - bytecode_tuple = self.read_bytecode(name) - if bytecode_tuple: - magic, pyc_timestamp, bytecode = bytecode_tuple + bytecode_path = self.bytecode_path(name) + if bytecode_path: + data = self.get_data(bytecode_path) + magic = data[:4] + pyc_timestamp = marshal._r_long(data[4:8]) + bytecode = data[8:] try: # Verify that the magic number is valid. if imp.get_magic() != magic: @@ -519,7 +487,8 @@ raise ImportError("no source or bytecode available to create code " "object for {0!r}".format(name)) # Use the source. - source, source_path = self.read_source(name) + source_path = self.source_path(name) + source = self.get_data(source_path) # Convert to universal newlines. line_endings = b'\n' for index, c in enumerate(source): From python-checkins at python.org Sun Feb 1 06:55:23 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 1 Feb 2009 06:55:23 +0100 (CET) Subject: [Python-checkins] r69178 - python/branches/py3k/Lib/importlib/NOTES Message-ID: <20090201055523.B631D1E4028@bag.python.org> Author: brett.cannon Date: Sun Feb 1 06:55:23 2009 New Revision: 69178 Log: Update importlib notes. Modified: python/branches/py3k/Lib/importlib/NOTES Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sun Feb 1 06:55:23 2009 @@ -1,20 +1,10 @@ to do ///// -* API simplification? - - + write_bytecode -> complete set of bytes for bytecode instead of - individual arguments. - * Create meta_path importer for sys.path. -* OPTIMIZE! - - + Write benchmark suite. - + Fast path common cases. - - - Absolute name from sys.path. - - Relative name from sys.path. + + Create hook. + + Rewrite Import to use the hook. * Implement PEP 302 protocol for loaders (should just be a matter of testing). @@ -73,4 +63,13 @@ * SourceFinder * (?) Loader +* Write benchmark suite. + +* OPTIMIZE! + + + Fast path common cases. + + - Absolute name from sys.path. + - Relative name from sys.path. + * Bootstrap importlib as implementation of builtins.__import__ From buildbot at python.org Sun Feb 1 06:56:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 05:56:45 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090201055645.E43B81E400C@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/212 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 Sun Feb 1 07:07:57 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 1 Feb 2009 07:07:57 +0100 (CET) Subject: [Python-checkins] r69179 - python/branches/py3k/Lib/importlib/_bootstrap.py Message-ID: <20090201060757.B8FE21E4002@bag.python.org> Author: brett.cannon Date: Sun Feb 1 07:07:57 2009 New Revision: 69179 Log: Simplify write_bytecode for importlib. Modified: python/branches/py3k/Lib/importlib/_bootstrap.py Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Sun Feb 1 07:07:57 2009 @@ -403,9 +403,8 @@ return open(source_path, encoding=encoding).read() @check_name - def write_bytecode(self, name, magic, timestamp, data): - """Write out 'data' for the specified module using the specific - timestamp, returning a boolean + def write_bytecode(self, name, data): + """Write out 'data' for the specified module, returning a boolean signifying if the write-out actually occurred. Raises ImportError (just like get_source) if the specified module @@ -418,8 +417,6 @@ file = _fileio._FileIO(bytecode_path, 'w') try: with closing(file) as bytecode_file: - bytecode_file.write(magic) - bytecode_file.write(marshal._w_long(timestamp)) bytecode_file.write(data) return True except IOError as exc: @@ -430,29 +427,7 @@ @check_name def get_code(self, name): - """Return the code object for the module. - - 'self' must implement: - - * read_bytecode(name:str) -> (int, int, bytes) or None - Return the magic number, timestamp, and bytecode for the - module. None is returned if not bytecode is available. - - * source_mtime(name:str) -> int - Return the last modification time for the source of the module. - Returns None if their is no source. - - * read_source(name:str) -> (bytes, str) - Return the source code for the module and the path to use in - the call to 'compile'. Not called if source_mtime returned - None. - - * write_bytecode(name:str, magic:bytes, timestamp:int, data:str) - Write out bytecode for the module with the specified magic - number and timestamp. Not called if sys.dont_write_bytecode is - True. - - """ + """Return the code object for the module.""" # XXX Care enough to make sure this call does not happen if the magic # number is bad? source_timestamp = self.source_mtime(name) @@ -507,8 +482,10 @@ code_object = compile(source, source_path, 'exec', dont_inherit=True) # Generate bytecode and write it out. if not sys.dont_write_bytecode: - data = marshal.dumps(code_object) - self.write_bytecode(name, imp.get_magic(), source_timestamp, data) + data = bytearray(imp.get_magic()) + data.extend(marshal._w_long(source_timestamp)) + data.extend(marshal.dumps(code_object)) + self.write_bytecode(name, data) return code_object def get_data(self, path): From python-checkins at python.org Sun Feb 1 07:14:11 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sun, 1 Feb 2009 07:14:11 +0100 (CET) Subject: [Python-checkins] r69180 - in sandbox/trunk/dbm_sqlite/alt: dbsqlite.py time_sqlite.py Message-ID: <20090201061411.424A21E4002@bag.python.org> Author: raymond.hettinger Date: Sun Feb 1 07:14:11 2009 New Revision: 69180 Log: Timings show PRIMARY KEY eliminated need for separate index and there is no cost to ORDER BY ROWID. Modified: sandbox/trunk/dbm_sqlite/alt/dbsqlite.py sandbox/trunk/dbm_sqlite/alt/time_sqlite.py Modified: sandbox/trunk/dbm_sqlite/alt/dbsqlite.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbsqlite.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbsqlite.py Sun Feb 1 07:14:11 2009 @@ -30,8 +30,7 @@ # w -- open existing # r -- readonly - MAKE_SHELF = 'CREATE TABLE IF NOT EXISTS shelf (key TEXT NOT NULL, value TEXT NOT NULL)' - MAKE_INDEX = 'CREATE UNIQUE INDEX IF NOT EXISTS keyndx ON shelf (key)' + MAKE_SHELF = 'CREATE TABLE IF NOT EXISTS shelf (key TEXT PRIMARY KEY, value TEXT NOT NULL)' self.conn = sqlite3.connect(filename) self.conn.text_factory = bytes self.conn.execute(MAKE_SHELF) @@ -108,7 +107,7 @@ class SQLhashKeysView(collections.KeysView, ListRepr): def __iter__(self): - GET_KEYS = 'SELECT key FROM shelf ORDER BY ROWID' # ??? does order by result in diff opcodes + GET_KEYS = 'SELECT key FROM shelf ORDER BY ROWID' return map(itemgetter(0), self._mapping.conn.cursor().execute(GET_KEYS)) class SQLhashValuesView(collections.ValuesView, ListRepr): Modified: sandbox/trunk/dbm_sqlite/alt/time_sqlite.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/time_sqlite.py (original) +++ sandbox/trunk/dbm_sqlite/alt/time_sqlite.py Sun Feb 1 07:14:11 2009 @@ -25,6 +25,13 @@ Cost and effects of vacuuming. BLOB vs TEXT +----------------------------------------------------------------- +no diff twixt "select *" and "select k,v" # prefer latter for specificity +no diff twixt "select *" and "select * by rowid" # prefer latter for specificity +no diff for "select *" whether unindexed, primary key, and indexed +? do those results hold after fragmenting +"order by key" is twice as slow as unordered, even with indexing +effect of "primary key" and a unique index is the same ''' from random import * @@ -33,15 +40,15 @@ import os from time import clock -MAKE_shelf = ('''\ +MAKE_shelf = (''' DROP INDEX IF EXISTS keyndx; DROP TABLE IF EXISTS shelf; CREATE TABLE IF NOT EXISTS shelf (key TEXT NOT NULL, value TEXT NOT NULL); ''', 'UNINDEXED') -MAKE_shelf_PRIMARY = ('''\ +MAKE_shelf_PRIMARY = (''' DROP INDEX IF EXISTS keyndx; DROP TABLE IF EXISTS shelf; CREATE TABLE IF NOT EXISTS shelf (key PRIMARY KEY, value TEXT NOT NULL); ''', 'PRIMARY') -MAKE_shelf_UNIQUE = ('''\ +MAKE_shelf_UNIQUE = (''' DROP INDEX IF EXISTS keyndx; DROP TABLE IF EXISTS shelf; CREATE TABLE IF NOT EXISTS shelf (key TEXT NOT NULL, value TEXT NOT NULL); CREATE UNIQUE INDEX IF NOT EXISTS keyndx ON shelf (key); From martin at v.loewis.de Sun Feb 1 07:23:49 2009 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Sun, 01 Feb 2009 07:23:49 +0100 Subject: [Python-checkins] r69160 - python/branches/release26-maint/Doc/library/binascii.rst In-Reply-To: <20090201001942.699281E4002@bag.python.org> References: <20090201001942.699281E4002@bag.python.org> Message-ID: <49853FF5.4080804@v.loewis.de> gregory.p.smith wrote: > Author: gregory.p.smith > Date: Sun Feb 1 01:19:42 2009 > New Revision: 69160 > > Log: > #documentation update for issue4903 - > svn merge -c68535 http://svn.python.org/projects/python/trunk > svn merge -c69159 http://svn.python.org/projects/python/trunk > > > Modified: > python/branches/release26-maint/Doc/library/binascii.rst Why didn't you use svnmerge.py for that? Regards, Martin From buildbot at python.org Sun Feb 1 07:32:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 06:32:18 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090201063219.0B73E1E4002@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/199 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: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sun Feb 1 08:22:44 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 07:22:44 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090201072244.7ADA01E4002@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/214 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: 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.x.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 43, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.x.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.x.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From buildbot at python.org Sun Feb 1 08:23:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 07:23:37 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090201072337.4A96D1E4002@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/231 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: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From ncoghlan at gmail.com Sun Feb 1 08:33:58 2009 From: ncoghlan at gmail.com (Nick Coghlan) Date: Sun, 01 Feb 2009 17:33:58 +1000 Subject: [Python-checkins] r69167 - in python/branches/py3k/Lib/importlib: NOTES _bootstrap.py test/frozen/test_loader.py In-Reply-To: <20090201013414.2FEB41E4002@bag.python.org> References: <20090201013414.2FEB41E4002@bag.python.org> Message-ID: <49855066.60507@gmail.com> brett.cannon wrote: > + elif '.' in module.__name__: > + module.__package__ = module.__name__.rsplit('.', 1)[0] 1. When determining a package name, rpartition is your friend (see the relevant code in runpy.py) 2. It's OK to set __package__ even in a top-level module (just set it to the empty string). That is why rpartition works so well for the application. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- From buildbot at python.org Sun Feb 1 09:53:51 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 08:53:51 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 trunk Message-ID: <20090201085352.1EC741E4002@bag.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/1837 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,david.goodger,gregory.p.smith,guilherme.polo 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\trunk.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\trunk.bolen-windows\build\lib\bsddb\dbshelve.py", line 106, in open d.open(filename, dbname, filetype, flags, mode) File "E:\cygwin\home\db3l\buildarea\trunk.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\trunk.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\trunk.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\trunk.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\trunk.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\trunk.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\trunk.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\trunk.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') sincerely, -The Buildbot From nnorwitz at gmail.com Sun Feb 1 11:26:34 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 1 Feb 2009 05:26:34 -0500 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090201102634.GA18277@python.psfb.org> More important issues: ---------------------- test_poplib leaked [-203, 0, 0] references, sum=-203 Less important issues: ---------------------- test_asynchat leaked [0, 118, -118] references, sum=0 test_cmd_line leaked [25, -25, 25] references, sum=25 test_smtplib leaked [0, 0, -1] references, sum=-1 test_socketserver leaked [0, 0, 82] references, sum=82 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 From brett at python.org Sun Feb 1 11:28:36 2009 From: brett at python.org (Brett Cannon) Date: Sun, 1 Feb 2009 02:28:36 -0800 Subject: [Python-checkins] r69167 - in python/branches/py3k/Lib/importlib: NOTES _bootstrap.py test/frozen/test_loader.py In-Reply-To: <49855066.60507@gmail.com> References: <20090201013414.2FEB41E4002@bag.python.org> <49855066.60507@gmail.com> Message-ID: On Sat, Jan 31, 2009 at 23:33, Nick Coghlan wrote: > brett.cannon wrote: >> + elif '.' in module.__name__: >> + module.__package__ = module.__name__.rsplit('.', 1)[0] > > 1. When determining a package name, rpartition is your friend (see the > relevant code in runpy.py) > I guess I could, but the semantics are the same. Although I see you hard-coded using rpartition in PEP 366. =) > 2. It's OK to set __package__ even in a top-level module (just set it to > the empty string). That is why rpartition works so well for the application. The PEP doesn't say that, although I guess your ``__name__.rpartition('.')[0]`` line makes that implicit. Could you edit the PEP to mention that the empty string is okay? -Brett From python-checkins at python.org Sun Feb 1 11:28:51 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 1 Feb 2009 11:28:51 +0100 (CET) Subject: [Python-checkins] r69181 - in python/branches/py3k: Lib/test/test_descr.py Lib/test/test_funcattrs.py Lib/test/test_parser.py Modules/_csv.c Modules/_elementtree.c Modules/_localemodule.c Modules/_pickle.c Modules/_tkinter.c Modules/parsermodule.c Modules/pyexpat.c Objects/cellobject.c Objects/descrobject.c Objects/rangeobject.c Objects/setobject.c PC/winreg.c Message-ID: <20090201102851.B10AB1E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 1 11:28:51 2009 New Revision: 69181 Log: Issue #1717, stage 2: remove uses of tp_compare in Modules and most Objects. Modified: python/branches/py3k/Lib/test/test_descr.py python/branches/py3k/Lib/test/test_funcattrs.py python/branches/py3k/Lib/test/test_parser.py python/branches/py3k/Modules/_csv.c python/branches/py3k/Modules/_elementtree.c python/branches/py3k/Modules/_localemodule.c python/branches/py3k/Modules/_pickle.c python/branches/py3k/Modules/_tkinter.c python/branches/py3k/Modules/parsermodule.c python/branches/py3k/Modules/pyexpat.c python/branches/py3k/Objects/cellobject.c python/branches/py3k/Objects/descrobject.c python/branches/py3k/Objects/rangeobject.c python/branches/py3k/Objects/setobject.c python/branches/py3k/PC/winreg.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 Sun Feb 1 11:28:51 2009 @@ -3885,7 +3885,7 @@ # Testing method-wrapper objects... # did not support any reflection before 2.5 - return # XXX should methods really support __eq__? + # XXX should methods really support __eq__? l = [] self.assertEqual(l.__add__, l.__add__) 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 Sun Feb 1 11:28:51 2009 @@ -224,10 +224,41 @@ del self.b.__doc__ self.assertEqual(self.b.__doc__, None) +def cell(value): + """Create a cell containing the given value.""" + def f(): + print(a) + a = value + return f.__closure__[0] + +def empty_cell(empty=True): + """Create an empty cell.""" + def f(): + print(a) + # the intent of the following line is simply "if False:"; it's + # spelt this way to avoid the danger that a future optimization + # might simply remove an "if False:" code block. + if not empty: + a = 1729 + return f.__closure__[0] + +class CellTest(unittest.TestCase): + def test_comparison(self): + # These tests are here simply to exercise the comparison code; + # their presence should not be interpreted as providing any + # guarantees about the semantics (or even existence) of cell + # comparisons in future versions of CPython. + self.assert_(cell(2) < cell(3)) + self.assert_(empty_cell() < cell('saturday')) + self.assert_(empty_cell() == empty_cell()) + self.assert_(cell(-36) == cell(-36.0)) + self.assert_(cell(True) > empty_cell()) + + def test_main(): support.run_unittest(FunctionPropertiesTest, ImplicitReferencesTest, ArbitraryFunctionAttrTest, FunctionDictsTest, - FunctionDocstringTest) + FunctionDocstringTest, CellTest) if __name__ == "__main__": test_main() 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 Sun Feb 1 11:28:51 2009 @@ -2,6 +2,7 @@ import os import unittest import sys +import operator from test import support # @@ -496,12 +497,81 @@ file=sys.stderr) self.assertRaises(MemoryError, parser.expr, e) +class STObjectTestCase(unittest.TestCase): + """Test operations on ST objects themselves""" + + def test_comparisons(self): + # ST objects should support order and equality comparisons + st1 = parser.expr('2 + 3') + st2 = parser.suite('x = 2; y = x + 3') + st3 = parser.expr('list(x**3 for x in range(20))') + st1_copy = parser.expr('2 + 3') + st2_copy = parser.suite('x = 2; y = x + 3') + st3_copy = parser.expr('list(x**3 for x in range(20))') + + # exercise fast path for object identity + self.assertEquals(st1 == st1, True) + self.assertEquals(st2 == st2, True) + self.assertEquals(st3 == st3, True) + # slow path equality + self.assertEqual(st1, st1_copy) + self.assertEqual(st2, st2_copy) + self.assertEqual(st3, st3_copy) + self.assertEquals(st1 == st2, False) + self.assertEquals(st1 == st3, False) + self.assertEquals(st2 == st3, False) + self.assertEquals(st1 != st1, False) + self.assertEquals(st2 != st2, False) + self.assertEquals(st3 != st3, False) + self.assertEquals(st1 != st1_copy, False) + self.assertEquals(st2 != st2_copy, False) + self.assertEquals(st3 != st3_copy, False) + self.assertEquals(st2 != st1, True) + self.assertEquals(st1 != st3, True) + self.assertEquals(st3 != st2, True) + # we don't particularly care what the ordering is; just that + # it's usable and self-consistent + self.assertEquals(st1 < st2, not (st2 <= st1)) + self.assertEquals(st1 < st3, not (st3 <= st1)) + self.assertEquals(st2 < st3, not (st3 <= st2)) + self.assertEquals(st1 < st2, st2 > st1) + self.assertEquals(st1 < st3, st3 > st1) + self.assertEquals(st2 < st3, st3 > st2) + self.assertEquals(st1 <= st2, st2 >= st1) + self.assertEquals(st3 <= st1, st1 >= st3) + self.assertEquals(st2 <= st3, st3 >= st2) + # transitivity + bottom = min(st1, st2, st3) + top = max(st1, st2, st3) + mid = sorted([st1, st2, st3])[1] + self.assert_(bottom < mid) + self.assert_(bottom < top) + self.assert_(mid < top) + self.assert_(bottom <= mid) + self.assert_(bottom <= top) + self.assert_(mid <= top) + self.assert_(bottom <= bottom) + self.assert_(mid <= mid) + self.assert_(top <= top) + # interaction with other types + self.assertEquals(st1 == 1588.602459, False) + self.assertEquals('spanish armada' != st2, True) + self.assertRaises(TypeError, operator.ge, st3, None) + self.assertRaises(TypeError, operator.le, False, st1) + self.assertRaises(TypeError, operator.lt, st1, 1815) + self.assertRaises(TypeError, operator.gt, b'waterloo', st2) + + + # XXX tests for pickling and unpickling of ST objects should go here + + def test_main(): support.run_unittest( RoundtripLegalSyntaxTestCase, IllegalSyntaxTestCase, CompileTestCase, ParserStackLimitTestCase, + STObjectTestCase, ) Modified: python/branches/py3k/Modules/_csv.c ============================================================================== --- python/branches/py3k/Modules/_csv.c (original) +++ python/branches/py3k/Modules/_csv.c Sun Feb 1 11:28:51 2009 @@ -443,7 +443,7 @@ (printfunc)0, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ - (cmpfunc)0, /* tp_compare */ + 0, /* tp_compare */ (reprfunc)0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -864,7 +864,7 @@ (printfunc)0, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)0, /*tp_setattr*/ - (cmpfunc)0, /*tp_compare*/ + 0, /*tp_compare*/ (reprfunc)0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1286,7 +1286,7 @@ (printfunc)0, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)0, /*tp_setattr*/ - (cmpfunc)0, /*tp_compare*/ + 0, /*tp_compare*/ (reprfunc)0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/_elementtree.c ============================================================================== --- python/branches/py3k/Modules/_elementtree.c (original) +++ python/branches/py3k/Modules/_elementtree.c Sun Feb 1 11:28:51 2009 @@ -761,7 +761,7 @@ for (i = 0; i < self->extra->length; i++) { PyObject* item = self->extra->children[i]; if (Element_CheckExact(item) && - PyObject_Compare(((ElementObject*)item)->tag, tag) == 0) { + PyObject_RichCompareBool(((ElementObject*)item)->tag, tag, Py_EQ) == 1) { Py_INCREF(item); return item; } @@ -792,7 +792,8 @@ for (i = 0; i < self->extra->length; i++) { ElementObject* item = (ElementObject*) self->extra->children[i]; - if (Element_CheckExact(item) && !PyObject_Compare(item->tag, tag)) { + if (Element_CheckExact(item) && (PyObject_RichCompareBool(item->tag, tag, Py_EQ) == 1)) { + PyObject* text = element_get_text(item); if (text == Py_None) return PyBytes_FromString(""); @@ -830,7 +831,7 @@ for (i = 0; i < self->extra->length; i++) { PyObject* item = self->extra->children[i]; if (Element_CheckExact(item) && - PyObject_Compare(((ElementObject*)item)->tag, tag) == 0) { + PyObject_RichCompareBool(((ElementObject*)item)->tag, tag, Py_EQ) == 1) { if (PyList_Append(out, item) < 0) { Py_DECREF(out); return NULL; @@ -1102,7 +1103,7 @@ for (i = 0; i < self->extra->length; i++) { if (self->extra->children[i] == element) break; - if (PyObject_Compare(self->extra->children[i], element) == 0) + if (PyObject_RichCompareBool(self->extra->children[i], element, Py_EQ) == 1) break; } Modified: python/branches/py3k/Modules/_localemodule.c ============================================================================== --- python/branches/py3k/Modules/_localemodule.c (original) +++ python/branches/py3k/Modules/_localemodule.c Sun Feb 1 11:28:51 2009 @@ -272,7 +272,9 @@ #ifdef HAVE_WCSXFRM PyDoc_STRVAR(strxfrm__doc__, -"string -> string. Returns a string that behaves for cmp locale-aware."); +"strxfrm(string) -> string.\n\ +\n\ +Return a string that can be used as a key for locale-aware comparisons."); static PyObject* PyLocale_strxfrm(PyObject* self, PyObject* args) Modified: python/branches/py3k/Modules/_pickle.c ============================================================================== --- python/branches/py3k/Modules/_pickle.c (original) +++ python/branches/py3k/Modules/_pickle.c Sun Feb 1 11:28:51 2009 @@ -715,7 +715,7 @@ i = 0; module_name = NULL; while ((j = PyDict_Next(modules_dict, &i, &module_name, &module))) { - if (PyObject_Compare(module_name, main_str) == 0) + if (PyObject_RichCompareBool(module_name, main_str, Py_EQ) == 1) continue; obj = PyObject_GetAttr(module, global_name); Modified: python/branches/py3k/Modules/_tkinter.c ============================================================================== --- python/branches/py3k/Modules/_tkinter.c (original) +++ python/branches/py3k/Modules/_tkinter.c Sun Feb 1 11:28:51 2009 @@ -788,15 +788,59 @@ self->value->typePtr->name, self->value); } -static int -PyTclObject_cmp(PyTclObject *self, PyTclObject *other) +#define TEST_COND(cond) ((cond) ? Py_True : Py_False) + +static PyObject * +PyTclObject_richcompare(PyObject *self, PyObject *other, int op) { - int res; - res = strcmp(Tcl_GetString(self->value), - Tcl_GetString(other->value)); - if (res < 0) return -1; - if (res > 0) return 1; - return 0; + int result; + PyObject *v; + + /* neither argument should be NULL, unless something's gone wrong */ + if (self == NULL || other == NULL) { + PyErr_BadInternalCall(); + return NULL; + } + + /* both arguments should be instances of PyTclObject */ + if (!PyTclObject_Check(self) || !PyTclObject_Check(other)) { + v = Py_NotImplemented; + goto finished; + } + + if (self == other) + /* fast path when self and other are identical */ + result = 0; + else + result = strcmp(Tcl_GetString(((PyTclObject *)self)->value), + Tcl_GetString(((PyTclObject *)other)->value)); + /* Convert return value to a Boolean */ + switch (op) { + case Py_EQ: + v = TEST_COND(result == 0); + break; + case Py_NE: + v = TEST_COND(result != 0); + break; + case Py_LE: + v = TEST_COND(result <= 0); + break; + case Py_GE: + v = TEST_COND(result >= 0); + break; + case Py_LT: + v = TEST_COND(result < 0); + break; + case Py_GT: + v = TEST_COND(result > 0); + break; + default: + PyErr_BadArgument(); + return NULL; + } + finished: + Py_INCREF(v); + return v; } PyDoc_STRVAR(get_typename__doc__, "name of the Tcl type"); @@ -818,45 +862,45 @@ static PyTypeObject PyTclObject_Type = { PyVarObject_HEAD_INIT(NULL, 0) "_tkinter.Tcl_Obj", /*tp_name*/ - sizeof(PyTclObject), /*tp_basicsize*/ - 0, /*tp_itemsize*/ + sizeof(PyTclObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ /* methods */ - (destructor)PyTclObject_dealloc, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - (cmpfunc)PyTclObject_cmp, /*tp_compare*/ + (destructor)PyTclObject_dealloc,/*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ (reprfunc)PyTclObject_repr, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - (reprfunc)PyTclObject_str, /*tp_str*/ - PyObject_GenericGetAttr,/*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - PyTclObject_getsetlist, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - 0, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + (reprfunc)PyTclObject_str, /*tp_str*/ + PyObject_GenericGetAttr, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + PyTclObject_richcompare, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + PyTclObject_getsetlist, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ }; static Tcl_Obj* Modified: python/branches/py3k/Modules/parsermodule.c ============================================================================== --- python/branches/py3k/Modules/parsermodule.c (original) +++ python/branches/py3k/Modules/parsermodule.c Sun Feb 1 11:28:51 2009 @@ -169,7 +169,7 @@ static void parser_free(PyST_Object *st); -static int parser_compare(PyST_Object *left, PyST_Object *right); +static PyObject* parser_richcompare(PyObject *left, PyObject *right, int op); static PyObject* parser_compilest(PyST_Object *, PyObject *, PyObject *); static PyObject* parser_isexpr(PyST_Object *, PyObject *, PyObject *); static PyObject* parser_issuite(PyST_Object *, PyObject *, PyObject *); @@ -203,7 +203,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - (cmpfunc)parser_compare, /* tp_compare */ + 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -223,7 +223,7 @@ "Intermediate representation of a Python parse tree.", 0, /* tp_traverse */ 0, /* tp_clear */ - 0, /* tp_richcompare */ + parser_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ @@ -231,6 +231,9 @@ }; /* PyST_Type */ +/* PyST_Type isn't subclassable, so just check ob_type */ +#define PyST_Object_Check(v) ((v)->ob_type == &PyST_Type) + static int parser_compare_nodes(node *left, node *right) { @@ -260,26 +263,69 @@ return (0); } - -/* int parser_compare(PyST_Object* left, PyST_Object* right) +/* parser_richcompare(PyObject* left, PyObject* right, int op) * * Comparison function used by the Python operators ==, !=, <, >, <=, >= * This really just wraps a call to parser_compare_nodes() with some easy * checks and protection code. * */ -static int -parser_compare(PyST_Object *left, PyST_Object *right) + +#define TEST_COND(cond) ((cond) ? Py_True : Py_False) + +static PyObject * +parser_richcompare(PyObject *left, PyObject *right, int op) { - if (left == right) - return (0); + int result; + PyObject *v; - if ((left == 0) || (right == 0)) - return (-1); + /* neither argument should be NULL, unless something's gone wrong */ + if (left == NULL || right == NULL) { + PyErr_BadInternalCall(); + return NULL; + } - return (parser_compare_nodes(left->st_node, right->st_node)); -} + /* both arguments should be instances of PyST_Object */ + if (!PyST_Object_Check(left) || !PyST_Object_Check(right)) { + v = Py_NotImplemented; + goto finished; + } + if (left == right) + /* if arguments are identical, they're equal */ + result = 0; + else + result = parser_compare_nodes(((PyST_Object *)left)->st_node, + ((PyST_Object *)right)->st_node); + + /* Convert return value to a Boolean */ + switch (op) { + case Py_EQ: + v = TEST_COND(result == 0); + break; + case Py_NE: + v = TEST_COND(result != 0); + break; + case Py_LE: + v = TEST_COND(result <= 0); + break; + case Py_GE: + v = TEST_COND(result >= 0); + break; + case Py_LT: + v = TEST_COND(result < 0); + break; + case Py_GT: + v = TEST_COND(result > 0); + break; + default: + PyErr_BadArgument(); + return NULL; + } + finished: + Py_INCREF(v); + return v; +} /* parser_newstobject(node* st) * Modified: python/branches/py3k/Modules/pyexpat.c ============================================================================== --- python/branches/py3k/Modules/pyexpat.c (original) +++ python/branches/py3k/Modules/pyexpat.c Sun Feb 1 11:28:51 2009 @@ -1622,7 +1622,7 @@ (printfunc)0, /*tp_print*/ 0, /*tp_getattr*/ (setattrfunc)xmlparse_setattr, /*tp_setattr*/ - (cmpfunc)0, /*tp_compare*/ + 0, /*tp_compare*/ (reprfunc)0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Objects/cellobject.c ============================================================================== --- python/branches/py3k/Objects/cellobject.c (original) +++ python/branches/py3k/Objects/cellobject.c Sun Feb 1 11:28:51 2009 @@ -51,16 +51,56 @@ PyObject_GC_Del(op); } -static int -cell_compare(PyCellObject *a, PyCellObject *b) +#define TEST_COND(cond) ((cond) ? Py_True : Py_False) + +static PyObject * +cell_richcompare(PyObject *a, PyObject *b, int op) { - if (a->ob_ref == NULL) { - if (b->ob_ref == NULL) - return 0; - return -1; - } else if (b->ob_ref == NULL) - return 1; - return PyObject_Compare(a->ob_ref, b->ob_ref); + int result; + PyObject *v; + + /* neither argument should be NULL, unless something's gone wrong */ + assert(a != NULL && b != NULL); + + /* both arguments should be instances of PyCellObject */ + if (!PyCell_Check(a) || !PyCell_Check(b)) { + v = Py_NotImplemented; + Py_INCREF(v); + return v; + } + + /* compare cells by contents; empty cells come before anything else */ + a = ((PyCellObject *)a)->ob_ref; + b = ((PyCellObject *)b)->ob_ref; + if (a != NULL && b != NULL) + return PyObject_RichCompare(a, b, op); + + result = (b == NULL) - (a == NULL); + switch (op) { + case Py_EQ: + v = TEST_COND(result == 0); + break; + case Py_NE: + v = TEST_COND(result != 0); + break; + case Py_LE: + v = TEST_COND(result <= 0); + break; + case Py_GE: + v = TEST_COND(result >= 0); + break; + case Py_LT: + v = TEST_COND(result < 0); + break; + case Py_GT: + v = TEST_COND(result > 0); + break; + default: + PyErr_BadArgument(); + return NULL; + } + Py_INCREF(v); + return v; } static PyObject * @@ -114,7 +154,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - (cmpfunc)cell_compare, /* tp_compare */ + 0, /* tp_compare */ (reprfunc)cell_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -129,7 +169,7 @@ 0, /* tp_doc */ (traverseproc)cell_traverse, /* tp_traverse */ (inquiry)cell_clear, /* tp_clear */ - 0, /* tp_richcompare */ + cell_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ Modified: python/branches/py3k/Objects/descrobject.c ============================================================================== --- python/branches/py3k/Objects/descrobject.c (original) +++ python/branches/py3k/Objects/descrobject.c Sun Feb 1 11:28:51 2009 @@ -774,12 +774,6 @@ return 0; } -static int -proxy_compare(proxyobject *v, PyObject *w) -{ - return PyObject_Compare(v->dict, w); -} - static PyObject * proxy_richcompare(proxyobject *v, PyObject *w, int op) { @@ -796,7 +790,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - (cmpfunc)proxy_compare, /* tp_compare */ + 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ &proxy_as_sequence, /* tp_as_sequence */ @@ -844,12 +838,17 @@ /* This has no reason to be in this file except that adding new files is a bit of a pain */ +/* forward */ +static PyTypeObject wrappertype; + typedef struct { PyObject_HEAD PyWrapperDescrObject *descr; PyObject *self; } wrapperobject; +#define Wrapper_Check(v) (Py_TYPE(v) == &wrappertype) + static void wrapper_dealloc(wrapperobject *wp) { @@ -861,13 +860,60 @@ Py_TRASHCAN_SAFE_END(wp) } -static int -wrapper_compare(wrapperobject *a, wrapperobject *b) +#define TEST_COND(cond) ((cond) ? Py_True : Py_False) + +static PyObject * +wrapper_richcompare(PyObject *a, PyObject *b, int op) { - if (a->descr == b->descr) - return PyObject_Compare(a->self, b->self); - else - return (a->descr < b->descr) ? -1 : 1; + int result; + PyObject *v; + PyWrapperDescrObject *a_descr, *b_descr; + + assert(a != NULL && b != NULL); + + /* both arguments should be wrapperobjects */ + if (!Wrapper_Check(a) || !Wrapper_Check(b)) { + v = Py_NotImplemented; + Py_INCREF(v); + return v; + } + + /* compare by descriptor address; if the descriptors are the same, + compare by the objects they're bound to */ + a_descr = ((wrapperobject *)a)->descr; + b_descr = ((wrapperobject *)b)->descr; + if (a_descr == b_descr) { + a = ((wrapperobject *)a)->self; + b = ((wrapperobject *)b)->self; + return PyObject_RichCompare(a, b, op); + } + + result = a_descr - b_descr; + switch (op) { + case Py_EQ: + v = TEST_COND(result == 0); + break; + case Py_NE: + v = TEST_COND(result != 0); + break; + case Py_LE: + v = TEST_COND(result <= 0); + break; + case Py_GE: + v = TEST_COND(result >= 0); + break; + case Py_LT: + v = TEST_COND(result < 0); + break; + case Py_GT: + v = TEST_COND(result > 0); + break; + default: + PyErr_BadArgument(); + return NULL; + } + Py_INCREF(v); + return v; } static long @@ -977,7 +1023,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - (cmpfunc)wrapper_compare, /* tp_compare */ + 0, /* tp_compare */ (reprfunc)wrapper_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -992,7 +1038,7 @@ 0, /* tp_doc */ wrapper_traverse, /* tp_traverse */ 0, /* tp_clear */ - 0, /* tp_richcompare */ + wrapper_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ Modified: python/branches/py3k/Objects/rangeobject.c ============================================================================== --- python/branches/py3k/Objects/rangeobject.c (original) +++ python/branches/py3k/Objects/rangeobject.c Sun Feb 1 11:28:51 2009 @@ -123,7 +123,7 @@ Algorithm is equal to that of get_len_of_range(), but it operates on PyObjects (which are assumed to be PyLong or PyInt objects). ---------------------------------------------------------------*/ - int cmp_result, cmp_call; + int cmp_result; PyObject *lo, *hi; PyObject *step = NULL; PyObject *diff = NULL; @@ -134,13 +134,12 @@ PyObject *zero = PyLong_FromLong(0); if (zero == NULL) return NULL; - cmp_call = PyObject_Cmp(r->step, zero, &cmp_result); + cmp_result = PyObject_RichCompareBool(r->step, zero, Py_GT); Py_DECREF(zero); - if (cmp_call == -1) + if (cmp_result == -1) return NULL; - assert(cmp_result != 0); - if (cmp_result > 0) { + if (cmp_result == 1) { lo = r->start; hi = r->stop; step = r->step; @@ -154,7 +153,7 @@ } /* if (lo >= hi), return length of 0. */ - if (PyObject_Compare(lo, hi) >= 0) { + if (PyObject_RichCompareBool(lo, hi, Py_GE) == 1) { Py_XDECREF(step); return PyLong_FromLong(0); } Modified: python/branches/py3k/Objects/setobject.c ============================================================================== --- python/branches/py3k/Objects/setobject.c (original) +++ python/branches/py3k/Objects/setobject.c Sun Feb 1 11:28:51 2009 @@ -1824,13 +1824,6 @@ return Py_NotImplemented; } -static int -set_nocmp(PyObject *self, PyObject *other) -{ - PyErr_SetString(PyExc_TypeError, "cannot compare sets using cmp()"); - return -1; -} - static PyObject * set_add(PySetObject *so, PyObject *key) { @@ -2111,7 +2104,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - set_nocmp, /* tp_compare */ + 0, /* tp_compare */ (reprfunc)set_repr, /* tp_repr */ &set_as_number, /* tp_as_number */ &set_as_sequence, /* tp_as_sequence */ @@ -2208,7 +2201,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - set_nocmp, /* tp_compare */ + 0, /* tp_compare */ (reprfunc)set_repr, /* tp_repr */ &frozenset_as_number, /* tp_as_number */ &set_as_sequence, /* tp_as_sequence */ Modified: python/branches/py3k/PC/winreg.c ============================================================================== --- python/branches/py3k/PC/winreg.c (original) +++ python/branches/py3k/PC/winreg.c Sun Feb 1 11:28:51 2009 @@ -326,7 +326,7 @@ "Operations:\n" "__bool__ - Handles with an open object return true, otherwise false.\n" "__int__ - Converting a handle to an integer returns the Win32 handle.\n" -"__cmp__ - Handle objects are compared using the handle value."); +"rich comparison - Handle objects are compared using the handle value."); PyDoc_STRVAR(PyHKEY_Close_doc, @@ -485,7 +485,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - PyHKEY_compareFunc, /* tp_compare */ + 0, /* tp_compare */ 0, /* tp_repr */ &PyHKEY_NumberMethods, /* tp_as_number */ 0, /* tp_as_sequence */ From python-checkins at python.org Sun Feb 1 11:41:18 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 1 Feb 2009 11:41:18 +0100 (CET) Subject: [Python-checkins] r69182 - in python/branches/release30-maint: Lib/test/test_descr.py Lib/test/test_funcattrs.py Lib/test/test_parser.py Modules/_csv.c Modules/_elementtree.c Modules/_localemodule.c Modules/_pickle.c Modules/_tkinter.c Modules/parsermodule.c Modules/pyexpat.c Objects/cellobject.c Objects/descrobject.c Objects/rangeobject.c Objects/setobject.c PC/winreg.c Message-ID: <20090201104118.B00891E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 1 11:41:18 2009 New Revision: 69182 Log: Merged revisions 69181 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69181 | mark.dickinson | 2009-02-01 10:28:51 +0000 (Sun, 01 Feb 2009) | 3 lines Issue #1717, stage 2: remove uses of tp_compare in Modules and most Objects. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_descr.py python/branches/release30-maint/Lib/test/test_funcattrs.py python/branches/release30-maint/Lib/test/test_parser.py python/branches/release30-maint/Modules/_csv.c python/branches/release30-maint/Modules/_elementtree.c python/branches/release30-maint/Modules/_localemodule.c python/branches/release30-maint/Modules/_pickle.c python/branches/release30-maint/Modules/_tkinter.c python/branches/release30-maint/Modules/parsermodule.c python/branches/release30-maint/Modules/pyexpat.c python/branches/release30-maint/Objects/cellobject.c python/branches/release30-maint/Objects/descrobject.c python/branches/release30-maint/Objects/rangeobject.c python/branches/release30-maint/Objects/setobject.c python/branches/release30-maint/PC/winreg.c Modified: python/branches/release30-maint/Lib/test/test_descr.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_descr.py (original) +++ python/branches/release30-maint/Lib/test/test_descr.py Sun Feb 1 11:41:18 2009 @@ -3885,7 +3885,7 @@ # Testing method-wrapper objects... # did not support any reflection before 2.5 - return # XXX should methods really support __eq__? + # XXX should methods really support __eq__? l = [] self.assertEqual(l.__add__, l.__add__) Modified: python/branches/release30-maint/Lib/test/test_funcattrs.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_funcattrs.py (original) +++ python/branches/release30-maint/Lib/test/test_funcattrs.py Sun Feb 1 11:41:18 2009 @@ -224,10 +224,41 @@ del self.b.__doc__ self.assertEqual(self.b.__doc__, None) +def cell(value): + """Create a cell containing the given value.""" + def f(): + print(a) + a = value + return f.__closure__[0] + +def empty_cell(empty=True): + """Create an empty cell.""" + def f(): + print(a) + # the intent of the following line is simply "if False:"; it's + # spelt this way to avoid the danger that a future optimization + # might simply remove an "if False:" code block. + if not empty: + a = 1729 + return f.__closure__[0] + +class CellTest(unittest.TestCase): + def test_comparison(self): + # These tests are here simply to exercise the comparison code; + # their presence should not be interpreted as providing any + # guarantees about the semantics (or even existence) of cell + # comparisons in future versions of CPython. + self.assert_(cell(2) < cell(3)) + self.assert_(empty_cell() < cell('saturday')) + self.assert_(empty_cell() == empty_cell()) + self.assert_(cell(-36) == cell(-36.0)) + self.assert_(cell(True) > empty_cell()) + + def test_main(): support.run_unittest(FunctionPropertiesTest, ImplicitReferencesTest, ArbitraryFunctionAttrTest, FunctionDictsTest, - FunctionDocstringTest) + FunctionDocstringTest, CellTest) if __name__ == "__main__": test_main() Modified: python/branches/release30-maint/Lib/test/test_parser.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_parser.py (original) +++ python/branches/release30-maint/Lib/test/test_parser.py Sun Feb 1 11:41:18 2009 @@ -2,6 +2,7 @@ import os import unittest import sys +import operator from test import support # @@ -496,12 +497,81 @@ file=sys.stderr) self.assertRaises(MemoryError, parser.expr, e) +class STObjectTestCase(unittest.TestCase): + """Test operations on ST objects themselves""" + + def test_comparisons(self): + # ST objects should support order and equality comparisons + st1 = parser.expr('2 + 3') + st2 = parser.suite('x = 2; y = x + 3') + st3 = parser.expr('list(x**3 for x in range(20))') + st1_copy = parser.expr('2 + 3') + st2_copy = parser.suite('x = 2; y = x + 3') + st3_copy = parser.expr('list(x**3 for x in range(20))') + + # exercise fast path for object identity + self.assertEquals(st1 == st1, True) + self.assertEquals(st2 == st2, True) + self.assertEquals(st3 == st3, True) + # slow path equality + self.assertEqual(st1, st1_copy) + self.assertEqual(st2, st2_copy) + self.assertEqual(st3, st3_copy) + self.assertEquals(st1 == st2, False) + self.assertEquals(st1 == st3, False) + self.assertEquals(st2 == st3, False) + self.assertEquals(st1 != st1, False) + self.assertEquals(st2 != st2, False) + self.assertEquals(st3 != st3, False) + self.assertEquals(st1 != st1_copy, False) + self.assertEquals(st2 != st2_copy, False) + self.assertEquals(st3 != st3_copy, False) + self.assertEquals(st2 != st1, True) + self.assertEquals(st1 != st3, True) + self.assertEquals(st3 != st2, True) + # we don't particularly care what the ordering is; just that + # it's usable and self-consistent + self.assertEquals(st1 < st2, not (st2 <= st1)) + self.assertEquals(st1 < st3, not (st3 <= st1)) + self.assertEquals(st2 < st3, not (st3 <= st2)) + self.assertEquals(st1 < st2, st2 > st1) + self.assertEquals(st1 < st3, st3 > st1) + self.assertEquals(st2 < st3, st3 > st2) + self.assertEquals(st1 <= st2, st2 >= st1) + self.assertEquals(st3 <= st1, st1 >= st3) + self.assertEquals(st2 <= st3, st3 >= st2) + # transitivity + bottom = min(st1, st2, st3) + top = max(st1, st2, st3) + mid = sorted([st1, st2, st3])[1] + self.assert_(bottom < mid) + self.assert_(bottom < top) + self.assert_(mid < top) + self.assert_(bottom <= mid) + self.assert_(bottom <= top) + self.assert_(mid <= top) + self.assert_(bottom <= bottom) + self.assert_(mid <= mid) + self.assert_(top <= top) + # interaction with other types + self.assertEquals(st1 == 1588.602459, False) + self.assertEquals('spanish armada' != st2, True) + self.assertRaises(TypeError, operator.ge, st3, None) + self.assertRaises(TypeError, operator.le, False, st1) + self.assertRaises(TypeError, operator.lt, st1, 1815) + self.assertRaises(TypeError, operator.gt, b'waterloo', st2) + + + # XXX tests for pickling and unpickling of ST objects should go here + + def test_main(): support.run_unittest( RoundtripLegalSyntaxTestCase, IllegalSyntaxTestCase, CompileTestCase, ParserStackLimitTestCase, + STObjectTestCase, ) Modified: python/branches/release30-maint/Modules/_csv.c ============================================================================== --- python/branches/release30-maint/Modules/_csv.c (original) +++ python/branches/release30-maint/Modules/_csv.c Sun Feb 1 11:41:18 2009 @@ -443,7 +443,7 @@ (printfunc)0, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ - (cmpfunc)0, /* tp_compare */ + 0, /* tp_compare */ (reprfunc)0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -864,7 +864,7 @@ (printfunc)0, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)0, /*tp_setattr*/ - (cmpfunc)0, /*tp_compare*/ + 0, /*tp_compare*/ (reprfunc)0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1286,7 +1286,7 @@ (printfunc)0, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)0, /*tp_setattr*/ - (cmpfunc)0, /*tp_compare*/ + 0, /*tp_compare*/ (reprfunc)0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/_elementtree.c ============================================================================== --- python/branches/release30-maint/Modules/_elementtree.c (original) +++ python/branches/release30-maint/Modules/_elementtree.c Sun Feb 1 11:41:18 2009 @@ -761,7 +761,7 @@ for (i = 0; i < self->extra->length; i++) { PyObject* item = self->extra->children[i]; if (Element_CheckExact(item) && - PyObject_Compare(((ElementObject*)item)->tag, tag) == 0) { + PyObject_RichCompareBool(((ElementObject*)item)->tag, tag, Py_EQ) == 1) { Py_INCREF(item); return item; } @@ -792,7 +792,8 @@ for (i = 0; i < self->extra->length; i++) { ElementObject* item = (ElementObject*) self->extra->children[i]; - if (Element_CheckExact(item) && !PyObject_Compare(item->tag, tag)) { + if (Element_CheckExact(item) && (PyObject_RichCompareBool(item->tag, tag, Py_EQ) == 1)) { + PyObject* text = element_get_text(item); if (text == Py_None) return PyBytes_FromString(""); @@ -830,7 +831,7 @@ for (i = 0; i < self->extra->length; i++) { PyObject* item = self->extra->children[i]; if (Element_CheckExact(item) && - PyObject_Compare(((ElementObject*)item)->tag, tag) == 0) { + PyObject_RichCompareBool(((ElementObject*)item)->tag, tag, Py_EQ) == 1) { if (PyList_Append(out, item) < 0) { Py_DECREF(out); return NULL; @@ -1102,7 +1103,7 @@ for (i = 0; i < self->extra->length; i++) { if (self->extra->children[i] == element) break; - if (PyObject_Compare(self->extra->children[i], element) == 0) + if (PyObject_RichCompareBool(self->extra->children[i], element, Py_EQ) == 1) break; } Modified: python/branches/release30-maint/Modules/_localemodule.c ============================================================================== --- python/branches/release30-maint/Modules/_localemodule.c (original) +++ python/branches/release30-maint/Modules/_localemodule.c Sun Feb 1 11:41:18 2009 @@ -272,7 +272,9 @@ #ifdef HAVE_WCSXFRM PyDoc_STRVAR(strxfrm__doc__, -"string -> string. Returns a string that behaves for cmp locale-aware."); +"strxfrm(string) -> string.\n\ +\n\ +Return a string that can be used as a key for locale-aware comparisons."); static PyObject* PyLocale_strxfrm(PyObject* self, PyObject* args) Modified: python/branches/release30-maint/Modules/_pickle.c ============================================================================== --- python/branches/release30-maint/Modules/_pickle.c (original) +++ python/branches/release30-maint/Modules/_pickle.c Sun Feb 1 11:41:18 2009 @@ -715,7 +715,7 @@ i = 0; module_name = NULL; while ((j = PyDict_Next(modules_dict, &i, &module_name, &module))) { - if (PyObject_Compare(module_name, main_str) == 0) + if (PyObject_RichCompareBool(module_name, main_str, Py_EQ) == 1) continue; obj = PyObject_GetAttr(module, global_name); Modified: python/branches/release30-maint/Modules/_tkinter.c ============================================================================== --- python/branches/release30-maint/Modules/_tkinter.c (original) +++ python/branches/release30-maint/Modules/_tkinter.c Sun Feb 1 11:41:18 2009 @@ -788,15 +788,59 @@ self->value->typePtr->name, self->value); } -static int -PyTclObject_cmp(PyTclObject *self, PyTclObject *other) +#define TEST_COND(cond) ((cond) ? Py_True : Py_False) + +static PyObject * +PyTclObject_richcompare(PyObject *self, PyObject *other, int op) { - int res; - res = strcmp(Tcl_GetString(self->value), - Tcl_GetString(other->value)); - if (res < 0) return -1; - if (res > 0) return 1; - return 0; + int result; + PyObject *v; + + /* neither argument should be NULL, unless something's gone wrong */ + if (self == NULL || other == NULL) { + PyErr_BadInternalCall(); + return NULL; + } + + /* both arguments should be instances of PyTclObject */ + if (!PyTclObject_Check(self) || !PyTclObject_Check(other)) { + v = Py_NotImplemented; + goto finished; + } + + if (self == other) + /* fast path when self and other are identical */ + result = 0; + else + result = strcmp(Tcl_GetString(((PyTclObject *)self)->value), + Tcl_GetString(((PyTclObject *)other)->value)); + /* Convert return value to a Boolean */ + switch (op) { + case Py_EQ: + v = TEST_COND(result == 0); + break; + case Py_NE: + v = TEST_COND(result != 0); + break; + case Py_LE: + v = TEST_COND(result <= 0); + break; + case Py_GE: + v = TEST_COND(result >= 0); + break; + case Py_LT: + v = TEST_COND(result < 0); + break; + case Py_GT: + v = TEST_COND(result > 0); + break; + default: + PyErr_BadArgument(); + return NULL; + } + finished: + Py_INCREF(v); + return v; } PyDoc_STRVAR(get_typename__doc__, "name of the Tcl type"); @@ -818,45 +862,45 @@ static PyTypeObject PyTclObject_Type = { PyVarObject_HEAD_INIT(NULL, 0) "_tkinter.Tcl_Obj", /*tp_name*/ - sizeof(PyTclObject), /*tp_basicsize*/ - 0, /*tp_itemsize*/ + sizeof(PyTclObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ /* methods */ - (destructor)PyTclObject_dealloc, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - (cmpfunc)PyTclObject_cmp, /*tp_compare*/ + (destructor)PyTclObject_dealloc,/*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ (reprfunc)PyTclObject_repr, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - (reprfunc)PyTclObject_str, /*tp_str*/ - PyObject_GenericGetAttr,/*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - PyTclObject_getsetlist, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - 0, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + (reprfunc)PyTclObject_str, /*tp_str*/ + PyObject_GenericGetAttr, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + PyTclObject_richcompare, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + PyTclObject_getsetlist, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ }; static Tcl_Obj* Modified: python/branches/release30-maint/Modules/parsermodule.c ============================================================================== --- python/branches/release30-maint/Modules/parsermodule.c (original) +++ python/branches/release30-maint/Modules/parsermodule.c Sun Feb 1 11:41:18 2009 @@ -169,7 +169,7 @@ static void parser_free(PyST_Object *st); -static int parser_compare(PyST_Object *left, PyST_Object *right); +static PyObject* parser_richcompare(PyObject *left, PyObject *right, int op); static PyObject* parser_compilest(PyST_Object *, PyObject *, PyObject *); static PyObject* parser_isexpr(PyST_Object *, PyObject *, PyObject *); static PyObject* parser_issuite(PyST_Object *, PyObject *, PyObject *); @@ -203,7 +203,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - (cmpfunc)parser_compare, /* tp_compare */ + 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -223,7 +223,7 @@ "Intermediate representation of a Python parse tree.", 0, /* tp_traverse */ 0, /* tp_clear */ - 0, /* tp_richcompare */ + parser_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ @@ -231,6 +231,9 @@ }; /* PyST_Type */ +/* PyST_Type isn't subclassable, so just check ob_type */ +#define PyST_Object_Check(v) ((v)->ob_type == &PyST_Type) + static int parser_compare_nodes(node *left, node *right) { @@ -260,26 +263,69 @@ return (0); } - -/* int parser_compare(PyST_Object* left, PyST_Object* right) +/* parser_richcompare(PyObject* left, PyObject* right, int op) * * Comparison function used by the Python operators ==, !=, <, >, <=, >= * This really just wraps a call to parser_compare_nodes() with some easy * checks and protection code. * */ -static int -parser_compare(PyST_Object *left, PyST_Object *right) + +#define TEST_COND(cond) ((cond) ? Py_True : Py_False) + +static PyObject * +parser_richcompare(PyObject *left, PyObject *right, int op) { - if (left == right) - return (0); + int result; + PyObject *v; - if ((left == 0) || (right == 0)) - return (-1); + /* neither argument should be NULL, unless something's gone wrong */ + if (left == NULL || right == NULL) { + PyErr_BadInternalCall(); + return NULL; + } - return (parser_compare_nodes(left->st_node, right->st_node)); -} + /* both arguments should be instances of PyST_Object */ + if (!PyST_Object_Check(left) || !PyST_Object_Check(right)) { + v = Py_NotImplemented; + goto finished; + } + if (left == right) + /* if arguments are identical, they're equal */ + result = 0; + else + result = parser_compare_nodes(((PyST_Object *)left)->st_node, + ((PyST_Object *)right)->st_node); + + /* Convert return value to a Boolean */ + switch (op) { + case Py_EQ: + v = TEST_COND(result == 0); + break; + case Py_NE: + v = TEST_COND(result != 0); + break; + case Py_LE: + v = TEST_COND(result <= 0); + break; + case Py_GE: + v = TEST_COND(result >= 0); + break; + case Py_LT: + v = TEST_COND(result < 0); + break; + case Py_GT: + v = TEST_COND(result > 0); + break; + default: + PyErr_BadArgument(); + return NULL; + } + finished: + Py_INCREF(v); + return v; +} /* parser_newstobject(node* st) * Modified: python/branches/release30-maint/Modules/pyexpat.c ============================================================================== --- python/branches/release30-maint/Modules/pyexpat.c (original) +++ python/branches/release30-maint/Modules/pyexpat.c Sun Feb 1 11:41:18 2009 @@ -1622,7 +1622,7 @@ (printfunc)0, /*tp_print*/ 0, /*tp_getattr*/ (setattrfunc)xmlparse_setattr, /*tp_setattr*/ - (cmpfunc)0, /*tp_compare*/ + 0, /*tp_compare*/ (reprfunc)0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Objects/cellobject.c ============================================================================== --- python/branches/release30-maint/Objects/cellobject.c (original) +++ python/branches/release30-maint/Objects/cellobject.c Sun Feb 1 11:41:18 2009 @@ -51,16 +51,56 @@ PyObject_GC_Del(op); } -static int -cell_compare(PyCellObject *a, PyCellObject *b) +#define TEST_COND(cond) ((cond) ? Py_True : Py_False) + +static PyObject * +cell_richcompare(PyObject *a, PyObject *b, int op) { - if (a->ob_ref == NULL) { - if (b->ob_ref == NULL) - return 0; - return -1; - } else if (b->ob_ref == NULL) - return 1; - return PyObject_Compare(a->ob_ref, b->ob_ref); + int result; + PyObject *v; + + /* neither argument should be NULL, unless something's gone wrong */ + assert(a != NULL && b != NULL); + + /* both arguments should be instances of PyCellObject */ + if (!PyCell_Check(a) || !PyCell_Check(b)) { + v = Py_NotImplemented; + Py_INCREF(v); + return v; + } + + /* compare cells by contents; empty cells come before anything else */ + a = ((PyCellObject *)a)->ob_ref; + b = ((PyCellObject *)b)->ob_ref; + if (a != NULL && b != NULL) + return PyObject_RichCompare(a, b, op); + + result = (b == NULL) - (a == NULL); + switch (op) { + case Py_EQ: + v = TEST_COND(result == 0); + break; + case Py_NE: + v = TEST_COND(result != 0); + break; + case Py_LE: + v = TEST_COND(result <= 0); + break; + case Py_GE: + v = TEST_COND(result >= 0); + break; + case Py_LT: + v = TEST_COND(result < 0); + break; + case Py_GT: + v = TEST_COND(result > 0); + break; + default: + PyErr_BadArgument(); + return NULL; + } + Py_INCREF(v); + return v; } static PyObject * @@ -114,7 +154,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - (cmpfunc)cell_compare, /* tp_compare */ + 0, /* tp_compare */ (reprfunc)cell_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -129,7 +169,7 @@ 0, /* tp_doc */ (traverseproc)cell_traverse, /* tp_traverse */ (inquiry)cell_clear, /* tp_clear */ - 0, /* tp_richcompare */ + cell_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ Modified: python/branches/release30-maint/Objects/descrobject.c ============================================================================== --- python/branches/release30-maint/Objects/descrobject.c (original) +++ python/branches/release30-maint/Objects/descrobject.c Sun Feb 1 11:41:18 2009 @@ -774,12 +774,6 @@ return 0; } -static int -proxy_compare(proxyobject *v, PyObject *w) -{ - return PyObject_Compare(v->dict, w); -} - static PyObject * proxy_richcompare(proxyobject *v, PyObject *w, int op) { @@ -796,7 +790,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - (cmpfunc)proxy_compare, /* tp_compare */ + 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ &proxy_as_sequence, /* tp_as_sequence */ @@ -844,12 +838,17 @@ /* This has no reason to be in this file except that adding new files is a bit of a pain */ +/* forward */ +static PyTypeObject wrappertype; + typedef struct { PyObject_HEAD PyWrapperDescrObject *descr; PyObject *self; } wrapperobject; +#define Wrapper_Check(v) (Py_TYPE(v) == &wrappertype) + static void wrapper_dealloc(wrapperobject *wp) { @@ -861,13 +860,60 @@ Py_TRASHCAN_SAFE_END(wp) } -static int -wrapper_compare(wrapperobject *a, wrapperobject *b) +#define TEST_COND(cond) ((cond) ? Py_True : Py_False) + +static PyObject * +wrapper_richcompare(PyObject *a, PyObject *b, int op) { - if (a->descr == b->descr) - return PyObject_Compare(a->self, b->self); - else - return (a->descr < b->descr) ? -1 : 1; + int result; + PyObject *v; + PyWrapperDescrObject *a_descr, *b_descr; + + assert(a != NULL && b != NULL); + + /* both arguments should be wrapperobjects */ + if (!Wrapper_Check(a) || !Wrapper_Check(b)) { + v = Py_NotImplemented; + Py_INCREF(v); + return v; + } + + /* compare by descriptor address; if the descriptors are the same, + compare by the objects they're bound to */ + a_descr = ((wrapperobject *)a)->descr; + b_descr = ((wrapperobject *)b)->descr; + if (a_descr == b_descr) { + a = ((wrapperobject *)a)->self; + b = ((wrapperobject *)b)->self; + return PyObject_RichCompare(a, b, op); + } + + result = a_descr - b_descr; + switch (op) { + case Py_EQ: + v = TEST_COND(result == 0); + break; + case Py_NE: + v = TEST_COND(result != 0); + break; + case Py_LE: + v = TEST_COND(result <= 0); + break; + case Py_GE: + v = TEST_COND(result >= 0); + break; + case Py_LT: + v = TEST_COND(result < 0); + break; + case Py_GT: + v = TEST_COND(result > 0); + break; + default: + PyErr_BadArgument(); + return NULL; + } + Py_INCREF(v); + return v; } static long @@ -977,7 +1023,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - (cmpfunc)wrapper_compare, /* tp_compare */ + 0, /* tp_compare */ (reprfunc)wrapper_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -992,7 +1038,7 @@ 0, /* tp_doc */ wrapper_traverse, /* tp_traverse */ 0, /* tp_clear */ - 0, /* tp_richcompare */ + wrapper_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ Modified: python/branches/release30-maint/Objects/rangeobject.c ============================================================================== --- python/branches/release30-maint/Objects/rangeobject.c (original) +++ python/branches/release30-maint/Objects/rangeobject.c Sun Feb 1 11:41:18 2009 @@ -123,7 +123,7 @@ Algorithm is equal to that of get_len_of_range(), but it operates on PyObjects (which are assumed to be PyLong or PyInt objects). ---------------------------------------------------------------*/ - int cmp_result, cmp_call; + int cmp_result; PyObject *lo, *hi; PyObject *step = NULL; PyObject *diff = NULL; @@ -134,13 +134,12 @@ PyObject *zero = PyLong_FromLong(0); if (zero == NULL) return NULL; - cmp_call = PyObject_Cmp(r->step, zero, &cmp_result); + cmp_result = PyObject_RichCompareBool(r->step, zero, Py_GT); Py_DECREF(zero); - if (cmp_call == -1) + if (cmp_result == -1) return NULL; - assert(cmp_result != 0); - if (cmp_result > 0) { + if (cmp_result == 1) { lo = r->start; hi = r->stop; step = r->step; @@ -154,7 +153,7 @@ } /* if (lo >= hi), return length of 0. */ - if (PyObject_Compare(lo, hi) >= 0) { + if (PyObject_RichCompareBool(lo, hi, Py_GE) == 1) { Py_XDECREF(step); return PyLong_FromLong(0); } Modified: python/branches/release30-maint/Objects/setobject.c ============================================================================== --- python/branches/release30-maint/Objects/setobject.c (original) +++ python/branches/release30-maint/Objects/setobject.c Sun Feb 1 11:41:18 2009 @@ -1824,13 +1824,6 @@ return Py_NotImplemented; } -static int -set_nocmp(PyObject *self, PyObject *other) -{ - PyErr_SetString(PyExc_TypeError, "cannot compare sets using cmp()"); - return -1; -} - static PyObject * set_add(PySetObject *so, PyObject *key) { @@ -2111,7 +2104,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - set_nocmp, /* tp_compare */ + 0, /* tp_compare */ (reprfunc)set_repr, /* tp_repr */ &set_as_number, /* tp_as_number */ &set_as_sequence, /* tp_as_sequence */ @@ -2208,7 +2201,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - set_nocmp, /* tp_compare */ + 0, /* tp_compare */ (reprfunc)set_repr, /* tp_repr */ &frozenset_as_number, /* tp_as_number */ &set_as_sequence, /* tp_as_sequence */ Modified: python/branches/release30-maint/PC/winreg.c ============================================================================== --- python/branches/release30-maint/PC/winreg.c (original) +++ python/branches/release30-maint/PC/winreg.c Sun Feb 1 11:41:18 2009 @@ -326,7 +326,7 @@ "Operations:\n" "__bool__ - Handles with an open object return true, otherwise false.\n" "__int__ - Converting a handle to an integer returns the Win32 handle.\n" -"__cmp__ - Handle objects are compared using the handle value."); +"rich comparison - Handle objects are compared using the handle value."); PyDoc_STRVAR(PyHKEY_Close_doc, @@ -485,7 +485,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - PyHKEY_compareFunc, /* tp_compare */ + 0, /* tp_compare */ 0, /* tp_repr */ &PyHKEY_NumberMethods, /* tp_as_number */ 0, /* tp_as_sequence */ From python-checkins at python.org Sun Feb 1 11:54:57 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 1 Feb 2009 11:54:57 +0100 (CET) Subject: [Python-checkins] r69183 - in python/branches/py3k-issue1717: Doc/library/binascii.rst Doc/library/zlib.rst Doc/reference/executionmodel.rst Lib/importlib/NOTES Lib/importlib/_bootstrap.py Lib/importlib/test/__init__.py Lib/importlib/test/builtin/test_finder.py Lib/importlib/test/builtin/test_loader.py Lib/importlib/test/extension/test_case_sensitivity.py Lib/importlib/test/extension/test_loader.py Lib/importlib/test/frozen/support.py Lib/importlib/test/frozen/test_loader.py Lib/importlib/test/import_/test___package__.py Lib/importlib/test/import_/test_caching.py Lib/importlib/test/import_/test_fromlist.py Lib/importlib/test/import_/test_meta_path.py Lib/importlib/test/import_/test_packages.py Lib/importlib/test/import_/test_path.py Lib/importlib/test/import_/test_relative_imports.py Lib/importlib/test/import_/util.py Lib/importlib/test/source/test_case_sensitivity.py Lib/importlib/test/source/test_finder.py Lib/importlib/test/source/test_loader.py Lib/importlib/test/source/test_path_hook.py Lib/importlib/test/source/test_reload.py Lib/importlib/test/source/test_source_encoding.py Lib/importlib/test/source/util.py Lib/importlib/test/support.py Lib/importlib/test/test_api.py Lib/importlib/test/util.py Lib/test/test_descr.py Objects/unicodeobject.c Python/makeopcodetargets.py Message-ID: <20090201105457.286E61E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 1 11:54:55 2009 New Revision: 69183 Log: Merged revisions 69132-69133,69136,69138,69150-69151,69164-69168,69170-69174,69176-69179,69181 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69132 | benjamin.peterson | 2009-01-31 03:57:19 +0000 (Sat, 31 Jan 2009) | 1 line comprehrensions now have proper scoping #5106 ................ r69133 | mark.dickinson | 2009-01-31 12:12:41 +0000 (Sat, 31 Jan 2009) | 3 lines Make Python/makeopcodetargets runnable with Python 2.3. With any luck, this should solve the 'failed compile' on the x86 gentoo 3.x buildbot. ................ r69136 | benjamin.peterson | 2009-01-31 16:36:08 +0000 (Sat, 31 Jan 2009) | 1 line detabify Objects/unicodeobject.c ................ r69138 | benjamin.peterson | 2009-01-31 16:41:58 +0000 (Sat, 31 Jan 2009) | 8 lines Blocked revisions 69134 via svnmerge ........ r69134 | benjamin.peterson | 2009-01-31 10:29:18 -0600 (Sat, 31 Jan 2009) | 1 line completely detabify unicodeobject.c ........ ................ r69150 | benjamin.peterson | 2009-01-31 22:14:21 +0000 (Sat, 31 Jan 2009) | 1 line fix indentation again ................ r69151 | benjamin.peterson | 2009-01-31 22:17:25 +0000 (Sat, 31 Jan 2009) | 12 lines Blocked revisions 69146,69149 via svnmerge ........ r69146 | benjamin.peterson | 2009-01-31 15:47:42 -0600 (Sat, 31 Jan 2009) | 1 line fix indentation ........ r69149 | benjamin.peterson | 2009-01-31 16:03:19 -0600 (Sat, 31 Jan 2009) | 1 line fix indentation; looks like all I managed to do the first time is make things uglier ........ ................ r69164 | gregory.p.smith | 2009-02-01 00:30:50 +0000 (Sun, 01 Feb 2009) | 2 lines documentation wording fix for issue4903 ................ r69165 | brett.cannon | 2009-02-01 00:37:13 +0000 (Sun, 01 Feb 2009) | 1 line Move built-in loader tests to importlib.test.abc.LoaderTests. ................ r69166 | brett.cannon | 2009-02-01 00:49:41 +0000 (Sun, 01 Feb 2009) | 1 line Move extension module loader tests over to importlib.test.abc.LoaderTests. ................ r69167 | brett.cannon | 2009-02-01 01:34:13 +0000 (Sun, 01 Feb 2009) | 4 lines Fix importlib.machinery.FrozenImporter.load_module() to set __package__ properly. Discovered by also moving the loader tests over to importlib.test.abc.LoaderTests. ................ r69168 | brett.cannon | 2009-02-01 02:05:11 +0000 (Sun, 01 Feb 2009) | 3 lines Move source loader tests (including reload tests) over to importlib.test.abc.LoaderTests. ................ r69170 | brett.cannon | 2009-02-01 03:08:31 +0000 (Sun, 01 Feb 2009) | 3 lines Split out support code that is specific to source tests out of importlib.test.support to importlib.test.source.util. ................ r69171 | brett.cannon | 2009-02-01 03:51:54 +0000 (Sun, 01 Feb 2009) | 2 lines Do not execute the .pyc/.pyo files as well as the .py files. ................ r69172 | brett.cannon | 2009-02-01 04:00:05 +0000 (Sun, 01 Feb 2009) | 2 lines Rename importlib.test.support to importlib.test.util. ................ r69173 | brett.cannon | 2009-02-01 04:28:04 +0000 (Sun, 01 Feb 2009) | 2 lines Move import semantic util code to importlib.test.import_.util. ................ r69174 | brett.cannon | 2009-02-01 05:04:06 +0000 (Sun, 01 Feb 2009) | 1 line Remove an outdated todo item from importlib. ................ r69176 | brett.cannon | 2009-02-01 05:33:17 +0000 (Sun, 01 Feb 2009) | 2 lines Expose source_path and bytecode_path on _PyFileLoader. ................ r69177 | brett.cannon | 2009-02-01 05:43:31 +0000 (Sun, 01 Feb 2009) | 3 lines Ditch read_source() and read_bytecode() and replace with *_path() and get_data(). ................ r69178 | brett.cannon | 2009-02-01 05:55:23 +0000 (Sun, 01 Feb 2009) | 1 line Update importlib notes. ................ r69179 | brett.cannon | 2009-02-01 06:07:57 +0000 (Sun, 01 Feb 2009) | 1 line Simplify write_bytecode for importlib. ................ r69181 | mark.dickinson | 2009-02-01 10:28:51 +0000 (Sun, 01 Feb 2009) | 3 lines Issue #1717, stage 2: remove uses of tp_compare in Modules and most Objects. ................ Added: python/branches/py3k-issue1717/Lib/importlib/test/import_/util.py - copied unchanged from r69181, /python/branches/py3k/Lib/importlib/test/import_/util.py python/branches/py3k-issue1717/Lib/importlib/test/source/util.py - copied unchanged from r69181, /python/branches/py3k/Lib/importlib/test/source/util.py python/branches/py3k-issue1717/Lib/importlib/test/util.py - copied unchanged from r69181, /python/branches/py3k/Lib/importlib/test/util.py Removed: python/branches/py3k-issue1717/Lib/importlib/test/frozen/support.py python/branches/py3k-issue1717/Lib/importlib/test/source/test_reload.py python/branches/py3k-issue1717/Lib/importlib/test/support.py Modified: python/branches/py3k-issue1717/ (props changed) python/branches/py3k-issue1717/Doc/library/binascii.rst python/branches/py3k-issue1717/Doc/library/zlib.rst python/branches/py3k-issue1717/Doc/reference/executionmodel.rst python/branches/py3k-issue1717/Lib/importlib/NOTES python/branches/py3k-issue1717/Lib/importlib/_bootstrap.py python/branches/py3k-issue1717/Lib/importlib/test/__init__.py python/branches/py3k-issue1717/Lib/importlib/test/builtin/test_finder.py python/branches/py3k-issue1717/Lib/importlib/test/builtin/test_loader.py python/branches/py3k-issue1717/Lib/importlib/test/extension/test_case_sensitivity.py python/branches/py3k-issue1717/Lib/importlib/test/extension/test_loader.py python/branches/py3k-issue1717/Lib/importlib/test/frozen/test_loader.py python/branches/py3k-issue1717/Lib/importlib/test/import_/test___package__.py python/branches/py3k-issue1717/Lib/importlib/test/import_/test_caching.py python/branches/py3k-issue1717/Lib/importlib/test/import_/test_fromlist.py python/branches/py3k-issue1717/Lib/importlib/test/import_/test_meta_path.py python/branches/py3k-issue1717/Lib/importlib/test/import_/test_packages.py python/branches/py3k-issue1717/Lib/importlib/test/import_/test_path.py python/branches/py3k-issue1717/Lib/importlib/test/import_/test_relative_imports.py python/branches/py3k-issue1717/Lib/importlib/test/source/test_case_sensitivity.py python/branches/py3k-issue1717/Lib/importlib/test/source/test_finder.py python/branches/py3k-issue1717/Lib/importlib/test/source/test_loader.py python/branches/py3k-issue1717/Lib/importlib/test/source/test_path_hook.py python/branches/py3k-issue1717/Lib/importlib/test/source/test_source_encoding.py python/branches/py3k-issue1717/Lib/importlib/test/test_api.py python/branches/py3k-issue1717/Lib/test/test_descr.py python/branches/py3k-issue1717/Objects/unicodeobject.c python/branches/py3k-issue1717/Python/makeopcodetargets.py Modified: python/branches/py3k-issue1717/Doc/library/binascii.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/binascii.rst (original) +++ python/branches/py3k-issue1717/Doc/library/binascii.rst Sun Feb 1 11:54:55 2009 @@ -120,11 +120,11 @@ To generate the same numeric value across all Python versions and platforms use crc32(data) & 0xffffffff. If you are only using the checksum in packed binary format this is not necessary as the - return value will have the correct 32bit binary representation + return value is the correct 32bit binary representation regardless of sign. .. versionchanged:: 3.0 - The return value will always be unsigned and in the range [0, 2**32-1] + The return value is unsigned and in the range [0, 2**32-1] regardless of platform. Modified: python/branches/py3k-issue1717/Doc/library/zlib.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/library/zlib.rst (original) +++ python/branches/py3k-issue1717/Doc/library/zlib.rst Sun Feb 1 11:54:55 2009 @@ -48,11 +48,11 @@ To generate the same numeric value across all Python versions and platforms use adler32(data) & 0xffffffff. If you are only using the checksum in packed binary format this is not necessary as the - return value will have the correct 32bit binary representation + return value is the correct 32bit binary representation regardless of sign. .. versionchanged:: 3.0 - The return value will always be unsigned and in the range [0, 2**32-1] + The return value is unsigned and in the range [0, 2**32-1] regardless of platform. @@ -93,11 +93,11 @@ To generate the same numeric value across all Python versions and platforms use crc32(data) & 0xffffffff. If you are only using the checksum in packed binary format this is not necessary as the - return value will have the correct 32bit binary representation + return value is the correct 32bit binary representation regardless of sign. .. versionchanged:: 3.0 - The return value will always be unsigned and in the range [0, 2**32-1] + The return value is unsigned and in the range [0, 2**32-1] regardless of platform. Modified: python/branches/py3k-issue1717/Doc/reference/executionmodel.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/reference/executionmodel.rst (original) +++ python/branches/py3k-issue1717/Doc/reference/executionmodel.rst Sun Feb 1 11:54:55 2009 @@ -51,8 +51,8 @@ within the defining one, unless a contained block introduces a different binding for the name. The scope of names defined in a class block is limited to the class block; it does not extend to the code blocks of methods -- this includes -generator expressions since they are implemented using a function scope. This -means that the following will fail:: +comprehensions and generator expressions since they are implemented using a +function scope. This means that the following will fail:: class A: a = 42 Modified: python/branches/py3k-issue1717/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/NOTES (original) +++ python/branches/py3k-issue1717/Lib/importlib/NOTES Sun Feb 1 11:54:55 2009 @@ -1,38 +1,10 @@ to do ///// -* Use test.loader_tests - - + builtin - + frozen - + extension - + source - -* Reorganize support code. - - + Separate general support code and importer-specific (e.g. source) support - code. - - Create support modules for each subdirectory (as needed). - + Add a file loader mock that returns monotonically increasing mtime. - - Use in source/test_reload. - - Use in source/test_load_module_mixed. - -* API simplification? - - + read_source -> get_data/source_path - + read_bytecode -> get_data/bytecode_path - + write_bytecode -> complete set of bytes for bytecode instead of - individual arguments. - * Create meta_path importer for sys.path. -* OPTIMIZE! - - + Write benchmark suite. - + Fast path common cases. - - - Absolute name from sys.path. - - Relative name from sys.path. + + Create hook. + + Rewrite Import to use the hook. * Implement PEP 302 protocol for loaders (should just be a matter of testing). @@ -91,4 +63,13 @@ * SourceFinder * (?) Loader +* Write benchmark suite. + +* OPTIMIZE! + + + Fast path common cases. + + - Absolute name from sys.path. + - Relative name from sys.path. + * Bootstrap importlib as implementation of builtins.__import__ Modified: python/branches/py3k-issue1717/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/_bootstrap.py Sun Feb 1 11:54:55 2009 @@ -137,7 +137,12 @@ """Load a frozen module.""" if cls.find_module(fullname) is None: raise ImportError("{0} is not a frozen module".format(fullname)) - return imp.init_frozen(fullname) + module = imp.init_frozen(fullname) + if hasattr(module, '__path__'): + module.__package__ = module.__name__ + elif '.' in module.__name__: + module.__package__ = module.__name__.rsplit('.', 1)[0] + return module class ChainedImporter(object): @@ -336,13 +341,15 @@ else: return None - def _source_path(self): + @check_name + def source_path(self, fullname): """Return the path to an existing source file for the module, or None if one cannot be found.""" # Not a property so that it is easy to override. return self._find_path(imp.PY_SOURCE) - def _bytecode_path(self): + @check_name + def bytecode_path(self, fullname): """Return the path to a bytecode file, or None if one does not exist.""" # Not a property for easy overriding. @@ -352,8 +359,9 @@ @get_module def load_module(self, module): """Load a Python source or bytecode module.""" - source_path = self._source_path() - bytecode_path = self._bytecode_path() + name = module.__name__ + source_path = self.source_path(name) + bytecode_path = self.bytecode_path(name) code_object = self.get_code(module.__name__) module.__file__ = source_path if source_path else bytecode_path module.__loader__ = self @@ -371,7 +379,7 @@ def source_mtime(self, name): """Return the modification time of the source for the specified module.""" - source_path = self._source_path() + source_path = self.source_path(name) if not source_path: return None return int(_os.stat(source_path).st_mtime) @@ -384,7 +392,7 @@ laoder cannot handle the specified module. """ - source_path = self._source_path() + source_path = self._source_path(name) if source_path is None: return None import tokenize @@ -395,57 +403,20 @@ return open(source_path, encoding=encoding).read() @check_name - def read_source(self, fullname): - """Return the source for the specified module as bytes along with the - path where the source came from. - - The returned path is used by 'compile' for error messages. - - """ - source_path = self._source_path() - if source_path is None: - return None - with closing(_fileio._FileIO(source_path, 'r')) as bytes_file: - return bytes_file.read(), source_path - - @check_name - def read_bytecode(self, name): - """Return the magic number, timestamp, and the module bytecode for the - module. - - Raises ImportError (just like get_source) if the laoder cannot handle - the module. Returns None if there is no bytecode. - - """ - path = self._bytecode_path() - if path is None: - return None - file = _fileio._FileIO(path, 'r') - try: - with closing(file) as bytecode_file: - data = bytecode_file.read() - return data[:4], marshal._r_long(data[4:8]), data[8:] - except AttributeError: - return None - - @check_name - def write_bytecode(self, name, magic, timestamp, data): - """Write out 'data' for the specified module using the specific - timestamp, returning a boolean + def write_bytecode(self, name, data): + """Write out 'data' for the specified module, returning a boolean signifying if the write-out actually occurred. Raises ImportError (just like get_source) if the specified module cannot be handled by the loader. """ - bytecode_path = self._bytecode_path() + bytecode_path = self.bytecode_path(name) if not bytecode_path: bytecode_path = self._base_path + suffix_list(imp.PY_COMPILED)[0] file = _fileio._FileIO(bytecode_path, 'w') try: with closing(file) as bytecode_file: - bytecode_file.write(magic) - bytecode_file.write(marshal._w_long(timestamp)) bytecode_file.write(data) return True except IOError as exc: @@ -454,39 +425,19 @@ else: raise - # XXX Take an optional argument to flag whether to write bytecode? @check_name def get_code(self, name): - """Return the code object for the module. - - 'self' must implement: - - * read_bytecode(name:str) -> (int, int, bytes) or None - Return the magic number, timestamp, and bytecode for the - module. None is returned if not bytecode is available. - - * source_mtime(name:str) -> int - Return the last modification time for the source of the module. - Returns None if their is no source. - - * read_source(name:str) -> (bytes, str) - Return the source code for the module and the path to use in - the call to 'compile'. Not called if source_mtime returned - None. - - * write_bytecode(name:str, magic:bytes, timestamp:int, data:str) - Write out bytecode for the module with the specified magic - number and timestamp. Not called if sys.dont_write_bytecode is - True. - - """ + """Return the code object for the module.""" # XXX Care enough to make sure this call does not happen if the magic # number is bad? source_timestamp = self.source_mtime(name) # Try to use bytecode if it is available. - bytecode_tuple = self.read_bytecode(name) - if bytecode_tuple: - magic, pyc_timestamp, bytecode = bytecode_tuple + bytecode_path = self.bytecode_path(name) + if bytecode_path: + data = self.get_data(bytecode_path) + magic = data[:4] + pyc_timestamp = marshal._r_long(data[4:8]) + bytecode = data[8:] try: # Verify that the magic number is valid. if imp.get_magic() != magic: @@ -511,7 +462,8 @@ raise ImportError("no source or bytecode available to create code " "object for {0!r}".format(name)) # Use the source. - source, source_path = self.read_source(name) + source_path = self.source_path(name) + source = self.get_data(source_path) # Convert to universal newlines. line_endings = b'\n' for index, c in enumerate(source): @@ -530,8 +482,10 @@ code_object = compile(source, source_path, 'exec', dont_inherit=True) # Generate bytecode and write it out. if not sys.dont_write_bytecode: - data = marshal.dumps(code_object) - self.write_bytecode(name, imp.get_magic(), source_timestamp, data) + data = bytearray(imp.get_magic()) + data.extend(marshal._w_long(source_timestamp)) + data.extend(marshal.dumps(code_object)) + self.write_bytecode(name, data) return code_object def get_data(self, path): Modified: python/branches/py3k-issue1717/Lib/importlib/test/__init__.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/__init__.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/__init__.py Sun Feb 1 11:54:55 2009 @@ -9,7 +9,8 @@ if name.startswith('.'): continue path = os.path.join(directory, name) - if os.path.isfile(path) and name.startswith('test_'): + if (os.path.isfile(path) and name.startswith('test_') and + name.endswith('.py')): submodule_name = os.path.splitext(name)[0] module_name = "{0}.{1}".format(package, submodule_name) __import__(module_name, level=0) @@ -20,6 +21,8 @@ __import__(package_name, level=0) package_tests = getattr(sys.modules[package_name], 'test_suite')() suite.addTest(package_tests) + else: + continue return suite Modified: python/branches/py3k-issue1717/Lib/importlib/test/builtin/test_finder.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/builtin/test_finder.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/builtin/test_finder.py Sun Feb 1 11:54:55 2009 @@ -1,6 +1,6 @@ from importlib import machinery from .. import abc -from .. import support +from .. import util import sys import unittest @@ -14,7 +14,7 @@ def test_module(self): # Common case. - with support.uncache(self.name): + with util.uncache(self.name): self.assert_(machinery.BuiltinImporter.find_module(self.name)) def test_package(self): @@ -40,7 +40,7 @@ def test_ignore_path(self): # The value for 'path' should always trigger a failed import. - with support.uncache(self.name): + with util.uncache(self.name): loader = machinery.BuiltinImporter.find_module(self.name, ['pkg']) self.assert_(loader is None) Modified: python/branches/py3k-issue1717/Lib/importlib/test/builtin/test_loader.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/builtin/test_loader.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/builtin/test_loader.py Sun Feb 1 11:54:55 2009 @@ -1,13 +1,14 @@ import importlib from importlib import machinery -from .. import support +from .. import abc +from .. import util import sys import types import unittest -class LoaderTests(unittest.TestCase): +class LoaderTests(abc.LoaderTests): """Test load_module() for built-in modules.""" @@ -26,13 +27,32 @@ load_module = staticmethod(lambda name: machinery.BuiltinImporter.load_module(name)) - def test_load_module(self): + def test_module(self): # Common case. - with support.uncache(self.name): + with util.uncache(self.name): module = self.load_module(self.name) self.verify(module) - def test_nonexistent(self): + def test_package(self): + # Built-in modules cannot be a package. + pass + + def test_lacking_parent(self): + # Built-in modules cannot be a package. + pass + + def test_state_after_failure(self): + # Not way to force an imoprt failure. + pass + + def test_module_reuse(self): + # Test that the same module is used in a reload. + with util.uncache(self.name): + module1 = self.load_module(self.name) + module2 = self.load_module(self.name) + self.assert_(module1 is module2) + + def test_unloadable(self): name = 'dssdsdfff' assert name not in sys.builtin_module_names self.assertRaises(ImportError, self.load_module, name) Modified: python/branches/py3k-issue1717/Lib/importlib/test/extension/test_case_sensitivity.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/extension/test_case_sensitivity.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/extension/test_case_sensitivity.py Sun Feb 1 11:54:55 2009 @@ -1,12 +1,12 @@ import sys -from test import support as test_support +from test import support import unittest import importlib -from .. import support +from .. import util from . import test_path_hook - at support.case_insensitive_tests + at util.case_insensitive_tests class ExtensionModuleCaseSensitivityTest(unittest.TestCase): def find_module(self): @@ -17,13 +17,13 @@ return finder.find_module(bad_name) def test_case_sensitive(self): - with test_support.EnvironmentVarGuard() as env: + with support.EnvironmentVarGuard() as env: env.unset('PYTHONCASEOK') loader = self.find_module() self.assert_(loader is None) def test_case_insensitivity(self): - with test_support.EnvironmentVarGuard() as env: + with support.EnvironmentVarGuard() as env: env.set('PYTHONCASEOK', '1') loader = self.find_module() self.assert_(hasattr(loader, 'load_module')) @@ -32,7 +32,7 @@ def test_main(): - test_support.run_unittest(ExtensionModuleCaseSensitivityTest) + support.run_unittest(ExtensionModuleCaseSensitivityTest) if __name__ == '__main__': Modified: python/branches/py3k-issue1717/Lib/importlib/test/extension/test_loader.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/extension/test_loader.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/extension/test_loader.py Sun Feb 1 11:54:55 2009 @@ -1,12 +1,13 @@ import importlib from . import test_path_hook -from .. import support +from .. import abc +from .. import util import sys import unittest -class LoaderTests(unittest.TestCase): +class LoaderTests(abc.LoaderTests): """Test load_module() for extension modules.""" @@ -16,15 +17,33 @@ False) return loader.load_module(fullname) - def test_success(self): - with support.uncache(test_path_hook.NAME): + def test_module(self): + with util.uncache(test_path_hook.NAME): module = self.load_module(test_path_hook.NAME) for attr, value in [('__name__', test_path_hook.NAME), ('__file__', test_path_hook.FILEPATH)]: self.assertEqual(getattr(module, attr), value) self.assert_(test_path_hook.NAME in sys.modules) - def test_failure(self): + def test_package(self): + # Extensions are not found in packages. + pass + + def test_lacking_parent(self): + # Extensions are not found in packages. + pass + + def test_module_reuse(self): + with util.uncache(test_path_hook.NAME): + module1 = self.load_module(test_path_hook.NAME) + module2 = self.load_module(test_path_hook.NAME) + self.assert_(module1 is module2) + + def test_state_after_failure(self): + # No easy way to trigger a failure after a successful import. + pass + + def test_unloadable(self): self.assertRaises(ImportError, self.load_module, 'asdfjkl;') Deleted: python/branches/py3k-issue1717/Lib/importlib/test/frozen/support.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/frozen/support.py Sun Feb 1 11:54:55 2009 +++ (empty file) @@ -1,24 +0,0 @@ -import sys - - -class Null: - - """Just absorb what is given.""" - - def __getattr__(self): - return lambda *args, **kwargs: None - - -class SilenceStdout: - - """Silence sys.stdout.""" - - def setUp(self): - """Substitute sys.stdout with something that does not print to the - screen thanks to what bytecode is frozen.""" - sys.stdout = Null() - super().setUp() - - def tearDown(self): - sys.stdout = sys.__stdout__ - super().tearDown() Modified: python/branches/py3k-issue1717/Lib/importlib/test/frozen/test_loader.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/frozen/test_loader.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/frozen/test_loader.py Sun Feb 1 11:54:55 2009 @@ -1,26 +1,59 @@ from importlib import machinery -from ..builtin import test_loader +from .. import abc +from .. import util -class LoaderTests(test_loader.LoaderTests): +class LoaderTests(abc.LoaderTests): - name = '__phello__' - load_module = staticmethod(lambda name: - machinery.FrozenImporter.load_module(name)) - verification = {'__name__': '__phello__', '__file__': '', - '__package__': None, '__path__': ['__phello__']} - - -class SubmoduleLoaderTests(LoaderTests): - - name = '__phello__.spam' - verification = {'__name__': '__phello__.spam', '__file__': '', - '__package__': None} + def test_module(self): + with util.uncache('__hello__'): + module = machinery.FrozenImporter.load_module('__hello__') + check = {'__name__': '__hello__', '__file__': '', + '__package__': None} + for attr, value in check.items(): + self.assertEqual(getattr(module, attr), value) + + def test_package(self): + with util.uncache('__phello__'): + module = machinery.FrozenImporter.load_module('__phello__') + check = {'__name__': '__phello__', '__file__': '', + '__package__': '__phello__', '__path__': ['__phello__']} + for attr, value in check.items(): + attr_value = getattr(module, attr) + self.assertEqual(attr_value, value, + "for __phello__.%s, %r != %r" % + (attr, attr_value, value)) + + def test_lacking_parent(self): + with util.uncache('__phello__', '__phello__.spam'): + module = machinery.FrozenImporter.load_module('__phello__.spam') + check = {'__name__': '__phello__.spam', '__file__': '', + '__package__': '__phello__'} + for attr, value in check.items(): + attr_value = getattr(module, attr) + self.assertEqual(attr_value, value, + "for __phello__.spam.%s, %r != %r" % + (attr, attr_value, value)) + + def test_module_reuse(self): + with util.uncache('__hello__'): + module1 = machinery.FrozenImporter.load_module('__hello__') + module2 = machinery.FrozenImporter.load_module('__hello__') + self.assert_(module1 is module2) + + def test_state_after_failure(self): + # No way to trigger an error in a frozen module. + pass + + def test_unloadable(self): + assert machinery.FrozenImporter.find_module('_not_real') is None + self.assertRaises(ImportError, machinery.FrozenImporter.load_module, + '_not_real') def test_main(): from test.support import run_unittest - run_unittest(LoaderTests, SubmoduleLoaderTests) + run_unittest(LoaderTests) if __name__ == '__main__': Modified: python/branches/py3k-issue1717/Lib/importlib/test/import_/test___package__.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/import_/test___package__.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/import_/test___package__.py Sun Feb 1 11:54:55 2009 @@ -5,7 +5,8 @@ """ import unittest -from .. import support +from .. import util +from . import util as import_util class Using__package__(unittest.TestCase): @@ -34,19 +35,19 @@ def test_using___package__(self): # [__package__] - with support.mock_modules('pkg.__init__', 'pkg.fake') as importer: - with support.import_state(meta_path=[importer]): - support.import_('pkg.fake') - module = support.import_('', globals={'__package__': 'pkg.fake'}, + with util.mock_modules('pkg.__init__', 'pkg.fake') as importer: + with util.import_state(meta_path=[importer]): + import_util.import_('pkg.fake') + module = import_util.import_('', globals={'__package__': 'pkg.fake'}, fromlist=['attr'], level=2) self.assertEquals(module.__name__, 'pkg') def test_using___name__(self): # [__name__] - with support.mock_modules('pkg.__init__', 'pkg.fake') as importer: - with support.import_state(meta_path=[importer]): - support.import_('pkg.fake') - module = support.import_('', + with util.mock_modules('pkg.__init__', 'pkg.fake') as importer: + with util.import_state(meta_path=[importer]): + import_util.import_('pkg.fake') + module = import_util.import_('', globals={'__name__': 'pkg.fake', '__path__': []}, fromlist=['attr'], level=2) @@ -54,12 +55,12 @@ def test_bad__package__(self): globals = {'__package__': ''} - self.assertRaises(SystemError, support.import_,'', globals, {}, + self.assertRaises(SystemError, import_util.import_,'', globals, {}, ['relimport'], 1) def test_bunk__package__(self): globals = {'__package__': 42} - self.assertRaises(ValueError, support.import_, '', globals, {}, + self.assertRaises(ValueError, import_util.import_, '', globals, {}, ['relimport'], 1) @@ -77,26 +78,26 @@ # [top-level] def test_top_level(self): - with support.mock_modules('top_level') as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules('top_level') as mock: + with util.import_state(meta_path=[mock]): del mock['top_level'].__package__ - module = support.import_('top_level') + module = import_util.import_('top_level') self.assert_(module.__package__ is None) # [package] def test_package(self): - with support.mock_modules('pkg.__init__') as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules('pkg.__init__') as mock: + with util.import_state(meta_path=[mock]): del mock['pkg'].__package__ - module = support.import_('pkg') + module = import_util.import_('pkg') self.assertEqual(module.__package__, 'pkg') # [submodule] def test_submodule(self): - with support.mock_modules('pkg.__init__', 'pkg.mod') as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules('pkg.__init__', 'pkg.mod') as mock: + with util.import_state(meta_path=[mock]): del mock['pkg.mod'].__package__ - pkg = support.import_('pkg.mod') + pkg = import_util.import_('pkg.mod') module = getattr(pkg, 'mod') self.assertEqual(module.__package__, 'pkg') Modified: python/branches/py3k-issue1717/Lib/importlib/test/import_/test_caching.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/import_/test_caching.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/import_/test_caching.py Sun Feb 1 11:54:55 2009 @@ -1,6 +1,6 @@ """Test that sys.modules is used properly by import.""" -from ..support import import_, mock_modules, importlib_only, import_state - +from .. import util +from . import util as import_util import sys from types import MethodType import unittest @@ -24,11 +24,11 @@ # [use cache] module_to_use = "some module found!" sys.modules['some_module'] = module_to_use - module = import_('some_module') + module = import_util.import_('some_module') self.assertEqual(id(module_to_use), id(module)) def create_mock(self, *names, return_=None): - mock = mock_modules(*names) + mock = util.mock_modules(*names) original_load = mock.load_module def load_module(self, fullname): original_load(fullname) @@ -38,31 +38,31 @@ # __import__ inconsistent between loaders and built-in import when it comes # to when to use the module in sys.modules and when not to. - @importlib_only + @import_util.importlib_only def test_using_cache_after_loader(self): # [from cache on return] with self.create_mock('module') as mock: - with import_state(meta_path=[mock]): - module = import_('module') + with util.import_state(meta_path=[mock]): + module = import_util.import_('module') self.assertEquals(id(module), id(sys.modules['module'])) # See test_using_cache_after_loader() for reasoning. - @importlib_only + @import_util.importlib_only def test_using_cache_for_assigning_to_attribute(self): # [from cache to attribute] with self.create_mock('pkg.__init__', 'pkg.module') as importer: - with import_state(meta_path=[importer]): - module = import_('pkg.module') + with util.import_state(meta_path=[importer]): + module = import_util.import_('pkg.module') self.assert_(hasattr(module, 'module')) self.assert_(id(module.module), id(sys.modules['pkg.module'])) # See test_using_cache_after_loader() for reasoning. - @importlib_only + @import_util.importlib_only def test_using_cache_for_fromlist(self): # [from cache for fromlist] with self.create_mock('pkg.__init__', 'pkg.module') as importer: - with import_state(meta_path=[importer]): - module = import_('pkg', fromlist=['module']) + with util.import_state(meta_path=[importer]): + module = import_util.import_('pkg', fromlist=['module']) self.assert_(hasattr(module, 'module')) self.assertEquals(id(module.module), id(sys.modules['pkg.module'])) Modified: python/branches/py3k-issue1717/Lib/importlib/test/import_/test_fromlist.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/import_/test_fromlist.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/import_/test_fromlist.py Sun Feb 1 11:54:55 2009 @@ -1,6 +1,6 @@ """Test that the semantics relating to the 'fromlist' argument are correct.""" -from ..support import import_, mock_modules, import_state - +from .. import util +from . import util as import_util import unittest class ReturnValue(unittest.TestCase): @@ -16,16 +16,16 @@ def test_return_from_import(self): # [import return] - with mock_modules('pkg.__init__', 'pkg.module') as importer: - with import_state(meta_path=[importer]): - module = import_('pkg.module') + with util.mock_modules('pkg.__init__', 'pkg.module') as importer: + with util.import_state(meta_path=[importer]): + module = import_util.import_('pkg.module') self.assertEquals(module.__name__, 'pkg') def test_return_from_from_import(self): # [from return] - with mock_modules('pkg.__init__', 'pkg.module')as importer: - with import_state(meta_path=[importer]): - module = import_('pkg.module', fromlist=['attr']) + with util.mock_modules('pkg.__init__', 'pkg.module')as importer: + with util.import_state(meta_path=[importer]): + module = import_util.import_('pkg.module', fromlist=['attr']) self.assertEquals(module.__name__, 'pkg.module') @@ -48,59 +48,59 @@ def test_object(self): # [object case] - with mock_modules('module') as importer: - with import_state(meta_path=[importer]): - module = import_('module', fromlist=['attr']) + with util.mock_modules('module') as importer: + with util.import_state(meta_path=[importer]): + module = import_util.import_('module', fromlist=['attr']) self.assertEquals(module.__name__, 'module') def test_unexistent_object(self): # [bad object] - with mock_modules('module') as importer: - with import_state(meta_path=[importer]): - module = import_('module', fromlist=['non_existent']) + with util.mock_modules('module') as importer: + with util.import_state(meta_path=[importer]): + module = import_util.import_('module', fromlist=['non_existent']) self.assertEquals(module.__name__, 'module') self.assert_(not hasattr(module, 'non_existent')) def test_module_from_package(self): # [module] - with mock_modules('pkg.__init__', 'pkg.module') as importer: - with import_state(meta_path=[importer]): - module = import_('pkg', fromlist=['module']) + with util.mock_modules('pkg.__init__', 'pkg.module') as importer: + with util.import_state(meta_path=[importer]): + module = import_util.import_('pkg', fromlist=['module']) self.assertEquals(module.__name__, 'pkg') self.assert_(hasattr(module, 'module')) self.assertEquals(module.module.__name__, 'pkg.module') def test_no_module_from_package(self): # [no module] - with mock_modules('pkg.__init__') as importer: - with import_state(meta_path=[importer]): - module = import_('pkg', fromlist='non_existent') + with util.mock_modules('pkg.__init__') as importer: + with util.import_state(meta_path=[importer]): + module = import_util.import_('pkg', fromlist='non_existent') self.assertEquals(module.__name__, 'pkg') self.assert_(not hasattr(module, 'non_existent')) def test_empty_string(self): - with mock_modules('pkg.__init__', 'pkg.mod') as importer: - with import_state(meta_path=[importer]): - module = import_('pkg.mod', fromlist=['']) + with util.mock_modules('pkg.__init__', 'pkg.mod') as importer: + with util.import_state(meta_path=[importer]): + module = import_util.import_('pkg.mod', fromlist=['']) self.assertEquals(module.__name__, 'pkg.mod') def test_using_star(self): # [using *] - with mock_modules('pkg.__init__', 'pkg.module') as mock: - with import_state(meta_path=[mock]): + with util.mock_modules('pkg.__init__', 'pkg.module') as mock: + with util.import_state(meta_path=[mock]): mock['pkg'].__all__ = ['module'] - module = import_('pkg', fromlist=['*']) + module = import_util.import_('pkg', fromlist=['*']) self.assertEquals(module.__name__, 'pkg') self.assert_(hasattr(module, 'module')) self.assertEqual(module.module.__name__, 'pkg.module') def test_star_with_others(self): # [using * with others] - context = mock_modules('pkg.__init__', 'pkg.module1', 'pkg.module2') + context = util.mock_modules('pkg.__init__', 'pkg.module1', 'pkg.module2') with context as mock: - with import_state(meta_path=[mock]): + with util.import_state(meta_path=[mock]): mock['pkg'].__all__ = ['module1'] - module = import_('pkg', fromlist=['module2', '*']) + module = import_util.import_('pkg', fromlist=['module2', '*']) self.assertEquals(module.__name__, 'pkg') self.assert_(hasattr(module, 'module1')) self.assert_(hasattr(module, 'module2')) Modified: python/branches/py3k-issue1717/Lib/importlib/test/import_/test_meta_path.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/import_/test_meta_path.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/import_/test_meta_path.py Sun Feb 1 11:54:55 2009 @@ -1,5 +1,5 @@ -from ..support import import_state, mock_modules, import_ - +from .. import util +from . import util as import_util from contextlib import nested from types import MethodType import unittest @@ -16,24 +16,25 @@ def test_first_called(self): # [first called] mod = 'top_level' - first = mock_modules(mod) - second = mock_modules(mod) - with nested(mock_modules(mod), mock_modules(mod)) as (first, second): + first = util.mock_modules(mod) + second = util.mock_modules(mod) + context = nested(util.mock_modules(mod), util.mock_modules(mod)) + with context as (first, second): first.modules[mod] = 42 second.modules[mod] = -13 - with import_state(meta_path=[first, second]): - self.assertEquals(import_(mod), 42) + with util.import_state(meta_path=[first, second]): + self.assertEquals(import_util.import_(mod), 42) def test_continuing(self): # [continuing] mod_name = 'for_real' - first = mock_modules('nonexistent') - second = mock_modules(mod_name) + first = util.mock_modules('nonexistent') + second = util.mock_modules(mod_name) with nested(first, second): first.find_module = lambda self, fullname, path=None: None second.modules[mod_name] = 42 - with import_state(meta_path=[first, second]): - self.assertEquals(import_(mod_name), 42) + with util.import_state(meta_path=[first, second]): + self.assertEquals(import_util.import_(mod_name), 42) class CallSignature(unittest.TestCase): @@ -54,11 +55,11 @@ # [no path] mod_name = 'top_level' assert '.' not in mod_name - with mock_modules(mod_name) as importer: + with util.mock_modules(mod_name) as importer: log, wrapped_call = self.log(importer.find_module) importer.find_module = MethodType(wrapped_call, importer) - with import_state(meta_path=[importer]): - import_(mod_name) + with util.import_state(meta_path=[importer]): + import_util.import_(mod_name) assert len(log) == 1 args = log[0][0] kwargs = log[0][1] @@ -74,12 +75,12 @@ mod_name = pkg_name + '.module' path = [42] assert '.' in mod_name - with mock_modules(pkg_name+'.__init__', mod_name) as importer: + with util.mock_modules(pkg_name+'.__init__', mod_name) as importer: importer.modules[pkg_name].__path__ = path log, wrapped_call = self.log(importer.find_module) importer.find_module = MethodType(wrapped_call, importer) - with import_state(meta_path=[importer]): - import_(mod_name) + with util.import_state(meta_path=[importer]): + import_util.import_(mod_name) assert len(log) == 2 args = log[1][0] kwargs = log[1][1] Modified: python/branches/py3k-issue1717/Lib/importlib/test/import_/test_packages.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/import_/test_packages.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/import_/test_packages.py Sun Feb 1 11:54:55 2009 @@ -1,7 +1,8 @@ +from .. import util +from . import util as import_util import sys import unittest import importlib -from .. import support class ParentModuleTests(unittest.TestCase): @@ -9,15 +10,16 @@ """Importing a submodule should import the parent modules.""" def test_import_parent(self): - with support.mock_modules('pkg.__init__', 'pkg.module') as mock: - with support.import_state(meta_path=[mock]): - module = support.import_('pkg.module') + with util.mock_modules('pkg.__init__', 'pkg.module') as mock: + with util.import_state(meta_path=[mock]): + module = import_util.import_('pkg.module') self.assert_('pkg' in sys.modules) def test_bad_parent(self): - with support.mock_modules('pkg.module') as mock: - with support.import_state(meta_path=[mock]): - self.assertRaises(ImportError, support.import_, 'pkg.module') + with util.mock_modules('pkg.module') as mock: + with util.import_state(meta_path=[mock]): + self.assertRaises(ImportError, + import_util.import_, 'pkg.module') def test_main(): Modified: python/branches/py3k-issue1717/Lib/importlib/test/import_/test_path.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/import_/test_path.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/import_/test_path.py Sun Feb 1 11:54:55 2009 @@ -1,6 +1,5 @@ -from ..support import (mock_modules, import_state, import_, mock_path_hook, - importlib_only, uncache) - +from .. import util +from . import util as import_util from contextlib import nested from imp import new_module import sys @@ -32,7 +31,7 @@ def order_test(self, to_import, entry, search_path, path=[]): # [order] log = [] - class LogFindModule(mock_modules): + class LogFindModule(util.mock_modules): def find_module(self, fullname): log.append(self) return super().find_module(fullname) @@ -42,12 +41,12 @@ hitter = LogFindModule(to_import) with nested(misser, hitter): cache = dict(zip(search_path, (misser, hitter))) - with import_state(path=path, path_importer_cache=cache): - import_(to_import) + with util.import_state(path=path, path_importer_cache=cache): + import_util.import_(to_import) self.assertEquals(log[0], misser) self.assertEquals(log[1], hitter) - @importlib_only # __import__ uses PyDict_GetItem(), bypassing log. + @import_util.importlib_only # __import__ uses PyDict_GetItem(), bypassing log. def cache_use_test(self, to_import, entry, path=[]): # [cache check], [cache use] log = [] @@ -56,11 +55,11 @@ log.append(item) return super(LoggingDict, self).__getitem__(item) - with mock_modules(to_import) as importer: + with util.mock_modules(to_import) as importer: cache = LoggingDict() cache[entry] = importer - with import_state(path=[entry], path_importer_cache=cache): - module = import_(to_import, fromlist=['a']) + with util.import_state(path=[entry], path_importer_cache=cache): + module = import_util.import_(to_import, fromlist=['a']) self.assert_(module is importer[to_import]) self.assertEquals(len(cache), 1) self.assertEquals([entry], log) @@ -71,11 +70,11 @@ def logging_hook(entry): log.append(entry) raise ImportError - with mock_modules(to_import) as importer: - hitter = mock_path_hook(entry, importer=importer) + with util.mock_modules(to_import) as importer: + hitter = import_util.mock_path_hook(entry, importer=importer) path_hooks = [logging_hook, logging_hook, hitter] - with import_state(path_hooks=path_hooks, path=path): - import_(to_import) + with util.import_state(path_hooks=path_hooks, path=path): + import_util.import_(to_import) self.assertEquals(sys.path_importer_cache[entry], importer) self.assertEquals(len(log), 2) @@ -90,7 +89,7 @@ raise ImportError try: - import_(to_import) + import_util.import_(to_import) except ImportError: pass @@ -113,7 +112,7 @@ def test_path_argument(self): name = 'total junk' - with uncache(name): + with util.uncache(name): self.path_argument_test(name) @@ -122,13 +121,13 @@ """Tests for __path__.""" def run_test(self, test, entry, path, *args): - with mock_modules('pkg.__init__') as importer: + with util.mock_modules('pkg.__init__') as importer: importer['pkg'].__path__ = path importer.load_module('pkg') test('pkg.hit', entry, *args) - @importlib_only # XXX Unknown reason why this fails. + @import_util.importlib_only # XXX Unknown reason why this fails. def test_order(self): self.run_test(self.order_test, 'second', ('first', 'second'), ['first', 'second']) @@ -146,7 +145,7 @@ module.__path__ = ['random __path__'] name = 'pkg.whatever' sys.modules['pkg'] = module - with uncache('pkg', name): + with util.uncache('pkg', name): self.path_argument_test(name) Modified: python/branches/py3k-issue1717/Lib/importlib/test/import_/test_relative_imports.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/import_/test_relative_imports.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/import_/test_relative_imports.py Sun Feb 1 11:54:55 2009 @@ -1,7 +1,6 @@ """Test relative imports (PEP 328).""" - -from ..support import uncache, import_, mock_modules, import_state - +from .. import util +from . import util as import_util import sys import unittest @@ -65,10 +64,10 @@ uncache_names.append(name) else: uncache_names.append(name[:-len('.__init__')]) - with mock_modules(*create) as importer: - with import_state(meta_path=[importer]): + with util.mock_modules(*create) as importer: + with util.import_state(meta_path=[importer]): for global_ in globals_: - with uncache(*uncache_names): + with util.uncache(*uncache_names): callback(global_) @@ -77,8 +76,8 @@ create = 'pkg.__init__', 'pkg.mod2' globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.mod1'} def callback(global_): - import_('pkg') # For __import__(). - module = import_('', global_, fromlist=['mod2'], level=1) + import_util.import_('pkg') # For __import__(). + module = import_util.import_('', global_, fromlist=['mod2'], level=1) self.assertEqual(module.__name__, 'pkg') self.assert_(hasattr(module, 'mod2')) self.assertEqual(module.mod2.attr, 'pkg.mod2') @@ -89,8 +88,9 @@ create = 'pkg.__init__', 'pkg.mod2' globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.mod1'} def callback(global_): - import_('pkg') # For __import__(). - module = import_('mod2', global_, fromlist=['attr'], level=1) + import_util.import_('pkg') # For __import__(). + module = import_util.import_('mod2', global_, fromlist=['attr'], + level=1) self.assertEqual(module.__name__, 'pkg.mod2') self.assertEqual(module.attr, 'pkg.mod2') self.relative_import_test(create, globals_, callback) @@ -101,8 +101,8 @@ globals_ = ({'__package__': 'pkg'}, {'__name__': 'pkg', '__path__': ['blah']}) def callback(global_): - import_('pkg') # For __import__(). - module = import_('', global_, fromlist=['module'], + import_util.import_('pkg') # For __import__(). + module = import_util.import_('', global_, fromlist=['module'], level=1) self.assertEqual(module.__name__, 'pkg') self.assert_(hasattr(module, 'module')) @@ -114,8 +114,8 @@ create = 'pkg.__init__', 'pkg.module' globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.module'} def callback(global_): - import_('pkg') # For __import__(). - module = import_('', global_, fromlist=['attr'], level=1) + import_util.import_('pkg') # For __import__(). + module = import_util.import_('', global_, fromlist=['attr'], level=1) self.assertEqual(module.__name__, 'pkg') self.relative_import_test(create, globals_, callback) @@ -126,7 +126,8 @@ globals_ = ({'__package__': 'pkg.subpkg1'}, {'__name__': 'pkg.subpkg1', '__path__': ['blah']}) def callback(global_): - module = import_('', global_, fromlist=['subpkg2'], level=2) + module = import_util.import_('', global_, fromlist=['subpkg2'], + level=2) self.assertEqual(module.__name__, 'pkg') self.assert_(hasattr(module, 'subpkg2')) self.assertEqual(module.subpkg2.attr, 'pkg.subpkg2.__init__') @@ -141,8 +142,8 @@ {'__name__': 'pkg.pkg1.pkg2.pkg3.pkg4.pkg5', '__path__': ['blah']}) def callback(global_): - import_(globals_[0]['__package__']) - module = import_('', global_, fromlist=['attr'], level=6) + import_util.import_(globals_[0]['__package__']) + module = import_util.import_('', global_, fromlist=['attr'], level=6) self.assertEqual(module.__name__, 'pkg') self.relative_import_test(create, globals_, callback) @@ -152,8 +153,8 @@ globals_ = ({'__package__': 'pkg'}, {'__name__': 'pkg', '__path__': ['blah']}) def callback(global_): - import_('pkg') - self.assertRaises(ValueError, import_, '', global_, + import_util.import_('pkg') + self.assertRaises(ValueError, import_util.import_, '', global_, fromlist=['top_level'], level=2) self.relative_import_test(create, globals_, callback) @@ -162,14 +163,14 @@ create = ['top_level', 'pkg.__init__', 'pkg.module'] globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.module'} def callback(global_): - import_('pkg') - self.assertRaises(ValueError, import_, '', global_, + import_util.import_('pkg') + self.assertRaises(ValueError, import_util.import_, '', global_, fromlist=['top_level'], level=2) self.relative_import_test(create, globals_, callback) def test_empty_name_w_level_0(self): # [empty name] - self.assertRaises(ValueError, import_, '') + self.assertRaises(ValueError, import_util.import_, '') def test_import_from_different_package(self): # Test importing from a different package than the caller. @@ -183,8 +184,9 @@ '__runpy_pkg__.uncle.cousin.nephew'] globals_ = {'__package__': '__runpy_pkg__.__runpy_pkg__'} def callback(global_): - import_('__runpy_pkg__.__runpy_pkg__') - module = import_('uncle.cousin', globals_, {}, fromlist=['nephew'], + import_util.import_('__runpy_pkg__.__runpy_pkg__') + module = import_util.import_('uncle.cousin', globals_, {}, + fromlist=['nephew'], level=2) self.assertEqual(module.__name__, '__runpy_pkg__.uncle.cousin') self.relative_import_test(create, globals_, callback) Modified: python/branches/py3k-issue1717/Lib/importlib/test/source/test_case_sensitivity.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/source/test_case_sensitivity.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/source/test_case_sensitivity.py Sun Feb 1 11:54:55 2009 @@ -1,13 +1,14 @@ """Test case-sensitivity (PEP 235).""" import importlib -from .. import support +from .. import util +from . import util as source_util import os import sys from test import support as test_support import unittest - at support.case_insensitive_tests + at util.case_insensitive_tests class CaseSensitivityTest(unittest.TestCase): """PEP 235 dictates that on case-preserving, case-insensitive file systems @@ -25,7 +26,8 @@ """Look for a module with matching and non-matching sensitivity.""" sensitive_pkg = 'sensitive.{0}'.format(self.name) insensitive_pkg = 'insensitive.{0}'.format(self.name.lower()) - with support.create_modules(insensitive_pkg, sensitive_pkg) as mapping: + context = source_util.create_modules(insensitive_pkg, sensitive_pkg) + with context as mapping: sensitive_path = os.path.join(mapping['.root'], 'sensitive') insensitive_path = os.path.join(mapping['.root'], 'insensitive') return self.find(sensitive_path), self.find(insensitive_path) Modified: python/branches/py3k-issue1717/Lib/importlib/test/source/test_finder.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/source/test_finder.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/source/test_finder.py Sun Feb 1 11:54:55 2009 @@ -1,6 +1,6 @@ import importlib from .. import abc -from .. import support +from . import util as source_util import os import py_compile import unittest @@ -45,7 +45,7 @@ """ if create is None: create = {test} - with support.create_modules(*create) as mapping: + with source_util.create_modules(*create) as mapping: if compile_: for name in compile_: py_compile.compile(mapping[name]) @@ -76,14 +76,14 @@ # [sub module] def test_module_in_package(self): - with support.create_modules('pkg.__init__', 'pkg.sub') as mapping: + with source_util.create_modules('pkg.__init__', 'pkg.sub') as mapping: pkg_dir = os.path.dirname(mapping['pkg.__init__']) loader = self.import_(pkg_dir, 'pkg.sub') self.assert_(hasattr(loader, 'load_module')) # [sub package] def test_package_in_package(self): - context = support.create_modules('pkg.__init__', 'pkg.sub.__init__') + context = source_util.create_modules('pkg.__init__', 'pkg.sub.__init__') with context as mapping: pkg_dir = os.path.dirname(mapping['pkg.__init__']) loader = self.import_(pkg_dir, 'pkg.sub') @@ -91,7 +91,7 @@ # [sub empty] def test_empty_sub_directory(self): - context = support.create_modules('pkg.__init__', 'pkg.sub.__init__') + context = source_util.create_modules('pkg.__init__', 'pkg.sub.__init__') with warnings.catch_warnings(): warnings.simplefilter("error", ImportWarning) with context as mapping: @@ -109,7 +109,7 @@ def test_failure(self): - with support.create_modules('blah') as mapping: + with source_util.create_modules('blah') as mapping: nothing = self.import_(mapping['.root'], 'sdfsadsadf') self.assert_(nothing is None) Modified: python/branches/py3k-issue1717/Lib/importlib/test/source/test_loader.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/source/test_loader.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/source/test_loader.py Sun Feb 1 11:54:55 2009 @@ -1,5 +1,6 @@ import importlib -from .. import support +from .. import abc +from . import util as source_util import imp import os @@ -16,15 +17,84 @@ """ # [basic] - def test_basic(self): - with support.create_modules('_temp') as mapping: + def test_module(self): + with source_util.create_modules('_temp') as mapping: loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) - loader.load_module('_temp') + module = loader.load_module('_temp') self.assert_('_temp' in sys.modules) + check = {'__name__': '_temp', '__file__': mapping['_temp'], + '__package__': None} + for attr, value in check.items(): + self.assertEqual(getattr(module, attr), value) + + def test_package(self): + with source_util.create_modules('_pkg.__init__') as mapping: + loader = importlib._PyFileLoader('_pkg', mapping['_pkg.__init__'], + True) + module = loader.load_module('_pkg') + self.assert_('_pkg' in sys.modules) + check = {'__name__': '_pkg', '__file__': mapping['_pkg.__init__'], + '__path__': [os.path.dirname(mapping['_pkg.__init__'])], + '__package__': '_pkg'} + for attr, value in check.items(): + self.assertEqual(getattr(module, attr), value) + + + def test_lacking_parent(self): + with source_util.create_modules('_pkg.__init__', '_pkg.mod')as mapping: + loader = importlib._PyFileLoader('_pkg.mod', mapping['_pkg.mod'], + False) + module = loader.load_module('_pkg.mod') + self.assert_('_pkg.mod' in sys.modules) + check = {'__name__': '_pkg.mod', '__file__': mapping['_pkg.mod'], + '__package__': '_pkg'} + for attr, value in check.items(): + self.assertEqual(getattr(module, attr), value) + + def fake_mtime(self, fxn): + """Fake mtime to always be higher than expected.""" + return lambda name: fxn(name) + 1 + + def test_module_reuse(self): + with source_util.create_modules('_temp') as mapping: + loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + module = loader.load_module('_temp') + module_id = id(module) + module_dict_id = id(module.__dict__) + with open(mapping['_temp'], 'w') as file: + file.write("testing_var = 42\n") + # For filesystems where the mtime is only to a second granularity, + # everything that has happened above can be too fast; + # force an mtime on the source that is guaranteed to be different + # than the original mtime. + loader.source_mtime = self.fake_mtime(loader.source_mtime) + module = loader.load_module('_temp') + self.assert_('testing_var' in module.__dict__, + "'testing_var' not in " + "{0}".format(list(module.__dict__.keys()))) + self.assertEqual(module, sys.modules['_temp']) + self.assertEqual(id(module), module_id) + self.assertEqual(id(module.__dict__), module_dict_id) + + def test_state_after_failure(self): + # A failed reload should leave the original module intact. + attributes = ('__file__', '__path__', '__package__') + value = '' + name = '_temp' + with source_util.create_modules(name) as mapping: + orig_module = imp.new_module(name) + for attr in attributes: + setattr(orig_module, attr, value) + with open(mapping[name], 'w') as file: + file.write('+++ bad syntax +++') + loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + self.assertRaises(SyntaxError, loader.load_module, name) + for attr in attributes: + self.assertEqual(getattr(orig_module, attr), value) # [syntax error] def test_bad_syntax(self): - with support.create_modules('_temp') as mapping: + with source_util.create_modules('_temp') as mapping: with open(mapping['_temp'], 'w') as file: file.write('=') loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) @@ -39,12 +109,12 @@ def tearDown(self): sys.dont_write_bytecode = False - @support.writes_bytecode + @source_util.writes_bytecode def run_test(self, assertion): - with support.create_modules('_temp') as mapping: + with source_util.create_modules('_temp') as mapping: loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) loader.load_module('_temp') - bytecode_path = support.bytecode_path(mapping['_temp']) + bytecode_path = source_util.bytecode_path(mapping['_temp']) assertion(bytecode_path) def test_bytecode_written(self): @@ -67,10 +137,10 @@ # [bad magic] def test_bad_magic(self): - with support.create_modules('_temp') as mapping: + with source_util.create_modules('_temp') as mapping: py_compile.compile(mapping['_temp']) os.unlink(mapping['_temp']) - bytecode_path = support.bytecode_path(mapping['_temp']) + bytecode_path = source_util.bytecode_path(mapping['_temp']) with open(bytecode_path, 'r+b') as file: file.seek(0) file.write(b'\x00\x00\x00\x00') @@ -94,7 +164,7 @@ def run_test(self, test, *create, pkg=False): create += (test,) - with support.create_modules(*create) as mapping: + with source_util.create_modules(*create) as mapping: for name in create: py_compile.compile(mapping[name]) if pkg: @@ -147,11 +217,11 @@ self.assert_(module_name in sys.modules) # [bad magic] - @support.writes_bytecode + @source_util.writes_bytecode def test_bad_magic(self): - with support.create_modules('_temp') as mapping: + with source_util.create_modules('_temp') as mapping: py_compile.compile(mapping['_temp']) - bytecode_path = support.bytecode_path(mapping['_temp']) + bytecode_path = source_util.bytecode_path(mapping['_temp']) with open(bytecode_path, 'r+b') as bytecode_file: bytecode_file.seek(0) bytecode_file.write(b'\x00\x00\x00\x00') @@ -160,12 +230,12 @@ self.assertEqual(bytecode_file.read(4), imp.get_magic()) # [bad timestamp] - @support.writes_bytecode + @source_util.writes_bytecode def test_bad_bytecode(self): zeros = b'\x00\x00\x00\x00' - with support.create_modules('_temp') as mapping: + with source_util.create_modules('_temp') as mapping: py_compile.compile(mapping['_temp']) - bytecode_path = support.bytecode_path(mapping['_temp']) + bytecode_path = source_util.bytecode_path(mapping['_temp']) with open(bytecode_path, 'r+b') as bytecode_file: bytecode_file.seek(4) bytecode_file.write(zeros) @@ -178,8 +248,8 @@ # [bad marshal] def test_bad_marshal(self): - with support.create_modules('_temp') as mapping: - bytecode_path = support.bytecode_path(mapping['_temp']) + with source_util.create_modules('_temp') as mapping: + bytecode_path = source_util.bytecode_path(mapping['_temp']) source_mtime = os.path.getmtime(mapping['_temp']) source_timestamp = importlib._w_long(source_mtime) with open(bytecode_path, 'wb') as bytecode_file: Modified: python/branches/py3k-issue1717/Lib/importlib/test/source/test_path_hook.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/source/test_path_hook.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/source/test_path_hook.py Sun Feb 1 11:54:55 2009 @@ -1,5 +1,5 @@ import importlib -from .. import support +from . import util as source_util import unittest @@ -9,7 +9,7 @@ def test_success(self): # XXX Only work on existing directories? - with support.create_modules('dummy') as mapping: + with source_util.create_modules('dummy') as mapping: self.assert_(hasattr(importlib.FileImporter(mapping['.root']), 'find_module')) Deleted: python/branches/py3k-issue1717/Lib/importlib/test/source/test_reload.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/source/test_reload.py Sun Feb 1 11:54:55 2009 +++ (empty file) @@ -1,71 +0,0 @@ -"""Test reload support. - -Reload support requires two things. One is that if module is loaded that -already exists in sys.modules then it is reused. And two, if a reload fails the -pre-existing module is left in a sane state. - -""" -import imp -import sys -import types -import unittest -import importlib -from .. import support - - -class ReloadTests(unittest.TestCase): - - name = '_temp' - - def load_module(self, mapping): - return importlib._PyFileLoader(self.name, mapping[self.name], False) - - def fake_mtime(self, fxn): - """Fake mtime to always be higher than expected.""" - return lambda name: fxn(name) + 1 - - def test_module_reuse(self): - with support.create_modules(self.name) as mapping: - loader = self.load_module(mapping) - module = loader.load_module(self.name) - module_id = id(module) - module_dict_id = id(module.__dict__) - with open(mapping[self.name], 'w') as file: - file.write("testing_var = 42\n") - # For filesystems where the mtime is only to a second granularity, - # everything that has happened above can be too fast; - # force an mtime on the source that is guaranteed to be different - # than the original mtime. - loader.source_mtime = self.fake_mtime(loader.source_mtime) - module = loader.load_module(self.name) - self.assert_('testing_var' in module.__dict__, - "'testing_var' not in " - "{0}".format(list(module.__dict__.keys()))) - self.assertEqual(module, sys.modules[self.name]) - self.assertEqual(id(module), module_id) - self.assertEqual(id(module.__dict__), module_dict_id) - - def test_bad_reload(self): - # A failed reload should leave the original module intact. - attributes = ('__file__', '__path__', '__package__') - value = '' - with support.create_modules(self.name) as mapping: - orig_module = imp.new_module(self.name) - for attr in attributes: - setattr(orig_module, attr, value) - with open(mapping[self.name], 'w') as file: - file.write('+++ bad syntax +++') - loader = self.load_module(mapping) - self.assertRaises(SyntaxError, loader.load_module, self.name) - for attr in attributes: - self.assertEqual(getattr(orig_module, attr), value) - - - -def test_main(): - from test.support import run_unittest - run_unittest(ReloadTests) - - -if __name__ == '__main__': - test_main() Modified: python/branches/py3k-issue1717/Lib/importlib/test/source/test_source_encoding.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/source/test_source_encoding.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/source/test_source_encoding.py Sun Feb 1 11:54:55 2009 @@ -1,5 +1,5 @@ import importlib -from .. import support +from . import util as source_util import codecs import re @@ -32,7 +32,7 @@ module_name = '_temp' def run_test(self, source): - with support.create_modules(self.module_name) as mapping: + with source_util.create_modules(self.module_name) as mapping: with open(mapping[self.module_name], 'wb')as file: file.write(source) loader = importlib._PyFileLoader(self.module_name, @@ -93,7 +93,7 @@ module_name = '_temp' source_lines = [b"a = 42", b"b = -13", b''] source = line_ending.join(source_lines) - with support.create_modules(module_name) as mapping: + with source_util.create_modules(module_name) as mapping: with open(mapping[module_name], 'wb') as file: file.write(source) loader = importlib._PyFileLoader(module_name, mapping[module_name], Deleted: python/branches/py3k-issue1717/Lib/importlib/test/support.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/support.py Sun Feb 1 11:54:55 2009 +++ (empty file) @@ -1,233 +0,0 @@ -from importlib import Import - -from contextlib import contextmanager -from functools import update_wrapper -import imp -import os.path -from test.support import unlink -import sys -from tempfile import gettempdir - - -using___import__ = False - -def import_(*args, **kwargs): - """Delegate to allow for injecting different implementations of import.""" - if using___import__: - return __import__(*args, **kwargs) - return Import()(*args, **kwargs) - -def importlib_only(fxn): - """Decorator to mark which tests are not supported by the current - implementation of __import__().""" - def inner(*args, **kwargs): - if using___import__: - return - else: - return fxn(*args, **kwargs) - update_wrapper(inner, fxn) - return inner - -def writes_bytecode(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: - return fxn - - -def case_insensitive_tests(class_): - """Class decorator that nullifies tests that require a case-insensitive - file system.""" - if sys.platform not in ('win32', 'darwin', 'cygwin'): - return object() - else: - return class_ - - - at contextmanager -def uncache(*names): - """Uncache a module from sys.modules. - - A basic sanity check is performed to prevent uncaching modules that either - cannot/shouldn't be uncached. - - """ - for name in names: - if name in ('sys', 'marshal', 'imp'): - raise ValueError( - "cannot uncache {0} as it will break _importlib".format(name)) - try: - del sys.modules[name] - except KeyError: - pass - try: - yield - finally: - for name in names: - try: - del sys.modules[name] - except KeyError: - pass - - at contextmanager -def import_state(**kwargs): - """Context manager to manage the various importers and stored state in the - sys module. - - The 'modules' attribute is not supported as the interpreter state stores a - pointer to the dict that the interpreter uses internally; - reassigning to sys.modules does not have the desired effect. - - """ - originals = {} - try: - for attr, default in (('meta_path', []), ('path', []), - ('path_hooks', []), - ('path_importer_cache', {})): - originals[attr] = getattr(sys, attr) - if attr in kwargs: - new_value = kwargs[attr] - del kwargs[attr] - else: - new_value = default - setattr(sys, attr, new_value) - if len(kwargs): - raise ValueError( - 'unrecognized arguments: {0}'.format(kwargs.keys())) - yield - finally: - for attr, value in originals.items(): - setattr(sys, attr, value) - - - at contextmanager -def create_modules(*names): - """Temporarily create each named module with an attribute (named 'attr') - that contains the name passed into the context manager that caused the - creation of the module. - - All files are created in a temporary directory specified by - tempfile.gettempdir(). This directory is inserted at the beginning of - sys.path. When the context manager exits all created files (source and - bytecode) are explicitly deleted. - - No magic is performed when creating packages! This means that if you create - a module within a package you must also create the package's __init__ as - well. - - """ - source = 'attr = {0!r}' - created_paths = [] - mapping = {} - try: - temp_dir = gettempdir() - mapping['.root'] = temp_dir - import_names = set() - for name in names: - if not name.endswith('__init__'): - import_name = name - else: - import_name = name[:-len('.__init__')] - import_names.add(import_name) - if import_name in sys.modules: - del sys.modules[import_name] - name_parts = name.split('.') - file_path = temp_dir - for directory in name_parts[:-1]: - file_path = os.path.join(file_path, directory) - if not os.path.exists(file_path): - os.mkdir(file_path) - created_paths.append(file_path) - file_path = os.path.join(file_path, name_parts[-1] + '.py') - with open(file_path, 'w') as file: - file.write(source.format(name)) - created_paths.append(file_path) - mapping[name] = file_path - uncache_manager = uncache(*import_names) - uncache_manager.__enter__() - state_manager = import_state(path=[temp_dir]) - state_manager.__enter__() - yield mapping - finally: - state_manager.__exit__(None, None, None) - uncache_manager.__exit__(None, None, None) - # Reverse the order for path removal to unroll directory creation. - for path in reversed(created_paths): - if file_path.endswith('.py'): - unlink(path) - unlink(path + 'c') - unlink(path + 'o') - else: - os.rmdir(path) - - -class mock_modules: - - """A mock importer/loader.""" - - def __init__(self, *names): - self.modules = {} - for name in names: - if not name.endswith('.__init__'): - import_name = name - else: - import_name = name[:-len('.__init__')] - if '.' not in name: - package = None - elif import_name == name: - package = name.rsplit('.', 1)[0] - else: - package = import_name - module = imp.new_module(import_name) - module.__loader__ = self - module.__file__ = '' - module.__package__ = package - module.attr = name - if import_name != name: - module.__path__ = [''] - self.modules[import_name] = module - - def __getitem__(self, name): - return self.modules[name] - - def find_module(self, fullname, path=None): - if fullname not in self.modules: - return None - else: - return self - - def load_module(self, fullname): - if fullname not in self.modules: - raise ImportError - else: - sys.modules[fullname] = self.modules[fullname] - return self.modules[fullname] - - def __enter__(self): - self._uncache = uncache(*self.modules.keys()) - self._uncache.__enter__() - return self - - def __exit__(self, *exc_info): - self._uncache.__exit__(None, None, None) - - -def mock_path_hook(*entries, importer): - """A mock sys.path_hooks entry.""" - def hook(entry): - if entry not in entries: - raise ImportError - return importer - return hook - - -def bytecode_path(source_path): - for suffix, _, type_ in imp.get_suffixes(): - if type_ == imp.PY_COMPILED: - bc_suffix = suffix - break - else: - raise ValueError("no bytecode suffix is defined") - return os.path.splitext(source_path)[0] + bc_suffix Modified: python/branches/py3k-issue1717/Lib/importlib/test/test_api.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/test/test_api.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/test/test_api.py Sun Feb 1 11:54:55 2009 @@ -1,6 +1,6 @@ import unittest import importlib -from . import support +from . import util class ImportModuleTests(unittest.TestCase): @@ -9,8 +9,8 @@ def test_module_import(self): # Test importing a top-level module. - with support.mock_modules('top_level') as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules('top_level') as mock: + with util.import_state(meta_path=[mock]): module = importlib.import_module('top_level') self.assertEqual(module.__name__, 'top_level') @@ -19,8 +19,8 @@ pkg_name = 'pkg' pkg_long_name = '{0}.__init__'.format(pkg_name) name = '{0}.mod'.format(pkg_name) - with support.mock_modules(pkg_long_name, name) as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules(pkg_long_name, name) as mock: + with util.import_state(meta_path=[mock]): module = importlib.import_module(name) self.assertEqual(module.__name__, name) @@ -31,8 +31,8 @@ module_name = 'mod' absolute_name = '{0}.{1}'.format(pkg_name, module_name) relative_name = '.{0}'.format(module_name) - with support.mock_modules(pkg_long_name, absolute_name) as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules(pkg_long_name, absolute_name) as mock: + with util.import_state(meta_path=[mock]): module = importlib.import_module(relative_name, pkg_name) self.assertEqual(module.__name__, absolute_name) @@ -42,8 +42,8 @@ pkg_name = 'pkg' pkg_long_name = '{0}.__init__'.format(pkg_name) name = '{0}.mod'.format(pkg_name) - with support.mock_modules(pkg_long_name, name) as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules(pkg_long_name, name) as mock: + with util.import_state(meta_path=[mock]): module = importlib.import_module(name, pkg_name) self.assertEqual(module.__name__, name) Modified: python/branches/py3k-issue1717/Lib/test/test_descr.py ============================================================================== --- python/branches/py3k-issue1717/Lib/test/test_descr.py (original) +++ python/branches/py3k-issue1717/Lib/test/test_descr.py Sun Feb 1 11:54:55 2009 @@ -3885,6 +3885,8 @@ # Testing method-wrapper objects... # did not support any reflection before 2.5 + # XXX should methods really support __eq__? + l = [] self.assertEqual(l.__add__, l.__add__) self.assertEqual(l.__add__, [].__add__) Modified: python/branches/py3k-issue1717/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/unicodeobject.c (original) +++ python/branches/py3k-issue1717/Objects/unicodeobject.c Sun Feb 1 11:54:55 2009 @@ -12,8 +12,8 @@ -------------------------------------------------------------------- The original string type implementation is: - Copyright (c) 1999 by Secret Labs AB - Copyright (c) 1999 by Fredrik Lundh + Copyright (c) 1999 by Secret Labs AB + Copyright (c) 1999 by Fredrik Lundh By obtaining, using, and/or copying this software and/or its associated documentation, you agree that you have read, understood, @@ -125,59 +125,59 @@ /* Fast detection of the most frequent whitespace characters */ const unsigned char _Py_ascii_whitespace[] = { - 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, /* case 0x0009: * HORIZONTAL TABULATION */ /* case 0x000A: * LINE FEED */ /* case 0x000B: * VERTICAL TABULATION */ /* case 0x000C: * FORM FEED */ /* case 0x000D: * CARRIAGE RETURN */ - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, /* case 0x001C: * FILE SEPARATOR */ /* case 0x001D: * GROUP SEPARATOR */ /* case 0x001E: * RECORD SEPARATOR */ /* case 0x001F: * UNIT SEPARATOR */ - 0, 0, 0, 0, 1, 1, 1, 1, + 0, 0, 0, 0, 1, 1, 1, 1, /* case 0x0020: * SPACE */ - 1, 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, 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, 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, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 + 1, 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, 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, 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, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 }; /* Same for linebreaks */ static unsigned char ascii_linebreak[] = { - 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x000A, * LINE FEED */ /* 0x000D, * CARRIAGE RETURN */ - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x001C, * FILE SEPARATOR */ /* 0x001D, * GROUP SEPARATOR */ /* 0x001E, * RECORD SEPARATOR */ - 0, 0, 0, 0, 1, 1, 1, 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, 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, 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, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 + 0, 0, 0, 0, 1, 1, 1, 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, 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, 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, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -185,11 +185,11 @@ PyUnicode_GetMax(void) { #ifdef Py_UNICODE_WIDE - return 0x10FFFF; + return 0x10FFFF; #else - /* This is actually an illegal character, so it should - not be passed to unichr. */ - return 0xFFFF; + /* This is actually an illegal character, so it should + not be passed to unichr. */ + return 0xFFFF; #endif } @@ -207,9 +207,9 @@ #define BLOOM(mask, ch) ((mask & (1 << ((ch) & 0x1F)))) -#define BLOOM_LINEBREAK(ch) \ - ((ch) < 128U ? ascii_linebreak[(ch)] : \ - (BLOOM(bloom_linebreak, (ch)) && Py_UNICODE_ISLINEBREAK(ch))) +#define BLOOM_LINEBREAK(ch) \ + ((ch) < 128U ? ascii_linebreak[(ch)] : \ + (BLOOM(bloom_linebreak, (ch)) && Py_UNICODE_ISLINEBREAK(ch))) Py_LOCAL_INLINE(BLOOM_MASK) make_bloom_mask(Py_UNICODE* ptr, Py_ssize_t len) { @@ -236,29 +236,29 @@ return 0; } -#define BLOOM_MEMBER(mask, chr, set, setlen)\ +#define BLOOM_MEMBER(mask, chr, set, setlen) \ BLOOM(mask, chr) && unicode_member(chr, set, setlen) /* --- Unicode Object ----------------------------------------------------- */ static int unicode_resize(register PyUnicodeObject *unicode, - Py_ssize_t length) + Py_ssize_t length) { void *oldstr; /* Shortcut if there's nothing much to do. */ if (unicode->length == length) - goto reset; + goto reset; /* Resizing shared object (unicode_empty or single character objects) in-place is not allowed. Use PyUnicode_Resize() instead ! */ - if (unicode == unicode_empty || - (unicode->length == 1 && - unicode->str[0] < 256U && - unicode_latin1[unicode->str[0]] == unicode)) { + if (unicode == unicode_empty || + (unicode->length == 1 && + unicode->str[0] < 256U && + unicode_latin1[unicode->str[0]] == unicode)) { PyErr_SetString(PyExc_SystemError, "can't resize shared str objects"); return -1; @@ -271,16 +271,16 @@ oldstr = unicode->str; unicode->str = PyObject_REALLOC(unicode->str, - sizeof(Py_UNICODE) * (length + 1)); + sizeof(Py_UNICODE) * (length + 1)); if (!unicode->str) { - unicode->str = (Py_UNICODE *)oldstr; + unicode->str = (Py_UNICODE *)oldstr; PyErr_NoMemory(); return -1; } unicode->str[length] = 0; unicode->length = length; - reset: + reset: /* Reset the object caches */ if (unicode->defenc) { Py_DECREF(unicode->defenc); @@ -296,7 +296,7 @@ relies on that. XXX This allocator could further be enhanced by assuring that the - free list never reduces its size below 1. + free list never reduces its size below 1. */ @@ -321,33 +321,33 @@ unicode = free_list; free_list = *(PyUnicodeObject **)unicode; numfree--; - if (unicode->str) { - /* Keep-Alive optimization: we only upsize the buffer, - never downsize it. */ - if ((unicode->length < length) && + if (unicode->str) { + /* Keep-Alive optimization: we only upsize the buffer, + never downsize it. */ + if ((unicode->length < length) && unicode_resize(unicode, length) < 0) { - PyObject_DEL(unicode->str); - unicode->str = NULL; - } - } + PyObject_DEL(unicode->str); + unicode->str = NULL; + } + } else { - size_t new_size = sizeof(Py_UNICODE) * ((size_t)length + 1); - unicode->str = (Py_UNICODE*) PyObject_MALLOC(new_size); + size_t new_size = sizeof(Py_UNICODE) * ((size_t)length + 1); + unicode->str = (Py_UNICODE*) PyObject_MALLOC(new_size); } PyObject_INIT(unicode, &PyUnicode_Type); } else { - size_t new_size; + size_t new_size; unicode = PyObject_New(PyUnicodeObject, &PyUnicode_Type); if (unicode == NULL) return NULL; - new_size = sizeof(Py_UNICODE) * ((size_t)length + 1); - unicode->str = (Py_UNICODE*) PyObject_MALLOC(new_size); + new_size = sizeof(Py_UNICODE) * ((size_t)length + 1); + unicode->str = (Py_UNICODE*) PyObject_MALLOC(new_size); } if (!unicode->str) { - PyErr_NoMemory(); - goto onError; + PyErr_NoMemory(); + goto onError; } /* Initialize the first element to guard against cases where * the caller fails before initializing str -- unicode_resize() @@ -364,7 +364,7 @@ unicode->defenc = NULL; return unicode; - onError: + onError: /* XXX UNREF/NEWREF interface should be more symmetrical */ _Py_DEC_REFTOTAL; _Py_ForgetReference((PyObject *)unicode); @@ -376,45 +376,45 @@ void unicode_dealloc(register PyUnicodeObject *unicode) { switch (PyUnicode_CHECK_INTERNED(unicode)) { - case SSTATE_NOT_INTERNED: - break; + case SSTATE_NOT_INTERNED: + break; - case SSTATE_INTERNED_MORTAL: - /* revive dead object temporarily for DelItem */ - Py_REFCNT(unicode) = 3; - if (PyDict_DelItem(interned, (PyObject *)unicode) != 0) - Py_FatalError( - "deletion of interned string failed"); - break; + case SSTATE_INTERNED_MORTAL: + /* revive dead object temporarily for DelItem */ + Py_REFCNT(unicode) = 3; + if (PyDict_DelItem(interned, (PyObject *)unicode) != 0) + Py_FatalError( + "deletion of interned string failed"); + break; - case SSTATE_INTERNED_IMMORTAL: - Py_FatalError("Immortal interned string died."); + case SSTATE_INTERNED_IMMORTAL: + Py_FatalError("Immortal interned string died."); - default: - Py_FatalError("Inconsistent interned string state."); + default: + Py_FatalError("Inconsistent interned string state."); } if (PyUnicode_CheckExact(unicode) && - numfree < PyUnicode_MAXFREELIST) { + numfree < PyUnicode_MAXFREELIST) { /* Keep-Alive optimization */ - if (unicode->length >= KEEPALIVE_SIZE_LIMIT) { - PyObject_DEL(unicode->str); - unicode->str = NULL; - unicode->length = 0; - } - if (unicode->defenc) { - Py_DECREF(unicode->defenc); - unicode->defenc = NULL; - } - /* Add to free list */ + if (unicode->length >= KEEPALIVE_SIZE_LIMIT) { + PyObject_DEL(unicode->str); + unicode->str = NULL; + unicode->length = 0; + } + if (unicode->defenc) { + Py_DECREF(unicode->defenc); + unicode->defenc = NULL; + } + /* Add to free list */ *(PyUnicodeObject **)unicode = free_list; free_list = unicode; numfree++; } else { - PyObject_DEL(unicode->str); - Py_XDECREF(unicode->defenc); - Py_TYPE(unicode)->tp_free((PyObject *)unicode); + PyObject_DEL(unicode->str); + Py_XDECREF(unicode->defenc); + Py_TYPE(unicode)->tp_free((PyObject *)unicode); } } @@ -425,28 +425,28 @@ /* Argument checks */ if (unicode == NULL) { - PyErr_BadInternalCall(); - return -1; + PyErr_BadInternalCall(); + return -1; } v = *unicode; if (v == NULL || !PyUnicode_Check(v) || Py_REFCNT(v) != 1 || length < 0) { - PyErr_BadInternalCall(); - return -1; + PyErr_BadInternalCall(); + return -1; } /* Resizing unicode_empty and single character objects is not possible since these are being shared. We simply return a fresh copy with the same Unicode content. */ if (v->length != length && - (v == unicode_empty || v->length == 1)) { - PyUnicodeObject *w = _PyUnicode_New(length); - if (w == NULL) - return -1; - Py_UNICODE_COPY(w->str, v->str, - length < v->length ? length : v->length); - Py_DECREF(*unicode); - *unicode = w; - return 0; + (v == unicode_empty || v->length == 1)) { + PyUnicodeObject *w = _PyUnicode_New(length); + if (w == NULL) + return -1; + Py_UNICODE_COPY(w->str, v->str, + length < v->length ? length : v->length); + Py_DECREF(*unicode); + *unicode = w; + return 0; } /* Note that we don't have to modify *unicode for unshared Unicode @@ -460,7 +460,7 @@ } PyObject *PyUnicode_FromUnicode(const Py_UNICODE *u, - Py_ssize_t size) + Py_ssize_t size) { PyUnicodeObject *unicode; @@ -468,26 +468,26 @@ some optimizations which share commonly used objects. */ if (u != NULL) { - /* Optimization for empty strings */ - if (size == 0 && unicode_empty != NULL) { - Py_INCREF(unicode_empty); - return (PyObject *)unicode_empty; - } - - /* Single character Unicode objects in the Latin-1 range are - shared when using this constructor */ - if (size == 1 && *u < 256) { - unicode = unicode_latin1[*u]; - if (!unicode) { - unicode = _PyUnicode_New(1); - if (!unicode) - return NULL; - unicode->str[0] = *u; - unicode_latin1[*u] = unicode; - } - Py_INCREF(unicode); - return (PyObject *)unicode; - } + /* Optimization for empty strings */ + if (size == 0 && unicode_empty != NULL) { + Py_INCREF(unicode_empty); + return (PyObject *)unicode_empty; + } + + /* Single character Unicode objects in the Latin-1 range are + shared when using this constructor */ + if (size == 1 && *u < 256) { + unicode = unicode_latin1[*u]; + if (!unicode) { + unicode = _PyUnicode_New(1); + if (!unicode) + return NULL; + unicode->str[0] = *u; + unicode_latin1[*u] = unicode; + } + Py_INCREF(unicode); + return (PyObject *)unicode; + } } unicode = _PyUnicode_New(size); @@ -496,7 +496,7 @@ /* Copy the Unicode data into the new object */ if (u != NULL) - Py_UNICODE_COPY(unicode->str, u, size); + Py_UNICODE_COPY(unicode->str, u, size); return (PyObject *)unicode; } @@ -505,11 +505,11 @@ { PyUnicodeObject *unicode; - if (size < 0) { - PyErr_SetString(PyExc_SystemError, - "Negative size passed to PyUnicode_FromStringAndSize"); - return NULL; - } + if (size < 0) { + PyErr_SetString(PyExc_SystemError, + "Negative size passed to PyUnicode_FromStringAndSize"); + return NULL; + } /* If the Unicode data is known at construction time, we can apply some optimizations which share commonly used objects. @@ -517,26 +517,26 @@ UTF-8 decoder at the end. */ if (u != NULL) { - /* Optimization for empty strings */ - if (size == 0 && unicode_empty != NULL) { - Py_INCREF(unicode_empty); - return (PyObject *)unicode_empty; - } + /* Optimization for empty strings */ + if (size == 0 && unicode_empty != NULL) { + Py_INCREF(unicode_empty); + return (PyObject *)unicode_empty; + } - /* Single characters are shared when using this constructor. + /* Single characters are shared when using this constructor. Restrict to ASCII, since the input must be UTF-8. */ - if (size == 1 && Py_CHARMASK(*u) < 128) { - unicode = unicode_latin1[Py_CHARMASK(*u)]; - if (!unicode) { - unicode = _PyUnicode_New(1); - if (!unicode) - return NULL; - unicode->str[0] = Py_CHARMASK(*u); - unicode_latin1[Py_CHARMASK(*u)] = unicode; - } - Py_INCREF(unicode); - return (PyObject *)unicode; - } + if (size == 1 && Py_CHARMASK(*u) < 128) { + unicode = unicode_latin1[Py_CHARMASK(*u)]; + if (!unicode) { + unicode = _PyUnicode_New(1); + if (!unicode) + return NULL; + unicode->str[0] = Py_CHARMASK(*u); + unicode_latin1[Py_CHARMASK(*u)] = unicode; + } + Py_INCREF(unicode); + return (PyObject *)unicode; + } return PyUnicode_DecodeUTF8(u, size, NULL); } @@ -562,15 +562,15 @@ #ifdef HAVE_WCHAR_H PyObject *PyUnicode_FromWideChar(register const wchar_t *w, - Py_ssize_t size) + Py_ssize_t size) { PyUnicodeObject *unicode; if (w == NULL) { if (size == 0) return PyUnicode_FromStringAndSize(NULL, 0); - PyErr_BadInternalCall(); - return NULL; + PyErr_BadInternalCall(); + return NULL; } if (size == -1) { @@ -586,11 +586,11 @@ memcpy(unicode->str, w, size * sizeof(wchar_t)); #else { - register Py_UNICODE *u; - register Py_ssize_t i; - u = PyUnicode_AS_UNICODE(unicode); - for (i = size; i > 0; i--) - *u++ = *w++; + register Py_UNICODE *u; + register Py_ssize_t i; + u = PyUnicode_AS_UNICODE(unicode); + for (i = size; i > 0; i--) + *u++ = *w++; } #endif @@ -600,23 +600,23 @@ static void makefmt(char *fmt, int longflag, int size_tflag, int zeropad, int width, int precision, char c) { - *fmt++ = '%'; - if (width) { - if (zeropad) - *fmt++ = '0'; - fmt += sprintf(fmt, "%d", width); - } - if (precision) - fmt += sprintf(fmt, ".%d", precision); - if (longflag) - *fmt++ = 'l'; - else if (size_tflag) { - char *f = PY_FORMAT_SIZE_T; - while (*f) - *fmt++ = *f++; - } - *fmt++ = c; - *fmt = '\0'; + *fmt++ = '%'; + if (width) { + if (zeropad) + *fmt++ = '0'; + fmt += sprintf(fmt, "%d", width); + } + if (precision) + fmt += sprintf(fmt, ".%d", precision); + if (longflag) + *fmt++ = 'l'; + else if (size_tflag) { + char *f = PY_FORMAT_SIZE_T; + while (*f) + *fmt++ = *f++; + } + *fmt++ = c; + *fmt = '\0'; } #define appendstring(string) {for (copy = string;*copy;) *s++ = *copy++;} @@ -624,387 +624,387 @@ PyObject * PyUnicode_FromFormatV(const char *format, va_list vargs) { - va_list count; - Py_ssize_t callcount = 0; - PyObject **callresults = NULL; - PyObject **callresult = NULL; - Py_ssize_t n = 0; - int width = 0; - int precision = 0; - int zeropad; - const char* f; - Py_UNICODE *s; - PyObject *string; - /* used by sprintf */ - char buffer[21]; - /* use abuffer instead of buffer, if we need more space - * (which can happen if there's a format specifier with width). */ - char *abuffer = NULL; - char *realbuffer; - Py_ssize_t abuffersize = 0; - char fmt[60]; /* should be enough for %0width.precisionld */ - const char *copy; + va_list count; + Py_ssize_t callcount = 0; + PyObject **callresults = NULL; + PyObject **callresult = NULL; + Py_ssize_t n = 0; + int width = 0; + int precision = 0; + int zeropad; + const char* f; + Py_UNICODE *s; + PyObject *string; + /* used by sprintf */ + char buffer[21]; + /* use abuffer instead of buffer, if we need more space + * (which can happen if there's a format specifier with width). */ + char *abuffer = NULL; + char *realbuffer; + Py_ssize_t abuffersize = 0; + char fmt[60]; /* should be enough for %0width.precisionld */ + const char *copy; #ifdef VA_LIST_IS_ARRAY - Py_MEMCPY(count, vargs, sizeof(va_list)); + Py_MEMCPY(count, vargs, sizeof(va_list)); #else #ifdef __va_copy - __va_copy(count, vargs); + __va_copy(count, vargs); #else - count = vargs; + 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) */ - for (f = format; *f; f++) { - if (*f == '%' && (*(f+1)=='S' || *(f+1)=='R' || *(f+1)=='A')) - ++callcount; - } - /* step 2: allocate memory for the results of - * PyObject_Str()/PyObject_Repr() calls */ - if (callcount) { - callresults = PyObject_Malloc(sizeof(PyObject *)*callcount); - if (!callresults) { - PyErr_NoMemory(); - return NULL; - } - callresult = callresults; - } - /* step 3: figure out how large a buffer we need */ - for (f = format; *f; f++) { - if (*f == '%') { - const char* p = f; - width = 0; - while (ISDIGIT((unsigned)*f)) - width = (width*10) + *f++ - '0'; - while (*++f && *f != '%' && !ISALPHA((unsigned)*f)) - ; - - /* skip the 'l' or 'z' in {%ld, %zd, %lu, %zu} since - * they don't affect the amount of space we reserve. - */ - if ((*f == 'l' || *f == 'z') && - (f[1] == 'd' || f[1] == 'u')) - ++f; - - switch (*f) { - case 'c': - (void)va_arg(count, int); - /* fall through... */ - case '%': - n++; - break; - case 'd': case 'u': case 'i': case 'x': - (void) va_arg(count, int); - /* 20 bytes is enough to hold a 64-bit - integer. Decimal takes the most space. - This isn't enough for octal. - If a width is specified we need more - (which we allocate later). */ - if (width < 20) - width = 20; - n += width; - if (abuffersize < width) - abuffersize = width; - break; - 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++; - } - } - break; - } - case 'U': - { - PyObject *obj = va_arg(count, PyObject *); - assert(obj && PyUnicode_Check(obj)); - n += PyUnicode_GET_SIZE(obj); - break; - } - case 'V': - { - PyObject *obj = va_arg(count, PyObject *); - const char *str = va_arg(count, const char *); - assert(obj || str); - assert(!obj || PyUnicode_Check(obj)); - if (obj) - n += PyUnicode_GET_SIZE(obj); - else - n += strlen(str); - break; - } - case 'S': - { - PyObject *obj = va_arg(count, PyObject *); - PyObject *str; - assert(obj); - str = PyObject_Str(obj); - if (!str) - goto fail; - n += PyUnicode_GET_SIZE(str); - /* Remember the str and switch to the next slot */ - *callresult++ = str; - break; - } - case 'R': - { - PyObject *obj = va_arg(count, PyObject *); - PyObject *repr; - assert(obj); - repr = PyObject_Repr(obj); - if (!repr) - goto fail; - n += PyUnicode_GET_SIZE(repr); - /* Remember the repr and switch to the next slot */ - *callresult++ = repr; - break; - } - case 'A': - { - PyObject *obj = va_arg(count, PyObject *); - PyObject *ascii; - assert(obj); - ascii = PyObject_ASCII(obj); - if (!ascii) - goto fail; - n += PyUnicode_GET_SIZE(ascii); - /* Remember the repr and switch to the next slot */ - *callresult++ = ascii; - break; - } - case 'p': - (void) va_arg(count, int); - /* maximum 64-bit pointer representation: - * 0xffffffffffffffff - * so 19 characters is enough. - * XXX I count 18 -- what's the extra for? - */ - n += 19; - break; - default: - /* if we stumble upon an unknown - formatting code, copy the rest of - the format string to the output - string. (we cannot just skip the - code, since there's no way to know - what's in the argument list) */ - n += strlen(p); - goto expand; - } - } else - n++; - } - expand: - if (abuffersize > 20) { - abuffer = PyObject_Malloc(abuffersize); - if (!abuffer) { - PyErr_NoMemory(); - goto fail; - } - realbuffer = abuffer; - } - else - realbuffer = buffer; - /* step 4: fill the buffer */ - /* Since we've analyzed how much space we need for the worst case, - we don't have to resize the string. - There can be no errors beyond this point. */ - string = PyUnicode_FromUnicode(NULL, n); - if (!string) - goto fail; - - s = PyUnicode_AS_UNICODE(string); - callresult = callresults; - - for (f = format; *f; f++) { - if (*f == '%') { - const char* p = f++; - int longflag = 0; - int size_tflag = 0; - zeropad = (*f == '0'); - /* parse the width.precision part */ - width = 0; - while (ISDIGIT((unsigned)*f)) - width = (width*10) + *f++ - '0'; - precision = 0; - if (*f == '.') { - f++; - while (ISDIGIT((unsigned)*f)) - precision = (precision*10) + *f++ - '0'; - } - /* handle the long flag, but only for %ld and %lu. - others can be added when necessary. */ - if (*f == 'l' && (f[1] == 'd' || f[1] == 'u')) { - longflag = 1; - ++f; - } - /* handle the size_t flag. */ - if (*f == 'z' && (f[1] == 'd' || f[1] == 'u')) { - size_tflag = 1; - ++f; - } - - switch (*f) { - case 'c': - *s++ = va_arg(vargs, int); - break; - case 'd': - makefmt(fmt, longflag, size_tflag, zeropad, width, precision, 'd'); - if (longflag) - sprintf(realbuffer, fmt, va_arg(vargs, long)); - else if (size_tflag) - sprintf(realbuffer, fmt, va_arg(vargs, Py_ssize_t)); - else - sprintf(realbuffer, fmt, va_arg(vargs, int)); - appendstring(realbuffer); - break; - case 'u': - makefmt(fmt, longflag, size_tflag, zeropad, width, precision, 'u'); - if (longflag) - sprintf(realbuffer, fmt, va_arg(vargs, unsigned long)); - else if (size_tflag) - sprintf(realbuffer, fmt, va_arg(vargs, size_t)); - else - sprintf(realbuffer, fmt, va_arg(vargs, unsigned int)); - appendstring(realbuffer); - break; - case 'i': - makefmt(fmt, 0, 0, zeropad, width, precision, 'i'); - sprintf(realbuffer, fmt, va_arg(vargs, int)); - appendstring(realbuffer); - break; - case 'x': - makefmt(fmt, 0, 0, zeropad, width, precision, 'x'); - sprintf(realbuffer, fmt, va_arg(vargs, int)); - appendstring(realbuffer); - 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); - break; - } - case 'U': - { - PyObject *obj = va_arg(vargs, PyObject *); - Py_ssize_t size = PyUnicode_GET_SIZE(obj); - Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(obj), size); - s += size; - break; - } - case 'V': - { - PyObject *obj = va_arg(vargs, PyObject *); - const char *str = va_arg(vargs, const char *); - if (obj) { - Py_ssize_t size = PyUnicode_GET_SIZE(obj); - Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(obj), size); - s += size; - } else { - appendstring(str); - } - break; - } - case 'S': - case 'R': - { - Py_UNICODE *ucopy; - Py_ssize_t usize; - Py_ssize_t upos; - /* unused, since we already have the result */ - (void) va_arg(vargs, PyObject *); - ucopy = PyUnicode_AS_UNICODE(*callresult); - usize = PyUnicode_GET_SIZE(*callresult); - for (upos = 0; upos forget it */ - Py_DECREF(*callresult); - /* switch to next unicode()/repr() result */ - ++callresult; - break; - } - case 'p': - sprintf(buffer, "%p", va_arg(vargs, void*)); - /* %p is ill-defined: ensure leading 0x. */ - if (buffer[1] == 'X') - buffer[1] = 'x'; - else if (buffer[1] != 'x') { - memmove(buffer+2, buffer, strlen(buffer)+1); - buffer[0] = '0'; - buffer[1] = 'x'; - } - appendstring(buffer); - break; - case '%': - *s++ = '%'; - break; - default: - appendstring(p); - goto end; - } - } else - *s++ = *f; - } - - end: - if (callresults) - PyObject_Free(callresults); - if (abuffer) - PyObject_Free(abuffer); - PyUnicode_Resize(&string, s - PyUnicode_AS_UNICODE(string)); - return string; - fail: - if (callresults) { - PyObject **callresult2 = callresults; - while (callresult2 < callresult) { - Py_DECREF(*callresult2); - ++callresult2; - } - PyObject_Free(callresults); - } - if (abuffer) - PyObject_Free(abuffer); - return NULL; + /* 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) */ + for (f = format; *f; f++) { + if (*f == '%' && (*(f+1)=='S' || *(f+1)=='R' || *(f+1)=='A')) + ++callcount; + } + /* step 2: allocate memory for the results of + * PyObject_Str()/PyObject_Repr() calls */ + if (callcount) { + callresults = PyObject_Malloc(sizeof(PyObject *)*callcount); + if (!callresults) { + PyErr_NoMemory(); + return NULL; + } + callresult = callresults; + } + /* step 3: figure out how large a buffer we need */ + for (f = format; *f; f++) { + if (*f == '%') { + const char* p = f; + width = 0; + while (ISDIGIT((unsigned)*f)) + width = (width*10) + *f++ - '0'; + while (*++f && *f != '%' && !ISALPHA((unsigned)*f)) + ; + + /* skip the 'l' or 'z' in {%ld, %zd, %lu, %zu} since + * they don't affect the amount of space we reserve. + */ + if ((*f == 'l' || *f == 'z') && + (f[1] == 'd' || f[1] == 'u')) + ++f; + + switch (*f) { + case 'c': + (void)va_arg(count, int); + /* fall through... */ + case '%': + n++; + break; + case 'd': case 'u': case 'i': case 'x': + (void) va_arg(count, int); + /* 20 bytes is enough to hold a 64-bit + integer. Decimal takes the most space. + This isn't enough for octal. + If a width is specified we need more + (which we allocate later). */ + if (width < 20) + width = 20; + n += width; + if (abuffersize < width) + abuffersize = width; + break; + 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++; + } + } + break; + } + case 'U': + { + PyObject *obj = va_arg(count, PyObject *); + assert(obj && PyUnicode_Check(obj)); + n += PyUnicode_GET_SIZE(obj); + break; + } + case 'V': + { + PyObject *obj = va_arg(count, PyObject *); + const char *str = va_arg(count, const char *); + assert(obj || str); + assert(!obj || PyUnicode_Check(obj)); + if (obj) + n += PyUnicode_GET_SIZE(obj); + else + n += strlen(str); + break; + } + case 'S': + { + PyObject *obj = va_arg(count, PyObject *); + PyObject *str; + assert(obj); + str = PyObject_Str(obj); + if (!str) + goto fail; + n += PyUnicode_GET_SIZE(str); + /* Remember the str and switch to the next slot */ + *callresult++ = str; + break; + } + case 'R': + { + PyObject *obj = va_arg(count, PyObject *); + PyObject *repr; + assert(obj); + repr = PyObject_Repr(obj); + if (!repr) + goto fail; + n += PyUnicode_GET_SIZE(repr); + /* Remember the repr and switch to the next slot */ + *callresult++ = repr; + break; + } + case 'A': + { + PyObject *obj = va_arg(count, PyObject *); + PyObject *ascii; + assert(obj); + ascii = PyObject_ASCII(obj); + if (!ascii) + goto fail; + n += PyUnicode_GET_SIZE(ascii); + /* Remember the repr and switch to the next slot */ + *callresult++ = ascii; + break; + } + case 'p': + (void) va_arg(count, int); + /* maximum 64-bit pointer representation: + * 0xffffffffffffffff + * so 19 characters is enough. + * XXX I count 18 -- what's the extra for? + */ + n += 19; + break; + default: + /* if we stumble upon an unknown + formatting code, copy the rest of + the format string to the output + string. (we cannot just skip the + code, since there's no way to know + what's in the argument list) */ + n += strlen(p); + goto expand; + } + } else + n++; + } + expand: + if (abuffersize > 20) { + abuffer = PyObject_Malloc(abuffersize); + if (!abuffer) { + PyErr_NoMemory(); + goto fail; + } + realbuffer = abuffer; + } + else + realbuffer = buffer; + /* step 4: fill the buffer */ + /* Since we've analyzed how much space we need for the worst case, + we don't have to resize the string. + There can be no errors beyond this point. */ + string = PyUnicode_FromUnicode(NULL, n); + if (!string) + goto fail; + + s = PyUnicode_AS_UNICODE(string); + callresult = callresults; + + for (f = format; *f; f++) { + if (*f == '%') { + const char* p = f++; + int longflag = 0; + int size_tflag = 0; + zeropad = (*f == '0'); + /* parse the width.precision part */ + width = 0; + while (ISDIGIT((unsigned)*f)) + width = (width*10) + *f++ - '0'; + precision = 0; + if (*f == '.') { + f++; + while (ISDIGIT((unsigned)*f)) + precision = (precision*10) + *f++ - '0'; + } + /* handle the long flag, but only for %ld and %lu. + others can be added when necessary. */ + if (*f == 'l' && (f[1] == 'd' || f[1] == 'u')) { + longflag = 1; + ++f; + } + /* handle the size_t flag. */ + if (*f == 'z' && (f[1] == 'd' || f[1] == 'u')) { + size_tflag = 1; + ++f; + } + + switch (*f) { + case 'c': + *s++ = va_arg(vargs, int); + break; + case 'd': + makefmt(fmt, longflag, size_tflag, zeropad, width, precision, 'd'); + if (longflag) + sprintf(realbuffer, fmt, va_arg(vargs, long)); + else if (size_tflag) + sprintf(realbuffer, fmt, va_arg(vargs, Py_ssize_t)); + else + sprintf(realbuffer, fmt, va_arg(vargs, int)); + appendstring(realbuffer); + break; + case 'u': + makefmt(fmt, longflag, size_tflag, zeropad, width, precision, 'u'); + if (longflag) + sprintf(realbuffer, fmt, va_arg(vargs, unsigned long)); + else if (size_tflag) + sprintf(realbuffer, fmt, va_arg(vargs, size_t)); + else + sprintf(realbuffer, fmt, va_arg(vargs, unsigned int)); + appendstring(realbuffer); + break; + case 'i': + makefmt(fmt, 0, 0, zeropad, width, precision, 'i'); + sprintf(realbuffer, fmt, va_arg(vargs, int)); + appendstring(realbuffer); + break; + case 'x': + makefmt(fmt, 0, 0, zeropad, width, precision, 'x'); + sprintf(realbuffer, fmt, va_arg(vargs, int)); + appendstring(realbuffer); + 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); + break; + } + case 'U': + { + PyObject *obj = va_arg(vargs, PyObject *); + Py_ssize_t size = PyUnicode_GET_SIZE(obj); + Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(obj), size); + s += size; + break; + } + case 'V': + { + PyObject *obj = va_arg(vargs, PyObject *); + const char *str = va_arg(vargs, const char *); + if (obj) { + Py_ssize_t size = PyUnicode_GET_SIZE(obj); + Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(obj), size); + s += size; + } else { + appendstring(str); + } + break; + } + case 'S': + case 'R': + { + Py_UNICODE *ucopy; + Py_ssize_t usize; + Py_ssize_t upos; + /* unused, since we already have the result */ + (void) va_arg(vargs, PyObject *); + ucopy = PyUnicode_AS_UNICODE(*callresult); + usize = PyUnicode_GET_SIZE(*callresult); + for (upos = 0; upos forget it */ + Py_DECREF(*callresult); + /* switch to next unicode()/repr() result */ + ++callresult; + break; + } + case 'p': + sprintf(buffer, "%p", va_arg(vargs, void*)); + /* %p is ill-defined: ensure leading 0x. */ + if (buffer[1] == 'X') + buffer[1] = 'x'; + else if (buffer[1] != 'x') { + memmove(buffer+2, buffer, strlen(buffer)+1); + buffer[0] = '0'; + buffer[1] = 'x'; + } + appendstring(buffer); + break; + case '%': + *s++ = '%'; + break; + default: + appendstring(p); + goto end; + } + } else + *s++ = *f; + } + + end: + if (callresults) + PyObject_Free(callresults); + if (abuffer) + PyObject_Free(abuffer); + PyUnicode_Resize(&string, s - PyUnicode_AS_UNICODE(string)); + return string; + fail: + if (callresults) { + PyObject **callresult2 = callresults; + while (callresult2 < callresult) { + Py_DECREF(*callresult2); + ++callresult2; + } + PyObject_Free(callresults); + } + if (abuffer) + PyObject_Free(abuffer); + return NULL; } #undef appendstring @@ -1012,48 +1012,48 @@ PyObject * PyUnicode_FromFormat(const char *format, ...) { - PyObject* ret; - va_list vargs; + PyObject* ret; + va_list vargs; #ifdef HAVE_STDARG_PROTOTYPES - va_start(vargs, format); + va_start(vargs, format); #else - va_start(vargs); + va_start(vargs); #endif - ret = PyUnicode_FromFormatV(format, vargs); - va_end(vargs); - return ret; + ret = PyUnicode_FromFormatV(format, vargs); + va_end(vargs); + return ret; } Py_ssize_t PyUnicode_AsWideChar(PyUnicodeObject *unicode, - wchar_t *w, - Py_ssize_t size) + wchar_t *w, + Py_ssize_t size) { if (unicode == NULL) { - PyErr_BadInternalCall(); - return -1; + PyErr_BadInternalCall(); + return -1; } /* If possible, try to copy the 0-termination as well */ if (size > PyUnicode_GET_SIZE(unicode)) - size = PyUnicode_GET_SIZE(unicode) + 1; + size = PyUnicode_GET_SIZE(unicode) + 1; #ifdef HAVE_USABLE_WCHAR_T memcpy(w, unicode->str, size * sizeof(wchar_t)); #else { - register Py_UNICODE *u; - register Py_ssize_t i; - u = PyUnicode_AS_UNICODE(unicode); - for (i = size; i > 0; i--) - *w++ = *u++; + register Py_UNICODE *u; + register Py_ssize_t i; + u = PyUnicode_AS_UNICODE(unicode); + for (i = size; i > 0; i--) + *w++ = *u++; } #endif if (size > PyUnicode_GET_SIZE(unicode)) return PyUnicode_GET_SIZE(unicode); else - return size; + return size; } #endif @@ -1063,9 +1063,9 @@ Py_UNICODE s[2]; if (ordinal < 0 || ordinal > 0x10ffff) { - PyErr_SetString(PyExc_ValueError, - "chr() arg not in range(0x110000)"); - return NULL; + PyErr_SetString(PyExc_ValueError, + "chr() arg not in range(0x110000)"); + return NULL; } #ifndef Py_UNICODE_WIDE @@ -1084,16 +1084,16 @@ PyObject *PyUnicode_FromObject(register PyObject *obj) { /* XXX Perhaps we should make this API an alias of - PyObject_Str() instead ?! */ + PyObject_Str() instead ?! */ if (PyUnicode_CheckExact(obj)) { - Py_INCREF(obj); - return obj; + Py_INCREF(obj); + return obj; } if (PyUnicode_Check(obj)) { - /* For a Unicode subtype that's not a Unicode object, - return a true Unicode object with the same data. */ - return PyUnicode_FromUnicode(PyUnicode_AS_UNICODE(obj), - PyUnicode_GET_SIZE(obj)); + /* For a Unicode subtype that's not a Unicode object, + return a true Unicode object with the same data. */ + return PyUnicode_FromUnicode(PyUnicode_AS_UNICODE(obj), + PyUnicode_GET_SIZE(obj)); } PyErr_Format(PyExc_TypeError, "Can't convert '%.100s' object to str implicitly", @@ -1102,23 +1102,23 @@ } PyObject *PyUnicode_FromEncodedObject(register PyObject *obj, - const char *encoding, - const char *errors) + const char *encoding, + const char *errors) { const char *s = NULL; Py_ssize_t len; PyObject *v; if (obj == NULL) { - PyErr_BadInternalCall(); - return NULL; + PyErr_BadInternalCall(); + return NULL; } if (PyUnicode_Check(obj)) { - PyErr_SetString(PyExc_TypeError, - "decoding str is not supported"); - return NULL; - } + PyErr_SetString(PyExc_TypeError, + "decoding str is not supported"); + return NULL; + } /* Coerce object */ if (PyBytes_Check(obj)) { @@ -1130,34 +1130,34 @@ len = PyByteArray_GET_SIZE(obj); } else if (PyObject_AsCharBuffer(obj, &s, &len)) { - /* Overwrite the error message with something more useful in - case of a TypeError. */ - if (PyErr_ExceptionMatches(PyExc_TypeError)) + /* Overwrite the error message with something more useful in + case of a TypeError. */ + if (PyErr_ExceptionMatches(PyExc_TypeError)) PyErr_Format(PyExc_TypeError, - "coercing to str: need string or buffer, " - "%.80s found", - Py_TYPE(obj)->tp_name); - goto onError; + "coercing to str: need string or buffer, " + "%.80s found", + Py_TYPE(obj)->tp_name); + goto onError; } /* Convert to Unicode */ if (len == 0) { - Py_INCREF(unicode_empty); - v = (PyObject *)unicode_empty; + Py_INCREF(unicode_empty); + v = (PyObject *)unicode_empty; } else - v = PyUnicode_Decode(s, len, encoding, errors); + v = PyUnicode_Decode(s, len, encoding, errors); return v; - onError: + onError: return NULL; } PyObject *PyUnicode_Decode(const char *s, - Py_ssize_t size, - const char *encoding, - const char *errors) + Py_ssize_t size, + const char *encoding, + const char *errors) { PyObject *buffer = NULL, *unicode; Py_buffer info; @@ -1223,7 +1223,7 @@ Py_DECREF(buffer); return unicode; - onError: + onError: Py_XDECREF(buffer); return NULL; } @@ -1240,7 +1240,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Decode via the codec registry */ v = PyCodec_Decode(unicode, encoding, errors); @@ -1248,7 +1248,7 @@ goto onError; return v; - onError: + onError: return NULL; } @@ -1264,7 +1264,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Decode via the codec registry */ v = PyCodec_Decode(unicode, encoding, errors); @@ -1279,20 +1279,20 @@ } return v; - onError: + onError: return NULL; } PyObject *PyUnicode_Encode(const Py_UNICODE *s, - Py_ssize_t size, - const char *encoding, - const char *errors) + Py_ssize_t size, + const char *encoding, + const char *errors) { PyObject *v, *unicode; unicode = PyUnicode_FromUnicode(s, size); if (unicode == NULL) - return NULL; + return NULL; v = PyUnicode_AsEncodedString(unicode, encoding, errors); Py_DECREF(unicode); return v; @@ -1310,7 +1310,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Encode via the codec registry */ v = PyCodec_Encode(unicode, encoding, errors); @@ -1318,7 +1318,7 @@ goto onError; return v; - onError: + onError: return NULL; } @@ -1334,20 +1334,20 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Shortcuts for common default encodings */ if (errors == NULL) { - if (strcmp(encoding, "utf-8") == 0) - return PyUnicode_AsUTF8String(unicode); - else if (strcmp(encoding, "latin-1") == 0) - return PyUnicode_AsLatin1String(unicode); + if (strcmp(encoding, "utf-8") == 0) + return PyUnicode_AsUTF8String(unicode); + else if (strcmp(encoding, "latin-1") == 0) + return PyUnicode_AsLatin1String(unicode); #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) - else if (strcmp(encoding, "mbcs") == 0) - return PyUnicode_AsMBCSString(unicode); + else if (strcmp(encoding, "mbcs") == 0) + return PyUnicode_AsMBCSString(unicode); #endif - else if (strcmp(encoding, "ascii") == 0) - return PyUnicode_AsASCIIString(unicode); + else if (strcmp(encoding, "ascii") == 0) + return PyUnicode_AsASCIIString(unicode); /* During bootstrap, we may need to find the encodings package, to load the file system encoding, and require the file system encoding in order to load the encodings @@ -1360,7 +1360,7 @@ else if (Py_FileSystemDefaultEncoding && strcmp(encoding, Py_FileSystemDefaultEncoding) == 0 && !PyThreadState_GET()->interp->codecs_initialized) - return PyUnicode_AsASCIIString(unicode); + return PyUnicode_AsASCIIString(unicode); } /* Encode via the codec registry */ @@ -1408,7 +1408,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Encode via the codec registry */ v = PyCodec_Encode(unicode, encoding, errors); @@ -1423,12 +1423,12 @@ } return v; - onError: + onError: return NULL; } PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode, - const char *errors) + const char *errors) { PyObject *v = ((PyUnicodeObject *)unicode)->defenc; if (v) @@ -1507,7 +1507,7 @@ } return PyUnicode_AS_UNICODE(unicode); - onError: + onError: return NULL; } @@ -1519,7 +1519,7 @@ } return PyUnicode_GET_SIZE(unicode); - onError: + onError: return -1; } @@ -1548,10 +1548,10 @@ static int unicode_decode_call_errorhandler(const char *errors, PyObject **errorHandler, - const char *encoding, const char *reason, - const char **input, const char **inend, Py_ssize_t *startinpos, - Py_ssize_t *endinpos, PyObject **exceptionObject, const char **inptr, - PyUnicodeObject **output, Py_ssize_t *outpos, Py_UNICODE **outptr) + const char *encoding, const char *reason, + const char **input, const char **inend, Py_ssize_t *startinpos, + Py_ssize_t *endinpos, PyObject **exceptionObject, const char **inptr, + PyUnicodeObject **output, Py_ssize_t *outpos, Py_UNICODE **outptr) { static char *argparse = "O!n;decoding error handler must return (str, int) tuple"; @@ -1567,35 +1567,35 @@ int res = -1; if (*errorHandler == NULL) { - *errorHandler = PyCodec_LookupError(errors); - if (*errorHandler == NULL) - goto onError; + *errorHandler = PyCodec_LookupError(errors); + if (*errorHandler == NULL) + goto onError; } if (*exceptionObject == NULL) { - *exceptionObject = PyUnicodeDecodeError_Create( - encoding, *input, *inend-*input, *startinpos, *endinpos, reason); - if (*exceptionObject == NULL) - goto onError; + *exceptionObject = PyUnicodeDecodeError_Create( + encoding, *input, *inend-*input, *startinpos, *endinpos, reason); + if (*exceptionObject == NULL) + goto onError; } else { - if (PyUnicodeDecodeError_SetStart(*exceptionObject, *startinpos)) - goto onError; - if (PyUnicodeDecodeError_SetEnd(*exceptionObject, *endinpos)) - goto onError; - if (PyUnicodeDecodeError_SetReason(*exceptionObject, reason)) - goto onError; + if (PyUnicodeDecodeError_SetStart(*exceptionObject, *startinpos)) + goto onError; + if (PyUnicodeDecodeError_SetEnd(*exceptionObject, *endinpos)) + goto onError; + if (PyUnicodeDecodeError_SetReason(*exceptionObject, reason)) + goto onError; } restuple = PyObject_CallFunctionObjArgs(*errorHandler, *exceptionObject, NULL); if (restuple == NULL) - goto onError; + goto onError; if (!PyTuple_Check(restuple)) { - PyErr_Format(PyExc_TypeError, &argparse[4]); - goto onError; + PyErr_Format(PyExc_TypeError, &argparse[4]); + goto onError; } if (!PyArg_ParseTuple(restuple, argparse, &PyUnicode_Type, &repunicode, &newpos)) - goto onError; + goto onError; /* Copy back the bytes variables, which might have been modified by the callback */ @@ -1603,7 +1603,7 @@ if (!inputobj) goto onError; if (!PyBytes_Check(inputobj)) { - PyErr_Format(PyExc_TypeError, "exception attribute object must be bytes"); + PyErr_Format(PyExc_TypeError, "exception attribute object must be bytes"); } *input = PyBytes_AS_STRING(inputobj); insize = PyBytes_GET_SIZE(inputobj); @@ -1613,10 +1613,10 @@ Py_DECREF(inputobj); if (newpos<0) - newpos = insize+newpos; + newpos = insize+newpos; if (newpos<0 || newpos>insize) { - PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", newpos); - goto onError; + PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", newpos); + goto onError; } /* need more space? (at least enough for what we @@ -1627,11 +1627,11 @@ repsize = PyUnicode_GET_SIZE(repunicode); requiredsize = *outpos + repsize + insize-newpos; if (requiredsize > outsize) { - if (requiredsize<2*outsize) - requiredsize = 2*outsize; - if (_PyUnicode_Resize(output, requiredsize) < 0) - goto onError; - *outptr = PyUnicode_AS_UNICODE(*output) + *outpos; + if (requiredsize<2*outsize) + requiredsize = 2*outsize; + if (_PyUnicode_Resize(output, requiredsize) < 0) + goto onError; + *outptr = PyUnicode_AS_UNICODE(*output) + *outpos; } *endinpos = newpos; *inptr = *input + newpos; @@ -1642,7 +1642,7 @@ /* we made it! */ res = 0; - onError: + onError: Py_XDECREF(restuple); return res; } @@ -1655,10 +1655,10 @@ 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) */ + 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, @@ -1675,17 +1675,17 @@ utf7_special[0] is 1, we can safely make that one comparison true */ -#define SPECIAL(c, encodeO, encodeWS) \ +#define SPECIAL(c, encodeO, encodeWS) \ ((c) > 127 || (c) <= 0 || utf7_special[(c)] == 1 || \ - (encodeWS && (utf7_special[(c)] == 2)) || \ + (encodeWS && (utf7_special[(c)] == 2)) || \ (encodeO && (utf7_special[(c)] == 3))) -#define B64(n) \ +#define B64(n) \ ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(n) & 0x3f]) -#define B64CHAR(c) \ +#define B64CHAR(c) \ (ISALNUM(c) || (c) == '+' || (c) == '/') -#define UB64(c) \ - ((c) == '+' ? 62 : (c) == '/' ? 63 : (c) >= 'a' ? \ +#define UB64(c) \ + ((c) == '+' ? 62 : (c) == '/' ? 63 : (c) >= 'a' ? \ (c) - 71 : (c) >= 'A' ? (c) - 65 : (c) + 4 ) #define ENCODE(out, ch, bits) \ @@ -1714,16 +1714,16 @@ } PyObject *PyUnicode_DecodeUTF7(const char *s, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { return PyUnicode_DecodeUTF7Stateful(s, size, errors, NULL); } PyObject *PyUnicode_DecodeUTF7Stateful(const char *s, - Py_ssize_t size, - const char *errors, - Py_ssize_t *consumed) + Py_ssize_t size, + const char *errors, + Py_ssize_t *consumed) { const char *starts = s; Py_ssize_t startinpos; @@ -1754,7 +1754,7 @@ while (s < e) { Py_UNICODE ch; - restart: + restart: ch = (unsigned char) *s; if (inShift) { @@ -1788,7 +1788,7 @@ } } else if (SPECIAL(ch,0,0)) { errmsg = "unexpected special character"; - goto utf7Error; + goto utf7Error; } else { *p++ = ch; } @@ -1822,28 +1822,28 @@ s++; } continue; - utf7Error: + utf7Error: outpos = p-PyUnicode_AS_UNICODE(unicode); endinpos = s-starts; if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "utf7", errmsg, - &starts, &e, &startinpos, &endinpos, &exc, &s, - &unicode, &outpos, &p)) - goto onError; + errors, &errorHandler, + "utf7", errmsg, + &starts, &e, &startinpos, &endinpos, &exc, &s, + &unicode, &outpos, &p)) + 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)) + errors, &errorHandler, + "utf7", "unterminated shift sequence", + &starts, &e, &startinpos, &endinpos, &exc, &s, + &unicode, &outpos, &p)) goto onError; if (s < e) - goto restart; + goto restart; } if (consumed) { if(inShift) @@ -1859,7 +1859,7 @@ Py_XDECREF(exc); return (PyObject *)unicode; -onError: + onError: Py_XDECREF(errorHandler); Py_XDECREF(exc); Py_DECREF(unicode); @@ -1868,10 +1868,10 @@ PyObject *PyUnicode_EncodeUTF7(const Py_UNICODE *s, - Py_ssize_t size, - int encodeSetO, - int encodeWhiteSpace, - const char *errors) + Py_ssize_t size, + int encodeSetO, + int encodeWhiteSpace, + const char *errors) { PyObject *v; /* It might be possible to tighten this worst case */ @@ -1884,7 +1884,7 @@ char * start; if (size == 0) - return PyBytes_FromStringAndSize(NULL, 0); + return PyBytes_FromStringAndSize(NULL, 0); if (cbAllocated / 5 != size) return PyErr_NoMemory(); @@ -1995,8 +1995,8 @@ }; PyObject *PyUnicode_DecodeUTF8(const char *s, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { return PyUnicode_DecodeUTF8Stateful(s, size, errors, NULL); } @@ -2015,9 +2015,9 @@ #endif PyObject *PyUnicode_DecodeUTF8Stateful(const char *s, - Py_ssize_t size, - const char *errors, - Py_ssize_t *consumed) + Py_ssize_t size, + const char *errors, + Py_ssize_t *consumed) { const char *starts = s; int n; @@ -2099,72 +2099,72 @@ n = utf8_code_length[ch]; if (s + n > e) { - if (consumed) - break; - else { - errmsg = "unexpected end of data"; - startinpos = s-starts; - endinpos = size; - goto utf8Error; - } - } + if (consumed) + break; + else { + errmsg = "unexpected end of data"; + startinpos = s-starts; + endinpos = size; + goto utf8Error; + } + } switch (n) { case 0: errmsg = "unexpected code byte"; - startinpos = s-starts; - endinpos = startinpos+1; - goto utf8Error; + startinpos = s-starts; + endinpos = startinpos+1; + goto utf8Error; case 1: errmsg = "internal error"; - startinpos = s-starts; - endinpos = startinpos+1; - goto utf8Error; + startinpos = s-starts; + endinpos = startinpos+1; + goto utf8Error; case 2: if ((s[1] & 0xc0) != 0x80) { errmsg = "invalid data"; - startinpos = s-starts; - endinpos = startinpos+2; - goto utf8Error; - } + startinpos = s-starts; + endinpos = startinpos+2; + goto utf8Error; + } ch = ((s[0] & 0x1f) << 6) + (s[1] & 0x3f); if (ch < 0x80) { - startinpos = s-starts; - endinpos = startinpos+2; + startinpos = s-starts; + endinpos = startinpos+2; errmsg = "illegal encoding"; - goto utf8Error; - } - else - *p++ = (Py_UNICODE)ch; + goto utf8Error; + } + else + *p++ = (Py_UNICODE)ch; break; case 3: if ((s[1] & 0xc0) != 0x80 || (s[2] & 0xc0) != 0x80) { errmsg = "invalid data"; - startinpos = s-starts; - endinpos = startinpos+3; - goto utf8Error; - } + startinpos = s-starts; + endinpos = startinpos+3; + 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; + /* 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. - */ + XXX For wide builds (UCS-4) we should probably try + to recombine the surrogates into a single code + unit. + */ errmsg = "illegal encoding"; - startinpos = s-starts; - endinpos = startinpos+3; - goto utf8Error; - } - else - *p++ = (Py_UNICODE)ch; + startinpos = s-starts; + endinpos = startinpos+3; + goto utf8Error; + } + else + *p++ = (Py_UNICODE)ch; break; case 4: @@ -2172,25 +2172,25 @@ (s[2] & 0xc0) != 0x80 || (s[3] & 0xc0) != 0x80) { errmsg = "invalid data"; - startinpos = s-starts; - endinpos = startinpos+4; - goto utf8Error; - } + startinpos = s-starts; + endinpos = startinpos+4; + goto utf8Error; + } ch = ((s[0] & 0x7) << 18) + ((s[1] & 0x3f) << 12) + - ((s[2] & 0x3f) << 6) + (s[3] & 0x3f); + ((s[2] & 0x3f) << 6) + (s[3] & 0x3f); /* validate and convert to UTF-16 */ if ((ch < 0x10000) /* minimum value allowed for 4 - byte encoding */ + byte encoding */ || (ch > 0x10ffff)) /* maximum value allowed for - UTF-16 */ - { + UTF-16 */ + { errmsg = "illegal encoding"; - startinpos = s-starts; - endinpos = startinpos+4; - goto utf8Error; - } + startinpos = s-starts; + endinpos = startinpos+4; + goto utf8Error; + } #ifdef Py_UNICODE_WIDE - *p++ = (Py_UNICODE)ch; + *p++ = (Py_UNICODE)ch; #else /* compute and append the two surrogates: */ @@ -2208,25 +2208,25 @@ default: /* Other sizes are only needed for UCS-4 */ errmsg = "unsupported Unicode code range"; - startinpos = s-starts; - endinpos = startinpos+n; - goto utf8Error; + startinpos = s-starts; + endinpos = startinpos+n; + goto utf8Error; } s += n; - continue; + continue; - utf8Error: - outpos = p-PyUnicode_AS_UNICODE(unicode); - if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "utf8", errmsg, - &starts, &e, &startinpos, &endinpos, &exc, &s, - &unicode, &outpos, &p)) - goto onError; - aligned_end = (const char *) ((size_t) e & ~LONG_PTR_MASK); + utf8Error: + outpos = p-PyUnicode_AS_UNICODE(unicode); + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "utf8", errmsg, + &starts, &e, &startinpos, &endinpos, &exc, &s, + &unicode, &outpos, &p)) + goto onError; + aligned_end = (const char *) ((size_t) e & ~LONG_PTR_MASK); } if (consumed) - *consumed = s-starts; + *consumed = s-starts; /* Adjust length */ if (_PyUnicode_Resize(&unicode, p - unicode->str) < 0) @@ -2236,7 +2236,7 @@ Py_XDECREF(exc); return (PyObject *)unicode; -onError: + onError: Py_XDECREF(errorHandler); Py_XDECREF(exc); Py_DECREF(unicode); @@ -2253,8 +2253,8 @@ */ PyObject * PyUnicode_EncodeUTF8(const Py_UNICODE *s, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { #define MAX_SHORT_UNICHARS 300 /* largest size we'll do on the stack */ @@ -2319,8 +2319,8 @@ *p++ = (char)(0x80 | ((ch >> 6) & 0x3f)); *p++ = (char)(0x80 | (ch & 0x3f)); continue; - } -encodeUCS4: + } + encodeUCS4: /* Encode UCS4 Unicode ordinals */ *p++ = (char)(0xf0 | (ch >> 18)); *p++ = (char)(0x80 | ((ch >> 12) & 0x3f)); @@ -2353,27 +2353,27 @@ return NULL; } return PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - NULL); + PyUnicode_GET_SIZE(unicode), + NULL); } /* --- UTF-32 Codec ------------------------------------------------------- */ PyObject * PyUnicode_DecodeUTF32(const char *s, - Py_ssize_t size, - const char *errors, - int *byteorder) + Py_ssize_t size, + const char *errors, + int *byteorder) { return PyUnicode_DecodeUTF32Stateful(s, size, errors, byteorder, NULL); } PyObject * PyUnicode_DecodeUTF32Stateful(const char *s, - Py_ssize_t size, - const char *errors, - int *byteorder, - Py_ssize_t *consumed) + Py_ssize_t size, + const char *errors, + int *byteorder, + Py_ssize_t *consumed) { const char *starts = s; Py_ssize_t startinpos; @@ -2401,8 +2401,8 @@ codepoints => count how much extra space we need. */ #ifndef Py_UNICODE_WIDE for (i = pairs = 0; i < size/4; i++) - if (((Py_UCS4 *)s)[i] >= 0x10000) - pairs++; + if (((Py_UCS4 *)s)[i] >= 0x10000) + pairs++; #endif /* This might be one to much, because of a BOM */ @@ -2427,27 +2427,27 @@ if (bo == 0) { if (size >= 4) { const Py_UCS4 bom = (q[iorder[3]] << 24) | (q[iorder[2]] << 16) | - (q[iorder[1]] << 8) | q[iorder[0]]; + (q[iorder[1]] << 8) | q[iorder[0]]; #ifdef BYTEORDER_IS_LITTLE_ENDIAN - if (bom == 0x0000FEFF) { - q += 4; - bo = -1; - } - else if (bom == 0xFFFE0000) { - q += 4; - bo = 1; - } + if (bom == 0x0000FEFF) { + q += 4; + bo = -1; + } + else if (bom == 0xFFFE0000) { + q += 4; + bo = 1; + } #else - if (bom == 0x0000FEFF) { - q += 4; - bo = 1; - } - else if (bom == 0xFFFE0000) { - q += 4; - bo = -1; - } + if (bom == 0x0000FEFF) { + q += 4; + bo = 1; + } + else if (bom == 0xFFFE0000) { + q += 4; + bo = -1; + } #endif - } + } } if (bo == -1) { @@ -2466,54 +2466,54 @@ } while (q < e) { - Py_UCS4 ch; - /* remaining bytes at the end? (size should be divisible by 4) */ - if (e-q<4) { - if (consumed) - break; - errmsg = "truncated data"; - startinpos = ((const char *)q)-starts; - endinpos = ((const char *)e)-starts; - goto utf32Error; - /* The remaining input chars are ignored if the callback - chooses to skip the input */ - } - ch = (q[iorder[3]] << 24) | (q[iorder[2]] << 16) | - (q[iorder[1]] << 8) | q[iorder[0]]; - - if (ch >= 0x110000) - { - errmsg = "codepoint not in range(0x110000)"; - startinpos = ((const char *)q)-starts; - endinpos = startinpos+4; - goto utf32Error; - } + Py_UCS4 ch; + /* remaining bytes at the end? (size should be divisible by 4) */ + if (e-q<4) { + if (consumed) + break; + errmsg = "truncated data"; + startinpos = ((const char *)q)-starts; + endinpos = ((const char *)e)-starts; + goto utf32Error; + /* The remaining input chars are ignored if the callback + chooses to skip the input */ + } + ch = (q[iorder[3]] << 24) | (q[iorder[2]] << 16) | + (q[iorder[1]] << 8) | q[iorder[0]]; + + if (ch >= 0x110000) + { + errmsg = "codepoint not in range(0x110000)"; + startinpos = ((const char *)q)-starts; + endinpos = startinpos+4; + goto utf32Error; + } #ifndef Py_UNICODE_WIDE - if (ch >= 0x10000) - { - *p++ = 0xD800 | ((ch-0x10000) >> 10); - *p++ = 0xDC00 | ((ch-0x10000) & 0x3FF); - } - else -#endif - *p++ = ch; - q += 4; - continue; - utf32Error: - outpos = p-PyUnicode_AS_UNICODE(unicode); - if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "utf32", errmsg, - &starts, (const char **)&e, &startinpos, &endinpos, &exc, (const char **)&q, - &unicode, &outpos, &p)) - goto onError; + if (ch >= 0x10000) + { + *p++ = 0xD800 | ((ch-0x10000) >> 10); + *p++ = 0xDC00 | ((ch-0x10000) & 0x3FF); + } + else +#endif + *p++ = ch; + q += 4; + continue; + utf32Error: + outpos = p-PyUnicode_AS_UNICODE(unicode); + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "utf32", errmsg, + &starts, (const char **)&e, &startinpos, &endinpos, &exc, (const char **)&q, + &unicode, &outpos, &p)) + goto onError; } if (byteorder) *byteorder = bo; if (consumed) - *consumed = (const char *)q-starts; + *consumed = (const char *)q-starts; /* Adjust length */ if (_PyUnicode_Resize(&unicode, p - unicode->str) < 0) @@ -2523,7 +2523,7 @@ Py_XDECREF(exc); return (PyObject *)unicode; -onError: + onError: Py_DECREF(unicode); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -2532,9 +2532,9 @@ PyObject * PyUnicode_EncodeUTF32(const Py_UNICODE *s, - Py_ssize_t size, - const char *errors, - int byteorder) + Py_ssize_t size, + const char *errors, + int byteorder) { PyObject *v; unsigned char *p; @@ -2551,34 +2551,34 @@ int iorder[] = {3, 2, 1, 0}; #endif -#define STORECHAR(CH) \ - do { \ - p[iorder[3]] = ((CH) >> 24) & 0xff; \ - p[iorder[2]] = ((CH) >> 16) & 0xff; \ - p[iorder[1]] = ((CH) >> 8) & 0xff; \ - p[iorder[0]] = (CH) & 0xff; \ - p += 4; \ +#define STORECHAR(CH) \ + do { \ + p[iorder[3]] = ((CH) >> 24) & 0xff; \ + p[iorder[2]] = ((CH) >> 16) & 0xff; \ + p[iorder[1]] = ((CH) >> 8) & 0xff; \ + p[iorder[0]] = (CH) & 0xff; \ + p += 4; \ } while(0) /* In narrow builds we can output surrogate pairs as one codepoint, so we need less space. */ #ifndef Py_UNICODE_WIDE for (i = pairs = 0; i < size-1; i++) - if (0xD800 <= s[i] && s[i] <= 0xDBFF && - 0xDC00 <= s[i+1] && s[i+1] <= 0xDFFF) - pairs++; + if (0xD800 <= s[i] && s[i] <= 0xDBFF && + 0xDC00 <= s[i+1] && s[i+1] <= 0xDFFF) + pairs++; #endif nsize = (size - pairs + (byteorder == 0)); bytesize = nsize * 4; if (bytesize / 4 != nsize) - return PyErr_NoMemory(); + return PyErr_NoMemory(); v = PyBytes_FromStringAndSize(NULL, bytesize); if (v == NULL) return NULL; p = (unsigned char *)PyBytes_AS_STRING(v); if (byteorder == 0) - STORECHAR(0xFEFF); + STORECHAR(0xFEFF); if (size == 0) goto done; @@ -2598,16 +2598,16 @@ } while (size-- > 0) { - Py_UCS4 ch = *s++; + Py_UCS4 ch = *s++; #ifndef Py_UNICODE_WIDE - if (0xD800 <= ch && ch <= 0xDBFF && size > 0) { - Py_UCS4 ch2 = *s; - if (0xDC00 <= ch2 && ch2 <= 0xDFFF) { - ch = (((ch & 0x3FF)<<10) | (ch2 & 0x3FF)) + 0x10000; - s++; - size--; - } - } + if (0xD800 <= ch && ch <= 0xDBFF && size > 0) { + Py_UCS4 ch2 = *s; + if (0xDC00 <= ch2 && ch2 <= 0xDFFF) { + ch = (((ch & 0x3FF)<<10) | (ch2 & 0x3FF)) + 0x10000; + s++; + size--; + } + } #endif STORECHAR(ch); } @@ -2624,18 +2624,18 @@ return NULL; } return PyUnicode_EncodeUTF32(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - NULL, - 0); + PyUnicode_GET_SIZE(unicode), + NULL, + 0); } /* --- UTF-16 Codec ------------------------------------------------------- */ PyObject * PyUnicode_DecodeUTF16(const char *s, - Py_ssize_t size, - const char *errors, - int *byteorder) + Py_ssize_t size, + const char *errors, + int *byteorder) { return PyUnicode_DecodeUTF16Stateful(s, size, errors, byteorder, NULL); } @@ -2646,7 +2646,7 @@ rare in most input. FAST_CHAR_MASK is used when the input is in native byte ordering, SWAPPED_FAST_CHAR_MASK when the input is in byteswapped ordering. - */ +*/ #if (SIZEOF_LONG == 8) # define FAST_CHAR_MASK 0x8000800080008000L # define SWAPPED_FAST_CHAR_MASK 0x0080008000800080L @@ -2659,10 +2659,10 @@ PyObject * PyUnicode_DecodeUTF16Stateful(const char *s, - Py_ssize_t size, - const char *errors, - int *byteorder, - Py_ssize_t *consumed) + Py_ssize_t size, + const char *errors, + int *byteorder, + Py_ssize_t *consumed) { const char *starts = s; Py_ssize_t startinpos; @@ -2707,25 +2707,25 @@ if (size >= 2) { const Py_UNICODE bom = (q[ihi] << 8) | q[ilo]; #ifdef BYTEORDER_IS_LITTLE_ENDIAN - if (bom == 0xFEFF) { - q += 2; - bo = -1; - } - else if (bom == 0xFFFE) { - q += 2; - bo = 1; - } + if (bom == 0xFEFF) { + q += 2; + bo = -1; + } + else if (bom == 0xFFFE) { + q += 2; + bo = 1; + } #else - if (bom == 0xFEFF) { - q += 2; - bo = 1; - } - else if (bom == 0xFFFE) { - q += 2; - bo = -1; - } + if (bom == 0xFEFF) { + q += 2; + bo = 1; + } + else if (bom == 0xFFFE) { + q += 2; + bo = -1; + } #endif - } + } } if (bo == -1) { @@ -2746,7 +2746,7 @@ aligned_end = (const unsigned char *) ((size_t) e & ~LONG_PTR_MASK); while (q < e) { - Py_UNICODE ch; + Py_UNICODE ch; /* First check for possible aligned read of a C 'long'. Unaligned reads are more expensive, better to defer to another iteration. */ if (!((size_t) q & LONG_PTR_MASK)) { @@ -2818,50 +2818,50 @@ if (q >= e) break; } - ch = (q[ihi] << 8) | q[ilo]; + ch = (q[ihi] << 8) | q[ilo]; + + q += 2; - q += 2; + if (ch < 0xD800 || ch > 0xDFFF) { + *p++ = ch; + continue; + } - if (ch < 0xD800 || ch > 0xDFFF) { - *p++ = ch; - continue; - } - - /* UTF-16 code pair: */ - if (q > e) { - errmsg = "unexpected end of data"; - startinpos = (((const char *)q) - 2) - starts; - endinpos = ((const char *)e) + 1 - starts; - goto utf16Error; - } - if (0xD800 <= ch && ch <= 0xDBFF) { - Py_UNICODE ch2 = (q[ihi] << 8) | q[ilo]; - q += 2; - if (0xDC00 <= ch2 && ch2 <= 0xDFFF) { + /* UTF-16 code pair: */ + if (q > e) { + errmsg = "unexpected end of data"; + startinpos = (((const char *)q) - 2) - starts; + endinpos = ((const char *)e) + 1 - starts; + goto utf16Error; + } + if (0xD800 <= ch && ch <= 0xDBFF) { + Py_UNICODE ch2 = (q[ihi] << 8) | q[ilo]; + q += 2; + if (0xDC00 <= ch2 && ch2 <= 0xDFFF) { #ifndef Py_UNICODE_WIDE - *p++ = ch; - *p++ = ch2; + *p++ = ch; + *p++ = ch2; #else - *p++ = (((ch & 0x3FF)<<10) | (ch2 & 0x3FF)) + 0x10000; + *p++ = (((ch & 0x3FF)<<10) | (ch2 & 0x3FF)) + 0x10000; #endif - continue; - } - else { + continue; + } + else { errmsg = "illegal UTF-16 surrogate"; - startinpos = (((const char *)q)-4)-starts; - endinpos = startinpos+2; - goto utf16Error; - } - - } - errmsg = "illegal encoding"; - startinpos = (((const char *)q)-2)-starts; - endinpos = startinpos+2; - /* Fall through to report the error */ - - utf16Error: - outpos = p - PyUnicode_AS_UNICODE(unicode); - if (unicode_decode_call_errorhandler( + startinpos = (((const char *)q)-4)-starts; + endinpos = startinpos+2; + goto utf16Error; + } + + } + errmsg = "illegal encoding"; + startinpos = (((const char *)q)-2)-starts; + endinpos = startinpos+2; + /* Fall through to report the error */ + + utf16Error: + outpos = p - PyUnicode_AS_UNICODE(unicode); + if (unicode_decode_call_errorhandler( errors, &errorHandler, "utf16", errmsg, @@ -2874,7 +2874,7 @@ &unicode, &outpos, &p)) - goto onError; + goto onError; } /* remaining byte at the end? (size should be even) */ if (e == q) { @@ -2906,7 +2906,7 @@ *byteorder = bo; if (consumed) - *consumed = (const char *)q-starts; + *consumed = (const char *)q-starts; /* Adjust length */ if (_PyUnicode_Resize(&unicode, p - unicode->str) < 0) @@ -2916,7 +2916,7 @@ Py_XDECREF(exc); return (PyObject *)unicode; -onError: + onError: Py_DECREF(unicode); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -2928,9 +2928,9 @@ PyObject * PyUnicode_EncodeUTF16(const Py_UNICODE *s, - Py_ssize_t size, - const char *errors, - int byteorder) + Py_ssize_t size, + const char *errors, + int byteorder) { PyObject *v; unsigned char *p; @@ -2947,33 +2947,33 @@ int ihi = 0, ilo = 1; #endif -#define STORECHAR(CH) \ - do { \ - p[ihi] = ((CH) >> 8) & 0xff; \ - p[ilo] = (CH) & 0xff; \ - p += 2; \ +#define STORECHAR(CH) \ + do { \ + p[ihi] = ((CH) >> 8) & 0xff; \ + p[ilo] = (CH) & 0xff; \ + p += 2; \ } while(0) #ifdef Py_UNICODE_WIDE for (i = pairs = 0; i < size; i++) - if (s[i] >= 0x10000) - pairs++; + if (s[i] >= 0x10000) + pairs++; #endif /* 2 * (size + pairs + (byteorder == 0)) */ if (size > PY_SSIZE_T_MAX || size > PY_SSIZE_T_MAX - pairs - (byteorder == 0)) - return PyErr_NoMemory(); + return PyErr_NoMemory(); nsize = size + pairs + (byteorder == 0); bytesize = nsize * 2; if (bytesize / 2 != nsize) - return PyErr_NoMemory(); + return PyErr_NoMemory(); v = PyBytes_FromStringAndSize(NULL, bytesize); if (v == NULL) return NULL; p = (unsigned char *)PyBytes_AS_STRING(v); if (byteorder == 0) - STORECHAR(0xFEFF); + STORECHAR(0xFEFF); if (size == 0) goto done; @@ -2989,13 +2989,13 @@ } while (size-- > 0) { - Py_UNICODE ch = *s++; - Py_UNICODE ch2 = 0; + Py_UNICODE ch = *s++; + Py_UNICODE ch2 = 0; #ifdef Py_UNICODE_WIDE - if (ch >= 0x10000) { - ch2 = 0xDC00 | ((ch-0x10000) & 0x3FF); - ch = 0xD800 | ((ch-0x10000) >> 10); - } + if (ch >= 0x10000) { + ch2 = 0xDC00 | ((ch-0x10000) & 0x3FF); + ch = 0xD800 | ((ch-0x10000) >> 10); + } #endif STORECHAR(ch); if (ch2) @@ -3014,9 +3014,9 @@ return NULL; } return PyUnicode_EncodeUTF16(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - NULL, - 0); + PyUnicode_GET_SIZE(unicode), + NULL, + 0); } /* --- Unicode Escape Codec ----------------------------------------------- */ @@ -3024,8 +3024,8 @@ static _PyUnicode_Name_CAPI *ucnhash_CAPI = NULL; PyObject *PyUnicode_DecodeUnicodeEscape(const char *s, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { const char *starts = s; Py_ssize_t startinpos; @@ -3073,7 +3073,7 @@ c = '\0'; /* Invalid after \ */ switch (c) { - /* \x escapes */ + /* \x escapes */ case '\n': break; case '\\': *p++ = '\\'; break; case '\'': *p++ = '\''; break; @@ -3086,7 +3086,7 @@ case 'v': *p++ = '\013'; break; /* VT */ case 'a': *p++ = '\007'; break; /* BEL, not classic C */ - /* \OOO (octal) escapes */ + /* \OOO (octal) escapes */ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': x = s[-1] - '0'; @@ -3098,20 +3098,20 @@ *p++ = x; break; - /* hex escapes */ - /* \xXX */ + /* hex escapes */ + /* \xXX */ case 'x': digits = 2; message = "truncated \\xXX escape"; goto hexescape; - /* \uXXXX */ + /* \uXXXX */ case 'u': digits = 4; message = "truncated \\uXXXX escape"; goto hexescape; - /* \UXXXXXXXX */ + /* \UXXXXXXXX */ case 'U': digits = 8; message = "truncated \\UXXXXXXXX escape"; @@ -3121,10 +3121,10 @@ if (s+digits>end) { endinpos = size; if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", "end of string in escape sequence", - &starts, &end, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", "end of string in escape sequence", + &starts, &end, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) goto onError; goto nextByte; } @@ -3133,10 +3133,10 @@ if (!ISXDIGIT(c)) { endinpos = (s+i+1)-starts; if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", message, - &starts, &end, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", message, + &starts, &end, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) goto onError; goto nextByte; } @@ -3172,15 +3172,15 @@ endinpos = s-starts; outpos = p-PyUnicode_AS_UNICODE(v); if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", "illegal Unicode character", - &starts, &end, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", "illegal Unicode character", + &starts, &end, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) goto onError; } break; - /* \N{name} */ + /* \N{name} */ case 'N': message = "malformed \\N character escape"; if (ucnhash_CAPI == NULL) { @@ -3214,10 +3214,10 @@ endinpos = s-starts; outpos = p-PyUnicode_AS_UNICODE(v); if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", message, - &starts, &end, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", message, + &starts, &end, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) goto onError; break; @@ -3228,10 +3228,10 @@ endinpos = s-starts; outpos = p-PyUnicode_AS_UNICODE(v); if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", message, - &starts, &end, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", message, + &starts, &end, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) goto onError; } else { @@ -3240,7 +3240,7 @@ } break; } - nextByte: + nextByte: ; } if (_PyUnicode_Resize(&v, p - PyUnicode_AS_UNICODE(v)) < 0) @@ -3249,7 +3249,7 @@ Py_XDECREF(exc); return (PyObject *)v; -ucnhashError: + ucnhashError: PyErr_SetString( PyExc_UnicodeError, "\\N escapes not supported (can't load unicodedata module)" @@ -3259,7 +3259,7 @@ Py_XDECREF(exc); return NULL; -onError: + onError: Py_XDECREF(v); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -3274,8 +3274,8 @@ */ Py_LOCAL_INLINE(const Py_UNICODE *) findchar(const Py_UNICODE *s, - Py_ssize_t size, - Py_UNICODE ch) + Py_ssize_t size, + Py_UNICODE ch) { /* like wcschr, but doesn't stop at NULL characters */ @@ -3291,7 +3291,7 @@ static const char *hexdigits = "0123456789abcdef"; PyObject *PyUnicode_EncodeUnicodeEscape(const Py_UNICODE *s, - Py_ssize_t size) + Py_ssize_t size) { PyObject *repr; char *p; @@ -3324,12 +3324,12 @@ return PyBytes_FromStringAndSize(NULL, 0); if (size > (PY_SSIZE_T_MAX - 2 - 1) / expandsize) - return PyErr_NoMemory(); + return PyErr_NoMemory(); repr = PyBytes_FromStringAndSize(NULL, - 2 - + expandsize*size - + 1); + 2 + + expandsize*size + + 1); if (repr == NULL) return NULL; @@ -3358,34 +3358,34 @@ *p++ = hexdigits[(ch >> 8) & 0x0000000F]; *p++ = hexdigits[(ch >> 4) & 0x0000000F]; *p++ = hexdigits[ch & 0x0000000F]; - continue; + continue; } #else - /* Map UTF-16 surrogate pairs to '\U00xxxxxx' */ - else if (ch >= 0xD800 && ch < 0xDC00) { - Py_UNICODE ch2; - Py_UCS4 ucs; - - ch2 = *s++; - size--; - if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) { - ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) + 0x00010000; - *p++ = '\\'; - *p++ = 'U'; - *p++ = hexdigits[(ucs >> 28) & 0x0000000F]; - *p++ = hexdigits[(ucs >> 24) & 0x0000000F]; - *p++ = hexdigits[(ucs >> 20) & 0x0000000F]; - *p++ = hexdigits[(ucs >> 16) & 0x0000000F]; - *p++ = hexdigits[(ucs >> 12) & 0x0000000F]; - *p++ = hexdigits[(ucs >> 8) & 0x0000000F]; - *p++ = hexdigits[(ucs >> 4) & 0x0000000F]; - *p++ = hexdigits[ucs & 0x0000000F]; - continue; - } - /* Fall through: isolated surrogates are copied as-is */ - s--; - size++; - } + /* Map UTF-16 surrogate pairs to '\U00xxxxxx' */ + else if (ch >= 0xD800 && ch < 0xDC00) { + Py_UNICODE ch2; + Py_UCS4 ucs; + + ch2 = *s++; + size--; + if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) { + ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) + 0x00010000; + *p++ = '\\'; + *p++ = 'U'; + *p++ = hexdigits[(ucs >> 28) & 0x0000000F]; + *p++ = hexdigits[(ucs >> 24) & 0x0000000F]; + *p++ = hexdigits[(ucs >> 20) & 0x0000000F]; + *p++ = hexdigits[(ucs >> 16) & 0x0000000F]; + *p++ = hexdigits[(ucs >> 12) & 0x0000000F]; + *p++ = hexdigits[(ucs >> 8) & 0x0000000F]; + *p++ = hexdigits[(ucs >> 4) & 0x0000000F]; + *p++ = hexdigits[ucs & 0x0000000F]; + continue; + } + /* Fall through: isolated surrogates are copied as-is */ + s--; + size++; + } #endif /* Map 16-bit characters to '\uxxxx' */ @@ -3446,8 +3446,8 @@ /* --- Raw Unicode Escape Codec ------------------------------------------- */ PyObject *PyUnicode_DecodeRawUnicodeEscape(const char *s, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { const char *starts = s; Py_ssize_t startinpos; @@ -3466,75 +3466,75 @@ handler might have to resize the string) */ v = _PyUnicode_New(size); if (v == NULL) - goto onError; + goto onError; if (size == 0) - return (PyObject *)v; + return (PyObject *)v; p = PyUnicode_AS_UNICODE(v); end = s + size; while (s < end) { - unsigned char c; - Py_UCS4 x; - int i; + unsigned char c; + Py_UCS4 x; + int i; int count; - /* Non-escape characters are interpreted as Unicode ordinals */ - if (*s != '\\') { - *p++ = (unsigned char)*s++; - continue; - } - startinpos = s-starts; - - /* \u-escapes are only interpreted iff the number of leading - backslashes if odd */ - bs = s; - for (;s < end;) { - if (*s != '\\') - break; - *p++ = (unsigned char)*s++; - } - if (((s - bs) & 1) == 0 || - s >= end || - (*s != 'u' && *s != 'U')) { - continue; - } - p--; + /* Non-escape characters are interpreted as Unicode ordinals */ + if (*s != '\\') { + *p++ = (unsigned char)*s++; + continue; + } + startinpos = s-starts; + + /* \u-escapes are only interpreted iff the number of leading + backslashes if odd */ + bs = s; + for (;s < end;) { + if (*s != '\\') + break; + *p++ = (unsigned char)*s++; + } + if (((s - bs) & 1) == 0 || + s >= end || + (*s != 'u' && *s != 'U')) { + continue; + } + p--; count = *s=='u' ? 4 : 8; - s++; + s++; - /* \uXXXX with 4 hex digits, \Uxxxxxxxx with 8 */ - outpos = p-PyUnicode_AS_UNICODE(v); - for (x = 0, i = 0; i < count; ++i, ++s) { - c = (unsigned char)*s; - if (!ISXDIGIT(c)) { - endinpos = s-starts; - if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "rawunicodeescape", "truncated \\uXXXX", - &starts, &end, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) - goto onError; - goto nextByte; - } - x = (x<<4) & ~0xF; - if (c >= '0' && c <= '9') - x += c - '0'; - else if (c >= 'a' && c <= 'f') - x += 10 + c - 'a'; - else - x += 10 + c - 'A'; - } + /* \uXXXX with 4 hex digits, \Uxxxxxxxx with 8 */ + outpos = p-PyUnicode_AS_UNICODE(v); + for (x = 0, i = 0; i < count; ++i, ++s) { + c = (unsigned char)*s; + if (!ISXDIGIT(c)) { + endinpos = s-starts; + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "rawunicodeescape", "truncated \\uXXXX", + &starts, &end, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) + goto onError; + goto nextByte; + } + x = (x<<4) & ~0xF; + if (c >= '0' && c <= '9') + x += c - '0'; + else if (c >= 'a' && c <= 'f') + x += 10 + c - 'a'; + else + x += 10 + c - 'A'; + } if (x <= 0xffff) - /* UCS-2 character */ - *p++ = (Py_UNICODE) x; + /* UCS-2 character */ + *p++ = (Py_UNICODE) x; else if (x <= 0x10ffff) { - /* UCS-4 character. Either store directly, or as - surrogate pair. */ + /* UCS-4 character. Either store directly, or as + surrogate pair. */ #ifdef Py_UNICODE_WIDE - *p++ = (Py_UNICODE) x; + *p++ = (Py_UNICODE) x; #else - x -= 0x10000L; - *p++ = 0xD800 + (Py_UNICODE) (x >> 10); - *p++ = 0xDC00 + (Py_UNICODE) (x & 0x03FF); + x -= 0x10000L; + *p++ = 0xD800 + (Py_UNICODE) (x >> 10); + *p++ = 0xDC00 + (Py_UNICODE) (x & 0x03FF); #endif } else { endinpos = s-starts; @@ -3542,20 +3542,20 @@ if (unicode_decode_call_errorhandler( errors, &errorHandler, "rawunicodeescape", "\\Uxxxxxxxx out of range", - &starts, &end, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) - goto onError; + &starts, &end, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) + goto onError; } - nextByte: - ; + nextByte: + ; } if (_PyUnicode_Resize(&v, p - PyUnicode_AS_UNICODE(v)) < 0) - goto onError; + goto onError; Py_XDECREF(errorHandler); Py_XDECREF(exc); return (PyObject *)v; - onError: + onError: Py_XDECREF(v); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -3563,7 +3563,7 @@ } PyObject *PyUnicode_EncodeRawUnicodeEscape(const Py_UNICODE *s, - Py_ssize_t size) + Py_ssize_t size) { PyObject *repr; char *p; @@ -3574,10 +3574,10 @@ #else const Py_ssize_t expandsize = 6; #endif - + if (size > PY_SSIZE_T_MAX / expandsize) - return PyErr_NoMemory(); - + return PyErr_NoMemory(); + repr = PyBytes_FromStringAndSize(NULL, expandsize * size); if (repr == NULL) return NULL; @@ -3588,8 +3588,8 @@ while (size-- > 0) { Py_UNICODE ch = *s++; #ifdef Py_UNICODE_WIDE - /* Map 32-bit characters to '\Uxxxxxxxx' */ - if (ch >= 0x10000) { + /* Map 32-bit characters to '\Uxxxxxxxx' */ + if (ch >= 0x10000) { *p++ = '\\'; *p++ = 'U'; *p++ = hexdigits[(ch >> 28) & 0xf]; @@ -3603,34 +3603,34 @@ } else #else - /* Map UTF-16 surrogate pairs to '\U00xxxxxx' */ - if (ch >= 0xD800 && ch < 0xDC00) { - Py_UNICODE ch2; - Py_UCS4 ucs; - - ch2 = *s++; - size--; - if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) { - ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) + 0x00010000; - *p++ = '\\'; - *p++ = 'U'; - *p++ = hexdigits[(ucs >> 28) & 0xf]; - *p++ = hexdigits[(ucs >> 24) & 0xf]; - *p++ = hexdigits[(ucs >> 20) & 0xf]; - *p++ = hexdigits[(ucs >> 16) & 0xf]; - *p++ = hexdigits[(ucs >> 12) & 0xf]; - *p++ = hexdigits[(ucs >> 8) & 0xf]; - *p++ = hexdigits[(ucs >> 4) & 0xf]; - *p++ = hexdigits[ucs & 0xf]; - continue; - } - /* Fall through: isolated surrogates are copied as-is */ - s--; - size++; - } + /* Map UTF-16 surrogate pairs to '\U00xxxxxx' */ + if (ch >= 0xD800 && ch < 0xDC00) { + Py_UNICODE ch2; + Py_UCS4 ucs; + + ch2 = *s++; + size--; + if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) { + ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) + 0x00010000; + *p++ = '\\'; + *p++ = 'U'; + *p++ = hexdigits[(ucs >> 28) & 0xf]; + *p++ = hexdigits[(ucs >> 24) & 0xf]; + *p++ = hexdigits[(ucs >> 20) & 0xf]; + *p++ = hexdigits[(ucs >> 16) & 0xf]; + *p++ = hexdigits[(ucs >> 12) & 0xf]; + *p++ = hexdigits[(ucs >> 8) & 0xf]; + *p++ = hexdigits[(ucs >> 4) & 0xf]; + *p++ = hexdigits[ucs & 0xf]; + continue; + } + /* Fall through: isolated surrogates are copied as-is */ + s--; + size++; + } #endif - /* Map 16-bit characters to '\uxxxx' */ - if (ch >= 256) { + /* Map 16-bit characters to '\uxxxx' */ + if (ch >= 256) { *p++ = '\\'; *p++ = 'u'; *p++ = hexdigits[(ch >> 12) & 0xf]; @@ -3638,8 +3638,8 @@ *p++ = hexdigits[(ch >> 4) & 0xf]; *p++ = hexdigits[ch & 15]; } - /* Copy everything else as-is */ - else + /* Copy everything else as-is */ + else *p++ = (char) ch; } size = p - q; @@ -3666,8 +3666,8 @@ /* --- Unicode Internal Codec ------------------------------------------- */ PyObject *_PyUnicode_DecodeUnicodeInternal(const char *s, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { const char *starts = s; Py_ssize_t startinpos; @@ -3687,9 +3687,9 @@ /* XXX overflow detection missing */ v = _PyUnicode_New((size+Py_UNICODE_SIZE-1)/ Py_UNICODE_SIZE); if (v == NULL) - goto onError; + goto onError; if (PyUnicode_GetSize((PyObject *)v) == 0) - return (PyObject *)v; + return (PyObject *)v; p = PyUnicode_AS_UNICODE(v); end = s + size; @@ -3698,12 +3698,12 @@ /* We have to sanity check the raw data, otherwise doom looms for some malformed UCS-4 data. */ if ( - #ifdef Py_UNICODE_WIDE +#ifdef Py_UNICODE_WIDE *p > unimax || *p < 0 || - #endif +#endif end-s < Py_UNICODE_SIZE ) - { + { startinpos = s - starts; if (end-s < Py_UNICODE_SIZE) { endinpos = end-starts; @@ -3734,7 +3734,7 @@ Py_XDECREF(exc); return (PyObject *)v; - onError: + onError: Py_XDECREF(v); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -3744,8 +3744,8 @@ /* --- Latin-1 Codec ------------------------------------------------------ */ PyObject *PyUnicode_DecodeLatin1(const char *s, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { PyUnicodeObject *v; Py_UNICODE *p; @@ -3753,15 +3753,15 @@ /* Latin-1 is equivalent to the first 256 ordinals in Unicode. */ if (size == 1) { - Py_UNICODE r = *(unsigned char*)s; - return PyUnicode_FromUnicode(&r, 1); + Py_UNICODE r = *(unsigned char*)s; + return PyUnicode_FromUnicode(&r, 1); } v = _PyUnicode_New(size); if (v == NULL) - goto onError; + goto onError; if (size == 0) - return (PyObject *)v; + return (PyObject *)v; p = PyUnicode_AS_UNICODE(v); e = s + size; /* Unrolling the copy makes it much faster by reducing the looping @@ -3779,47 +3779,47 @@ *p++ = (unsigned char) *s++; return (PyObject *)v; - onError: + onError: Py_XDECREF(v); return NULL; } /* create or adjust a UnicodeEncodeError */ static void make_encode_exception(PyObject **exceptionObject, - const char *encoding, - const Py_UNICODE *unicode, Py_ssize_t size, - Py_ssize_t startpos, Py_ssize_t endpos, - const char *reason) + const char *encoding, + const Py_UNICODE *unicode, Py_ssize_t size, + Py_ssize_t startpos, Py_ssize_t endpos, + const char *reason) { if (*exceptionObject == NULL) { - *exceptionObject = PyUnicodeEncodeError_Create( - encoding, unicode, size, startpos, endpos, reason); + *exceptionObject = PyUnicodeEncodeError_Create( + encoding, unicode, size, startpos, endpos, reason); } else { - if (PyUnicodeEncodeError_SetStart(*exceptionObject, startpos)) - goto onError; - if (PyUnicodeEncodeError_SetEnd(*exceptionObject, endpos)) - goto onError; - if (PyUnicodeEncodeError_SetReason(*exceptionObject, reason)) - goto onError; - return; - onError: - Py_DECREF(*exceptionObject); - *exceptionObject = NULL; + if (PyUnicodeEncodeError_SetStart(*exceptionObject, startpos)) + goto onError; + if (PyUnicodeEncodeError_SetEnd(*exceptionObject, endpos)) + goto onError; + if (PyUnicodeEncodeError_SetReason(*exceptionObject, reason)) + goto onError; + return; + onError: + Py_DECREF(*exceptionObject); + *exceptionObject = NULL; } } /* raises a UnicodeEncodeError */ static void raise_encode_exception(PyObject **exceptionObject, - const char *encoding, - const Py_UNICODE *unicode, Py_ssize_t size, - Py_ssize_t startpos, Py_ssize_t endpos, - const char *reason) + const char *encoding, + const Py_UNICODE *unicode, Py_ssize_t size, + Py_ssize_t startpos, Py_ssize_t endpos, + const char *reason) { make_encode_exception(exceptionObject, - encoding, unicode, size, startpos, endpos, reason); + encoding, unicode, size, startpos, endpos, reason); if (*exceptionObject != NULL) - PyCodec_StrictErrors(*exceptionObject); + PyCodec_StrictErrors(*exceptionObject); } /* error handling callback helper: @@ -3827,11 +3827,11 @@ put the result into newpos and return the replacement string, which has to be freed by the caller */ 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) { static char *argparse = "O!n;encoding error handler must return (str, int) tuple"; @@ -3839,36 +3839,36 @@ PyObject *resunicode; if (*errorHandler == NULL) { - *errorHandler = PyCodec_LookupError(errors); + *errorHandler = PyCodec_LookupError(errors); if (*errorHandler == NULL) - return NULL; + return NULL; } make_encode_exception(exceptionObject, - encoding, unicode, size, startpos, endpos, reason); + encoding, unicode, size, startpos, endpos, reason); if (*exceptionObject == NULL) - return NULL; + return NULL; restuple = PyObject_CallFunctionObjArgs( - *errorHandler, *exceptionObject, NULL); + *errorHandler, *exceptionObject, NULL); if (restuple == NULL) - return NULL; + return NULL; if (!PyTuple_Check(restuple)) { - PyErr_Format(PyExc_TypeError, &argparse[4]); - Py_DECREF(restuple); - return NULL; + PyErr_Format(PyExc_TypeError, &argparse[4]); + Py_DECREF(restuple); + return NULL; } if (!PyArg_ParseTuple(restuple, argparse, &PyUnicode_Type, - &resunicode, newpos)) { - Py_DECREF(restuple); - return NULL; + &resunicode, newpos)) { + Py_DECREF(restuple); + return NULL; } if (*newpos<0) - *newpos = size+*newpos; + *newpos = size+*newpos; if (*newpos<0 || *newpos>size) { - PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", *newpos); - Py_DECREF(restuple); - return NULL; + PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", *newpos); + Py_DECREF(restuple); + return NULL; } Py_INCREF(resunicode); Py_DECREF(restuple); @@ -3876,9 +3876,9 @@ } static PyObject *unicode_encode_ucs1(const Py_UNICODE *p, - Py_ssize_t size, - const char *errors, - int limit) + Py_ssize_t size, + const char *errors, + int limit) { /* output object */ PyObject *res; @@ -3910,128 +3910,128 @@ ressize = size; while (p=limit)) - ++collend; - /* cache callback name lookup (if not done yet, i.e. it's the first error) */ - if (known_errorHandler==-1) { - if ((errors==NULL) || (!strcmp(errors, "strict"))) - known_errorHandler = 1; - else if (!strcmp(errors, "replace")) - known_errorHandler = 2; - else if (!strcmp(errors, "ignore")) - known_errorHandler = 3; - else if (!strcmp(errors, "xmlcharrefreplace")) - known_errorHandler = 4; - else - known_errorHandler = 0; - } - switch (known_errorHandler) { - case 1: /* strict */ - raise_encode_exception(&exc, encoding, startp, size, collstart-startp, collend-startp, reason); - goto onError; - case 2: /* replace */ - while (collstart++=limit)) + ++collend; + /* cache callback name lookup (if not done yet, i.e. it's the first error) */ + if (known_errorHandler==-1) { + if ((errors==NULL) || (!strcmp(errors, "strict"))) + known_errorHandler = 1; + else if (!strcmp(errors, "replace")) + known_errorHandler = 2; + else if (!strcmp(errors, "ignore")) + known_errorHandler = 3; + else if (!strcmp(errors, "xmlcharrefreplace")) + known_errorHandler = 4; + else + known_errorHandler = 0; + } + switch (known_errorHandler) { + case 1: /* strict */ + raise_encode_exception(&exc, encoding, startp, size, collstart-startp, collend-startp, reason); + goto onError; + case 2: /* replace */ + while (collstart++ ressize) { - if (requiredsize<2*ressize) - requiredsize = 2*ressize; - if (_PyBytes_Resize(&res, requiredsize)) - goto onError; - str = PyBytes_AS_STRING(res) + respos; - ressize = requiredsize; - } - /* generate replacement (temporarily (mis)uses p) */ - for (p = collstart; p < collend; ++p) { - str += sprintf(str, "&#%d;", (int)*p); - } - p = collend; - break; - default: - repunicode = unicode_encode_call_errorhandler(errors, &errorHandler, - encoding, reason, startp, size, &exc, - collstart-startp, collend-startp, &newpos); - if (repunicode == NULL) - 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) */ - respos = str - PyBytes_AS_STRING(res); - repsize = PyUnicode_GET_SIZE(repunicode); - requiredsize = respos+repsize+(endp-collend); - if (requiredsize > ressize) { - if (requiredsize<2*ressize) - requiredsize = 2*ressize; - if (_PyBytes_Resize(&res, requiredsize)) { - Py_DECREF(repunicode); - goto onError; - } - str = PyBytes_AS_STRING(res) + respos; - ressize = requiredsize; - } - /* check if there is anything unencodable in the replacement - and copy it to the output */ - for (uni2 = PyUnicode_AS_UNICODE(repunicode);repsize-->0; ++uni2, ++str) { - c = *uni2; - if (c >= limit) { - raise_encode_exception(&exc, encoding, startp, size, - unicodepos, unicodepos+1, reason); - Py_DECREF(repunicode); - goto onError; - } - *str = (char)c; - } - p = startp + newpos; - Py_DECREF(repunicode); - } - } + else if (*p<100000) + repsize += 2+5+1; + else if (*p<1000000) + repsize += 2+6+1; + else + repsize += 2+7+1; +#endif + } + requiredsize = respos+repsize+(endp-collend); + if (requiredsize > ressize) { + if (requiredsize<2*ressize) + requiredsize = 2*ressize; + if (_PyBytes_Resize(&res, requiredsize)) + goto onError; + str = PyBytes_AS_STRING(res) + respos; + ressize = requiredsize; + } + /* generate replacement (temporarily (mis)uses p) */ + for (p = collstart; p < collend; ++p) { + str += sprintf(str, "&#%d;", (int)*p); + } + p = collend; + break; + default: + repunicode = unicode_encode_call_errorhandler(errors, &errorHandler, + encoding, reason, startp, size, &exc, + collstart-startp, collend-startp, &newpos); + if (repunicode == NULL) + 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) */ + respos = str - PyBytes_AS_STRING(res); + repsize = PyUnicode_GET_SIZE(repunicode); + requiredsize = respos+repsize+(endp-collend); + if (requiredsize > ressize) { + if (requiredsize<2*ressize) + requiredsize = 2*ressize; + if (_PyBytes_Resize(&res, requiredsize)) { + Py_DECREF(repunicode); + goto onError; + } + str = PyBytes_AS_STRING(res) + respos; + ressize = requiredsize; + } + /* check if there is anything unencodable in the replacement + and copy it to the output */ + for (uni2 = PyUnicode_AS_UNICODE(repunicode);repsize-->0; ++uni2, ++str) { + c = *uni2; + if (c >= limit) { + raise_encode_exception(&exc, encoding, startp, size, + unicodepos, unicodepos+1, reason); + Py_DECREF(repunicode); + goto onError; + } + *str = (char)c; + } + p = startp + newpos; + Py_DECREF(repunicode); + } + } } /* Resize if we allocated to much */ size = str - PyBytes_AS_STRING(res); @@ -4053,8 +4053,8 @@ } PyObject *PyUnicode_EncodeLatin1(const Py_UNICODE *p, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { return unicode_encode_ucs1(p, size, errors, 256); } @@ -4062,19 +4062,19 @@ PyObject *PyUnicode_AsLatin1String(PyObject *unicode) { if (!PyUnicode_Check(unicode)) { - PyErr_BadArgument(); - return NULL; + PyErr_BadArgument(); + return NULL; } return PyUnicode_EncodeLatin1(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - NULL); + PyUnicode_GET_SIZE(unicode), + NULL); } /* --- 7-bit ASCII Codec -------------------------------------------------- */ PyObject *PyUnicode_DecodeASCII(const char *s, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { const char *starts = s; PyUnicodeObject *v; @@ -4088,43 +4088,43 @@ /* ASCII is equivalent to the first 128 ordinals in Unicode. */ if (size == 1 && *(unsigned char*)s < 128) { - Py_UNICODE r = *(unsigned char*)s; - return PyUnicode_FromUnicode(&r, 1); + Py_UNICODE r = *(unsigned char*)s; + return PyUnicode_FromUnicode(&r, 1); } v = _PyUnicode_New(size); if (v == NULL) - goto onError; + goto onError; if (size == 0) - return (PyObject *)v; + return (PyObject *)v; p = PyUnicode_AS_UNICODE(v); e = s + size; while (s < e) { - register unsigned char c = (unsigned char)*s; - if (c < 128) { - *p++ = c; - ++s; - } - else { - startinpos = s-starts; - endinpos = startinpos + 1; - outpos = p - (Py_UNICODE *)PyUnicode_AS_UNICODE(v); - if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "ascii", "ordinal not in range(128)", - &starts, &e, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) - goto onError; - } + register unsigned char c = (unsigned char)*s; + if (c < 128) { + *p++ = c; + ++s; + } + else { + startinpos = s-starts; + endinpos = startinpos + 1; + outpos = p - (Py_UNICODE *)PyUnicode_AS_UNICODE(v); + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "ascii", "ordinal not in range(128)", + &starts, &e, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) + goto onError; + } } if (p - PyUnicode_AS_UNICODE(v) < PyUnicode_GET_SIZE(v)) - if (_PyUnicode_Resize(&v, p - PyUnicode_AS_UNICODE(v)) < 0) - goto onError; + if (_PyUnicode_Resize(&v, p - PyUnicode_AS_UNICODE(v)) < 0) + goto onError; Py_XDECREF(errorHandler); Py_XDECREF(exc); return (PyObject *)v; - onError: + onError: Py_XDECREF(v); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -4132,8 +4132,8 @@ } PyObject *PyUnicode_EncodeASCII(const Py_UNICODE *p, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { return unicode_encode_ucs1(p, size, errors, 128); } @@ -4141,12 +4141,12 @@ PyObject *PyUnicode_AsASCIIString(PyObject *unicode) { if (!PyUnicode_Check(unicode)) { - PyErr_BadArgument(); - return NULL; + PyErr_BadArgument(); + return NULL; } return PyUnicode_EncodeASCII(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - NULL); + PyUnicode_GET_SIZE(unicode), + NULL); } #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) @@ -4160,15 +4160,15 @@ /* XXX This code is limited to "true" double-byte encodings, as a) it assumes an incomplete character consists of a single byte, and b) IsDBCSLeadByte (probably) does not work for non-DBCS multi-byte - encodings, see IsDBCSLeadByteEx documentation. */ + encodings, see IsDBCSLeadByteEx documentation. */ static int is_dbcs_lead_byte(const char *s, int offset) { const char *curr = s + offset; if (IsDBCSLeadByte(*curr)) { - const char *prev = CharPrev(s, curr); - return (prev == curr) || !IsDBCSLeadByte(*prev) || (curr - prev == 2); + const char *prev = CharPrev(s, curr); + return (prev == curr) || !IsDBCSLeadByte(*prev) || (curr - prev == 2); } return 0; } @@ -4178,9 +4178,9 @@ * trailing lead-byte too. Returns consumed size if succeed, -1 otherwise. */ static int decode_mbcs(PyUnicodeObject **v, - const char *s, /* MBCS string */ - int size, /* sizeof MBCS string */ - int final) + const char *s, /* MBCS string */ + int size, /* sizeof MBCS string */ + int final) { Py_UNICODE *p; Py_ssize_t n = 0; @@ -4190,74 +4190,74 @@ /* Skip trailing lead-byte unless 'final' is set */ if (!final && size >= 1 && is_dbcs_lead_byte(s, size - 1)) - --size; + --size; /* First get the size of the result */ if (size > 0) { - usize = MultiByteToWideChar(CP_ACP, 0, s, size, NULL, 0); - if (usize == 0) { - PyErr_SetFromWindowsErrWithFilename(0, NULL); - return -1; - } + usize = MultiByteToWideChar(CP_ACP, 0, s, size, NULL, 0); + if (usize == 0) { + PyErr_SetFromWindowsErrWithFilename(0, NULL); + return -1; + } } if (*v == NULL) { - /* Create unicode object */ - *v = _PyUnicode_New(usize); - if (*v == NULL) - return -1; + /* Create unicode object */ + *v = _PyUnicode_New(usize); + if (*v == NULL) + return -1; } else { - /* Extend unicode object */ - n = PyUnicode_GET_SIZE(*v); - if (_PyUnicode_Resize(v, n + usize) < 0) - return -1; + /* Extend unicode object */ + n = PyUnicode_GET_SIZE(*v); + if (_PyUnicode_Resize(v, n + usize) < 0) + return -1; } /* Do the conversion */ if (size > 0) { - p = PyUnicode_AS_UNICODE(*v) + n; - if (0 == MultiByteToWideChar(CP_ACP, 0, s, size, p, usize)) { - PyErr_SetFromWindowsErrWithFilename(0, NULL); - return -1; - } + p = PyUnicode_AS_UNICODE(*v) + n; + if (0 == MultiByteToWideChar(CP_ACP, 0, s, size, p, usize)) { + PyErr_SetFromWindowsErrWithFilename(0, NULL); + return -1; + } } return size; } PyObject *PyUnicode_DecodeMBCSStateful(const char *s, - Py_ssize_t size, - const char *errors, - Py_ssize_t *consumed) + Py_ssize_t size, + const char *errors, + Py_ssize_t *consumed) { PyUnicodeObject *v = NULL; int done; if (consumed) - *consumed = 0; + *consumed = 0; #ifdef NEED_RETRY retry: if (size > INT_MAX) - done = decode_mbcs(&v, s, INT_MAX, 0); + done = decode_mbcs(&v, s, INT_MAX, 0); else #endif - done = decode_mbcs(&v, s, (int)size, !consumed); + done = decode_mbcs(&v, s, (int)size, !consumed); if (done < 0) { Py_XDECREF(v); - return NULL; + return NULL; } if (consumed) - *consumed += done; + *consumed += done; #ifdef NEED_RETRY if (size > INT_MAX) { - s += done; - size -= done; - goto retry; + s += done; + size -= done; + goto retry; } #endif @@ -4265,8 +4265,8 @@ } PyObject *PyUnicode_DecodeMBCS(const char *s, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { return PyUnicode_DecodeMBCSStateful(s, size, errors, NULL); } @@ -4276,8 +4276,8 @@ * Returns 0 if succeed, -1 otherwise. */ static int encode_mbcs(PyObject **repr, - const Py_UNICODE *p, /* unicode */ - int size) /* size of unicode */ + const Py_UNICODE *p, /* unicode */ + int size) /* size of unicode */ { int mbcssize = 0; Py_ssize_t n = 0; @@ -4286,63 +4286,63 @@ /* First get the size of the result */ if (size > 0) { - mbcssize = WideCharToMultiByte(CP_ACP, 0, p, size, NULL, 0, NULL, NULL); - if (mbcssize == 0) { - PyErr_SetFromWindowsErrWithFilename(0, NULL); - return -1; - } + mbcssize = WideCharToMultiByte(CP_ACP, 0, p, size, NULL, 0, NULL, NULL); + if (mbcssize == 0) { + PyErr_SetFromWindowsErrWithFilename(0, NULL); + return -1; + } } if (*repr == NULL) { - /* Create string object */ - *repr = PyBytes_FromStringAndSize(NULL, mbcssize); - if (*repr == NULL) - return -1; + /* Create string object */ + *repr = PyBytes_FromStringAndSize(NULL, mbcssize); + if (*repr == NULL) + return -1; } else { - /* Extend string object */ - n = PyBytes_Size(*repr); - if (_PyBytes_Resize(repr, n + mbcssize) < 0) - return -1; + /* Extend string object */ + n = PyBytes_Size(*repr); + if (_PyBytes_Resize(repr, n + mbcssize) < 0) + return -1; } /* Do the conversion */ if (size > 0) { - char *s = PyBytes_AS_STRING(*repr) + n; - if (0 == WideCharToMultiByte(CP_ACP, 0, p, size, s, mbcssize, NULL, NULL)) { - PyErr_SetFromWindowsErrWithFilename(0, NULL); - return -1; - } + char *s = PyBytes_AS_STRING(*repr) + n; + if (0 == WideCharToMultiByte(CP_ACP, 0, p, size, s, mbcssize, NULL, NULL)) { + PyErr_SetFromWindowsErrWithFilename(0, NULL); + return -1; + } } return 0; } PyObject *PyUnicode_EncodeMBCS(const Py_UNICODE *p, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { PyObject *repr = NULL; int ret; #ifdef NEED_RETRY - retry: + retry: if (size > INT_MAX) - ret = encode_mbcs(&repr, p, INT_MAX); + ret = encode_mbcs(&repr, p, INT_MAX); else #endif - ret = encode_mbcs(&repr, p, (int)size); + ret = encode_mbcs(&repr, p, (int)size); if (ret < 0) { - Py_XDECREF(repr); - return NULL; + Py_XDECREF(repr); + return NULL; } #ifdef NEED_RETRY if (size > INT_MAX) { - p += INT_MAX; - size -= INT_MAX; - goto retry; + p += INT_MAX; + size -= INT_MAX; + goto retry; } #endif @@ -4356,8 +4356,8 @@ return NULL; } return PyUnicode_EncodeMBCS(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - NULL); + PyUnicode_GET_SIZE(unicode), + NULL); } #undef NEED_RETRY @@ -4367,9 +4367,9 @@ /* --- Character Mapping Codec -------------------------------------------- */ PyObject *PyUnicode_DecodeCharmap(const char *s, - Py_ssize_t size, - PyObject *mapping, - const char *errors) + Py_ssize_t size, + PyObject *mapping, + const char *errors) { const char *starts = s; Py_ssize_t startinpos; @@ -4386,141 +4386,141 @@ /* Default to Latin-1 */ if (mapping == NULL) - return PyUnicode_DecodeLatin1(s, size, errors); + return PyUnicode_DecodeLatin1(s, size, errors); v = _PyUnicode_New(size); if (v == NULL) - goto onError; + goto onError; if (size == 0) - return (PyObject *)v; + return (PyObject *)v; p = PyUnicode_AS_UNICODE(v); e = s + size; if (PyUnicode_CheckExact(mapping)) { - mapstring = PyUnicode_AS_UNICODE(mapping); - maplen = PyUnicode_GET_SIZE(mapping); - while (s < e) { - unsigned char ch = *s; - Py_UNICODE x = 0xfffe; /* illegal value */ - - if (ch < maplen) - x = mapstring[ch]; - - if (x == 0xfffe) { - /* undefined mapping */ - outpos = p-PyUnicode_AS_UNICODE(v); - startinpos = s-starts; - endinpos = startinpos+1; - if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "charmap", "character maps to ", - &starts, &e, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) { - goto onError; - } - continue; - } - *p++ = x; - ++s; - } + mapstring = PyUnicode_AS_UNICODE(mapping); + maplen = PyUnicode_GET_SIZE(mapping); + while (s < e) { + unsigned char ch = *s; + Py_UNICODE x = 0xfffe; /* illegal value */ + + if (ch < maplen) + x = mapstring[ch]; + + if (x == 0xfffe) { + /* undefined mapping */ + outpos = p-PyUnicode_AS_UNICODE(v); + startinpos = s-starts; + endinpos = startinpos+1; + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "charmap", "character maps to ", + &starts, &e, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) { + goto onError; + } + continue; + } + *p++ = x; + ++s; + } } else { - while (s < e) { - unsigned char ch = *s; - PyObject *w, *x; - - /* Get mapping (char ordinal -> integer, Unicode char or None) */ - w = PyLong_FromLong((long)ch); - if (w == NULL) - goto onError; - x = PyObject_GetItem(mapping, w); - Py_DECREF(w); - if (x == NULL) { - if (PyErr_ExceptionMatches(PyExc_LookupError)) { - /* No mapping found means: mapping is undefined. */ - PyErr_Clear(); - x = Py_None; - Py_INCREF(x); - } else - goto onError; - } - - /* Apply mapping */ - if (PyLong_Check(x)) { - long value = PyLong_AS_LONG(x); - if (value < 0 || value > 65535) { - PyErr_SetString(PyExc_TypeError, - "character mapping must be in range(65536)"); - Py_DECREF(x); - goto onError; - } - *p++ = (Py_UNICODE)value; - } - else if (x == Py_None) { - /* undefined mapping */ - outpos = p-PyUnicode_AS_UNICODE(v); - startinpos = s-starts; - endinpos = startinpos+1; - if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "charmap", "character maps to ", - &starts, &e, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) { - Py_DECREF(x); - goto onError; - } - Py_DECREF(x); - continue; - } - else if (PyUnicode_Check(x)) { - Py_ssize_t targetsize = PyUnicode_GET_SIZE(x); - - if (targetsize == 1) - /* 1-1 mapping */ - *p++ = *PyUnicode_AS_UNICODE(x); - - else if (targetsize > 1) { - /* 1-n mapping */ - if (targetsize > extrachars) { - /* resize first */ - Py_ssize_t oldpos = p - PyUnicode_AS_UNICODE(v); - Py_ssize_t needed = (targetsize - extrachars) + \ - (targetsize << 2); - extrachars += needed; - /* XXX overflow detection missing */ - if (_PyUnicode_Resize(&v, - PyUnicode_GET_SIZE(v) + needed) < 0) { - Py_DECREF(x); - goto onError; - } - p = PyUnicode_AS_UNICODE(v) + oldpos; - } - Py_UNICODE_COPY(p, - PyUnicode_AS_UNICODE(x), - targetsize); - p += targetsize; - extrachars -= targetsize; - } - /* 1-0 mapping: skip the character */ - } - else { - /* wrong return value */ - PyErr_SetString(PyExc_TypeError, - "character mapping must return integer, None or str"); - Py_DECREF(x); - goto onError; - } - Py_DECREF(x); - ++s; - } + while (s < e) { + unsigned char ch = *s; + PyObject *w, *x; + + /* Get mapping (char ordinal -> integer, Unicode char or None) */ + w = PyLong_FromLong((long)ch); + if (w == NULL) + goto onError; + x = PyObject_GetItem(mapping, w); + Py_DECREF(w); + if (x == NULL) { + if (PyErr_ExceptionMatches(PyExc_LookupError)) { + /* No mapping found means: mapping is undefined. */ + PyErr_Clear(); + x = Py_None; + Py_INCREF(x); + } else + goto onError; + } + + /* Apply mapping */ + if (PyLong_Check(x)) { + long value = PyLong_AS_LONG(x); + if (value < 0 || value > 65535) { + PyErr_SetString(PyExc_TypeError, + "character mapping must be in range(65536)"); + Py_DECREF(x); + goto onError; + } + *p++ = (Py_UNICODE)value; + } + else if (x == Py_None) { + /* undefined mapping */ + outpos = p-PyUnicode_AS_UNICODE(v); + startinpos = s-starts; + endinpos = startinpos+1; + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "charmap", "character maps to ", + &starts, &e, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) { + Py_DECREF(x); + goto onError; + } + Py_DECREF(x); + continue; + } + else if (PyUnicode_Check(x)) { + Py_ssize_t targetsize = PyUnicode_GET_SIZE(x); + + if (targetsize == 1) + /* 1-1 mapping */ + *p++ = *PyUnicode_AS_UNICODE(x); + + else if (targetsize > 1) { + /* 1-n mapping */ + if (targetsize > extrachars) { + /* resize first */ + Py_ssize_t oldpos = p - PyUnicode_AS_UNICODE(v); + Py_ssize_t needed = (targetsize - extrachars) + \ + (targetsize << 2); + extrachars += needed; + /* XXX overflow detection missing */ + if (_PyUnicode_Resize(&v, + PyUnicode_GET_SIZE(v) + needed) < 0) { + Py_DECREF(x); + goto onError; + } + p = PyUnicode_AS_UNICODE(v) + oldpos; + } + Py_UNICODE_COPY(p, + PyUnicode_AS_UNICODE(x), + targetsize); + p += targetsize; + extrachars -= targetsize; + } + /* 1-0 mapping: skip the character */ + } + else { + /* wrong return value */ + PyErr_SetString(PyExc_TypeError, + "character mapping must return integer, None or str"); + Py_DECREF(x); + goto onError; + } + Py_DECREF(x); + ++s; + } } if (p - PyUnicode_AS_UNICODE(v) < PyUnicode_GET_SIZE(v)) - if (_PyUnicode_Resize(&v, p - PyUnicode_AS_UNICODE(v)) < 0) - goto onError; + if (_PyUnicode_Resize(&v, p - PyUnicode_AS_UNICODE(v)) < 0) + goto onError; Py_XDECREF(errorHandler); Py_XDECREF(exc); return (PyObject *)v; - onError: + onError: Py_XDECREF(errorHandler); Py_XDECREF(exc); Py_XDECREF(v); @@ -4530,74 +4530,74 @@ /* Charmap encoding: the lookup table */ struct encoding_map{ - PyObject_HEAD - unsigned char level1[32]; - int count2, count3; - unsigned char level23[1]; + PyObject_HEAD + unsigned char level1[32]; + int count2, count3; + unsigned char level23[1]; }; static PyObject* encoding_map_size(PyObject *obj, PyObject* args) { struct encoding_map *map = (struct encoding_map*)obj; - return PyLong_FromLong(sizeof(*map) - 1 + 16*map->count2 + - 128*map->count3); + return PyLong_FromLong(sizeof(*map) - 1 + 16*map->count2 + + 128*map->count3); } static PyMethodDef encoding_map_methods[] = { - {"size", encoding_map_size, METH_NOARGS, - PyDoc_STR("Return the size (in bytes) of this object") }, - { 0 } + {"size", encoding_map_size, METH_NOARGS, + PyDoc_STR("Return the size (in bytes) of this object") }, + { 0 } }; static void encoding_map_dealloc(PyObject* o) { - PyObject_FREE(o); + PyObject_FREE(o); } static PyTypeObject EncodingMapType = { - PyVarObject_HEAD_INIT(NULL, 0) - "EncodingMap", /*tp_name*/ - sizeof(struct encoding_map), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - /* methods */ - encoding_map_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*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - encoding_map_methods, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - 0, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ + PyVarObject_HEAD_INIT(NULL, 0) + "EncodingMap", /*tp_name*/ + sizeof(struct encoding_map), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + /* methods */ + encoding_map_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*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + encoding_map_methods, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ }; PyObject* @@ -4629,10 +4629,10 @@ for (i = 1; i < 256; i++) { int l1, l2; if (decode[i] == 0 - #ifdef Py_UNICODE_WIDE +#ifdef Py_UNICODE_WIDE || decode[i] > 0xFFFF - #endif - ) { +#endif + ) { need_dict = 1; break; } @@ -4644,7 +4644,7 @@ if (level1[l1] == 0xFF) level1[l1] = count2++; if (level2[l2] == 0xFF) - level2[l2] = count3++; + level2[l2] = count3++; } if (count2 >= 0xFF || count3 >= 0xFF) @@ -4718,7 +4718,7 @@ #ifdef Py_UNICODE_WIDE if (c > 0xFFFF) { - return -1; + return -1; } #endif if (c == 0) @@ -4750,57 +4750,57 @@ PyObject *x; if (w == NULL) - return NULL; + return NULL; x = PyObject_GetItem(mapping, w); Py_DECREF(w); if (x == NULL) { - if (PyErr_ExceptionMatches(PyExc_LookupError)) { - /* No mapping found means: mapping is undefined. */ - PyErr_Clear(); - x = Py_None; - Py_INCREF(x); - return x; - } else - return NULL; + if (PyErr_ExceptionMatches(PyExc_LookupError)) { + /* No mapping found means: mapping is undefined. */ + PyErr_Clear(); + x = Py_None; + Py_INCREF(x); + return x; + } else + return NULL; } else if (x == Py_None) - return x; + return x; else if (PyLong_Check(x)) { - long value = PyLong_AS_LONG(x); - if (value < 0 || value > 255) { - PyErr_SetString(PyExc_TypeError, - "character mapping must be in range(256)"); - Py_DECREF(x); - return NULL; - } - return x; + long value = PyLong_AS_LONG(x); + if (value < 0 || value > 255) { + PyErr_SetString(PyExc_TypeError, + "character mapping must be in range(256)"); + Py_DECREF(x); + return NULL; + } + return x; } else if (PyBytes_Check(x)) - return x; + return x; else { - /* wrong return value */ - PyErr_Format(PyExc_TypeError, - "character mapping must return integer, bytes or None, not %.400s", - x->ob_type->tp_name); - Py_DECREF(x); - return NULL; + /* wrong return value */ + PyErr_Format(PyExc_TypeError, + "character mapping must return integer, bytes or None, not %.400s", + x->ob_type->tp_name); + Py_DECREF(x); + return NULL; } } static int charmapencode_resize(PyObject **outobj, Py_ssize_t *outpos, Py_ssize_t requiredsize) { - Py_ssize_t outsize = PyBytes_GET_SIZE(*outobj); - /* exponentially overallocate to minimize reallocations */ - if (requiredsize < 2*outsize) - requiredsize = 2*outsize; - if (_PyBytes_Resize(outobj, requiredsize)) - return -1; - return 0; + Py_ssize_t outsize = PyBytes_GET_SIZE(*outobj); + /* exponentially overallocate to minimize reallocations */ + if (requiredsize < 2*outsize) + requiredsize = 2*outsize; + if (_PyBytes_Resize(outobj, requiredsize)) + return -1; + return 0; } -typedef enum charmapencode_result { - enc_SUCCESS, enc_FAILED, enc_EXCEPTION +typedef enum charmapencode_result { + enc_SUCCESS, enc_FAILED, enc_EXCEPTION }charmapencode_result; /* lookup the character, put the result in the output string and adjust various state variables. Resize the output bytes object if not enough @@ -4810,7 +4810,7 @@ reallocation error occurred. The caller must decref the result */ static charmapencode_result charmapencode_output(Py_UNICODE c, PyObject *mapping, - PyObject **outobj, Py_ssize_t *outpos) + PyObject **outobj, Py_ssize_t *outpos) { PyObject *rep; char *outstart; @@ -4818,47 +4818,47 @@ if (Py_TYPE(mapping) == &EncodingMapType) { int res = encoding_map_lookup(c, mapping); - Py_ssize_t requiredsize = *outpos+1; + Py_ssize_t requiredsize = *outpos+1; if (res == -1) return enc_FAILED; - if (outsize0; ++uni2) { - x = charmapencode_output(*uni2, mapping, res, respos); - if (x==enc_EXCEPTION) { - return -1; - } - else if (x==enc_FAILED) { - Py_DECREF(repunicode); - raise_encode_exception(exceptionObject, encoding, p, size, collstartpos, collendpos, reason); - return -1; - } - } - *inpos = newpos; - Py_DECREF(repunicode); + case 1: /* strict */ + raise_encode_exception(exceptionObject, encoding, p, size, collstartpos, collendpos, reason); + return -1; + case 2: /* replace */ + for (collpos = collstartpos; collpos0; ++uni2) { + x = charmapencode_output(*uni2, mapping, res, respos); + if (x==enc_EXCEPTION) { + return -1; + } + else if (x==enc_FAILED) { + Py_DECREF(repunicode); + raise_encode_exception(exceptionObject, encoding, p, size, collstartpos, collendpos, reason); + return -1; + } + } + *inpos = newpos; + Py_DECREF(repunicode); } return 0; } PyObject *PyUnicode_EncodeCharmap(const Py_UNICODE *p, - Py_ssize_t size, - PyObject *mapping, - const char *errors) + Py_ssize_t size, + PyObject *mapping, + const char *errors) { /* output object */ PyObject *res = NULL; @@ -5002,7 +5002,7 @@ /* Default to Latin-1 */ if (mapping == NULL) - return PyUnicode_EncodeLatin1(p, size, errors); + return PyUnicode_EncodeLatin1(p, size, errors); /* allocate enough for a simple encoding without replacements, if we need more, we'll resize */ @@ -5010,24 +5010,24 @@ if (res == NULL) goto onError; if (size == 0) - return res; + return res; while (inpos adjust input position */ - ++inpos; + /* try to encode it */ + charmapencode_result x = charmapencode_output(p[inpos], mapping, &res, &respos); + if (x==enc_EXCEPTION) /* error */ + goto onError; + if (x==enc_FAILED) { /* unencodable character */ + if (charmap_encoding_error(p, size, &inpos, mapping, + &exc, + &known_errorHandler, &errorHandler, errors, + &res, &respos)) { + goto onError; + } + } + else + /* done with this character => adjust input position */ + ++inpos; } /* Resize if we allocated to much */ @@ -5039,7 +5039,7 @@ Py_XDECREF(errorHandler); return res; - onError: + onError: Py_XDECREF(res); Py_XDECREF(exc); Py_XDECREF(errorHandler); @@ -5047,52 +5047,52 @@ } PyObject *PyUnicode_AsCharmapString(PyObject *unicode, - PyObject *mapping) + PyObject *mapping) { if (!PyUnicode_Check(unicode) || mapping == NULL) { - PyErr_BadArgument(); - return NULL; + PyErr_BadArgument(); + return NULL; } return PyUnicode_EncodeCharmap(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - mapping, - NULL); + PyUnicode_GET_SIZE(unicode), + mapping, + NULL); } /* create or adjust a UnicodeTranslateError */ static void make_translate_exception(PyObject **exceptionObject, - const Py_UNICODE *unicode, Py_ssize_t size, - Py_ssize_t startpos, Py_ssize_t endpos, - const char *reason) + const Py_UNICODE *unicode, Py_ssize_t size, + Py_ssize_t startpos, Py_ssize_t endpos, + const char *reason) { if (*exceptionObject == NULL) { - *exceptionObject = PyUnicodeTranslateError_Create( - unicode, size, startpos, endpos, reason); + *exceptionObject = PyUnicodeTranslateError_Create( + unicode, size, startpos, endpos, reason); } else { - if (PyUnicodeTranslateError_SetStart(*exceptionObject, startpos)) - goto onError; - if (PyUnicodeTranslateError_SetEnd(*exceptionObject, endpos)) - goto onError; - if (PyUnicodeTranslateError_SetReason(*exceptionObject, reason)) - goto onError; - return; - onError: - Py_DECREF(*exceptionObject); - *exceptionObject = NULL; + if (PyUnicodeTranslateError_SetStart(*exceptionObject, startpos)) + goto onError; + if (PyUnicodeTranslateError_SetEnd(*exceptionObject, endpos)) + goto onError; + if (PyUnicodeTranslateError_SetReason(*exceptionObject, reason)) + goto onError; + return; + onError: + Py_DECREF(*exceptionObject); + *exceptionObject = NULL; } } /* raises a UnicodeTranslateError */ static void raise_translate_exception(PyObject **exceptionObject, - const Py_UNICODE *unicode, Py_ssize_t size, - Py_ssize_t startpos, Py_ssize_t endpos, - const char *reason) + const Py_UNICODE *unicode, Py_ssize_t size, + Py_ssize_t startpos, Py_ssize_t endpos, + const char *reason) { make_translate_exception(exceptionObject, - unicode, size, startpos, endpos, reason); + unicode, size, startpos, endpos, reason); if (*exceptionObject != NULL) - PyCodec_StrictErrors(*exceptionObject); + PyCodec_StrictErrors(*exceptionObject); } /* error handling callback helper: @@ -5100,11 +5100,11 @@ put the result into newpos and return the replacement string, which has to be freed by the caller */ static PyObject *unicode_translate_call_errorhandler(const char *errors, - PyObject **errorHandler, - 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 *reason, + const Py_UNICODE *unicode, Py_ssize_t size, PyObject **exceptionObject, + Py_ssize_t startpos, Py_ssize_t endpos, + Py_ssize_t *newpos) { static char *argparse = "O!n;translating error handler must return (str, int) tuple"; @@ -5113,38 +5113,38 @@ PyObject *resunicode; if (*errorHandler == NULL) { - *errorHandler = PyCodec_LookupError(errors); + *errorHandler = PyCodec_LookupError(errors); if (*errorHandler == NULL) - return NULL; + return NULL; } make_translate_exception(exceptionObject, - unicode, size, startpos, endpos, reason); + unicode, size, startpos, endpos, reason); if (*exceptionObject == NULL) - return NULL; + return NULL; restuple = PyObject_CallFunctionObjArgs( - *errorHandler, *exceptionObject, NULL); + *errorHandler, *exceptionObject, NULL); if (restuple == NULL) - return NULL; + return NULL; if (!PyTuple_Check(restuple)) { - PyErr_Format(PyExc_TypeError, &argparse[4]); - Py_DECREF(restuple); - return NULL; + PyErr_Format(PyExc_TypeError, &argparse[4]); + Py_DECREF(restuple); + return NULL; } if (!PyArg_ParseTuple(restuple, argparse, &PyUnicode_Type, - &resunicode, &i_newpos)) { - Py_DECREF(restuple); - return NULL; + &resunicode, &i_newpos)) { + Py_DECREF(restuple); + return NULL; } if (i_newpos<0) - *newpos = size+i_newpos; + *newpos = size+i_newpos; else *newpos = i_newpos; if (*newpos<0 || *newpos>size) { - PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", *newpos); - Py_DECREF(restuple); - return NULL; + PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", *newpos); + Py_DECREF(restuple); + return NULL; } Py_INCREF(resunicode); Py_DECREF(restuple); @@ -5161,63 +5161,63 @@ PyObject *x; if (w == NULL) - return -1; + return -1; x = PyObject_GetItem(mapping, w); Py_DECREF(w); if (x == NULL) { - if (PyErr_ExceptionMatches(PyExc_LookupError)) { - /* No mapping found means: use 1:1 mapping. */ - PyErr_Clear(); - *result = NULL; - return 0; - } else - return -1; + if (PyErr_ExceptionMatches(PyExc_LookupError)) { + /* No mapping found means: use 1:1 mapping. */ + PyErr_Clear(); + *result = NULL; + return 0; + } else + return -1; } else if (x == Py_None) { - *result = x; - return 0; + *result = x; + return 0; } else if (PyLong_Check(x)) { - long value = PyLong_AS_LONG(x); - long max = PyUnicode_GetMax(); - if (value < 0 || value > max) { - PyErr_Format(PyExc_TypeError, + long value = PyLong_AS_LONG(x); + long max = PyUnicode_GetMax(); + if (value < 0 || value > max) { + PyErr_Format(PyExc_TypeError, "character mapping must be in range(0x%x)", max+1); - Py_DECREF(x); - return -1; - } - *result = x; - return 0; + Py_DECREF(x); + return -1; + } + *result = x; + return 0; } else if (PyUnicode_Check(x)) { - *result = x; - return 0; + *result = x; + return 0; } else { - /* wrong return value */ - PyErr_SetString(PyExc_TypeError, - "character mapping must return integer, None or str"); - Py_DECREF(x); - return -1; + /* wrong return value */ + PyErr_SetString(PyExc_TypeError, + "character mapping must return integer, None or str"); + Py_DECREF(x); + return -1; } } /* ensure that *outobj is at least requiredsize characters long, -if not reallocate and adjust various state variables. -Return 0 on success, -1 on error */ + if not reallocate and adjust various state variables. + Return 0 on success, -1 on error */ static int charmaptranslate_makespace(PyObject **outobj, Py_UNICODE **outp, - Py_ssize_t requiredsize) + Py_ssize_t requiredsize) { Py_ssize_t oldsize = PyUnicode_GET_SIZE(*outobj); if (requiredsize > oldsize) { - /* remember old output position */ - Py_ssize_t outpos = *outp-PyUnicode_AS_UNICODE(*outobj); - /* exponentially overallocate to minimize reallocations */ - if (requiredsize < 2 * oldsize) - requiredsize = 2 * oldsize; - if (PyUnicode_Resize(outobj, requiredsize) < 0) - return -1; - *outp = PyUnicode_AS_UNICODE(*outobj) + outpos; + /* remember old output position */ + Py_ssize_t outpos = *outp-PyUnicode_AS_UNICODE(*outobj); + /* exponentially overallocate to minimize reallocations */ + if (requiredsize < 2 * oldsize) + requiredsize = 2 * oldsize; + if (PyUnicode_Resize(outobj, requiredsize) < 0) + return -1; + *outp = PyUnicode_AS_UNICODE(*outobj) + outpos; } return 0; } @@ -5229,47 +5229,47 @@ Return 0 on success, -1 on error. */ static int charmaptranslate_output(const Py_UNICODE *startinp, const Py_UNICODE *curinp, - Py_ssize_t insize, PyObject *mapping, PyObject **outobj, Py_UNICODE **outp, - PyObject **res) + Py_ssize_t insize, PyObject *mapping, PyObject **outobj, Py_UNICODE **outp, + PyObject **res) { if (charmaptranslate_lookup(*curinp, mapping, res)) - return -1; + return -1; if (*res==NULL) { - /* not found => default to 1:1 mapping */ - *(*outp)++ = *curinp; + /* not found => default to 1:1 mapping */ + *(*outp)++ = *curinp; } else if (*res==Py_None) - ; + ; else if (PyLong_Check(*res)) { - /* no overflow check, because we know that the space is enough */ - *(*outp)++ = (Py_UNICODE)PyLong_AS_LONG(*res); + /* no overflow check, because we know that the space is enough */ + *(*outp)++ = (Py_UNICODE)PyLong_AS_LONG(*res); } else if (PyUnicode_Check(*res)) { - Py_ssize_t repsize = PyUnicode_GET_SIZE(*res); - if (repsize==1) { - /* no overflow check, because we know that the space is enough */ - *(*outp)++ = *PyUnicode_AS_UNICODE(*res); - } - else if (repsize!=0) { - /* more than one character */ - Py_ssize_t requiredsize = (*outp-PyUnicode_AS_UNICODE(*outobj)) + - (insize - (curinp-startinp)) + - repsize - 1; - if (charmaptranslate_makespace(outobj, outp, requiredsize)) - return -1; - memcpy(*outp, PyUnicode_AS_UNICODE(*res), sizeof(Py_UNICODE)*repsize); - *outp += repsize; - } + Py_ssize_t repsize = PyUnicode_GET_SIZE(*res); + if (repsize==1) { + /* no overflow check, because we know that the space is enough */ + *(*outp)++ = *PyUnicode_AS_UNICODE(*res); + } + else if (repsize!=0) { + /* more than one character */ + Py_ssize_t requiredsize = (*outp-PyUnicode_AS_UNICODE(*outobj)) + + (insize - (curinp-startinp)) + + repsize - 1; + if (charmaptranslate_makespace(outobj, outp, requiredsize)) + return -1; + memcpy(*outp, PyUnicode_AS_UNICODE(*res), sizeof(Py_UNICODE)*repsize); + *outp += repsize; + } } else - return -1; + return -1; return 0; } PyObject *PyUnicode_TranslateCharmap(const Py_UNICODE *p, - Py_ssize_t size, - PyObject *mapping, - const char *errors) + Py_ssize_t size, + PyObject *mapping, + const char *errors) { /* output object */ PyObject *res = NULL; @@ -5289,119 +5289,119 @@ int known_errorHandler = -1; if (mapping == NULL) { - PyErr_BadArgument(); - return NULL; + PyErr_BadArgument(); + return NULL; } /* allocate enough for a simple 1:1 translation without replacements, if we need more, we'll resize */ res = PyUnicode_FromUnicode(NULL, size); if (res == NULL) - goto onError; + goto onError; if (size == 0) - return res; + return res; str = PyUnicode_AS_UNICODE(res); while (p adjust input pointer */ - ++p; - else { /* untranslatable character */ - PyObject *repunicode = NULL; /* initialize to prevent gcc warning */ - Py_ssize_t repsize; - Py_ssize_t newpos; - Py_UNICODE *uni2; - /* startpos for collecting untranslatable chars */ - const Py_UNICODE *collstart = p; - const Py_UNICODE *collend = p+1; - const Py_UNICODE *coll; - - /* find all untranslatable characters */ - while (collend < endp) { - if (charmaptranslate_lookup(*collend, mapping, &x)) - goto onError; - Py_XDECREF(x); - if (x!=Py_None) - break; - ++collend; - } - /* cache callback name lookup - * (if not done yet, i.e. it's the first error) */ - if (known_errorHandler==-1) { - if ((errors==NULL) || (!strcmp(errors, "strict"))) - known_errorHandler = 1; - else if (!strcmp(errors, "replace")) - known_errorHandler = 2; - else if (!strcmp(errors, "ignore")) - known_errorHandler = 3; - else if (!strcmp(errors, "xmlcharrefreplace")) - known_errorHandler = 4; - else - known_errorHandler = 0; - } - switch (known_errorHandler) { - case 1: /* strict */ - raise_translate_exception(&exc, startp, size, collstart-startp, collend-startp, reason); - goto onError; - case 2: /* replace */ - /* No need to check for space, this is a 1:1 replacement */ - for (coll = collstart; coll0; ++uni2) - *str++ = *uni2; - p = startp + newpos; - Py_DECREF(repunicode); - } - } + /* try to encode it */ + PyObject *x = NULL; + if (charmaptranslate_output(startp, p, size, mapping, &res, &str, &x)) { + Py_XDECREF(x); + goto onError; + } + Py_XDECREF(x); + if (x!=Py_None) /* it worked => adjust input pointer */ + ++p; + else { /* untranslatable character */ + PyObject *repunicode = NULL; /* initialize to prevent gcc warning */ + Py_ssize_t repsize; + Py_ssize_t newpos; + Py_UNICODE *uni2; + /* startpos for collecting untranslatable chars */ + const Py_UNICODE *collstart = p; + const Py_UNICODE *collend = p+1; + const Py_UNICODE *coll; + + /* find all untranslatable characters */ + while (collend < endp) { + if (charmaptranslate_lookup(*collend, mapping, &x)) + goto onError; + Py_XDECREF(x); + if (x!=Py_None) + break; + ++collend; + } + /* cache callback name lookup + * (if not done yet, i.e. it's the first error) */ + if (known_errorHandler==-1) { + if ((errors==NULL) || (!strcmp(errors, "strict"))) + known_errorHandler = 1; + else if (!strcmp(errors, "replace")) + known_errorHandler = 2; + else if (!strcmp(errors, "ignore")) + known_errorHandler = 3; + else if (!strcmp(errors, "xmlcharrefreplace")) + known_errorHandler = 4; + else + known_errorHandler = 0; + } + switch (known_errorHandler) { + case 1: /* strict */ + raise_translate_exception(&exc, startp, size, collstart-startp, collend-startp, reason); + goto onError; + case 2: /* replace */ + /* No need to check for space, this is a 1:1 replacement */ + for (coll = collstart; coll0; ++uni2) + *str++ = *uni2; + p = startp + newpos; + Py_DECREF(repunicode); + } + } } /* Resize if we allocated to much */ respos = str-PyUnicode_AS_UNICODE(res); if (respos= 0) { - *output++ = '0' + decimal; - ++p; - continue; - } - if (0 < ch && ch < 256) { - *output++ = (char)ch; - ++p; - continue; - } - /* All other characters are considered unencodable */ - collstart = p; - collend = p+1; - while (collend < end) { - if ((0 < *collend && *collend < 256) || - !Py_UNICODE_ISSPACE(*collend) || - Py_UNICODE_TODECIMAL(*collend)) - break; - } - /* cache callback name lookup - * (if not done yet, i.e. it's the first error) */ - if (known_errorHandler==-1) { - if ((errors==NULL) || (!strcmp(errors, "strict"))) - known_errorHandler = 1; - else if (!strcmp(errors, "replace")) - known_errorHandler = 2; - else if (!strcmp(errors, "ignore")) - known_errorHandler = 3; - else if (!strcmp(errors, "xmlcharrefreplace")) - known_errorHandler = 4; - else - known_errorHandler = 0; - } - switch (known_errorHandler) { - case 1: /* strict */ - raise_encode_exception(&exc, encoding, s, length, collstart-s, collend-s, reason); - goto onError; - case 2: /* replace */ - for (p = collstart; p < collend; ++p) - *output++ = '?'; - /* fall through */ - case 3: /* ignore */ - p = collend; - break; - case 4: /* xmlcharrefreplace */ - /* generate replacement (temporarily (mis)uses p) */ - for (p = collstart; p < collend; ++p) - output += sprintf(output, "&#%d;", (int)*p); - p = collend; - break; - default: - repunicode = unicode_encode_call_errorhandler(errors, &errorHandler, - encoding, reason, s, length, &exc, - collstart-s, collend-s, &newpos); - if (repunicode == NULL) - goto onError; - /* generate replacement */ - repsize = PyUnicode_GET_SIZE(repunicode); - for (uni2 = PyUnicode_AS_UNICODE(repunicode); repsize-->0; ++uni2) { - Py_UNICODE ch = *uni2; - if (Py_UNICODE_ISSPACE(ch)) - *output++ = ' '; - else { - decimal = Py_UNICODE_TODECIMAL(ch); - if (decimal >= 0) - *output++ = '0' + decimal; - else if (0 < ch && ch < 256) - *output++ = (char)ch; - else { - Py_DECREF(repunicode); - raise_encode_exception(&exc, encoding, - s, length, collstart-s, collend-s, reason); - goto onError; - } - } - } - p = s + newpos; - Py_DECREF(repunicode); - } + register Py_UNICODE ch = *p; + int decimal; + PyObject *repunicode; + Py_ssize_t repsize; + Py_ssize_t newpos; + Py_UNICODE *uni2; + Py_UNICODE *collstart; + Py_UNICODE *collend; + + if (Py_UNICODE_ISSPACE(ch)) { + *output++ = ' '; + ++p; + continue; + } + decimal = Py_UNICODE_TODECIMAL(ch); + if (decimal >= 0) { + *output++ = '0' + decimal; + ++p; + continue; + } + if (0 < ch && ch < 256) { + *output++ = (char)ch; + ++p; + continue; + } + /* All other characters are considered unencodable */ + collstart = p; + collend = p+1; + while (collend < end) { + if ((0 < *collend && *collend < 256) || + !Py_UNICODE_ISSPACE(*collend) || + Py_UNICODE_TODECIMAL(*collend)) + break; + } + /* cache callback name lookup + * (if not done yet, i.e. it's the first error) */ + if (known_errorHandler==-1) { + if ((errors==NULL) || (!strcmp(errors, "strict"))) + known_errorHandler = 1; + else if (!strcmp(errors, "replace")) + known_errorHandler = 2; + else if (!strcmp(errors, "ignore")) + known_errorHandler = 3; + else if (!strcmp(errors, "xmlcharrefreplace")) + known_errorHandler = 4; + else + known_errorHandler = 0; + } + switch (known_errorHandler) { + case 1: /* strict */ + raise_encode_exception(&exc, encoding, s, length, collstart-s, collend-s, reason); + goto onError; + case 2: /* replace */ + for (p = collstart; p < collend; ++p) + *output++ = '?'; + /* fall through */ + case 3: /* ignore */ + p = collend; + break; + case 4: /* xmlcharrefreplace */ + /* generate replacement (temporarily (mis)uses p) */ + for (p = collstart; p < collend; ++p) + output += sprintf(output, "&#%d;", (int)*p); + p = collend; + break; + default: + repunicode = unicode_encode_call_errorhandler(errors, &errorHandler, + encoding, reason, s, length, &exc, + collstart-s, collend-s, &newpos); + if (repunicode == NULL) + goto onError; + /* generate replacement */ + repsize = PyUnicode_GET_SIZE(repunicode); + for (uni2 = PyUnicode_AS_UNICODE(repunicode); repsize-->0; ++uni2) { + Py_UNICODE ch = *uni2; + if (Py_UNICODE_ISSPACE(ch)) + *output++ = ' '; + else { + decimal = Py_UNICODE_TODECIMAL(ch); + if (decimal >= 0) + *output++ = '0' + decimal; + else if (0 < ch && ch < 256) + *output++ = (char)ch; + else { + Py_DECREF(repunicode); + raise_encode_exception(&exc, encoding, + s, length, collstart-s, collend-s, reason); + goto onError; + } + } + } + p = s + newpos; + Py_DECREF(repunicode); + } } /* 0-terminate the output string */ *output++ = '\0'; @@ -5554,7 +5554,7 @@ Py_XDECREF(errorHandler); return 0; - onError: + onError: Py_XDECREF(exc); Py_XDECREF(errorHandler); return -1; @@ -5597,11 +5597,11 @@ str_obj = (PyUnicodeObject*) PyUnicode_FromObject(str); if (!str_obj) - return -1; + return -1; sub_obj = (PyUnicodeObject*) PyUnicode_FromObject(substr); if (!sub_obj) { - Py_DECREF(str_obj); - return -1; + Py_DECREF(str_obj); + return -1; } FIX_START_END(str_obj); @@ -5626,11 +5626,11 @@ str = PyUnicode_FromObject(str); if (!str) - return -2; + return -2; sub = PyUnicode_FromObject(sub); if (!sub) { - Py_DECREF(str); - return -2; + Py_DECREF(str); + return -2; } if (direction > 0) @@ -5654,10 +5654,10 @@ static int tailmatch(PyUnicodeObject *self, - PyUnicodeObject *substring, - Py_ssize_t start, - Py_ssize_t end, - int direction) + PyUnicodeObject *substring, + Py_ssize_t start, + Py_ssize_t end, + int direction) { if (substring->length == 0) return 1; @@ -5666,39 +5666,39 @@ end -= substring->length; if (end < start) - return 0; + return 0; if (direction > 0) { - if (Py_UNICODE_MATCH(self, end, substring)) - return 1; + if (Py_UNICODE_MATCH(self, end, substring)) + return 1; } else { if (Py_UNICODE_MATCH(self, start, substring)) - return 1; + return 1; } return 0; } Py_ssize_t PyUnicode_Tailmatch(PyObject *str, - PyObject *substr, - Py_ssize_t start, - Py_ssize_t end, - int direction) + PyObject *substr, + Py_ssize_t start, + Py_ssize_t end, + int direction) { Py_ssize_t result; str = PyUnicode_FromObject(str); if (str == NULL) - return -1; + return -1; substr = PyUnicode_FromObject(substr); if (substr == NULL) { - Py_DECREF(str); - return -1; + Py_DECREF(str); + return -1; } result = tailmatch((PyUnicodeObject *)str, - (PyUnicodeObject *)substr, - start, end, direction); + (PyUnicodeObject *)substr, + start, end, direction); Py_DECREF(str); Py_DECREF(substr); return result; @@ -5709,24 +5709,24 @@ static PyObject *fixup(PyUnicodeObject *self, - int (*fixfct)(PyUnicodeObject *s)) + int (*fixfct)(PyUnicodeObject *s)) { PyUnicodeObject *u; u = (PyUnicodeObject*) PyUnicode_FromUnicode(NULL, self->length); if (u == NULL) - return NULL; + return NULL; Py_UNICODE_COPY(u->str, self->str, self->length); if (!fixfct(u) && PyUnicode_CheckExact(self)) { - /* fixfct should return TRUE if it modified the buffer. If - FALSE, return a reference to the original buffer instead - (to save space, not time) */ - Py_INCREF(self); - Py_DECREF(u); - return (PyObject*) self; + /* fixfct should return TRUE if it modified the buffer. If + FALSE, return a reference to the original buffer instead + (to save space, not time) */ + Py_INCREF(self); + Py_DECREF(u); + return (PyObject*) self; } return (PyObject*) u; } @@ -5739,13 +5739,13 @@ int status = 0; while (len-- > 0) { - register Py_UNICODE ch; + register Py_UNICODE ch; - ch = Py_UNICODE_TOUPPER(*s); - if (ch != *s) { + ch = Py_UNICODE_TOUPPER(*s); + if (ch != *s) { status = 1; - *s = ch; - } + *s = ch; + } s++; } @@ -5760,13 +5760,13 @@ int status = 0; while (len-- > 0) { - register Py_UNICODE ch; + register Py_UNICODE ch; - ch = Py_UNICODE_TOLOWER(*s); - if (ch != *s) { + ch = Py_UNICODE_TOLOWER(*s); + if (ch != *s) { status = 1; - *s = ch; - } + *s = ch; + } s++; } @@ -5802,10 +5802,10 @@ int status = 0; if (len == 0) - return 0; + return 0; if (Py_UNICODE_ISLOWER(*s)) { - *s = Py_UNICODE_TOUPPER(*s); - status = 1; + *s = Py_UNICODE_TOUPPER(*s); + status = 1; } s++; while (--len > 0) { @@ -5827,31 +5827,31 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1) { - Py_UNICODE ch = Py_UNICODE_TOTITLE(*p); - if (*p != ch) { - *p = ch; - return 1; - } - else - return 0; + Py_UNICODE ch = Py_UNICODE_TOTITLE(*p); + if (*p != ch) { + *p = ch; + return 1; + } + else + return 0; } e = p + PyUnicode_GET_SIZE(self); previous_is_cased = 0; for (; p < e; p++) { - register const Py_UNICODE ch = *p; + register const Py_UNICODE ch = *p; - if (previous_is_cased) - *p = Py_UNICODE_TOLOWER(ch); - else - *p = Py_UNICODE_TOTITLE(ch); - - if (Py_UNICODE_ISLOWER(ch) || - Py_UNICODE_ISUPPER(ch) || - Py_UNICODE_ISTITLE(ch)) - previous_is_cased = 1; - else - previous_is_cased = 0; + if (previous_is_cased) + *p = Py_UNICODE_TOLOWER(ch); + else + *p = Py_UNICODE_TOTITLE(ch); + + if (Py_UNICODE_ISLOWER(ch) || + Py_UNICODE_ISUPPER(ch) || + Py_UNICODE_ISTITLE(ch)) + previous_is_cased = 1; + else + previous_is_cased = 0; } return 1; } @@ -5872,7 +5872,7 @@ fseq = PySequence_Fast(seq, ""); if (fseq == NULL) { - return NULL; + return NULL; } /* NOTE: the following code can't call back into Python code, @@ -5882,18 +5882,18 @@ seqlen = PySequence_Fast_GET_SIZE(fseq); /* If empty sequence, return u"". */ if (seqlen == 0) { - res = _PyUnicode_New(0); /* empty sequence; return u"" */ - goto Done; + res = _PyUnicode_New(0); /* empty sequence; return u"" */ + goto Done; } items = PySequence_Fast_ITEMS(fseq); /* If singleton sequence with an exact Unicode, return that. */ if (seqlen == 1) { - item = items[0]; - if (PyUnicode_CheckExact(item)) { - Py_INCREF(item); - res = (PyUnicodeObject *)item; - goto Done; - } + item = items[0]; + if (PyUnicode_CheckExact(item)) { + Py_INCREF(item); + res = (PyUnicodeObject *)item; + goto Done; + } } else { /* Set up sep and seplen */ @@ -5923,19 +5923,19 @@ for (i = 0; i < seqlen; i++) { const Py_ssize_t old_sz = sz; item = items[i]; - if (!PyUnicode_Check(item)) { - PyErr_Format(PyExc_TypeError, - "sequence item %zd: expected str instance," - " %.80s found", - i, Py_TYPE(item)->tp_name); - goto onError; - } + if (!PyUnicode_Check(item)) { + PyErr_Format(PyExc_TypeError, + "sequence item %zd: expected str instance," + " %.80s found", + i, Py_TYPE(item)->tp_name); + goto onError; + } sz += PyUnicode_GET_SIZE(item); if (i != 0) sz += seplen; if (sz < old_sz || sz > PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, - "join() result is too long for a Python string"); + "join() result is too long for a Python string"); goto onError; } } @@ -5950,20 +5950,20 @@ Py_ssize_t itemlen; item = items[i]; itemlen = PyUnicode_GET_SIZE(item); - /* Copy item, and maybe the separator. */ - if (i) { - Py_UNICODE_COPY(res_p, sep, seplen); - res_p += seplen; - } - Py_UNICODE_COPY(res_p, PyUnicode_AS_UNICODE(item), itemlen); - res_p += itemlen; + /* Copy item, and maybe the separator. */ + if (i) { + Py_UNICODE_COPY(res_p, sep, seplen); + res_p += seplen; + } + Py_UNICODE_COPY(res_p, PyUnicode_AS_UNICODE(item), itemlen); + res_p += itemlen; } - Done: + Done: Py_DECREF(fseq); return (PyObject *)res; - onError: + onError: Py_DECREF(fseq); Py_XDECREF(res); return NULL; @@ -5971,9 +5971,9 @@ static PyUnicodeObject *pad(PyUnicodeObject *self, - Py_ssize_t left, - Py_ssize_t right, - Py_UNICODE fill) + Py_ssize_t left, + Py_ssize_t right, + Py_UNICODE fill) { PyUnicodeObject *u; @@ -6004,21 +6004,21 @@ return u; } -#define SPLIT_APPEND(data, left, right) \ - str = PyUnicode_FromUnicode((data) + (left), (right) - (left)); \ - if (!str) \ - goto onError; \ - if (PyList_Append(list, str)) { \ - Py_DECREF(str); \ - goto onError; \ - } \ - else \ - Py_DECREF(str); +#define SPLIT_APPEND(data, left, right) \ + str = PyUnicode_FromUnicode((data) + (left), (right) - (left)); \ + if (!str) \ + goto onError; \ + if (PyList_Append(list, str)) { \ + Py_DECREF(str); \ + goto onError; \ + } \ + else \ + Py_DECREF(str); static PyObject *split_whitespace(PyUnicodeObject *self, - PyObject *list, - Py_ssize_t maxcount) + PyObject *list, + Py_ssize_t maxcount) { register Py_ssize_t i; register Py_ssize_t j; @@ -6027,33 +6027,33 @@ register const Py_UNICODE *buf = self->str; for (i = j = 0; i < len; ) { - /* find a token */ - while (i < len && Py_UNICODE_ISSPACE(buf[i])) - i++; - j = i; - while (i < len && !Py_UNICODE_ISSPACE(buf[i])) - i++; - if (j < i) { - if (maxcount-- <= 0) - break; - SPLIT_APPEND(buf, j, i); - while (i < len && Py_UNICODE_ISSPACE(buf[i])) - i++; - j = i; - } + /* find a token */ + while (i < len && Py_UNICODE_ISSPACE(buf[i])) + i++; + j = i; + while (i < len && !Py_UNICODE_ISSPACE(buf[i])) + i++; + if (j < i) { + if (maxcount-- <= 0) + break; + SPLIT_APPEND(buf, j, i); + while (i < len && Py_UNICODE_ISSPACE(buf[i])) + i++; + j = i; + } } if (j < len) { - SPLIT_APPEND(buf, j, len); + SPLIT_APPEND(buf, j, len); } return list; - onError: + onError: Py_DECREF(list); return NULL; } PyObject *PyUnicode_Splitlines(PyObject *string, - int keepends) + int keepends) { register Py_ssize_t i; register Py_ssize_t j; @@ -6064,7 +6064,7 @@ string = PyUnicode_FromObject(string); if (string == NULL) - return NULL; + return NULL; data = PyUnicode_AS_UNICODE(string); len = PyUnicode_GET_SIZE(string); @@ -6073,34 +6073,34 @@ goto onError; for (i = j = 0; i < len; ) { - Py_ssize_t eol; + Py_ssize_t eol; - /* Find a line and append it */ - while (i < len && !BLOOM_LINEBREAK(data[i])) - i++; - - /* Skip the line break reading CRLF as one line break */ - eol = i; - if (i < len) { - if (data[i] == '\r' && i + 1 < len && - data[i+1] == '\n') - i += 2; - else - i++; - if (keepends) - eol = i; - } - SPLIT_APPEND(data, j, eol); - j = i; + /* Find a line and append it */ + while (i < len && !BLOOM_LINEBREAK(data[i])) + i++; + + /* Skip the line break reading CRLF as one line break */ + eol = i; + if (i < len) { + if (data[i] == '\r' && i + 1 < len && + data[i+1] == '\n') + i += 2; + else + i++; + if (keepends) + eol = i; + } + SPLIT_APPEND(data, j, eol); + j = i; } if (j < len) { - SPLIT_APPEND(data, j, len); + SPLIT_APPEND(data, j, len); } Py_DECREF(string); return list; - onError: + onError: Py_XDECREF(list); Py_DECREF(string); return NULL; @@ -6108,9 +6108,9 @@ static PyObject *split_char(PyUnicodeObject *self, - PyObject *list, - Py_UNICODE ch, - Py_ssize_t maxcount) + PyObject *list, + Py_UNICODE ch, + Py_ssize_t maxcount) { register Py_ssize_t i; register Py_ssize_t j; @@ -6119,29 +6119,29 @@ register const Py_UNICODE *buf = self->str; for (i = j = 0; i < len; ) { - if (buf[i] == ch) { - if (maxcount-- <= 0) - break; - SPLIT_APPEND(buf, j, i); - i = j = i + 1; - } else - i++; + if (buf[i] == ch) { + if (maxcount-- <= 0) + break; + SPLIT_APPEND(buf, j, i); + i = j = i + 1; + } else + i++; } if (j <= len) { - SPLIT_APPEND(buf, j, len); + SPLIT_APPEND(buf, j, len); } return list; - onError: + onError: Py_DECREF(list); return NULL; } static PyObject *split_substring(PyUnicodeObject *self, - PyObject *list, - PyUnicodeObject *substring, - Py_ssize_t maxcount) + PyObject *list, + PyUnicodeObject *substring, + Py_ssize_t maxcount) { register Py_ssize_t i; register Py_ssize_t j; @@ -6150,28 +6150,28 @@ PyObject *str; for (i = j = 0; i <= len - sublen; ) { - if (Py_UNICODE_MATCH(self, i, substring)) { - if (maxcount-- <= 0) - break; - SPLIT_APPEND(self->str, j, i); - i = j = i + sublen; - } else - i++; + if (Py_UNICODE_MATCH(self, i, substring)) { + if (maxcount-- <= 0) + break; + SPLIT_APPEND(self->str, j, i); + i = j = i + sublen; + } else + i++; } if (j <= len) { - SPLIT_APPEND(self->str, j, len); + SPLIT_APPEND(self->str, j, len); } return list; - onError: + onError: Py_DECREF(list); return NULL; } static PyObject *rsplit_whitespace(PyUnicodeObject *self, - PyObject *list, - Py_ssize_t maxcount) + PyObject *list, + Py_ssize_t maxcount) { register Py_ssize_t i; register Py_ssize_t j; @@ -6180,38 +6180,38 @@ register const Py_UNICODE *buf = self->str; for (i = j = len - 1; i >= 0; ) { - /* find a token */ - while (i >= 0 && Py_UNICODE_ISSPACE(buf[i])) - i--; - j = i; - while (i >= 0 && !Py_UNICODE_ISSPACE(buf[i])) - i--; - if (j > i) { - if (maxcount-- <= 0) - break; - SPLIT_APPEND(buf, i + 1, j + 1); - while (i >= 0 && Py_UNICODE_ISSPACE(buf[i])) - i--; - j = i; - } + /* find a token */ + while (i >= 0 && Py_UNICODE_ISSPACE(buf[i])) + i--; + j = i; + while (i >= 0 && !Py_UNICODE_ISSPACE(buf[i])) + i--; + if (j > i) { + if (maxcount-- <= 0) + break; + SPLIT_APPEND(buf, i + 1, j + 1); + while (i >= 0 && Py_UNICODE_ISSPACE(buf[i])) + i--; + j = i; + } } if (j >= 0) { - SPLIT_APPEND(buf, 0, j + 1); + SPLIT_APPEND(buf, 0, j + 1); } if (PyList_Reverse(list) < 0) goto onError; return list; - onError: + onError: Py_DECREF(list); return NULL; } -static +static PyObject *rsplit_char(PyUnicodeObject *self, - PyObject *list, - Py_UNICODE ch, - Py_ssize_t maxcount) + PyObject *list, + Py_UNICODE ch, + Py_ssize_t maxcount) { register Py_ssize_t i; register Py_ssize_t j; @@ -6220,31 +6220,31 @@ register const Py_UNICODE *buf = self->str; for (i = j = len - 1; i >= 0; ) { - if (buf[i] == ch) { - if (maxcount-- <= 0) - break; - SPLIT_APPEND(buf, i + 1, j + 1); - j = i = i - 1; - } else - i--; + if (buf[i] == ch) { + if (maxcount-- <= 0) + break; + SPLIT_APPEND(buf, i + 1, j + 1); + j = i = i - 1; + } else + i--; } if (j >= -1) { - SPLIT_APPEND(buf, 0, j + 1); + SPLIT_APPEND(buf, 0, j + 1); } if (PyList_Reverse(list) < 0) goto onError; return list; - onError: + onError: Py_DECREF(list); return NULL; } -static +static PyObject *rsplit_substring(PyUnicodeObject *self, - PyObject *list, - PyUnicodeObject *substring, - Py_ssize_t maxcount) + PyObject *list, + PyUnicodeObject *substring, + Py_ssize_t maxcount) { register Py_ssize_t i; register Py_ssize_t j; @@ -6253,23 +6253,23 @@ PyObject *str; for (i = len - sublen, j = len; i >= 0; ) { - if (Py_UNICODE_MATCH(self, i, substring)) { - if (maxcount-- <= 0) - break; - SPLIT_APPEND(self->str, i + sublen, j); - j = i; - i -= sublen; - } else - i--; + if (Py_UNICODE_MATCH(self, i, substring)) { + if (maxcount-- <= 0) + break; + SPLIT_APPEND(self->str, i + sublen, j); + j = i; + i -= sublen; + } else + i--; } if (j >= 0) { - SPLIT_APPEND(self->str, 0, j); + SPLIT_APPEND(self->str, 0, j); } if (PyList_Reverse(list) < 0) goto onError; return list; - onError: + onError: Py_DECREF(list); return NULL; } @@ -6278,8 +6278,8 @@ static PyObject *split(PyUnicodeObject *self, - PyUnicodeObject *substring, - Py_ssize_t maxcount) + PyUnicodeObject *substring, + Py_ssize_t maxcount) { PyObject *list; @@ -6291,24 +6291,24 @@ return NULL; if (substring == NULL) - return split_whitespace(self,list,maxcount); + return split_whitespace(self,list,maxcount); else if (substring->length == 1) - return split_char(self,list,substring->str[0],maxcount); + return split_char(self,list,substring->str[0],maxcount); else if (substring->length == 0) { - Py_DECREF(list); - PyErr_SetString(PyExc_ValueError, "empty separator"); - return NULL; + Py_DECREF(list); + PyErr_SetString(PyExc_ValueError, "empty separator"); + return NULL; } else - return split_substring(self,list,substring,maxcount); + return split_substring(self,list,substring,maxcount); } static PyObject *rsplit(PyUnicodeObject *self, - PyUnicodeObject *substring, - Py_ssize_t maxcount) + PyUnicodeObject *substring, + Py_ssize_t maxcount) { PyObject *list; @@ -6320,30 +6320,30 @@ return NULL; if (substring == NULL) - return rsplit_whitespace(self,list,maxcount); + return rsplit_whitespace(self,list,maxcount); else if (substring->length == 1) - return rsplit_char(self,list,substring->str[0],maxcount); + return rsplit_char(self,list,substring->str[0],maxcount); else if (substring->length == 0) { - Py_DECREF(list); - PyErr_SetString(PyExc_ValueError, "empty separator"); - return NULL; + Py_DECREF(list); + PyErr_SetString(PyExc_ValueError, "empty separator"); + return NULL; } else - return rsplit_substring(self,list,substring,maxcount); + return rsplit_substring(self,list,substring,maxcount); } static PyObject *replace(PyUnicodeObject *self, - PyUnicodeObject *str1, - PyUnicodeObject *str2, - Py_ssize_t maxcount) + PyUnicodeObject *str1, + PyUnicodeObject *str2, + Py_ssize_t maxcount) { PyUnicodeObject *u; if (maxcount < 0) - maxcount = PY_SSIZE_T_MAX; + maxcount = PY_SSIZE_T_MAX; if (str1->length == str2->length) { /* same length */ @@ -6429,7 +6429,7 @@ break; j++; } - if (j > i) { + if (j > i) { if (j > e) break; /* copy unchanged part [i:j] */ @@ -6460,7 +6460,7 @@ } return (PyObject *) u; -nothing: + nothing: /* nothing to replace; return original string (when possible) */ if (PyUnicode_CheckExact(self)) { Py_INCREF(self); @@ -6472,7 +6472,7 @@ /* --- Unicode Object Methods --------------------------------------------- */ PyDoc_STRVAR(title__doc__, -"S.title() -> str\n\ + "S.title() -> str\n\ \n\ Return a titlecased version of S, i.e. words start with title case\n\ characters, all remaining cased characters have lower case."); @@ -6484,7 +6484,7 @@ } PyDoc_STRVAR(capitalize__doc__, -"S.capitalize() -> str\n\ + "S.capitalize() -> str\n\ \n\ Return a capitalized version of S, i.e. make the first character\n\ have upper case."); @@ -6497,7 +6497,7 @@ #if 0 PyDoc_STRVAR(capwords__doc__, -"S.capwords() -> str\n\ + "S.capwords() -> str\n\ \n\ Apply .capitalize() to all words in S and return the result with\n\ normalized whitespace (all whitespace strings are replaced by ' ')."); @@ -6517,7 +6517,7 @@ /* Capitalize each word */ for (i = 0; i < PyList_GET_SIZE(list); i++) { item = fixup((PyUnicodeObject *)PyList_GET_ITEM(list, i), - fixcapitalize); + fixcapitalize); if (item == NULL) goto onError; Py_DECREF(PyList_GET_ITEM(list, i)); @@ -6527,7 +6527,7 @@ /* Join the words to form a new string */ item = PyUnicode_Join(NULL, list); -onError: + onError: Py_DECREF(list); return (PyObject *)item; } @@ -6538,30 +6538,30 @@ static int convert_uc(PyObject *obj, void *addr) { - Py_UNICODE *fillcharloc = (Py_UNICODE *)addr; - PyObject *uniobj; - Py_UNICODE *unistr; - - uniobj = PyUnicode_FromObject(obj); - if (uniobj == NULL) { - PyErr_SetString(PyExc_TypeError, - "The fill character cannot be converted to Unicode"); - return 0; - } - if (PyUnicode_GET_SIZE(uniobj) != 1) { - PyErr_SetString(PyExc_TypeError, - "The fill character must be exactly one character long"); - Py_DECREF(uniobj); - return 0; - } - unistr = PyUnicode_AS_UNICODE(uniobj); - *fillcharloc = unistr[0]; - Py_DECREF(uniobj); - return 1; + Py_UNICODE *fillcharloc = (Py_UNICODE *)addr; + PyObject *uniobj; + Py_UNICODE *unistr; + + uniobj = PyUnicode_FromObject(obj); + if (uniobj == NULL) { + PyErr_SetString(PyExc_TypeError, + "The fill character cannot be converted to Unicode"); + return 0; + } + if (PyUnicode_GET_SIZE(uniobj) != 1) { + PyErr_SetString(PyExc_TypeError, + "The fill character must be exactly one character long"); + Py_DECREF(uniobj); + return 0; + } + unistr = PyUnicode_AS_UNICODE(uniobj); + *fillcharloc = unistr[0]; + Py_DECREF(uniobj); + return 1; } PyDoc_STRVAR(center__doc__, -"S.center(width[, fillchar]) -> str\n\ + "S.center(width[, fillchar]) -> str\n\ \n\ Return S centered in a string of length width. Padding is\n\ done using the specified fill character (default is a space)"); @@ -6622,9 +6622,9 @@ c1 = *s1++; c2 = *s2++; - if (c1 > (1<<11) * 26) - c1 += utf16Fixup[c1>>11]; - if (c2 > (1<<11) * 26) + if (c1 > (1<<11) * 26) + c1 += utf16Fixup[c1>>11]; + if (c2 > (1<<11) * 26) c2 += utf16Fixup[c2>>11]; /* now c1 and c2 are in UTF-32-compatible order */ @@ -6668,7 +6668,7 @@ #endif int PyUnicode_Compare(PyObject *left, - PyObject *right) + PyObject *right) { if (PyUnicode_Check(left) && PyUnicode_Check(right)) return unicode_compare((PyUnicodeObject *)left, @@ -6689,25 +6689,25 @@ id = PyUnicode_AS_UNICODE(uni); /* Compare Unicode string and source character set string */ for (i = 0; id[i] && str[i]; i++) - if (id[i] != str[i]) - return ((int)id[i] < (int)str[i]) ? -1 : 1; + if (id[i] != str[i]) + return ((int)id[i] < (int)str[i]) ? -1 : 1; if (id[i]) - return 1; /* uni is longer */ + return 1; /* uni is longer */ if (str[i]) - return -1; /* str is longer */ + return -1; /* str is longer */ return 0; } -#define TEST_COND(cond) \ - ((cond) ? Py_True : Py_False) +#define TEST_COND(cond) \ + ((cond) ? Py_True : Py_False) PyObject *PyUnicode_RichCompare(PyObject *left, PyObject *right, int op) { int result; - + if (PyUnicode_Check(left) && PyUnicode_Check(right)) { PyObject *v; if (((PyUnicodeObject *) left)->length != @@ -6726,7 +6726,7 @@ else result = unicode_compare((PyUnicodeObject *)left, (PyUnicodeObject *)right); - + /* Convert the return value to a Boolean */ switch (op) { case Py_EQ: @@ -6754,13 +6754,13 @@ Py_INCREF(v); return v; } - + Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } int PyUnicode_Contains(PyObject *container, - PyObject *element) + PyObject *element) { PyObject *str, *sub; int result; @@ -6768,9 +6768,9 @@ /* Coerce the two arguments */ sub = PyUnicode_FromObject(element); if (!sub) { - PyErr_Format(PyExc_TypeError, - "'in ' requires string as left operand, not %s", - element->ob_type->tp_name); + PyErr_Format(PyExc_TypeError, + "'in ' requires string as left operand, not %s", + element->ob_type->tp_name); return -1; } @@ -6791,32 +6791,32 @@ /* Concat to string or Unicode object giving a new Unicode object. */ PyObject *PyUnicode_Concat(PyObject *left, - PyObject *right) + PyObject *right) { PyUnicodeObject *u = NULL, *v = NULL, *w; /* Coerce the two arguments */ u = (PyUnicodeObject *)PyUnicode_FromObject(left); if (u == NULL) - goto onError; + goto onError; v = (PyUnicodeObject *)PyUnicode_FromObject(right); if (v == NULL) - goto onError; + goto onError; /* Shortcuts */ if (v == unicode_empty) { - Py_DECREF(v); - return (PyObject *)u; + Py_DECREF(v); + return (PyObject *)u; } if (u == unicode_empty) { - Py_DECREF(u); - return (PyObject *)v; + Py_DECREF(u); + return (PyObject *)v; } /* Concat the two Unicode strings */ w = _PyUnicode_New(u->length + v->length); if (w == NULL) - goto onError; + goto onError; Py_UNICODE_COPY(w->str, u->str, u->length); Py_UNICODE_COPY(w->str + u->length, v->str, v->length); @@ -6824,7 +6824,7 @@ Py_DECREF(v); return (PyObject *)w; -onError: + onError: Py_XDECREF(u); Py_XDECREF(v); return NULL; @@ -6833,28 +6833,28 @@ void PyUnicode_Append(PyObject **pleft, PyObject *right) { - PyObject *new; - if (*pleft == NULL) - return; - if (right == NULL || !PyUnicode_Check(*pleft)) { - Py_DECREF(*pleft); - *pleft = NULL; - return; - } - new = PyUnicode_Concat(*pleft, right); - Py_DECREF(*pleft); - *pleft = new; + PyObject *new; + if (*pleft == NULL) + return; + if (right == NULL || !PyUnicode_Check(*pleft)) { + Py_DECREF(*pleft); + *pleft = NULL; + return; + } + new = PyUnicode_Concat(*pleft, right); + Py_DECREF(*pleft); + *pleft = new; } void PyUnicode_AppendAndDel(PyObject **pleft, PyObject *right) { - PyUnicode_Append(pleft, right); - Py_XDECREF(right); + PyUnicode_Append(pleft, right); + Py_XDECREF(right); } PyDoc_STRVAR(count__doc__, -"S.count(sub[, start[, end]]) -> int\n\ + "S.count(sub[, start[, end]]) -> int\n\ \n\ Return the number of non-overlapping occurrences of substring sub in\n\ string S[start:end]. Optional arguments start and end are\n\ @@ -6869,13 +6869,13 @@ PyObject *result; if (!PyArg_ParseTuple(args, "O|O&O&:count", &substring, - _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) + _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) return NULL; substring = (PyUnicodeObject *)PyUnicode_FromObject( (PyObject *)substring); if (substring == NULL) - return NULL; + return NULL; FIX_START_END(self); @@ -6890,7 +6890,7 @@ } PyDoc_STRVAR(encode__doc__, -"S.encode([encoding[, errors]]) -> bytes\n\ + "S.encode([encoding[, errors]]) -> bytes\n\ \n\ Encode S using the codec registered for encoding. encoding defaults\n\ to the default encoding. errors may be given to set a different error\n\ @@ -6921,12 +6921,12 @@ } return v; - onError: + onError: return NULL; } PyDoc_STRVAR(expandtabs__doc__, -"S.expandtabs([tabsize]) -> str\n\ + "S.expandtabs([tabsize]) -> str\n\ \n\ Return a copy of S where all tab characters are expanded using spaces.\n\ If tabsize is not given, a tab size of 8 characters is assumed."); @@ -6943,7 +6943,7 @@ int tabsize = 8; if (!PyArg_ParseTuple(args, "|i:expandtabs", &tabsize)) - return NULL; + return NULL; /* First pass: determine size of output string */ i = 0; /* chars up to and including most recent \n or \r */ @@ -6951,27 +6951,27 @@ e = self->str + self->length; /* end of input */ for (p = self->str; p < e; p++) if (*p == '\t') { - if (tabsize > 0) { - incr = tabsize - (j % tabsize); /* cannot overflow */ - if (j > PY_SSIZE_T_MAX - incr) - goto overflow1; - j += incr; + if (tabsize > 0) { + incr = tabsize - (j % tabsize); /* cannot overflow */ + if (j > PY_SSIZE_T_MAX - incr) + goto overflow1; + j += incr; } - } + } else { - if (j > PY_SSIZE_T_MAX - 1) - goto overflow1; + if (j > PY_SSIZE_T_MAX - 1) + goto overflow1; j++; if (*p == '\n' || *p == '\r') { - if (i > PY_SSIZE_T_MAX - j) - goto overflow1; + if (i > PY_SSIZE_T_MAX - j) + goto overflow1; i += j; j = 0; } } if (i > PY_SSIZE_T_MAX - j) - goto overflow1; + goto overflow1; /* Second pass: create output string and fill it */ u = _PyUnicode_New(i + j); @@ -6984,20 +6984,20 @@ for (p = self->str; p < e; p++) if (*p == '\t') { - if (tabsize > 0) { - i = tabsize - (j % tabsize); - j += i; - while (i--) { - if (q >= qe) - goto overflow2; - *q++ = ' '; - } - } - } - else { - if (q >= qe) - goto overflow2; - *q++ = *p; + if (tabsize > 0) { + i = tabsize - (j % tabsize); + j += i; + while (i--) { + if (q >= qe) + goto overflow2; + *q++ = ' '; + } + } + } + else { + if (q >= qe) + goto overflow2; + *q++ = *p; j++; if (*p == '\n' || *p == '\r') j = 0; @@ -7013,7 +7013,7 @@ } PyDoc_STRVAR(find__doc__, -"S.find(sub[, start[, end]]) -> int\n\ + "S.find(sub[, start[, end]]) -> int\n\ \n\ Return the lowest index in S where substring sub is found,\n\ such that sub is contained within s[start:end]. Optional\n\ @@ -7078,7 +7078,7 @@ } PyDoc_STRVAR(index__doc__, -"S.index(sub[, start[, end]]) -> int\n\ + "S.index(sub[, start[, end]]) -> int\n\ \n\ Like S.find() but raise ValueError when the substring is not found."); @@ -7110,7 +7110,7 @@ } PyDoc_STRVAR(islower__doc__, -"S.islower() -> bool\n\ + "S.islower() -> bool\n\ \n\ Return True if all cased characters in S are lowercase and there is\n\ at least one cased character in S, False otherwise."); @@ -7124,27 +7124,27 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1) - return PyBool_FromLong(Py_UNICODE_ISLOWER(*p)); + return PyBool_FromLong(Py_UNICODE_ISLOWER(*p)); /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return PyBool_FromLong(0); + return PyBool_FromLong(0); e = p + PyUnicode_GET_SIZE(self); cased = 0; for (; p < e; p++) { - register const Py_UNICODE ch = *p; + register const Py_UNICODE ch = *p; - if (Py_UNICODE_ISUPPER(ch) || Py_UNICODE_ISTITLE(ch)) - return PyBool_FromLong(0); - else if (!cased && Py_UNICODE_ISLOWER(ch)) - cased = 1; + if (Py_UNICODE_ISUPPER(ch) || Py_UNICODE_ISTITLE(ch)) + return PyBool_FromLong(0); + else if (!cased && Py_UNICODE_ISLOWER(ch)) + cased = 1; } return PyBool_FromLong(cased); } PyDoc_STRVAR(isupper__doc__, -"S.isupper() -> bool\n\ + "S.isupper() -> bool\n\ \n\ Return True if all cased characters in S are uppercase and there is\n\ at least one cased character in S, False otherwise."); @@ -7158,27 +7158,27 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1) - return PyBool_FromLong(Py_UNICODE_ISUPPER(*p) != 0); + return PyBool_FromLong(Py_UNICODE_ISUPPER(*p) != 0); /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return PyBool_FromLong(0); + return PyBool_FromLong(0); e = p + PyUnicode_GET_SIZE(self); cased = 0; for (; p < e; p++) { - register const Py_UNICODE ch = *p; + register const Py_UNICODE ch = *p; - if (Py_UNICODE_ISLOWER(ch) || Py_UNICODE_ISTITLE(ch)) - return PyBool_FromLong(0); - else if (!cased && Py_UNICODE_ISUPPER(ch)) - cased = 1; + if (Py_UNICODE_ISLOWER(ch) || Py_UNICODE_ISTITLE(ch)) + return PyBool_FromLong(0); + else if (!cased && Py_UNICODE_ISUPPER(ch)) + cased = 1; } return PyBool_FromLong(cased); } PyDoc_STRVAR(istitle__doc__, -"S.istitle() -> bool\n\ + "S.istitle() -> bool\n\ \n\ Return True if S is a titlecased string and there is at least one\n\ character in S, i.e. upper- and titlecase characters may only\n\ @@ -7194,39 +7194,39 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1) - return PyBool_FromLong((Py_UNICODE_ISTITLE(*p) != 0) || - (Py_UNICODE_ISUPPER(*p) != 0)); + return PyBool_FromLong((Py_UNICODE_ISTITLE(*p) != 0) || + (Py_UNICODE_ISUPPER(*p) != 0)); /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return PyBool_FromLong(0); + return PyBool_FromLong(0); e = p + PyUnicode_GET_SIZE(self); cased = 0; previous_is_cased = 0; for (; p < e; p++) { - register const Py_UNICODE ch = *p; + register const Py_UNICODE ch = *p; - if (Py_UNICODE_ISUPPER(ch) || Py_UNICODE_ISTITLE(ch)) { - if (previous_is_cased) - return PyBool_FromLong(0); - previous_is_cased = 1; - cased = 1; - } - else if (Py_UNICODE_ISLOWER(ch)) { - if (!previous_is_cased) - return PyBool_FromLong(0); - previous_is_cased = 1; - cased = 1; - } - else - previous_is_cased = 0; + if (Py_UNICODE_ISUPPER(ch) || Py_UNICODE_ISTITLE(ch)) { + if (previous_is_cased) + return PyBool_FromLong(0); + previous_is_cased = 1; + cased = 1; + } + else if (Py_UNICODE_ISLOWER(ch)) { + if (!previous_is_cased) + return PyBool_FromLong(0); + previous_is_cased = 1; + cased = 1; + } + else + previous_is_cased = 0; } return PyBool_FromLong(cased); } PyDoc_STRVAR(isspace__doc__, -"S.isspace() -> bool\n\ + "S.isspace() -> bool\n\ \n\ Return True if all characters in S are whitespace\n\ and there is at least one character in S, False otherwise."); @@ -7239,23 +7239,23 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && - Py_UNICODE_ISSPACE(*p)) - return PyBool_FromLong(1); + Py_UNICODE_ISSPACE(*p)) + return PyBool_FromLong(1); /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return PyBool_FromLong(0); + return PyBool_FromLong(0); e = p + PyUnicode_GET_SIZE(self); for (; p < e; p++) { - if (!Py_UNICODE_ISSPACE(*p)) - return PyBool_FromLong(0); + if (!Py_UNICODE_ISSPACE(*p)) + return PyBool_FromLong(0); } return PyBool_FromLong(1); } PyDoc_STRVAR(isalpha__doc__, -"S.isalpha() -> bool\n\ + "S.isalpha() -> bool\n\ \n\ Return True if all characters in S are alphabetic\n\ and there is at least one character in S, False otherwise."); @@ -7268,23 +7268,23 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && - Py_UNICODE_ISALPHA(*p)) - return PyBool_FromLong(1); + Py_UNICODE_ISALPHA(*p)) + return PyBool_FromLong(1); /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return PyBool_FromLong(0); + return PyBool_FromLong(0); e = p + PyUnicode_GET_SIZE(self); for (; p < e; p++) { - if (!Py_UNICODE_ISALPHA(*p)) - return PyBool_FromLong(0); + if (!Py_UNICODE_ISALPHA(*p)) + return PyBool_FromLong(0); } return PyBool_FromLong(1); } PyDoc_STRVAR(isalnum__doc__, -"S.isalnum() -> bool\n\ + "S.isalnum() -> bool\n\ \n\ Return True if all characters in S are alphanumeric\n\ and there is at least one character in S, False otherwise."); @@ -7297,23 +7297,23 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && - Py_UNICODE_ISALNUM(*p)) - return PyBool_FromLong(1); + Py_UNICODE_ISALNUM(*p)) + return PyBool_FromLong(1); /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return PyBool_FromLong(0); + return PyBool_FromLong(0); e = p + PyUnicode_GET_SIZE(self); for (; p < e; p++) { - if (!Py_UNICODE_ISALNUM(*p)) - return PyBool_FromLong(0); + if (!Py_UNICODE_ISALNUM(*p)) + return PyBool_FromLong(0); } return PyBool_FromLong(1); } PyDoc_STRVAR(isdecimal__doc__, -"S.isdecimal() -> bool\n\ + "S.isdecimal() -> bool\n\ \n\ Return True if there are only decimal characters in S,\n\ False otherwise."); @@ -7326,23 +7326,23 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && - Py_UNICODE_ISDECIMAL(*p)) - return PyBool_FromLong(1); + Py_UNICODE_ISDECIMAL(*p)) + return PyBool_FromLong(1); /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return PyBool_FromLong(0); + return PyBool_FromLong(0); e = p + PyUnicode_GET_SIZE(self); for (; p < e; p++) { - if (!Py_UNICODE_ISDECIMAL(*p)) - return PyBool_FromLong(0); + if (!Py_UNICODE_ISDECIMAL(*p)) + return PyBool_FromLong(0); } return PyBool_FromLong(1); } PyDoc_STRVAR(isdigit__doc__, -"S.isdigit() -> bool\n\ + "S.isdigit() -> bool\n\ \n\ Return True if all characters in S are digits\n\ and there is at least one character in S, False otherwise."); @@ -7355,23 +7355,23 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && - Py_UNICODE_ISDIGIT(*p)) - return PyBool_FromLong(1); + Py_UNICODE_ISDIGIT(*p)) + return PyBool_FromLong(1); /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return PyBool_FromLong(0); + return PyBool_FromLong(0); e = p + PyUnicode_GET_SIZE(self); for (; p < e; p++) { - if (!Py_UNICODE_ISDIGIT(*p)) - return PyBool_FromLong(0); + if (!Py_UNICODE_ISDIGIT(*p)) + return PyBool_FromLong(0); } return PyBool_FromLong(1); } PyDoc_STRVAR(isnumeric__doc__, -"S.isnumeric() -> bool\n\ + "S.isnumeric() -> bool\n\ \n\ Return True if there are only numeric characters in S,\n\ False otherwise."); @@ -7384,17 +7384,17 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && - Py_UNICODE_ISNUMERIC(*p)) - return PyBool_FromLong(1); + Py_UNICODE_ISNUMERIC(*p)) + return PyBool_FromLong(1); /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return PyBool_FromLong(0); + return PyBool_FromLong(0); e = p + PyUnicode_GET_SIZE(self); for (; p < e; p++) { - if (!Py_UNICODE_ISNUMERIC(*p)) - return PyBool_FromLong(0); + if (!Py_UNICODE_ISNUMERIC(*p)) + return PyBool_FromLong(0); } return PyBool_FromLong(1); } @@ -7407,12 +7407,12 @@ /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return 0; + return 0; /* PEP 3131 says that the first character must be in XID_Start and subsequent characters in XID_Continue, and for the ASCII range, the 2.x rules apply (i.e - start with letters and underscore, continue with + start with letters and underscore, continue with letters, digits, underscore). However, given the current definition of XID_Start and XID_Continue, it is sufficient to check just for these, except that _ must be allowed @@ -7422,14 +7422,14 @@ e = p + PyUnicode_GET_SIZE(self); for (p++; p < e; p++) { - if (!_PyUnicode_IsXidContinue(*p)) - return 0; + if (!_PyUnicode_IsXidContinue(*p)) + return 0; } return 1; } PyDoc_STRVAR(isidentifier__doc__, -"S.isidentifier() -> bool\n\ + "S.isidentifier() -> bool\n\ \n\ Return True if S is a valid identifier according\n\ to the language definition."); @@ -7441,7 +7441,7 @@ } PyDoc_STRVAR(isprintable__doc__, -"S.isprintable() -> bool\n\ + "S.isprintable() -> bool\n\ \n\ Return True if all characters in S are considered\n\ printable in repr() or S is empty, False otherwise."); @@ -7467,7 +7467,7 @@ } PyDoc_STRVAR(join__doc__, -"S.join(sequence) -> str\n\ + "S.join(sequence) -> str\n\ \n\ Return a string which is the concatenation of the strings in the\n\ sequence. The separator between elements is S."); @@ -7485,7 +7485,7 @@ } PyDoc_STRVAR(ljust__doc__, -"S.ljust(width[, fillchar]) -> str\n\ + "S.ljust(width[, fillchar]) -> str\n\ \n\ Return S left-justified in a Unicode string of length width. Padding is\n\ done using the specified fill character (default is a space)."); @@ -7508,7 +7508,7 @@ } PyDoc_STRVAR(lower__doc__, -"S.lower() -> str\n\ + "S.lower() -> str\n\ \n\ Return a copy of the string S converted to lowercase."); @@ -7531,93 +7531,93 @@ PyObject * _PyUnicode_XStrip(PyUnicodeObject *self, int striptype, PyObject *sepobj) { - Py_UNICODE *s = PyUnicode_AS_UNICODE(self); - Py_ssize_t len = PyUnicode_GET_SIZE(self); - Py_UNICODE *sep = PyUnicode_AS_UNICODE(sepobj); - Py_ssize_t seplen = PyUnicode_GET_SIZE(sepobj); - Py_ssize_t i, j; - - BLOOM_MASK sepmask = make_bloom_mask(sep, seplen); - - i = 0; - if (striptype != RIGHTSTRIP) { - while (i < len && BLOOM_MEMBER(sepmask, s[i], sep, seplen)) { - i++; - } - } + Py_UNICODE *s = PyUnicode_AS_UNICODE(self); + Py_ssize_t len = PyUnicode_GET_SIZE(self); + Py_UNICODE *sep = PyUnicode_AS_UNICODE(sepobj); + Py_ssize_t seplen = PyUnicode_GET_SIZE(sepobj); + Py_ssize_t i, j; - j = len; - if (striptype != LEFTSTRIP) { - do { - j--; - } while (j >= i && BLOOM_MEMBER(sepmask, s[j], sep, seplen)); - j++; - } + BLOOM_MASK sepmask = make_bloom_mask(sep, seplen); - if (i == 0 && j == len && PyUnicode_CheckExact(self)) { - Py_INCREF(self); - return (PyObject*)self; - } - else - return PyUnicode_FromUnicode(s+i, j-i); + i = 0; + if (striptype != RIGHTSTRIP) { + while (i < len && BLOOM_MEMBER(sepmask, s[i], sep, seplen)) { + i++; + } + } + + j = len; + if (striptype != LEFTSTRIP) { + do { + j--; + } while (j >= i && BLOOM_MEMBER(sepmask, s[j], sep, seplen)); + j++; + } + + if (i == 0 && j == len && PyUnicode_CheckExact(self)) { + Py_INCREF(self); + return (PyObject*)self; + } + else + return PyUnicode_FromUnicode(s+i, j-i); } static PyObject * do_strip(PyUnicodeObject *self, int striptype) { - Py_UNICODE *s = PyUnicode_AS_UNICODE(self); - Py_ssize_t len = PyUnicode_GET_SIZE(self), i, j; + Py_UNICODE *s = PyUnicode_AS_UNICODE(self); + Py_ssize_t len = PyUnicode_GET_SIZE(self), i, j; + + i = 0; + if (striptype != RIGHTSTRIP) { + while (i < len && Py_UNICODE_ISSPACE(s[i])) { + i++; + } + } + + j = len; + if (striptype != LEFTSTRIP) { + do { + j--; + } while (j >= i && Py_UNICODE_ISSPACE(s[j])); + j++; + } - i = 0; - if (striptype != RIGHTSTRIP) { - while (i < len && Py_UNICODE_ISSPACE(s[i])) { - i++; - } - } - - j = len; - if (striptype != LEFTSTRIP) { - do { - j--; - } while (j >= i && Py_UNICODE_ISSPACE(s[j])); - j++; - } - - if (i == 0 && j == len && PyUnicode_CheckExact(self)) { - Py_INCREF(self); - return (PyObject*)self; - } - else - return PyUnicode_FromUnicode(s+i, j-i); + if (i == 0 && j == len && PyUnicode_CheckExact(self)) { + Py_INCREF(self); + return (PyObject*)self; + } + else + return PyUnicode_FromUnicode(s+i, j-i); } static PyObject * do_argstrip(PyUnicodeObject *self, int striptype, PyObject *args) { - PyObject *sep = NULL; + PyObject *sep = NULL; - if (!PyArg_ParseTuple(args, (char *)stripformat[striptype], &sep)) - return NULL; + if (!PyArg_ParseTuple(args, (char *)stripformat[striptype], &sep)) + return NULL; - if (sep != NULL && sep != Py_None) { - if (PyUnicode_Check(sep)) - return _PyUnicode_XStrip(self, striptype, sep); - else { - PyErr_Format(PyExc_TypeError, - "%s arg must be None or str", - STRIPNAME(striptype)); - return NULL; - } - } + if (sep != NULL && sep != Py_None) { + if (PyUnicode_Check(sep)) + return _PyUnicode_XStrip(self, striptype, sep); + else { + PyErr_Format(PyExc_TypeError, + "%s arg must be None or str", + STRIPNAME(striptype)); + return NULL; + } + } - return do_strip(self, striptype); + return do_strip(self, striptype); } PyDoc_STRVAR(strip__doc__, -"S.strip([chars]) -> str\n\ + "S.strip([chars]) -> str\n\ \n\ Return a copy of the string S with leading and trailing\n\ whitespace removed.\n\ @@ -7626,15 +7626,15 @@ static PyObject * unicode_strip(PyUnicodeObject *self, PyObject *args) { - if (PyTuple_GET_SIZE(args) == 0) - return do_strip(self, BOTHSTRIP); /* Common case */ - else - return do_argstrip(self, BOTHSTRIP, args); + if (PyTuple_GET_SIZE(args) == 0) + return do_strip(self, BOTHSTRIP); /* Common case */ + else + return do_argstrip(self, BOTHSTRIP, args); } PyDoc_STRVAR(lstrip__doc__, -"S.lstrip([chars]) -> str\n\ + "S.lstrip([chars]) -> str\n\ \n\ Return a copy of the string S with leading whitespace removed.\n\ If chars is given and not None, remove characters in chars instead."); @@ -7642,15 +7642,15 @@ static PyObject * unicode_lstrip(PyUnicodeObject *self, PyObject *args) { - if (PyTuple_GET_SIZE(args) == 0) - return do_strip(self, LEFTSTRIP); /* Common case */ - else - return do_argstrip(self, LEFTSTRIP, args); + if (PyTuple_GET_SIZE(args) == 0) + return do_strip(self, LEFTSTRIP); /* Common case */ + else + return do_argstrip(self, LEFTSTRIP, args); } PyDoc_STRVAR(rstrip__doc__, -"S.rstrip([chars]) -> str\n\ + "S.rstrip([chars]) -> str\n\ \n\ Return a copy of the string S with trailing whitespace removed.\n\ If chars is given and not None, remove characters in chars instead."); @@ -7658,10 +7658,10 @@ static PyObject * unicode_rstrip(PyUnicodeObject *self, PyObject *args) { - if (PyTuple_GET_SIZE(args) == 0) - return do_strip(self, RIGHTSTRIP); /* Common case */ - else - return do_argstrip(self, RIGHTSTRIP, args); + if (PyTuple_GET_SIZE(args) == 0) + return do_strip(self, RIGHTSTRIP); /* Common case */ + else + return do_argstrip(self, RIGHTSTRIP, args); } @@ -7706,25 +7706,25 @@ if (str->length == 1 && len > 0) { Py_UNICODE_FILL(p, str->str[0], len); } else { - Py_ssize_t done = 0; /* number of characters copied this far */ - if (done < nchars) { + Py_ssize_t done = 0; /* number of characters copied this far */ + if (done < nchars) { Py_UNICODE_COPY(p, str->str, str->length); done = str->length; - } - while (done < nchars) { + } + while (done < nchars) { Py_ssize_t n = (done <= nchars-done) ? done : nchars-done; Py_UNICODE_COPY(p+done, p, n); done += n; - } + } } return (PyObject*) u; } PyObject *PyUnicode_Replace(PyObject *obj, - PyObject *subobj, - PyObject *replobj, - Py_ssize_t maxcount) + PyObject *subobj, + PyObject *replobj, + Py_ssize_t maxcount) { PyObject *self; PyObject *str1; @@ -7733,22 +7733,22 @@ self = PyUnicode_FromObject(obj); if (self == NULL) - return NULL; + return NULL; str1 = PyUnicode_FromObject(subobj); if (str1 == NULL) { - Py_DECREF(self); - return NULL; + Py_DECREF(self); + return NULL; } str2 = PyUnicode_FromObject(replobj); if (str2 == NULL) { - Py_DECREF(self); - Py_DECREF(str1); - return NULL; + Py_DECREF(self); + Py_DECREF(str1); + return NULL; } result = replace((PyUnicodeObject *)self, - (PyUnicodeObject *)str1, - (PyUnicodeObject *)str2, - maxcount); + (PyUnicodeObject *)str1, + (PyUnicodeObject *)str2, + maxcount); Py_DECREF(self); Py_DECREF(str1); Py_DECREF(str2); @@ -7756,7 +7756,7 @@ } PyDoc_STRVAR(replace__doc__, -"S.replace (old, new[, count]) -> str\n\ + "S.replace (old, new[, count]) -> str\n\ \n\ Return a copy of S with all occurrences of substring\n\ old replaced by new. If the optional argument count is\n\ @@ -7774,11 +7774,11 @@ return NULL; str1 = (PyUnicodeObject *)PyUnicode_FromObject((PyObject *)str1); if (str1 == NULL) - return NULL; + return NULL; str2 = (PyUnicodeObject *)PyUnicode_FromObject((PyObject *)str2); if (str2 == NULL) { - Py_DECREF(str1); - return NULL; + Py_DECREF(str1); + return NULL; } result = replace(self, str1, str2, maxcount); @@ -7815,13 +7815,13 @@ */ repr = PyUnicode_FromUnicode(NULL, - 2 /* quotes */ + 2 /* quotes */ #ifdef Py_UNICODE_WIDE - + 10*size + + 10*size #else - + 6*size + + 6*size #endif - + 1); + + 1); if (repr == NULL) return NULL; @@ -7840,7 +7840,7 @@ continue; } - /* Map special whitespace to '\t', \n', '\r' */ + /* Map special whitespace to '\t', \n', '\r' */ if (ch == '\t') { *p++ = '\\'; *p++ = 't'; @@ -7867,7 +7867,7 @@ *p++ = ch; } - /* Non-ASCII characters */ + /* Non-ASCII characters */ else { Py_UCS4 ucs = ch; @@ -7877,15 +7877,15 @@ if (size > 0) { ch2 = *s; if (ch >= 0xD800 && ch < 0xDC00 && ch2 >= 0xDC00 - && ch2 <= 0xDFFF) { - ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) - + 0x00010000; - s++; + && ch2 <= 0xDFFF) { + ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) + + 0x00010000; + s++; size--; } } #endif - /* Map Unicode whitespace and control characters + /* Map Unicode whitespace and control characters (categories Z* and C* except ASCII space) */ if (!Py_UNICODE_ISPRINTABLE(ucs)) { @@ -7938,7 +7938,7 @@ } PyDoc_STRVAR(rfind__doc__, -"S.rfind(sub[, start[, end]]) -> int\n\ + "S.rfind(sub[, start[, end]]) -> int\n\ \n\ Return the highest index in S where substring sub is found,\n\ such that sub is contained within s[start:end]. Optional\n\ @@ -7955,7 +7955,7 @@ Py_ssize_t result; if (!_ParseTupleFinds(args, &substring, &start, &end)) - return NULL; + return NULL; result = stringlib_rfind_slice( PyUnicode_AS_UNICODE(self), PyUnicode_GET_SIZE(self), @@ -7969,7 +7969,7 @@ } PyDoc_STRVAR(rindex__doc__, -"S.rindex(sub[, start[, end]]) -> int\n\ + "S.rindex(sub[, start[, end]]) -> int\n\ \n\ Like S.rfind() but raise ValueError when the substring is not found."); @@ -7982,7 +7982,7 @@ Py_ssize_t result; if (!_ParseTupleFinds(args, &substring, &start, &end)) - return NULL; + return NULL; result = stringlib_rfind_slice( PyUnicode_AS_UNICODE(self), PyUnicode_GET_SIZE(self), @@ -8000,7 +8000,7 @@ } PyDoc_STRVAR(rjust__doc__, -"S.rjust(width[, fillchar]) -> str\n\ + "S.rjust(width[, fillchar]) -> str\n\ \n\ Return S right-justified in a string of length width. Padding is\n\ done using the specified fill character (default is a space)."); @@ -8023,20 +8023,20 @@ } PyObject *PyUnicode_Split(PyObject *s, - PyObject *sep, - Py_ssize_t maxsplit) + PyObject *sep, + Py_ssize_t maxsplit) { PyObject *result; s = PyUnicode_FromObject(s); if (s == NULL) - return NULL; + return NULL; if (sep != NULL) { - sep = PyUnicode_FromObject(sep); - if (sep == NULL) { - Py_DECREF(s); - return NULL; - } + sep = PyUnicode_FromObject(sep); + if (sep == NULL) { + Py_DECREF(s); + return NULL; + } } result = split((PyUnicodeObject *)s, (PyUnicodeObject *)sep, maxsplit); @@ -8047,7 +8047,7 @@ } PyDoc_STRVAR(split__doc__, -"S.split([sep[, maxsplit]]) -> list of strings\n\ + "S.split([sep[, maxsplit]]) -> list of strings\n\ \n\ Return a list of the words in S, using sep as the\n\ delimiter string. If maxsplit is given, at most maxsplit\n\ @@ -8065,11 +8065,11 @@ return NULL; if (substring == Py_None) - return split(self, NULL, maxcount); + return split(self, NULL, maxcount); else if (PyUnicode_Check(substring)) - return split(self, (PyUnicodeObject *)substring, maxcount); + return split(self, (PyUnicodeObject *)substring, maxcount); else - return PyUnicode_Split((PyObject *)self, substring, maxcount); + return PyUnicode_Split((PyObject *)self, substring, maxcount); } PyObject * @@ -8081,7 +8081,7 @@ str_obj = PyUnicode_FromObject(str_in); if (!str_obj) - return NULL; + return NULL; sep_obj = PyUnicode_FromObject(sep_in); if (!sep_obj) { Py_DECREF(str_obj); @@ -8109,7 +8109,7 @@ str_obj = PyUnicode_FromObject(str_in); if (!str_obj) - return NULL; + return NULL; sep_obj = PyUnicode_FromObject(sep_in); if (!sep_obj) { Py_DECREF(str_obj); @@ -8128,7 +8128,7 @@ } PyDoc_STRVAR(partition__doc__, -"S.partition(sep) -> (head, sep, tail)\n\ + "S.partition(sep) -> (head, sep, tail)\n\ \n\ Search for the separator sep in S, and return the part before it,\n\ the separator itself, and the part after it. If the separator is not\n\ @@ -8141,7 +8141,7 @@ } PyDoc_STRVAR(rpartition__doc__, -"S.rpartition(sep) -> (tail, sep, head)\n\ + "S.rpartition(sep) -> (tail, sep, head)\n\ \n\ Search for the separator sep in S, starting at the end of S, and return\n\ the part before it, the separator itself, and the part after it. If the\n\ @@ -8154,20 +8154,20 @@ } PyObject *PyUnicode_RSplit(PyObject *s, - PyObject *sep, - Py_ssize_t maxsplit) + PyObject *sep, + Py_ssize_t maxsplit) { PyObject *result; - + s = PyUnicode_FromObject(s); if (s == NULL) - return NULL; + return NULL; if (sep != NULL) { - sep = PyUnicode_FromObject(sep); - if (sep == NULL) { - Py_DECREF(s); - return NULL; - } + sep = PyUnicode_FromObject(sep); + if (sep == NULL) { + Py_DECREF(s); + return NULL; + } } result = rsplit((PyUnicodeObject *)s, (PyUnicodeObject *)sep, maxsplit); @@ -8178,7 +8178,7 @@ } PyDoc_STRVAR(rsplit__doc__, -"S.rsplit([sep[, maxsplit]]) -> list of strings\n\ + "S.rsplit([sep[, maxsplit]]) -> list of strings\n\ \n\ Return a list of the words in S, using sep as the\n\ delimiter string, starting at the end of the string and\n\ @@ -8196,15 +8196,15 @@ return NULL; if (substring == Py_None) - return rsplit(self, NULL, maxcount); + return rsplit(self, NULL, maxcount); else if (PyUnicode_Check(substring)) - return rsplit(self, (PyUnicodeObject *)substring, maxcount); + return rsplit(self, (PyUnicodeObject *)substring, maxcount); else - return PyUnicode_RSplit((PyObject *)self, substring, maxcount); + return PyUnicode_RSplit((PyObject *)self, substring, maxcount); } PyDoc_STRVAR(splitlines__doc__, -"S.splitlines([keepends]) -> list of strings\n\ + "S.splitlines([keepends]) -> list of strings\n\ \n\ Return a list of the lines in S, breaking at line boundaries.\n\ Line breaks are not included in the resulting list unless keepends\n\ @@ -8234,7 +8234,7 @@ } PyDoc_STRVAR(swapcase__doc__, -"S.swapcase() -> str\n\ + "S.swapcase() -> str\n\ \n\ Return a copy of S with uppercase characters converted to lowercase\n\ and vice versa."); @@ -8246,7 +8246,7 @@ } PyDoc_STRVAR(maketrans__doc__, -"str.maketrans(x[, y[, z]]) -> dict (static method)\n\ + "str.maketrans(x[, y[, z]]) -> dict (static method)\n\ \n\ Return a translation table usable for str.translate().\n\ If there is only one argument, it must be a dictionary mapping Unicode\n\ @@ -8264,7 +8264,7 @@ PyObject *new = NULL, *key, *value; Py_ssize_t i = 0; int res; - + if (!PyArg_ParseTuple(args, "O|UU:maketrans", &x, &y, &z)) return NULL; new = PyDict_New(); @@ -8349,7 +8349,7 @@ } PyDoc_STRVAR(translate__doc__, -"S.translate(table) -> str\n\ + "S.translate(table) -> str\n\ \n\ Return a copy of the string S, where all characters have been mapped\n\ through the given translation table, which must be a mapping of\n\ @@ -8364,7 +8364,7 @@ } PyDoc_STRVAR(upper__doc__, -"S.upper() -> str\n\ + "S.upper() -> str\n\ \n\ Return a copy of S converted to uppercase."); @@ -8375,7 +8375,7 @@ } PyDoc_STRVAR(zfill__doc__, -"S.zfill(width) -> str\n\ + "S.zfill(width) -> str\n\ \n\ Pad a numeric string S with zeros on the left, to fill a field\n\ of the specified width. The string S is never truncated."); @@ -8399,7 +8399,7 @@ return PyUnicode_FromUnicode( PyUnicode_AS_UNICODE(self), PyUnicode_GET_SIZE(self) - ); + ); } fill = width - self->length; @@ -8427,7 +8427,7 @@ #endif PyDoc_STRVAR(startswith__doc__, -"S.startswith(prefix[, start[, end]]) -> bool\n\ + "S.startswith(prefix[, start[, end]]) -> bool\n\ \n\ Return True if S starts with the specified prefix, False otherwise.\n\ With optional start, test S beginning at that position.\n\ @@ -8436,7 +8436,7 @@ static PyObject * unicode_startswith(PyUnicodeObject *self, - PyObject *args) + PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; @@ -8445,13 +8445,13 @@ int result; if (!PyArg_ParseTuple(args, "O|O&O&:startswith", &subobj, - _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) - return NULL; + _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) + return NULL; if (PyTuple_Check(subobj)) { Py_ssize_t i; for (i = 0; i < PyTuple_GET_SIZE(subobj); i++) { substring = (PyUnicodeObject *)PyUnicode_FromObject( - PyTuple_GET_ITEM(subobj, i)); + PyTuple_GET_ITEM(subobj, i)); if (substring == NULL) return NULL; result = tailmatch(self, substring, start, end, -1); @@ -8465,7 +8465,7 @@ } substring = (PyUnicodeObject *)PyUnicode_FromObject(subobj); if (substring == NULL) - return NULL; + return NULL; result = tailmatch(self, substring, start, end, -1); Py_DECREF(substring); return PyBool_FromLong(result); @@ -8473,7 +8473,7 @@ PyDoc_STRVAR(endswith__doc__, -"S.endswith(suffix[, start[, end]]) -> bool\n\ + "S.endswith(suffix[, start[, end]]) -> bool\n\ \n\ Return True if S ends with the specified suffix, False otherwise.\n\ With optional start, test S beginning at that position.\n\ @@ -8482,7 +8482,7 @@ static PyObject * unicode_endswith(PyUnicodeObject *self, - PyObject *args) + PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; @@ -8491,15 +8491,15 @@ int result; if (!PyArg_ParseTuple(args, "O|O&O&:endswith", &subobj, - _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) - return NULL; + _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) + return NULL; if (PyTuple_Check(subobj)) { Py_ssize_t i; for (i = 0; i < PyTuple_GET_SIZE(subobj); i++) { substring = (PyUnicodeObject *)PyUnicode_FromObject( - PyTuple_GET_ITEM(subobj, i)); + PyTuple_GET_ITEM(subobj, i)); if (substring == NULL) - return NULL; + return NULL; result = tailmatch(self, substring, start, end, +1); Py_DECREF(substring); if (result) { @@ -8510,7 +8510,7 @@ } substring = (PyUnicodeObject *)PyUnicode_FromObject(subobj); if (substring == NULL) - return NULL; + return NULL; result = tailmatch(self, substring, start, end, +1); Py_DECREF(substring); @@ -8520,7 +8520,7 @@ #include "stringlib/string_format.h" PyDoc_STRVAR(format__doc__, -"S.format(*args, **kwargs) -> str\n\ + "S.format(*args, **kwargs) -> str\n\ \n\ "); @@ -8538,7 +8538,7 @@ } PyDoc_STRVAR(p_format__doc__, -"S.__format__(format_spec) -> str\n\ + "S.__format__(format_spec) -> str\n\ \n\ "); @@ -8550,12 +8550,12 @@ } PyDoc_STRVAR(sizeof__doc__, -"S.__sizeof__() -> size of S in memory, in bytes"); + "S.__sizeof__() -> size of S in memory, in bytes"); static PyObject * unicode_getnewargs(PyUnicodeObject *v) { - return Py_BuildValue("(u#)", v->str, v->length); + return Py_BuildValue("(u#)", v->str, v->length); } @@ -8620,36 +8620,36 @@ {"freelistsize", (PyCFunction) unicode_freelistsize, METH_NOARGS}, #endif - {"__getnewargs__", (PyCFunction)unicode_getnewargs, METH_NOARGS}, + {"__getnewargs__", (PyCFunction)unicode_getnewargs, METH_NOARGS}, {NULL, NULL} }; static PyObject * unicode_mod(PyObject *v, PyObject *w) { - if (!PyUnicode_Check(v)) { - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; - } - return PyUnicode_Format(v, w); + if (!PyUnicode_Check(v)) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + return PyUnicode_Format(v, w); } static PyNumberMethods unicode_as_number = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - unicode_mod, /*nb_remainder*/ + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + unicode_mod, /*nb_remainder*/ }; static PySequenceMethods unicode_as_sequence = { - (lenfunc) unicode_length, /* sq_length */ - PyUnicode_Concat, /* sq_concat */ - (ssizeargfunc) unicode_repeat, /* sq_repeat */ - (ssizeargfunc) unicode_getitem, /* sq_item */ - 0, /* sq_slice */ - 0, /* sq_ass_item */ - 0, /* sq_ass_slice */ - PyUnicode_Contains, /* sq_contains */ + (lenfunc) unicode_length, /* sq_length */ + PyUnicode_Concat, /* sq_concat */ + (ssizeargfunc) unicode_repeat, /* sq_repeat */ + (ssizeargfunc) unicode_getitem, /* sq_item */ + 0, /* sq_slice */ + 0, /* sq_ass_item */ + 0, /* sq_ass_slice */ + PyUnicode_Contains, /* sq_contains */ }; static PyObject* @@ -8669,7 +8669,7 @@ PyObject* result; if (PySlice_GetIndicesEx((PySliceObject*)item, PyUnicode_GET_SIZE(self), - &start, &stop, &step, &slicelength) < 0) { + &start, &stop, &step, &slicelength) < 0) { return NULL; } @@ -8685,9 +8685,9 @@ source_buf = PyUnicode_AS_UNICODE((PyObject*)self); result_buf = (Py_UNICODE *)PyObject_MALLOC(slicelength* sizeof(Py_UNICODE)); - - if (result_buf == NULL) - return PyErr_NoMemory(); + + if (result_buf == NULL) + return PyErr_NoMemory(); for (cur = start, i = 0; i < slicelength; cur += step, i++) { result_buf[i] = source_buf[cur]; @@ -8704,9 +8704,9 @@ } static PyMappingMethods unicode_as_mapping = { - (lenfunc)unicode_length, /* mp_length */ - (binaryfunc)unicode_subscript, /* mp_subscript */ - (objobjargproc)0, /* mp_ass_subscript */ + (lenfunc)unicode_length, /* mp_length */ + (binaryfunc)unicode_subscript, /* mp_subscript */ + (objobjargproc)0, /* mp_ass_subscript */ }; @@ -8717,14 +8717,14 @@ { Py_ssize_t argidx = *p_argidx; if (argidx < arglen) { - (*p_argidx)++; - if (arglen < 0) - return args; - else - return PyTuple_GetItem(args, argidx); + (*p_argidx)++; + if (arglen < 0) + return args; + else + return PyTuple_GetItem(args, argidx); } PyErr_SetString(PyExc_TypeError, - "not enough arguments for format string"); + "not enough arguments for format string"); return NULL; } @@ -8734,7 +8734,7 @@ register Py_ssize_t i; Py_ssize_t len = strlen(charbuffer); for (i = len - 1; i >= 0; i--) - buffer[i] = (Py_UNICODE) charbuffer[i]; + buffer[i] = (Py_UNICODE) charbuffer[i]; return len; } @@ -8749,7 +8749,7 @@ return Py_SAFE_DOWNCAST(result, Py_ssize_t, int); } -#if 0 +#if 0 static int longtounicode(Py_UNICODE *buffer, size_t len, const char *format, long x) { @@ -8767,11 +8767,11 @@ static int formatfloat(Py_UNICODE *buf, - size_t buflen, - int flags, - int prec, - int type, - PyObject *v) + size_t buflen, + int flags, + int prec, + int type, + PyObject *v) { /* fmt = '%#.' + `prec` + `type` worst case length = 3 + 10 (len of INT_MAX) + 1 = 14 (use 20)*/ @@ -8780,64 +8780,64 @@ x = PyFloat_AsDouble(v); if (x == -1.0 && PyErr_Occurred()) - return -1; + return -1; if (prec < 0) - prec = 6; + prec = 6; if (type == 'f' && (fabs(x) / 1e25) >= 1e25) - type = 'g'; + type = 'g'; /* Worst case length calc to ensure no buffer overrun: 'g' formats: - fmt = %#.g - buf = '-' + [0-9]*prec + '.' + 'e+' + (longest exp - for any double rep.) - len = 1 + prec + 1 + 2 + 5 = 9 + prec + fmt = %#.g + buf = '-' + [0-9]*prec + '.' + 'e+' + (longest exp + for any double rep.) + len = 1 + prec + 1 + 2 + 5 = 9 + prec 'f' formats: - buf = '-' + [0-9]*x + '.' + [0-9]*prec (with x < 50) - len = 1 + 50 + 1 + prec = 52 + prec + buf = '-' + [0-9]*x + '.' + [0-9]*prec (with x < 50) + len = 1 + 50 + 1 + prec = 52 + prec If prec=0 the effective precision is 1 (the leading digit is always given), therefore increase the length by one. */ - if (((type == 'g' || type == 'G') && - buflen <= (size_t)10 + (size_t)prec) || - (type == 'f' && buflen <= (size_t)53 + (size_t)prec)) { - PyErr_SetString(PyExc_OverflowError, - "formatted float is too long (precision too large?)"); - return -1; + if (((type == 'g' || type == 'G') && + buflen <= (size_t)10 + (size_t)prec) || + (type == 'f' && buflen <= (size_t)53 + (size_t)prec)) { + PyErr_SetString(PyExc_OverflowError, + "formatted float is too long (precision too large?)"); + return -1; } PyOS_snprintf(fmt, sizeof(fmt), "%%%s.%d%c", - (flags&F_ALT) ? "#" : "", - prec, type); + (flags&F_ALT) ? "#" : "", + prec, type); return doubletounicode(buf, buflen, fmt, x); } static PyObject* formatlong(PyObject *val, int flags, int prec, int type) { - char *buf; - int len; - PyObject *str; /* temporary string object. */ - PyObject *result; - - str = _PyBytes_FormatLong(val, flags, prec, type, &buf, &len); - if (!str) - return NULL; - result = PyUnicode_FromStringAndSize(buf, len); - Py_DECREF(str); - return result; + char *buf; + int len; + PyObject *str; /* temporary string object. */ + PyObject *result; + + str = _PyBytes_FormatLong(val, flags, prec, type, &buf, &len); + if (!str) + return NULL; + result = PyUnicode_FromStringAndSize(buf, len); + Py_DECREF(str); + return result; } #if 0 static int formatint(Py_UNICODE *buf, - size_t buflen, - int flags, - int prec, - int type, - PyObject *v) + size_t buflen, + int flags, + int prec, + int type, + PyObject *v) { /* fmt = '%#.' + `prec` + 'l' + `type` * worst case length = 3 + 19 (worst len of INT_MAX on 64-bit machine) @@ -8866,7 +8866,7 @@ */ if (buflen <= 14 || buflen <= (size_t)3 + (size_t)prec) { PyErr_SetString(PyExc_OverflowError, - "formatted integer is too long (precision too large?)"); + "formatted integer is too long (precision too large?)"); return -1; } @@ -8874,7 +8874,7 @@ (type == 'x' || type == 'X' || type == 'o')) { /* When converting under %#o, %#x or %#X, there are a number * of issues that cause pain: - * - for %#o, we want a different base marker than C + * - for %#o, we want a different base marker than C * - when 0 is being converted, the C standard leaves off * the '0x' or '0X', which is inconsistent with other * %#x/%#X conversions and inconsistent with Python's @@ -8915,56 +8915,56 @@ { /* presume that the buffer is at least 3 characters long */ if (PyUnicode_Check(v)) { - if (PyUnicode_GET_SIZE(v) == 1) { - buf[0] = PyUnicode_AS_UNICODE(v)[0]; - buf[1] = '\0'; - return 1; - } + if (PyUnicode_GET_SIZE(v) == 1) { + buf[0] = PyUnicode_AS_UNICODE(v)[0]; + buf[1] = '\0'; + return 1; + } #ifndef Py_UNICODE_WIDE - if (PyUnicode_GET_SIZE(v) == 2) { - /* Decode a valid surrogate pair */ - int c0 = PyUnicode_AS_UNICODE(v)[0]; - int c1 = PyUnicode_AS_UNICODE(v)[1]; - if (0xD800 <= c0 && c0 <= 0xDBFF && - 0xDC00 <= c1 && c1 <= 0xDFFF) { - buf[0] = c0; - buf[1] = c1; - buf[2] = '\0'; - return 2; - } - } + if (PyUnicode_GET_SIZE(v) == 2) { + /* Decode a valid surrogate pair */ + int c0 = PyUnicode_AS_UNICODE(v)[0]; + int c1 = PyUnicode_AS_UNICODE(v)[1]; + if (0xD800 <= c0 && c0 <= 0xDBFF && + 0xDC00 <= c1 && c1 <= 0xDFFF) { + buf[0] = c0; + buf[1] = c1; + buf[2] = '\0'; + return 2; + } + } #endif - goto onError; + goto onError; } else { - /* Integer input truncated to a character */ + /* Integer input truncated to a character */ long x; - x = PyLong_AsLong(v); - if (x == -1 && PyErr_Occurred()) - goto onError; - - if (x < 0 || x > 0x10ffff) { - PyErr_SetString(PyExc_OverflowError, - "%c arg not in range(0x110000)"); - return -1; - } + x = PyLong_AsLong(v); + if (x == -1 && PyErr_Occurred()) + goto onError; + + if (x < 0 || x > 0x10ffff) { + PyErr_SetString(PyExc_OverflowError, + "%c arg not in range(0x110000)"); + return -1; + } #ifndef Py_UNICODE_WIDE - if (x > 0xffff) { - x -= 0x10000; - buf[0] = (Py_UNICODE)(0xD800 | (x >> 10)); - buf[1] = (Py_UNICODE)(0xDC00 | (x & 0x3FF)); - return 2; - } -#endif - buf[0] = (Py_UNICODE) x; - buf[1] = '\0'; - return 1; + if (x > 0xffff) { + x -= 0x10000; + buf[0] = (Py_UNICODE)(0xD800 | (x >> 10)); + buf[1] = (Py_UNICODE)(0xDC00 | (x & 0x3FF)); + return 2; + } +#endif + buf[0] = (Py_UNICODE) x; + buf[1] = '\0'; + return 1; } - onError: + onError: PyErr_SetString(PyExc_TypeError, - "%c requires int or char"); + "%c requires int or char"); return -1; } @@ -8979,7 +8979,7 @@ #define FORMATBUFLEN (size_t)120 PyObject *PyUnicode_Format(PyObject *format, - PyObject *args) + PyObject *args) { Py_UNICODE *fmt, *res; Py_ssize_t fmtcnt, rescnt, reslen, arglen, argidx; @@ -8989,433 +8989,433 @@ PyObject *uformat; if (format == NULL || args == NULL) { - PyErr_BadInternalCall(); - return NULL; + PyErr_BadInternalCall(); + return NULL; } uformat = PyUnicode_FromObject(format); if (uformat == NULL) - return NULL; + return NULL; fmt = PyUnicode_AS_UNICODE(uformat); fmtcnt = PyUnicode_GET_SIZE(uformat); reslen = rescnt = fmtcnt + 100; result = _PyUnicode_New(reslen); if (result == NULL) - goto onError; + goto onError; res = PyUnicode_AS_UNICODE(result); if (PyTuple_Check(args)) { - arglen = PyTuple_Size(args); - argidx = 0; + arglen = PyTuple_Size(args); + argidx = 0; } else { - arglen = -1; - argidx = -2; + arglen = -1; + argidx = -2; } if (Py_TYPE(args)->tp_as_mapping && !PyTuple_Check(args) && !PyUnicode_Check(args)) - dict = args; + dict = args; while (--fmtcnt >= 0) { - if (*fmt != '%') { - if (--rescnt < 0) { - rescnt = fmtcnt + 100; - reslen += rescnt; - if (_PyUnicode_Resize(&result, reslen) < 0) - goto onError; - res = PyUnicode_AS_UNICODE(result) + reslen - rescnt; - --rescnt; - } - *res++ = *fmt++; - } - else { - /* Got a format specifier */ - int flags = 0; - Py_ssize_t width = -1; - int prec = -1; - Py_UNICODE c = '\0'; - Py_UNICODE fill; - int isnumok; - PyObject *v = NULL; - PyObject *temp = NULL; - Py_UNICODE *pbuf; - Py_UNICODE sign; - Py_ssize_t len; - Py_UNICODE formatbuf[FORMATBUFLEN]; /* For format{float,int,char}() */ - - fmt++; - if (*fmt == '(') { - Py_UNICODE *keystart; - Py_ssize_t keylen; - PyObject *key; - int pcount = 1; - - if (dict == NULL) { - PyErr_SetString(PyExc_TypeError, - "format requires a mapping"); - goto onError; - } - ++fmt; - --fmtcnt; - keystart = fmt; - /* Skip over balanced parentheses */ - while (pcount > 0 && --fmtcnt >= 0) { - if (*fmt == ')') - --pcount; - else if (*fmt == '(') - ++pcount; - fmt++; - } - keylen = fmt - keystart - 1; - if (fmtcnt < 0 || pcount > 0) { - PyErr_SetString(PyExc_ValueError, - "incomplete format key"); - goto onError; - } + if (*fmt != '%') { + if (--rescnt < 0) { + rescnt = fmtcnt + 100; + reslen += rescnt; + if (_PyUnicode_Resize(&result, reslen) < 0) + goto onError; + res = PyUnicode_AS_UNICODE(result) + reslen - rescnt; + --rescnt; + } + *res++ = *fmt++; + } + else { + /* Got a format specifier */ + int flags = 0; + Py_ssize_t width = -1; + int prec = -1; + Py_UNICODE c = '\0'; + Py_UNICODE fill; + int isnumok; + PyObject *v = NULL; + PyObject *temp = NULL; + Py_UNICODE *pbuf; + Py_UNICODE sign; + Py_ssize_t len; + Py_UNICODE formatbuf[FORMATBUFLEN]; /* For format{float,int,char}() */ + + fmt++; + if (*fmt == '(') { + Py_UNICODE *keystart; + Py_ssize_t keylen; + PyObject *key; + int pcount = 1; + + if (dict == NULL) { + PyErr_SetString(PyExc_TypeError, + "format requires a mapping"); + goto onError; + } + ++fmt; + --fmtcnt; + keystart = fmt; + /* Skip over balanced parentheses */ + while (pcount > 0 && --fmtcnt >= 0) { + if (*fmt == ')') + --pcount; + else if (*fmt == '(') + ++pcount; + fmt++; + } + keylen = fmt - keystart - 1; + if (fmtcnt < 0 || pcount > 0) { + PyErr_SetString(PyExc_ValueError, + "incomplete format key"); + goto onError; + } #if 0 - /* keys are converted to strings using UTF-8 and - then looked up since Python uses strings to hold - variables names etc. in its namespaces and we - wouldn't want to break common idioms. */ - key = PyUnicode_EncodeUTF8(keystart, - keylen, - NULL); + /* keys are converted to strings using UTF-8 and + then looked up since Python uses strings to hold + variables names etc. in its namespaces and we + wouldn't want to break common idioms. */ + key = PyUnicode_EncodeUTF8(keystart, + keylen, + NULL); #else - key = PyUnicode_FromUnicode(keystart, keylen); + key = PyUnicode_FromUnicode(keystart, keylen); #endif - if (key == NULL) - goto onError; - if (args_owned) { - Py_DECREF(args); - args_owned = 0; - } - args = PyObject_GetItem(dict, key); - Py_DECREF(key); - if (args == NULL) { - goto onError; - } - args_owned = 1; - arglen = -1; - argidx = -2; - } - while (--fmtcnt >= 0) { - switch (c = *fmt++) { - case '-': flags |= F_LJUST; continue; - case '+': flags |= F_SIGN; continue; - case ' ': flags |= F_BLANK; continue; - case '#': flags |= F_ALT; continue; - case '0': flags |= F_ZERO; continue; - } - break; - } - if (c == '*') { - v = getnextarg(args, arglen, &argidx); - if (v == NULL) - goto onError; - if (!PyLong_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "* wants int"); - goto onError; - } - width = PyLong_AsLong(v); - if (width == -1 && PyErr_Occurred()) - goto onError; - if (width < 0) { - flags |= F_LJUST; - width = -width; - } - if (--fmtcnt >= 0) - c = *fmt++; - } - else if (c >= '0' && c <= '9') { - width = c - '0'; - while (--fmtcnt >= 0) { - c = *fmt++; - if (c < '0' || c > '9') - break; - if ((width*10) / 10 != width) { - PyErr_SetString(PyExc_ValueError, - "width too big"); - goto onError; - } - width = width*10 + (c - '0'); - } - } - if (c == '.') { - prec = 0; - if (--fmtcnt >= 0) - c = *fmt++; - if (c == '*') { - v = getnextarg(args, arglen, &argidx); - if (v == NULL) - goto onError; - if (!PyLong_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "* wants int"); - goto onError; - } - prec = PyLong_AsLong(v); - if (prec == -1 && PyErr_Occurred()) - goto onError; - if (prec < 0) - prec = 0; - if (--fmtcnt >= 0) - c = *fmt++; - } - else if (c >= '0' && c <= '9') { - prec = c - '0'; - while (--fmtcnt >= 0) { - c = Py_CHARMASK(*fmt++); - if (c < '0' || c > '9') - break; - if ((prec*10) / 10 != prec) { - PyErr_SetString(PyExc_ValueError, - "prec too big"); - goto onError; - } - prec = prec*10 + (c - '0'); - } - } - } /* prec */ - if (fmtcnt >= 0) { - if (c == 'h' || c == 'l' || c == 'L') { - if (--fmtcnt >= 0) - c = *fmt++; - } - } - if (fmtcnt < 0) { - PyErr_SetString(PyExc_ValueError, - "incomplete format"); - goto onError; - } - if (c != '%') { - v = getnextarg(args, arglen, &argidx); - if (v == NULL) - goto onError; - } - sign = 0; - fill = ' '; - switch (c) { - - case '%': - pbuf = formatbuf; - /* presume that buffer length is at least 1 */ - pbuf[0] = '%'; - len = 1; - break; - - case 's': - case 'r': - case 'a': - if (PyUnicode_Check(v) && c == 's') { - temp = v; - Py_INCREF(temp); - } - else { - if (c == 's') - temp = PyObject_Str(v); - else if (c == 'r') - temp = PyObject_Repr(v); - else - temp = PyObject_ASCII(v); - if (temp == NULL) - goto onError; + if (key == NULL) + goto onError; + if (args_owned) { + Py_DECREF(args); + args_owned = 0; + } + args = PyObject_GetItem(dict, key); + Py_DECREF(key); + if (args == NULL) { + goto onError; + } + args_owned = 1; + arglen = -1; + argidx = -2; + } + while (--fmtcnt >= 0) { + switch (c = *fmt++) { + case '-': flags |= F_LJUST; continue; + case '+': flags |= F_SIGN; continue; + case ' ': flags |= F_BLANK; continue; + case '#': flags |= F_ALT; continue; + case '0': flags |= F_ZERO; continue; + } + break; + } + if (c == '*') { + v = getnextarg(args, arglen, &argidx); + if (v == NULL) + goto onError; + if (!PyLong_Check(v)) { + PyErr_SetString(PyExc_TypeError, + "* wants int"); + goto onError; + } + width = PyLong_AsLong(v); + if (width == -1 && PyErr_Occurred()) + goto onError; + if (width < 0) { + flags |= F_LJUST; + width = -width; + } + if (--fmtcnt >= 0) + c = *fmt++; + } + else if (c >= '0' && c <= '9') { + width = c - '0'; + while (--fmtcnt >= 0) { + c = *fmt++; + if (c < '0' || c > '9') + break; + if ((width*10) / 10 != width) { + PyErr_SetString(PyExc_ValueError, + "width too big"); + goto onError; + } + width = width*10 + (c - '0'); + } + } + if (c == '.') { + prec = 0; + if (--fmtcnt >= 0) + c = *fmt++; + if (c == '*') { + v = getnextarg(args, arglen, &argidx); + if (v == NULL) + goto onError; + if (!PyLong_Check(v)) { + PyErr_SetString(PyExc_TypeError, + "* wants int"); + goto onError; + } + prec = PyLong_AsLong(v); + if (prec == -1 && PyErr_Occurred()) + goto onError; + if (prec < 0) + prec = 0; + if (--fmtcnt >= 0) + c = *fmt++; + } + else if (c >= '0' && c <= '9') { + prec = c - '0'; + while (--fmtcnt >= 0) { + c = Py_CHARMASK(*fmt++); + if (c < '0' || c > '9') + break; + if ((prec*10) / 10 != prec) { + PyErr_SetString(PyExc_ValueError, + "prec too big"); + goto onError; + } + prec = prec*10 + (c - '0'); + } + } + } /* prec */ + if (fmtcnt >= 0) { + if (c == 'h' || c == 'l' || c == 'L') { + if (--fmtcnt >= 0) + c = *fmt++; + } + } + if (fmtcnt < 0) { + PyErr_SetString(PyExc_ValueError, + "incomplete format"); + goto onError; + } + if (c != '%') { + v = getnextarg(args, arglen, &argidx); + if (v == NULL) + goto onError; + } + sign = 0; + fill = ' '; + switch (c) { + + case '%': + pbuf = formatbuf; + /* presume that buffer length is at least 1 */ + pbuf[0] = '%'; + len = 1; + break; + + case 's': + case 'r': + case 'a': + if (PyUnicode_Check(v) && c == 's') { + temp = v; + Py_INCREF(temp); + } + else { + if (c == 's') + temp = PyObject_Str(v); + else if (c == 'r') + temp = PyObject_Repr(v); + else + temp = PyObject_ASCII(v); + if (temp == NULL) + goto onError; if (PyUnicode_Check(temp)) /* nothing to do */; - else { - Py_DECREF(temp); - PyErr_SetString(PyExc_TypeError, - "%s argument has non-string str()"); - goto onError; - } - } - pbuf = PyUnicode_AS_UNICODE(temp); - len = PyUnicode_GET_SIZE(temp); - if (prec >= 0 && len > prec) - len = prec; - break; - - case 'i': - case 'd': - case 'u': - case 'o': - case 'x': - case 'X': - if (c == 'i') - c = 'd'; - isnumok = 0; - if (PyNumber_Check(v)) { - PyObject *iobj=NULL; - - if (PyLong_Check(v)) { - iobj = v; - Py_INCREF(iobj); - } - else { - iobj = PyNumber_Long(v); - } - if (iobj!=NULL) { - if (PyLong_Check(iobj)) { - isnumok = 1; - temp = formatlong(iobj, flags, prec, c); - Py_DECREF(iobj); - if (!temp) - goto onError; - pbuf = PyUnicode_AS_UNICODE(temp); - len = PyUnicode_GET_SIZE(temp); - sign = 1; - } - else { - Py_DECREF(iobj); - } - } - } - if (!isnumok) { - PyErr_Format(PyExc_TypeError, - "%%%c format: a number is required, " - "not %.200s", (char)c, Py_TYPE(v)->tp_name); - goto onError; - } - if (flags & F_ZERO) - fill = '0'; - break; - - case 'e': - case 'E': - case 'f': - case 'F': - case 'g': - case 'G': - if (c == 'F') - c = 'f'; - pbuf = formatbuf; - len = formatfloat(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), - flags, prec, c, v); - if (len < 0) - goto onError; - sign = 1; - if (flags & F_ZERO) - fill = '0'; - break; - - case 'c': - pbuf = formatbuf; - len = formatchar(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), v); - if (len < 0) - goto onError; - break; - - default: - PyErr_Format(PyExc_ValueError, - "unsupported format character '%c' (0x%x) " - "at index %zd", - (31<=c && c<=126) ? (char)c : '?', + else { + Py_DECREF(temp); + PyErr_SetString(PyExc_TypeError, + "%s argument has non-string str()"); + goto onError; + } + } + pbuf = PyUnicode_AS_UNICODE(temp); + len = PyUnicode_GET_SIZE(temp); + if (prec >= 0 && len > prec) + len = prec; + break; + + case 'i': + case 'd': + case 'u': + case 'o': + case 'x': + case 'X': + if (c == 'i') + c = 'd'; + isnumok = 0; + if (PyNumber_Check(v)) { + PyObject *iobj=NULL; + + if (PyLong_Check(v)) { + iobj = v; + Py_INCREF(iobj); + } + else { + iobj = PyNumber_Long(v); + } + if (iobj!=NULL) { + if (PyLong_Check(iobj)) { + isnumok = 1; + temp = formatlong(iobj, flags, prec, c); + Py_DECREF(iobj); + if (!temp) + goto onError; + pbuf = PyUnicode_AS_UNICODE(temp); + len = PyUnicode_GET_SIZE(temp); + sign = 1; + } + else { + Py_DECREF(iobj); + } + } + } + if (!isnumok) { + PyErr_Format(PyExc_TypeError, + "%%%c format: a number is required, " + "not %.200s", (char)c, Py_TYPE(v)->tp_name); + goto onError; + } + if (flags & F_ZERO) + fill = '0'; + break; + + case 'e': + case 'E': + case 'f': + case 'F': + case 'g': + case 'G': + if (c == 'F') + c = 'f'; + pbuf = formatbuf; + len = formatfloat(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), + flags, prec, c, v); + if (len < 0) + goto onError; + sign = 1; + if (flags & F_ZERO) + fill = '0'; + break; + + case 'c': + pbuf = formatbuf; + len = formatchar(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), v); + if (len < 0) + goto onError; + break; + + default: + PyErr_Format(PyExc_ValueError, + "unsupported format character '%c' (0x%x) " + "at index %zd", + (31<=c && c<=126) ? (char)c : '?', (int)c, - (Py_ssize_t)(fmt - 1 - - PyUnicode_AS_UNICODE(uformat))); - goto onError; - } - if (sign) { - if (*pbuf == '-' || *pbuf == '+') { - sign = *pbuf++; - len--; - } - else if (flags & F_SIGN) - sign = '+'; - else if (flags & F_BLANK) - sign = ' '; - else - sign = 0; - } - if (width < len) - width = len; - if (rescnt - (sign != 0) < width) { - reslen -= rescnt; - rescnt = width + fmtcnt + 100; - reslen += rescnt; - if (reslen < 0) { - Py_XDECREF(temp); - PyErr_NoMemory(); - goto onError; - } - if (_PyUnicode_Resize(&result, reslen) < 0) { - Py_XDECREF(temp); - goto onError; - } - res = PyUnicode_AS_UNICODE(result) - + reslen - rescnt; - } - if (sign) { - if (fill != ' ') - *res++ = sign; - rescnt--; - if (width > len) - width--; - } - if ((flags & F_ALT) && (c == 'x' || c == 'X' || c == 'o')) { - assert(pbuf[0] == '0'); - assert(pbuf[1] == c); - if (fill != ' ') { - *res++ = *pbuf++; - *res++ = *pbuf++; - } - rescnt -= 2; - width -= 2; - if (width < 0) - width = 0; - len -= 2; - } - if (width > len && !(flags & F_LJUST)) { - do { - --rescnt; - *res++ = fill; - } while (--width > len); - } - if (fill == ' ') { - if (sign) - *res++ = sign; - if ((flags & F_ALT) && (c == 'x' || c == 'X' || c == 'o')) { - assert(pbuf[0] == '0'); - assert(pbuf[1] == c); - *res++ = *pbuf++; - *res++ = *pbuf++; - } - } - Py_UNICODE_COPY(res, pbuf, len); - res += len; - rescnt -= len; - while (--width >= len) { - --rescnt; - *res++ = ' '; - } - if (dict && (argidx < arglen) && c != '%') { - PyErr_SetString(PyExc_TypeError, - "not all arguments converted during string formatting"); + (Py_ssize_t)(fmt - 1 - + PyUnicode_AS_UNICODE(uformat))); + goto onError; + } + if (sign) { + if (*pbuf == '-' || *pbuf == '+') { + sign = *pbuf++; + len--; + } + else if (flags & F_SIGN) + sign = '+'; + else if (flags & F_BLANK) + sign = ' '; + else + sign = 0; + } + if (width < len) + width = len; + if (rescnt - (sign != 0) < width) { + reslen -= rescnt; + rescnt = width + fmtcnt + 100; + reslen += rescnt; + if (reslen < 0) { + Py_XDECREF(temp); + PyErr_NoMemory(); + goto onError; + } + if (_PyUnicode_Resize(&result, reslen) < 0) { + Py_XDECREF(temp); + goto onError; + } + res = PyUnicode_AS_UNICODE(result) + + reslen - rescnt; + } + if (sign) { + if (fill != ' ') + *res++ = sign; + rescnt--; + if (width > len) + width--; + } + if ((flags & F_ALT) && (c == 'x' || c == 'X' || c == 'o')) { + assert(pbuf[0] == '0'); + assert(pbuf[1] == c); + if (fill != ' ') { + *res++ = *pbuf++; + *res++ = *pbuf++; + } + rescnt -= 2; + width -= 2; + if (width < 0) + width = 0; + len -= 2; + } + if (width > len && !(flags & F_LJUST)) { + do { + --rescnt; + *res++ = fill; + } while (--width > len); + } + if (fill == ' ') { + if (sign) + *res++ = sign; + if ((flags & F_ALT) && (c == 'x' || c == 'X' || c == 'o')) { + assert(pbuf[0] == '0'); + assert(pbuf[1] == c); + *res++ = *pbuf++; + *res++ = *pbuf++; + } + } + Py_UNICODE_COPY(res, pbuf, len); + res += len; + rescnt -= len; + while (--width >= len) { + --rescnt; + *res++ = ' '; + } + if (dict && (argidx < arglen) && c != '%') { + PyErr_SetString(PyExc_TypeError, + "not all arguments converted during string formatting"); Py_XDECREF(temp); - goto onError; - } - Py_XDECREF(temp); - } /* '%' */ + goto onError; + } + Py_XDECREF(temp); + } /* '%' */ } /* until end */ if (argidx < arglen && !dict) { - PyErr_SetString(PyExc_TypeError, - "not all arguments converted during string formatting"); - goto onError; + PyErr_SetString(PyExc_TypeError, + "not all arguments converted during string formatting"); + goto onError; } if (_PyUnicode_Resize(&result, reslen - rescnt) < 0) - goto onError; + goto onError; if (args_owned) { - Py_DECREF(args); + Py_DECREF(args); } Py_DECREF(uformat); return (PyObject *)result; - onError: + onError: Py_XDECREF(result); Py_DECREF(uformat); if (args_owned) { - Py_DECREF(args); + Py_DECREF(args); } return NULL; } @@ -9426,56 +9426,56 @@ static PyObject * unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { - PyObject *x = NULL; - static char *kwlist[] = {"object", "encoding", "errors", 0}; - char *encoding = NULL; - char *errors = NULL; - - if (type != &PyUnicode_Type) - return unicode_subtype_new(type, args, kwds); - if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oss:str", - kwlist, &x, &encoding, &errors)) - return NULL; - if (x == NULL) - return (PyObject *)_PyUnicode_New(0); - if (encoding == NULL && errors == NULL) - return PyObject_Str(x); - else - return PyUnicode_FromEncodedObject(x, encoding, errors); + PyObject *x = NULL; + static char *kwlist[] = {"object", "encoding", "errors", 0}; + char *encoding = NULL; + char *errors = NULL; + + if (type != &PyUnicode_Type) + return unicode_subtype_new(type, args, kwds); + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oss:str", + kwlist, &x, &encoding, &errors)) + return NULL; + if (x == NULL) + return (PyObject *)_PyUnicode_New(0); + if (encoding == NULL && errors == NULL) + return PyObject_Str(x); + else + return PyUnicode_FromEncodedObject(x, encoding, errors); } static PyObject * unicode_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { - PyUnicodeObject *tmp, *pnew; - Py_ssize_t n; + PyUnicodeObject *tmp, *pnew; + Py_ssize_t n; - assert(PyType_IsSubtype(type, &PyUnicode_Type)); - tmp = (PyUnicodeObject *)unicode_new(&PyUnicode_Type, args, kwds); - if (tmp == NULL) - return NULL; - assert(PyUnicode_Check(tmp)); - pnew = (PyUnicodeObject *) type->tp_alloc(type, n = tmp->length); - if (pnew == NULL) { - Py_DECREF(tmp); - return NULL; - } - pnew->str = (Py_UNICODE*) PyObject_MALLOC(sizeof(Py_UNICODE) * (n+1)); - if (pnew->str == NULL) { - _Py_ForgetReference((PyObject *)pnew); - PyObject_Del(pnew); - Py_DECREF(tmp); - return PyErr_NoMemory(); - } - Py_UNICODE_COPY(pnew->str, tmp->str, n+1); - pnew->length = n; - pnew->hash = tmp->hash; - Py_DECREF(tmp); - return (PyObject *)pnew; + assert(PyType_IsSubtype(type, &PyUnicode_Type)); + tmp = (PyUnicodeObject *)unicode_new(&PyUnicode_Type, args, kwds); + if (tmp == NULL) + return NULL; + assert(PyUnicode_Check(tmp)); + pnew = (PyUnicodeObject *) type->tp_alloc(type, n = tmp->length); + if (pnew == NULL) { + Py_DECREF(tmp); + return NULL; + } + pnew->str = (Py_UNICODE*) PyObject_MALLOC(sizeof(Py_UNICODE) * (n+1)); + if (pnew->str == NULL) { + _Py_ForgetReference((PyObject *)pnew); + PyObject_Del(pnew); + Py_DECREF(tmp); + return PyErr_NoMemory(); + } + Py_UNICODE_COPY(pnew->str, tmp->str, n+1); + pnew->length = n; + pnew->hash = tmp->hash; + Py_DECREF(tmp); + return (PyObject *)pnew; } PyDoc_STRVAR(unicode_doc, -"str(string[, encoding[, errors]]) -> str\n\ + "str(string[, encoding[, errors]]) -> str\n\ \n\ Create a new string object from the given encoded string.\n\ encoding defaults to the current default string encoding.\n\ @@ -9485,46 +9485,46 @@ PyTypeObject PyUnicode_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) - "str", /* tp_name */ - sizeof(PyUnicodeObject), /* tp_size */ - 0, /* tp_itemsize */ + "str", /* tp_name */ + sizeof(PyUnicodeObject), /* tp_size */ + 0, /* tp_itemsize */ /* Slots */ - (destructor)unicode_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_compare */ - unicode_repr, /* tp_repr */ - &unicode_as_number, /* tp_as_number */ - &unicode_as_sequence, /* tp_as_sequence */ - &unicode_as_mapping, /* tp_as_mapping */ - (hashfunc) unicode_hash, /* tp_hash*/ - 0, /* tp_call*/ - (reprfunc) unicode_str, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | - Py_TPFLAGS_UNICODE_SUBCLASS, /* tp_flags */ - unicode_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - PyUnicode_RichCompare, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - unicode_iter, /* tp_iter */ - 0, /* tp_iternext */ - unicode_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &PyBaseObject_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - unicode_new, /* tp_new */ - PyObject_Del, /* tp_free */ + (destructor)unicode_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + unicode_repr, /* tp_repr */ + &unicode_as_number, /* tp_as_number */ + &unicode_as_sequence, /* tp_as_sequence */ + &unicode_as_mapping, /* tp_as_mapping */ + (hashfunc) unicode_hash, /* tp_hash*/ + 0, /* tp_call*/ + (reprfunc) unicode_str, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | + Py_TPFLAGS_UNICODE_SUBCLASS, /* tp_flags */ + unicode_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + PyUnicode_RichCompare, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + unicode_iter, /* tp_iter */ + 0, /* tp_iternext */ + unicode_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &PyBaseObject_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + unicode_new, /* tp_new */ + PyObject_Del, /* tp_free */ }; /* Initialize the Unicode implementation */ @@ -9550,12 +9550,12 @@ numfree = 0; unicode_empty = _PyUnicode_New(0); if (!unicode_empty) - return; + return; for (i = 0; i < 256; i++) - unicode_latin1[i] = NULL; + unicode_latin1[i] = NULL; if (PyType_Ready(&PyUnicode_Type) < 0) - Py_FatalError("Can't initialize 'unicode'"); + Py_FatalError("Can't initialize 'unicode'"); /* initialize the linebreak bloom filter */ bloom_linebreak = make_bloom_mask( @@ -9574,13 +9574,13 @@ PyUnicodeObject *u; for (u = free_list; u != NULL;) { - PyUnicodeObject *v = u; - u = *(PyUnicodeObject **)u; - if (v->str) - PyObject_DEL(v->str); - Py_XDECREF(v->defenc); - PyObject_Del(v); - numfree--; + PyUnicodeObject *v = u; + u = *(PyUnicodeObject **)u; + if (v->str) + PyObject_DEL(v->str); + Py_XDECREF(v->defenc); + PyObject_Del(v); + numfree--; } free_list = NULL; assert(numfree == 0); @@ -9596,10 +9596,10 @@ unicode_empty = NULL; for (i = 0; i < 256; i++) { - if (unicode_latin1[i]) { - Py_DECREF(unicode_latin1[i]); - unicode_latin1[i] = NULL; - } + if (unicode_latin1[i]) { + Py_DECREF(unicode_latin1[i]); + unicode_latin1[i] = NULL; + } } (void)PyUnicode_ClearFreeList(); } @@ -9607,238 +9607,238 @@ void PyUnicode_InternInPlace(PyObject **p) { - register PyUnicodeObject *s = (PyUnicodeObject *)(*p); - PyObject *t; - if (s == NULL || !PyUnicode_Check(s)) - Py_FatalError( - "PyUnicode_InternInPlace: unicode strings only please!"); - /* If it's a subclass, we don't really know what putting - it in the interned dict might do. */ - if (!PyUnicode_CheckExact(s)) - return; - if (PyUnicode_CHECK_INTERNED(s)) - return; - if (interned == NULL) { - interned = PyDict_New(); - if (interned == NULL) { - PyErr_Clear(); /* Don't leave an exception */ - return; - } - } - /* It might be that the GetItem call fails even - though the key is present in the dictionary, - namely when this happens during a stack overflow. */ - Py_ALLOW_RECURSION - t = PyDict_GetItem(interned, (PyObject *)s); - Py_END_ALLOW_RECURSION - - if (t) { - Py_INCREF(t); - Py_DECREF(*p); - *p = t; - return; - } - - PyThreadState_GET()->recursion_critical = 1; - if (PyDict_SetItem(interned, (PyObject *)s, (PyObject *)s) < 0) { - PyErr_Clear(); - PyThreadState_GET()->recursion_critical = 0; - return; - } - PyThreadState_GET()->recursion_critical = 0; - /* The two references in interned are not counted by refcnt. - The deallocator will take care of this */ - Py_REFCNT(s) -= 2; - PyUnicode_CHECK_INTERNED(s) = SSTATE_INTERNED_MORTAL; + register PyUnicodeObject *s = (PyUnicodeObject *)(*p); + PyObject *t; + if (s == NULL || !PyUnicode_Check(s)) + Py_FatalError( + "PyUnicode_InternInPlace: unicode strings only please!"); + /* If it's a subclass, we don't really know what putting + it in the interned dict might do. */ + if (!PyUnicode_CheckExact(s)) + return; + if (PyUnicode_CHECK_INTERNED(s)) + return; + if (interned == NULL) { + interned = PyDict_New(); + if (interned == NULL) { + PyErr_Clear(); /* Don't leave an exception */ + return; + } + } + /* It might be that the GetItem call fails even + though the key is present in the dictionary, + namely when this happens during a stack overflow. */ + Py_ALLOW_RECURSION + t = PyDict_GetItem(interned, (PyObject *)s); + Py_END_ALLOW_RECURSION + + if (t) { + Py_INCREF(t); + Py_DECREF(*p); + *p = t; + return; + } + + PyThreadState_GET()->recursion_critical = 1; + if (PyDict_SetItem(interned, (PyObject *)s, (PyObject *)s) < 0) { + PyErr_Clear(); + PyThreadState_GET()->recursion_critical = 0; + return; + } + PyThreadState_GET()->recursion_critical = 0; + /* The two references in interned are not counted by refcnt. + The deallocator will take care of this */ + Py_REFCNT(s) -= 2; + PyUnicode_CHECK_INTERNED(s) = SSTATE_INTERNED_MORTAL; } void PyUnicode_InternImmortal(PyObject **p) { - PyUnicode_InternInPlace(p); - if (PyUnicode_CHECK_INTERNED(*p) != SSTATE_INTERNED_IMMORTAL) { - PyUnicode_CHECK_INTERNED(*p) = SSTATE_INTERNED_IMMORTAL; - Py_INCREF(*p); - } + PyUnicode_InternInPlace(p); + if (PyUnicode_CHECK_INTERNED(*p) != SSTATE_INTERNED_IMMORTAL) { + PyUnicode_CHECK_INTERNED(*p) = SSTATE_INTERNED_IMMORTAL; + Py_INCREF(*p); + } } PyObject * PyUnicode_InternFromString(const char *cp) { - PyObject *s = PyUnicode_FromString(cp); - if (s == NULL) - return NULL; - PyUnicode_InternInPlace(&s); - return s; + PyObject *s = PyUnicode_FromString(cp); + if (s == NULL) + return NULL; + PyUnicode_InternInPlace(&s); + return s; } void _Py_ReleaseInternedUnicodeStrings(void) { - PyObject *keys; - PyUnicodeObject *s; - Py_ssize_t i, n; - Py_ssize_t immortal_size = 0, mortal_size = 0; - - if (interned == NULL || !PyDict_Check(interned)) - return; - keys = PyDict_Keys(interned); - if (keys == NULL || !PyList_Check(keys)) { - PyErr_Clear(); - return; - } - - /* Since _Py_ReleaseInternedUnicodeStrings() is intended to help a leak - detector, interned unicode strings are not forcibly deallocated; - rather, we give them their stolen references back, and then clear - and DECREF the interned dict. */ - - n = PyList_GET_SIZE(keys); - fprintf(stderr, "releasing %" PY_FORMAT_SIZE_T "d interned strings\n", - n); - for (i = 0; i < n; i++) { - s = (PyUnicodeObject *) PyList_GET_ITEM(keys, i); - switch (s->state) { - case SSTATE_NOT_INTERNED: - /* XXX Shouldn't happen */ - break; - case SSTATE_INTERNED_IMMORTAL: - Py_REFCNT(s) += 1; - immortal_size += s->length; - break; - case SSTATE_INTERNED_MORTAL: - Py_REFCNT(s) += 2; - mortal_size += s->length; - break; - default: - Py_FatalError("Inconsistent interned string state."); - } - s->state = SSTATE_NOT_INTERNED; - } - fprintf(stderr, "total size of all interned strings: " - "%" PY_FORMAT_SIZE_T "d/%" PY_FORMAT_SIZE_T "d " - "mortal/immortal\n", mortal_size, immortal_size); - Py_DECREF(keys); - PyDict_Clear(interned); - Py_DECREF(interned); - interned = NULL; + PyObject *keys; + PyUnicodeObject *s; + Py_ssize_t i, n; + Py_ssize_t immortal_size = 0, mortal_size = 0; + + if (interned == NULL || !PyDict_Check(interned)) + return; + keys = PyDict_Keys(interned); + if (keys == NULL || !PyList_Check(keys)) { + PyErr_Clear(); + return; + } + + /* Since _Py_ReleaseInternedUnicodeStrings() is intended to help a leak + detector, interned unicode strings are not forcibly deallocated; + rather, we give them their stolen references back, and then clear + and DECREF the interned dict. */ + + n = PyList_GET_SIZE(keys); + fprintf(stderr, "releasing %" PY_FORMAT_SIZE_T "d interned strings\n", + n); + for (i = 0; i < n; i++) { + s = (PyUnicodeObject *) PyList_GET_ITEM(keys, i); + switch (s->state) { + case SSTATE_NOT_INTERNED: + /* XXX Shouldn't happen */ + break; + case SSTATE_INTERNED_IMMORTAL: + Py_REFCNT(s) += 1; + immortal_size += s->length; + break; + case SSTATE_INTERNED_MORTAL: + Py_REFCNT(s) += 2; + mortal_size += s->length; + break; + default: + Py_FatalError("Inconsistent interned string state."); + } + s->state = SSTATE_NOT_INTERNED; + } + fprintf(stderr, "total size of all interned strings: " + "%" PY_FORMAT_SIZE_T "d/%" PY_FORMAT_SIZE_T "d " + "mortal/immortal\n", mortal_size, immortal_size); + Py_DECREF(keys); + PyDict_Clear(interned); + Py_DECREF(interned); + interned = NULL; } /********************* Unicode Iterator **************************/ typedef struct { - PyObject_HEAD - Py_ssize_t it_index; - PyUnicodeObject *it_seq; /* Set to NULL when iterator is exhausted */ + PyObject_HEAD + Py_ssize_t it_index; + PyUnicodeObject *it_seq; /* Set to NULL when iterator is exhausted */ } unicodeiterobject; static void unicodeiter_dealloc(unicodeiterobject *it) { - _PyObject_GC_UNTRACK(it); - Py_XDECREF(it->it_seq); - PyObject_GC_Del(it); + _PyObject_GC_UNTRACK(it); + Py_XDECREF(it->it_seq); + PyObject_GC_Del(it); } static int unicodeiter_traverse(unicodeiterobject *it, visitproc visit, void *arg) { - Py_VISIT(it->it_seq); - return 0; + Py_VISIT(it->it_seq); + return 0; } static PyObject * unicodeiter_next(unicodeiterobject *it) { - PyUnicodeObject *seq; - PyObject *item; + PyUnicodeObject *seq; + PyObject *item; + + assert(it != NULL); + seq = it->it_seq; + if (seq == NULL) + return NULL; + assert(PyUnicode_Check(seq)); + + if (it->it_index < PyUnicode_GET_SIZE(seq)) { + item = PyUnicode_FromUnicode( + PyUnicode_AS_UNICODE(seq)+it->it_index, 1); + if (item != NULL) + ++it->it_index; + return item; + } - assert(it != NULL); - seq = it->it_seq; - if (seq == NULL) - return NULL; - assert(PyUnicode_Check(seq)); - - if (it->it_index < PyUnicode_GET_SIZE(seq)) { - item = PyUnicode_FromUnicode( - PyUnicode_AS_UNICODE(seq)+it->it_index, 1); - if (item != NULL) - ++it->it_index; - return item; - } - - Py_DECREF(seq); - it->it_seq = NULL; - return NULL; + Py_DECREF(seq); + it->it_seq = NULL; + return NULL; } static PyObject * unicodeiter_len(unicodeiterobject *it) { - Py_ssize_t len = 0; - if (it->it_seq) - len = PyUnicode_GET_SIZE(it->it_seq) - it->it_index; - return PyLong_FromSsize_t(len); + Py_ssize_t len = 0; + if (it->it_seq) + len = PyUnicode_GET_SIZE(it->it_seq) - it->it_index; + return PyLong_FromSsize_t(len); } PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it))."); static PyMethodDef unicodeiter_methods[] = { - {"__length_hint__", (PyCFunction)unicodeiter_len, METH_NOARGS, - length_hint_doc}, - {NULL, NULL} /* sentinel */ + {"__length_hint__", (PyCFunction)unicodeiter_len, METH_NOARGS, + length_hint_doc}, + {NULL, NULL} /* sentinel */ }; PyTypeObject PyUnicodeIter_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - "str_iterator", /* tp_name */ - sizeof(unicodeiterobject), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)unicodeiter_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 */ - 0, /* tp_call */ - 0, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ - 0, /* tp_doc */ - (traverseproc)unicodeiter_traverse, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - PyObject_SelfIter, /* tp_iter */ - (iternextfunc)unicodeiter_next, /* tp_iternext */ - unicodeiter_methods, /* tp_methods */ - 0, + PyVarObject_HEAD_INIT(&PyType_Type, 0) + "str_iterator", /* tp_name */ + sizeof(unicodeiterobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + /* methods */ + (destructor)unicodeiter_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 */ + 0, /* tp_call */ + 0, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ + 0, /* tp_doc */ + (traverseproc)unicodeiter_traverse, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + PyObject_SelfIter, /* tp_iter */ + (iternextfunc)unicodeiter_next, /* tp_iternext */ + unicodeiter_methods, /* tp_methods */ + 0, }; static PyObject * unicode_iter(PyObject *seq) { - unicodeiterobject *it; + unicodeiterobject *it; - if (!PyUnicode_Check(seq)) { - PyErr_BadInternalCall(); - return NULL; - } - it = PyObject_GC_New(unicodeiterobject, &PyUnicodeIter_Type); - if (it == NULL) - return NULL; - it->it_index = 0; - Py_INCREF(seq); - it->it_seq = (PyUnicodeObject *)seq; - _PyObject_GC_TRACK(it); - return (PyObject *)it; + if (!PyUnicode_Check(seq)) { + PyErr_BadInternalCall(); + return NULL; + } + it = PyObject_GC_New(unicodeiterobject, &PyUnicodeIter_Type); + if (it == NULL) + return NULL; + it->it_index = 0; + Py_INCREF(seq); + it->it_seq = (PyUnicodeObject *)seq; + _PyObject_GC_TRACK(it); + return (PyObject *)it; } size_t @@ -9899,8 +9899,8 @@ /* -Local variables: -c-basic-offset: 4 -indent-tabs-mode: nil -End: + Local variables: + c-basic-offset: 4 + indent-tabs-mode: nil + End: */ Modified: python/branches/py3k-issue1717/Python/makeopcodetargets.py ============================================================================== --- python/branches/py3k-issue1717/Python/makeopcodetargets.py (original) +++ python/branches/py3k-issue1717/Python/makeopcodetargets.py Sun Feb 1 11:54:55 2009 @@ -3,6 +3,9 @@ (for compilers supporting computed gotos or "labels-as-values", such as gcc). """ +# This code should stay compatible with Python 2.3, at least while +# some of the buildbots have Python 2.3 as their system Python. + import imp import os @@ -25,7 +28,7 @@ continue targets[op] = "TARGET_%s" % opname f.write("static void *opcode_targets[256] = {\n") - f.write(",\n".join("\t&&%s" % s for s in targets)) + f.write(",\n".join(["\t&&%s" % s for s in targets])) f.write("\n};\n") From buildbot at python.org Sun Feb 1 12:57:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 11:57:14 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090201115714.C4B741E4002@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/114 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,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 Sun Feb 1 13:13:56 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 1 Feb 2009 13:13:56 +0100 (CET) Subject: [Python-checkins] r69184 - in python/branches/py3k: Doc/c-api/object.rst Include/abstract.h Lib/test/test_builtin.py Misc/NEWS Objects/abstract.c Objects/object.c Objects/typeobject.c Python/bltinmodule.c Message-ID: <20090201121356.CE0421E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 1 13:13:56 2009 New Revision: 69184 Log: Issue #1717: remove the cmp builtin function, the C-API functions PyObject_Cmp, PyObject_Compare, and various support functions. Modified: python/branches/py3k/Doc/c-api/object.rst python/branches/py3k/Include/abstract.h python/branches/py3k/Lib/test/test_builtin.py python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/abstract.c python/branches/py3k/Objects/object.c python/branches/py3k/Objects/typeobject.c python/branches/py3k/Python/bltinmodule.c Modified: python/branches/py3k/Doc/c-api/object.rst ============================================================================== --- python/branches/py3k/Doc/c-api/object.rst (original) +++ python/branches/py3k/Doc/c-api/object.rst Sun Feb 1 13:13:56 2009 @@ -89,27 +89,6 @@ *opid*. -.. cfunction:: int PyObject_Cmp(PyObject *o1, PyObject *o2, int *result) - - .. index:: builtin: cmp - - Compare the values of *o1* and *o2* using a routine provided by *o1*, if one - exists, otherwise with a routine provided by *o2*. The result of the comparison - is returned in *result*. Returns ``-1`` on failure. This is the equivalent of - the Python statement ``result = cmp(o1, o2)``. - - -.. cfunction:: int PyObject_Compare(PyObject *o1, PyObject *o2) - - .. index:: builtin: cmp - - Compare the values of *o1* and *o2* using a routine provided by *o1*, if one - exists, otherwise with a routine provided by *o2*. Returns the result of the - comparison on success. On error, the value returned is undefined; use - :cfunc:`PyErr_Occurred` to detect an error. This is equivalent to the Python - expression ``cmp(o1, o2)``. - - .. cfunction:: PyObject* PyObject_Repr(PyObject *o) .. index:: builtin: repr Modified: python/branches/py3k/Include/abstract.h ============================================================================== --- python/branches/py3k/Include/abstract.h (original) +++ python/branches/py3k/Include/abstract.h Sun Feb 1 13:13:56 2009 @@ -228,29 +228,6 @@ */ #define PyObject_DelAttr(O,A) PyObject_SetAttr((O),(A),NULL) - PyAPI_FUNC(int) PyObject_Cmp(PyObject *o1, PyObject *o2, int *result); - - /* - Compare the values of o1 and o2 using a routine provided by - o1, if one exists, otherwise with a routine provided by o2. - The result of the comparison is returned in result. Returns - -1 on failure. This is the equivalent of the Python - statement: result=cmp(o1,o2). - - */ - - /* Implemented elsewhere: - - int PyObject_Compare(PyObject *o1, PyObject *o2); - - Compare the values of o1 and o2 using a routine provided by - o1, if one exists, otherwise with a routine provided by o2. - Returns the result of the comparison on success. On error, - the value returned is undefined. This is equivalent to the - Python expression: cmp(o1,o2). - - */ - /* Implemented elsewhere: PyObject *PyObject_Repr(PyObject *o); Modified: python/branches/py3k/Lib/test/test_builtin.py ============================================================================== --- python/branches/py3k/Lib/test/test_builtin.py (original) +++ python/branches/py3k/Lib/test/test_builtin.py Sun Feb 1 13:13:56 2009 @@ -220,9 +220,7 @@ self.assertRaises((OverflowError, ValueError), chr, 2**32) def test_cmp(self): - # uncomment the following line once cmp has been removed - #self.assert_(not hasattr(builtins, "cmp")) - pass + self.assert_(not hasattr(builtins, "cmp")) def test_compile(self): compile('print(1)\n', '', 'exec') Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun Feb 1 13:13:56 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #1717: Remove builtin cmp() function, C-API functions + PyObject_Cmp and PyObject_Compare, and the support function + Py_CmpToRich. + - Issue #4707: round(x, n) now returns an integer if x is an integer. Previously it returned a float. Modified: python/branches/py3k/Objects/abstract.c ============================================================================== --- python/branches/py3k/Objects/abstract.c (original) +++ python/branches/py3k/Objects/abstract.c Sun Feb 1 13:13:56 2009 @@ -27,22 +27,6 @@ /* Operations on any object */ -int -PyObject_Cmp(PyObject *o1, PyObject *o2, int *result) -{ - int r; - - if (o1 == NULL || o2 == NULL) { - null_error(); - return -1; - } - r = PyObject_Compare(o1, o2); - if (PyErr_Occurred()) - return -1; - *result = r; - return 0; -} - PyObject * PyObject_Type(PyObject *o) { Modified: python/branches/py3k/Objects/object.c ============================================================================== --- python/branches/py3k/Objects/object.c (original) +++ python/branches/py3k/Objects/object.c Sun Feb 1 13:13:56 2009 @@ -549,68 +549,6 @@ */ -/* Forward */ -static PyObject *do_richcompare(PyObject *v, PyObject *w, int op); - -/* Perform a three-way comparison, raising TypeError if three-way comparison - is not supported. */ -static int -do_compare(PyObject *v, PyObject *w) -{ - cmpfunc f; - int ok; - - if (v->ob_type == w->ob_type && - (f = v->ob_type->tp_compare) != NULL) { - return (*f)(v, w); - } - - /* Now try three-way compare before giving up. This is intentionally - elaborate; if you have a it will raise TypeError if it detects two - objects that aren't ordered with respect to each other. */ - ok = PyObject_RichCompareBool(v, w, Py_LT); - if (ok < 0) - return -1; /* Error */ - if (ok) - return -1; /* Less than */ - ok = PyObject_RichCompareBool(v, w, Py_GT); - if (ok < 0) - return -1; /* Error */ - if (ok) - return 1; /* Greater than */ - ok = PyObject_RichCompareBool(v, w, Py_EQ); - if (ok < 0) - return -1; /* Error */ - if (ok) - return 0; /* Equal */ - - /* Give up */ - PyErr_Format(PyExc_TypeError, - "unorderable types: '%.100s' != '%.100s'", - v->ob_type->tp_name, - w->ob_type->tp_name); - return -1; -} - -/* Perform a three-way comparison. This wraps do_compare() with a check for - NULL arguments and a recursion check. */ -int -PyObject_Compare(PyObject *v, PyObject *w) -{ - int res; - - if (v == NULL || w == NULL) { - if (!PyErr_Occurred()) - PyErr_BadInternalCall(); - return -1; - } - if (Py_EnterRecursiveCall(" in cmp")) - return -1; - res = do_compare(v, w); - Py_LeaveRecursiveCall(); - return res < 0 ? -1 : res; -} - /* Map rich comparison operators to their swapped version, e.g. LT <--> GT */ int _Py_SwappedOp[] = {Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE}; @@ -715,44 +653,6 @@ return ok; } -/* Turn the result of a three-way comparison into the result expected by a - rich comparison. */ -PyObject * -Py_CmpToRich(int op, int cmp) -{ - PyObject *res; - int ok; - - if (PyErr_Occurred()) - return NULL; - switch (op) { - case Py_LT: - ok = cmp < 0; - break; - case Py_LE: - ok = cmp <= 0; - break; - case Py_EQ: - ok = cmp == 0; - break; - case Py_NE: - ok = cmp != 0; - break; - case Py_GT: - ok = cmp > 0; - break; - case Py_GE: - ok = cmp >= 0; - break; - default: - PyErr_BadArgument(); - return NULL; - } - res = ok ? Py_True : Py_False; - Py_INCREF(res); - return res; -} - /* Set of hash utility functions to help maintaining the invariant that if a==b then hash(a)==hash(b) Modified: python/branches/py3k/Objects/typeobject.c ============================================================================== --- python/branches/py3k/Objects/typeobject.c (original) +++ python/branches/py3k/Objects/typeobject.c Sun Feb 1 13:13:56 2009 @@ -2897,7 +2897,7 @@ slots_a = ((PyHeapTypeObject *)a)->ht_slots; slots_b = ((PyHeapTypeObject *)b)->ht_slots; if (slots_a && slots_b) { - if (PyObject_Compare(slots_a, slots_b) != 0) + if (PyObject_RichCompareBool(slots_a, slots_b, Py_EQ) != 1) return 0; size += sizeof(PyObject *) * PyTuple_GET_SIZE(slots_a); } Modified: python/branches/py3k/Python/bltinmodule.c ============================================================================== --- python/branches/py3k/Python/bltinmodule.c (original) +++ python/branches/py3k/Python/bltinmodule.c Sun Feb 1 13:13:56 2009 @@ -493,25 +493,6 @@ ; -static PyObject * -builtin_cmp(PyObject *self, PyObject *args) -{ - PyObject *a, *b; - int c; - - if (!PyArg_UnpackTuple(args, "cmp", 2, 2, &a, &b)) - return NULL; - if (PyObject_Cmp(a, b, &c) < 0) - return NULL; - return PyLong_FromLong((long)c); -} - -PyDoc_STRVAR(cmp_doc, -"cmp(x, y) -> integer\n\ -\n\ -Return negative if xy."); - - static char * source_as_string(PyObject *cmd, char *funcname, char *what) { @@ -2230,7 +2211,6 @@ {"ascii", builtin_ascii, METH_O, ascii_doc}, {"bin", builtin_bin, METH_O, bin_doc}, {"chr", builtin_chr, METH_VARARGS, chr_doc}, - {"cmp", builtin_cmp, METH_VARARGS, cmp_doc}, {"compile", (PyCFunction)builtin_compile, METH_VARARGS | METH_KEYWORDS, compile_doc}, {"delattr", builtin_delattr, METH_VARARGS, delattr_doc}, {"dir", builtin_dir, METH_VARARGS, dir_doc}, From python-checkins at python.org Sun Feb 1 13:31:56 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 1 Feb 2009 13:31:56 +0100 (CET) Subject: [Python-checkins] r69185 - in python/branches/release30-maint: Doc/c-api/object.rst Include/abstract.h Lib/test/test_builtin.py Misc/NEWS Objects/abstract.c Objects/object.c Objects/typeobject.c Python/bltinmodule.c Message-ID: <20090201123156.F41F11E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 1 13:31:56 2009 New Revision: 69185 Log: Merged revisions 69184 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69184 | mark.dickinson | 2009-02-01 12:13:56 +0000 (Sun, 01 Feb 2009) | 3 lines Issue #1717: remove the cmp builtin function, the C-API functions PyObject_Cmp, PyObject_Compare, and various support functions. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/c-api/object.rst python/branches/release30-maint/Include/abstract.h python/branches/release30-maint/Lib/test/test_builtin.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Objects/abstract.c python/branches/release30-maint/Objects/object.c python/branches/release30-maint/Objects/typeobject.c python/branches/release30-maint/Python/bltinmodule.c Modified: python/branches/release30-maint/Doc/c-api/object.rst ============================================================================== --- python/branches/release30-maint/Doc/c-api/object.rst (original) +++ python/branches/release30-maint/Doc/c-api/object.rst Sun Feb 1 13:31:56 2009 @@ -89,27 +89,6 @@ *opid*. -.. cfunction:: int PyObject_Cmp(PyObject *o1, PyObject *o2, int *result) - - .. index:: builtin: cmp - - Compare the values of *o1* and *o2* using a routine provided by *o1*, if one - exists, otherwise with a routine provided by *o2*. The result of the comparison - is returned in *result*. Returns ``-1`` on failure. This is the equivalent of - the Python statement ``result = cmp(o1, o2)``. - - -.. cfunction:: int PyObject_Compare(PyObject *o1, PyObject *o2) - - .. index:: builtin: cmp - - Compare the values of *o1* and *o2* using a routine provided by *o1*, if one - exists, otherwise with a routine provided by *o2*. Returns the result of the - comparison on success. On error, the value returned is undefined; use - :cfunc:`PyErr_Occurred` to detect an error. This is equivalent to the Python - expression ``cmp(o1, o2)``. - - .. cfunction:: PyObject* PyObject_Repr(PyObject *o) .. index:: builtin: repr Modified: python/branches/release30-maint/Include/abstract.h ============================================================================== --- python/branches/release30-maint/Include/abstract.h (original) +++ python/branches/release30-maint/Include/abstract.h Sun Feb 1 13:31:56 2009 @@ -228,29 +228,6 @@ */ #define PyObject_DelAttr(O,A) PyObject_SetAttr((O),(A),NULL) - PyAPI_FUNC(int) PyObject_Cmp(PyObject *o1, PyObject *o2, int *result); - - /* - Compare the values of o1 and o2 using a routine provided by - o1, if one exists, otherwise with a routine provided by o2. - The result of the comparison is returned in result. Returns - -1 on failure. This is the equivalent of the Python - statement: result=cmp(o1,o2). - - */ - - /* Implemented elsewhere: - - int PyObject_Compare(PyObject *o1, PyObject *o2); - - Compare the values of o1 and o2 using a routine provided by - o1, if one exists, otherwise with a routine provided by o2. - Returns the result of the comparison on success. On error, - the value returned is undefined. This is equivalent to the - Python expression: cmp(o1,o2). - - */ - /* Implemented elsewhere: PyObject *PyObject_Repr(PyObject *o); Modified: python/branches/release30-maint/Lib/test/test_builtin.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_builtin.py (original) +++ python/branches/release30-maint/Lib/test/test_builtin.py Sun Feb 1 13:31:56 2009 @@ -220,9 +220,7 @@ self.assertRaises((OverflowError, ValueError), chr, 2**32) def test_cmp(self): - # uncomment the following line once cmp has been removed - #self.assert_(not hasattr(builtins, "cmp")) - pass + self.assert_(not hasattr(builtins, "cmp")) def test_compile(self): compile('print(1)\n', '', 'exec') Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sun Feb 1 13:31:56 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #1717: Remove builtin cmp() function, C-API functions + PyObject_Cmp and PyObject_Compare, and the support function + Py_CmpToRich. + - Issue #4707: round(x, n) now returns an integer if x is an integer. Previously it returned a float. Modified: python/branches/release30-maint/Objects/abstract.c ============================================================================== --- python/branches/release30-maint/Objects/abstract.c (original) +++ python/branches/release30-maint/Objects/abstract.c Sun Feb 1 13:31:56 2009 @@ -27,22 +27,6 @@ /* Operations on any object */ -int -PyObject_Cmp(PyObject *o1, PyObject *o2, int *result) -{ - int r; - - if (o1 == NULL || o2 == NULL) { - null_error(); - return -1; - } - r = PyObject_Compare(o1, o2); - if (PyErr_Occurred()) - return -1; - *result = r; - return 0; -} - PyObject * PyObject_Type(PyObject *o) { Modified: python/branches/release30-maint/Objects/object.c ============================================================================== --- python/branches/release30-maint/Objects/object.c (original) +++ python/branches/release30-maint/Objects/object.c Sun Feb 1 13:31:56 2009 @@ -544,68 +544,6 @@ */ -/* Forward */ -static PyObject *do_richcompare(PyObject *v, PyObject *w, int op); - -/* Perform a three-way comparison, raising TypeError if three-way comparison - is not supported. */ -static int -do_compare(PyObject *v, PyObject *w) -{ - cmpfunc f; - int ok; - - if (v->ob_type == w->ob_type && - (f = v->ob_type->tp_compare) != NULL) { - return (*f)(v, w); - } - - /* Now try three-way compare before giving up. This is intentionally - elaborate; if you have a it will raise TypeError if it detects two - objects that aren't ordered with respect to each other. */ - ok = PyObject_RichCompareBool(v, w, Py_LT); - if (ok < 0) - return -1; /* Error */ - if (ok) - return -1; /* Less than */ - ok = PyObject_RichCompareBool(v, w, Py_GT); - if (ok < 0) - return -1; /* Error */ - if (ok) - return 1; /* Greater than */ - ok = PyObject_RichCompareBool(v, w, Py_EQ); - if (ok < 0) - return -1; /* Error */ - if (ok) - return 0; /* Equal */ - - /* Give up */ - PyErr_Format(PyExc_TypeError, - "unorderable types: '%.100s' != '%.100s'", - v->ob_type->tp_name, - w->ob_type->tp_name); - return -1; -} - -/* Perform a three-way comparison. This wraps do_compare() with a check for - NULL arguments and a recursion check. */ -int -PyObject_Compare(PyObject *v, PyObject *w) -{ - int res; - - if (v == NULL || w == NULL) { - if (!PyErr_Occurred()) - PyErr_BadInternalCall(); - return -1; - } - if (Py_EnterRecursiveCall(" in cmp")) - return -1; - res = do_compare(v, w); - Py_LeaveRecursiveCall(); - return res < 0 ? -1 : res; -} - /* Map rich comparison operators to their swapped version, e.g. LT <--> GT */ int _Py_SwappedOp[] = {Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE}; @@ -710,44 +648,6 @@ return ok; } -/* Turn the result of a three-way comparison into the result expected by a - rich comparison. */ -PyObject * -Py_CmpToRich(int op, int cmp) -{ - PyObject *res; - int ok; - - if (PyErr_Occurred()) - return NULL; - switch (op) { - case Py_LT: - ok = cmp < 0; - break; - case Py_LE: - ok = cmp <= 0; - break; - case Py_EQ: - ok = cmp == 0; - break; - case Py_NE: - ok = cmp != 0; - break; - case Py_GT: - ok = cmp > 0; - break; - case Py_GE: - ok = cmp >= 0; - break; - default: - PyErr_BadArgument(); - return NULL; - } - res = ok ? Py_True : Py_False; - Py_INCREF(res); - return res; -} - /* Set of hash utility functions to help maintaining the invariant that if a==b then hash(a)==hash(b) Modified: python/branches/release30-maint/Objects/typeobject.c ============================================================================== --- python/branches/release30-maint/Objects/typeobject.c (original) +++ python/branches/release30-maint/Objects/typeobject.c Sun Feb 1 13:31:56 2009 @@ -2897,7 +2897,7 @@ slots_a = ((PyHeapTypeObject *)a)->ht_slots; slots_b = ((PyHeapTypeObject *)b)->ht_slots; if (slots_a && slots_b) { - if (PyObject_Compare(slots_a, slots_b) != 0) + if (PyObject_RichCompareBool(slots_a, slots_b, Py_EQ) != 1) return 0; size += sizeof(PyObject *) * PyTuple_GET_SIZE(slots_a); } Modified: python/branches/release30-maint/Python/bltinmodule.c ============================================================================== --- python/branches/release30-maint/Python/bltinmodule.c (original) +++ python/branches/release30-maint/Python/bltinmodule.c Sun Feb 1 13:31:56 2009 @@ -494,25 +494,6 @@ ; -static PyObject * -builtin_cmp(PyObject *self, PyObject *args) -{ - PyObject *a, *b; - int c; - - if (!PyArg_UnpackTuple(args, "cmp", 2, 2, &a, &b)) - return NULL; - if (PyObject_Cmp(a, b, &c) < 0) - return NULL; - return PyLong_FromLong((long)c); -} - -PyDoc_STRVAR(cmp_doc, -"cmp(x, y) -> integer\n\ -\n\ -Return negative if xy."); - - static char * source_as_string(PyObject *cmd, char *funcname, char *what) { @@ -2233,7 +2214,6 @@ {"ascii", builtin_ascii, METH_O, ascii_doc}, {"bin", builtin_bin, METH_O, bin_doc}, {"chr", builtin_chr, METH_VARARGS, chr_doc}, - {"cmp", builtin_cmp, METH_VARARGS, cmp_doc}, {"compile", (PyCFunction)builtin_compile, METH_VARARGS | METH_KEYWORDS, compile_doc}, {"delattr", builtin_delattr, METH_VARARGS, delattr_doc}, {"dir", builtin_dir, METH_VARARGS, dir_doc}, From python-checkins at python.org Sun Feb 1 13:42:37 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 1 Feb 2009 13:42:37 +0100 (CET) Subject: [Python-checkins] r69186 - in python/branches/py3k-issue1717: Objects/abstract.c Objects/typeobject.c Message-ID: <20090201124237.8868A1E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 1 13:42:37 2009 New Revision: 69186 Log: Merged revisions 69184 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69184 | mark.dickinson | 2009-02-01 12:13:56 +0000 (Sun, 01 Feb 2009) | 3 lines Issue #1717: remove the cmp builtin function, the C-API functions PyObject_Cmp, PyObject_Compare, and various support functions. ........ Modified: python/branches/py3k-issue1717/ (props changed) python/branches/py3k-issue1717/Objects/abstract.c python/branches/py3k-issue1717/Objects/typeobject.c Modified: python/branches/py3k-issue1717/Objects/abstract.c ============================================================================== --- python/branches/py3k-issue1717/Objects/abstract.c (original) +++ python/branches/py3k-issue1717/Objects/abstract.c Sun Feb 1 13:42:37 2009 @@ -25,6 +25,8 @@ return NULL; } +/* Operations on any object */ + PyObject * PyObject_Type(PyObject *o) { Modified: python/branches/py3k-issue1717/Objects/typeobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/typeobject.c (original) +++ python/branches/py3k-issue1717/Objects/typeobject.c Sun Feb 1 13:42:37 2009 @@ -2897,7 +2897,7 @@ slots_a = ((PyHeapTypeObject *)a)->ht_slots; slots_b = ((PyHeapTypeObject *)b)->ht_slots; if (slots_a && slots_b) { - if (PyObject_RichCompareBool(slots_a, slots_b, Py_NE) == 1) + if (PyObject_RichCompareBool(slots_a, slots_b, Py_EQ) != 1) return 0; size += sizeof(PyObject *) * PyTuple_GET_SIZE(slots_a); } From python-checkins at python.org Sun Feb 1 14:01:16 2009 From: python-checkins at python.org (nick.coghlan) Date: Sun, 1 Feb 2009 14:01:16 +0100 (CET) Subject: [Python-checkins] r69187 - peps/trunk/pep-0366.txt Message-ID: <20090201130116.CBFB71E4002@bag.python.org> Author: nick.coghlan Date: Sun Feb 1 14:01:16 2009 New Revision: 69187 Log: Add explicit note regarding __package__ in top level modules Modified: peps/trunk/pep-0366.txt Modified: peps/trunk/pep-0366.txt ============================================================================== --- peps/trunk/pep-0366.txt (original) +++ peps/trunk/pep-0366.txt Sun Feb 1 14:01:16 2009 @@ -72,6 +72,12 @@ manually. It has the advantage that this change need only be made once per file, regardless of the number of relative imports. +Note that setting ``__package__`` to the empty string explicitly is +permitted, and has the effect of disabling all relative imports from +that module (since the import machinery will consider it to be a +top level module in that case). This means that tools like ``runpy`` +do not need to provide special case handling for top level modules +when setting ``__package__``. Rationale for Change ==================== From ncoghlan at gmail.com Sun Feb 1 14:03:27 2009 From: ncoghlan at gmail.com (Nick Coghlan) Date: Sun, 01 Feb 2009 23:03:27 +1000 Subject: [Python-checkins] r69167 - in python/branches/py3k/Lib/importlib: NOTES _bootstrap.py test/frozen/test_loader.py In-Reply-To: References: <20090201013414.2FEB41E4002@bag.python.org> <49855066.60507@gmail.com> Message-ID: <49859D9F.1080701@gmail.com> Brett Cannon wrote: > On Sat, Jan 31, 2009 at 23:33, Nick Coghlan wrote: >> 1. When determining a package name, rpartition is your friend (see the >> relevant code in runpy.py) > > I guess I could, but the semantics are the same. Although I see you > hard-coded using rpartition in PEP 366. =) I find partition to be such a handy addition to the string API I like to promote it whenever I can :) >> 2. It's OK to set __package__ even in a top-level module (just set it to >> the empty string). That is why rpartition works so well for the application. > > The PEP doesn't say that, although I guess your > ``__name__.rpartition('.')[0]`` line makes that implicit. Could you > edit the PEP to mention that the empty string is okay? Done - should show up on the website shortly. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- From buildbot at python.org Sun Feb 1 14:06:03 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 13:06:03 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090201130603.79E081E4002@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/216 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_posix test_subprocess ====================================================================== 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Sun Feb 1 14:59:23 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 1 Feb 2009 14:59:23 +0100 (CET) Subject: [Python-checkins] r69188 - in python/branches/py3k: Include/code.h Include/object.h Misc/NEWS Objects/object.c Objects/typeobject.c Message-ID: <20090201135923.0961F1E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 1 14:59:22 2009 New Revision: 69188 Log: Issue #1717, continued: remove PyObject_Compare and Py_CmpToRich declarations from object.h; don't inherit tp_compare slot on subclasses; and raise TypeError when initializing a type that has a nonzero tp_compare slot. Fix up comparison-related comments in object.c and code.h. Modified: python/branches/py3k/Include/code.h python/branches/py3k/Include/object.h python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/object.c python/branches/py3k/Objects/typeobject.c Modified: python/branches/py3k/Include/code.h ============================================================================== --- python/branches/py3k/Include/code.h (original) +++ python/branches/py3k/Include/code.h Sun Feb 1 14:59:22 2009 @@ -20,7 +20,7 @@ PyObject *co_varnames; /* tuple of strings (local variable names) */ PyObject *co_freevars; /* tuple of strings (free variable names) */ PyObject *co_cellvars; /* tuple of strings (cell variable names) */ - /* The rest doesn't count for hash/cmp */ + /* The rest doesn't count for hash or comparisons */ PyObject *co_filename; /* unicode (where it was loaded from) */ PyObject *co_name; /* unicode (name, for reference) */ int co_firstlineno; /* first source line number */ Modified: python/branches/py3k/Include/object.h ============================================================================== --- python/branches/py3k/Include/object.h (original) +++ python/branches/py3k/Include/object.h Sun Feb 1 14:59:22 2009 @@ -426,10 +426,8 @@ PyAPI_FUNC(PyObject *) PyObject_Str(PyObject *); PyAPI_FUNC(PyObject *) PyObject_ASCII(PyObject *); PyAPI_FUNC(PyObject *) PyObject_Bytes(PyObject *); -PyAPI_FUNC(int) PyObject_Compare(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyObject_RichCompare(PyObject *, PyObject *, int); PyAPI_FUNC(int) PyObject_RichCompareBool(PyObject *, PyObject *, int); -PyAPI_FUNC(PyObject *) Py_CmpToRich(int op, int cmp); PyAPI_FUNC(PyObject *) PyObject_GetAttrString(PyObject *, const char *); PyAPI_FUNC(int) PyObject_SetAttrString(PyObject *, const char *, PyObject *); PyAPI_FUNC(int) PyObject_HasAttrString(PyObject *, const char *); Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun Feb 1 14:59:22 2009 @@ -12,9 +12,11 @@ Core and Builtins ----------------- -- Issue #1717: Remove builtin cmp() function, C-API functions - PyObject_Cmp and PyObject_Compare, and the support function - Py_CmpToRich. +- Issue #1717: Removed builtin cmp() function, dropped tp_compare + slot, the C API functions PyObject_Compare and PyUnicode_Compare and + the type definition cmpfunc. The tp_compare slot is reserved for + future usage. An attempt to initialize a type with a nonzero + tp_compare slot will raise TypeError. - Issue #4707: round(x, n) now returns an integer if x is an integer. Previously it returned a float. Modified: python/branches/py3k/Objects/object.c ============================================================================== --- python/branches/py3k/Objects/object.c (original) +++ python/branches/py3k/Objects/object.c Sun Feb 1 14:59:22 2009 @@ -500,35 +500,19 @@ return PyBytes_FromObject(v); } -/* The new comparison philosophy is: we completely separate three-way - comparison from rich comparison. That is, PyObject_Compare() and - PyObject_Cmp() *just* use the tp_compare slot. And PyObject_RichCompare() - and PyObject_RichCompareBool() *just* use the tp_richcompare slot. +/* For Python 3.0.1 and later, the old three-way comparison has been + completely removed in favour of rich comparisons. PyObject_Compare() and + PyObject_Cmp() are gone, and the builtin cmp function no longer exists. + The old tp_compare slot will be renamed to tp_reserved, and should no + longer be used. Use tp_richcompare instead. See (*) below for practical amendments. - IOW, only cmp() uses tp_compare; the comparison operators (==, !=, <=, <, - >=, >) only use tp_richcompare. Note that list.sort() only uses <. + tp_richcompare gets called with a first argument of the appropriate type + and a second object of an arbitrary type. We never do any kind of + coercion. - (And yes, eventually we'll rip out cmp() and tp_compare.) - - The calling conventions are different: tp_compare only gets called with two - objects of the appropriate type; tp_richcompare gets called with a first - argument of the appropriate type and a second object of an arbitrary type. - We never do any kind of coercion. - - The return conventions are also different. - - The tp_compare slot should return a C int, as follows: - - -1 if a < b or if an exception occurred - 0 if a == b - +1 if a > b - - No other return values are allowed. PyObject_Compare() has the same - calling convention. - - The tp_richcompare slot should return an object, as follows: + The tp_richcompare slot should return an object, as follows: NULL if an exception occurred NotImplemented if the requested comparison is not implemented @@ -544,9 +528,6 @@ comparing the object pointer (i.e. falling back to the base object implementation). - - If three-way comparison is not implemented, it falls back on rich - comparison (but not the other way around!). - */ /* Map rich comparison operators to their swapped version, e.g. LT <--> GT */ Modified: python/branches/py3k/Objects/typeobject.c ============================================================================== --- python/branches/py3k/Objects/typeobject.c (original) +++ python/branches/py3k/Objects/typeobject.c Sun Feb 1 14:59:22 2009 @@ -3662,7 +3662,7 @@ type->tp_setattr = base->tp_setattr; type->tp_setattro = base->tp_setattro; } - /* tp_compare see tp_richcompare */ + /* tp_compare is ignored, see tp_richcompare */ COPYSLOT(tp_repr); /* tp_hash see tp_richcompare */ COPYSLOT(tp_call); @@ -3670,12 +3670,10 @@ { /* Copy comparison-related slots only when not overriding them anywhere */ - if (type->tp_compare == NULL && - type->tp_richcompare == NULL && + if (type->tp_richcompare == NULL && type->tp_hash == NULL && !overrides_hash(type)) { - type->tp_compare = base->tp_compare; type->tp_richcompare = base->tp_richcompare; type->tp_hash = base->tp_hash; } @@ -3888,6 +3886,13 @@ goto error; } + /* Check reserved slots */ + if (type->tp_compare) { + PyErr_Format(PyExc_TypeError, + "type %s has tp_compare", + type->tp_name); + } + /* All done -- set the ready flag */ assert(type->tp_dict != NULL); type->tp_flags = From ggpolo at gmail.com Sun Feb 1 15:00:55 2009 From: ggpolo at gmail.com (Guilherme Polo) Date: Sun, 1 Feb 2009 12:00:55 -0200 Subject: [Python-checkins] r69131 - python/trunk/Doc/library/ttk.rst In-Reply-To: <20090131032602.ADC491E4002@bag.python.org> References: <20090131032602.ADC491E4002@bag.python.org> Message-ID: Thanks for taking a look into it Andrew, On Sat, Jan 31, 2009 at 1:26 AM, andrew. kuchling wrote: > Author: andrew.kuchling > Date: Sat Jan 31 04:26:02 2009 > New Revision: 69131 > > Log: > Text edits and markup fixes > > Modified: > python/trunk/Doc/library/ttk.rst > > Modified: python/trunk/Doc/library/ttk.rst > ============================================================================== > --- python/trunk/Doc/library/ttk.rst (original) > +++ python/trunk/Doc/library/ttk.rst Sat Jan 31 04:26:02 2009 > @@ -44,9 +44,9 @@ > And then several :mod:`ttk` widgets (:class:`Button`, :class:`Checkbutton`, > :class:`Entry`, :class:`Frame`, :class:`Label`, :class:`LabelFrame`, > :class:`Menubutton`, :class:`PanedWindow`, :class:`Radiobutton`, :class:`Scale` > -and :class:`Scrollbar`) will automatically substitute the Tk widgets. > +and :class:`Scrollbar`) will automatically substitute for the Tk widgets. > > -This has the direct benefit of using the new widgets which gives better > +This has the direct benefit of using the new widgets, giving better > look & feel across platforms, but you should be aware that they are not > totally compatible. The main difference you will find out is that widget > options such as "fg", "bg" and others related to widget styling are no > @@ -57,21 +57,22 @@ > > `Converting existing applications to use the Tile widgets `_ > A text which talks in Tcl terms about differences typically found when > - moving applications to use the new widgets. > + converting applications to use the new widgets. > > > Ttk Widgets > ----------- > > -Ttk comes with 17 widgets, where 11 of these already existed in Tkinter: > +Ttk comes with 17 widgets, 11 of which already exist in Tkinter: > :class:`Button`, :class:`Checkbutton`, :class:`Entry`, :class:`Frame`, > -:class:`Label`, :class:`LabelFrame`, :class:`Menubutton`, :class:`PanedWindow`, > -:class:`Radiobutton`, :class:`Scale` and :class:`Scrollbar`. The others 6 are > -new: :class:`Combobox`, :class:`Notebook`, :class:`Progressbar`, > -:class:`Separator`, :class:`Sizegrip` and :class:`Treeview`. And all them are > +:class:`Label`, :class:`LabelFrame`, :class:`Menubutton`, > +:class:`PanedWindow`, :class:`Radiobutton`, :class:`Scale` and > +:class:`Scrollbar`. The 6 new widget classes are: :class:`Combobox`, > +:class:`Notebook`, :class:`Progressbar`, :class:`Separator`, > +:class:`Sizegrip` and :class:`Treeview`. All of these classes are > subclasses of :class:`Widget`. > > -Like it was told before, you will notice changes in look & feel as well in the > +As said previously, you will notice changes in look-and-feel as well in the > styling code. To demonstrate the latter, a very simple example is shown below. > > Tk code:: > @@ -80,7 +81,7 @@ > l2 = Tkinter.Label(text="Test", fg="black", bg="white") > > > -Ttk code:: > +Corresponding Ttk code:: > > style = ttk.Style() > style.configure("BW.TLabel", foreground="black", background="white") > @@ -101,7 +102,7 @@ > Standard Options > ^^^^^^^^^^^^^^^^ > > -All the :mod:`ttk` Widgets accepts the following options: > +All the :mod:`ttk` widgets accept the following options: > > +-----------+--------------------------------------------------------------+ > | Option | Description | > @@ -110,18 +111,19 @@ > | | the option database for the window's other options, to | > | | determine the default bindtags for the window, and to select | > | | the widget's default layout and style. This is a read-only | > - | | which may only be specified when the window is created | > + | | option which may only be specified when the window is | > + | | created. | > +-----------+--------------------------------------------------------------+ > | cursor | Specifies the mouse cursor to be used for the widget. If set | > | | to the empty string (the default), the cursor is inherited | > - | | for the parent widget. | > + | | from the parent widget. | > +-----------+--------------------------------------------------------------+ > | takefocus | Determines whether the window accepts the focus during | > - | | keyboard traversal. 0, 1 or an empty is return. If 0 is | > - | | returned, it means that the window should be skipped entirely| > - | | during keyboard traversal. If 1, it means that the window | > - | | should receive the input focus as long as it is viewable. And| > - | | an empty string means that the traversal scripts make the | > + | | keyboard traversal. 0, 1 or an empty string is returned. | > + | | If 0, the window should be skipped entirely | > + | | during keyboard traversal. If 1, the window | > + | | should receive the input focus as long as it is viewable. | > + | | An empty string means that the traversal scripts make the | > | | decision about whether or not to focus on the window. | > +-----------+--------------------------------------------------------------+ > | style | May be used to specify a custom widget style. | > @@ -137,18 +139,19 @@ > +----------------+---------------------------------------------------------+ > | option | description | > +================+=========================================================+ > - | xscrollcommand | Used to comunicate with horizontal scrollbars. | > + | xscrollcommand | Used to communicate with horizontal scrollbars. | > | | | > - | | When the view in the widget's window change, the widget | > + | | When the view in the widget's window changes, the widget| > | | will generate a Tcl command based on the scrollcommand. | > | | | > - | | Usually this option consists of the method | > - | | :meth:`Scrollbar.set` of some scrollbar. This will cause| > + | | Usually this option consists of the | > + | | :meth:`Scrollbar.set` method of some scrollbar. This | > + | | will cause | > | | the scrollbar to be updated whenever the view in the | > | | window changes. | > +----------------+---------------------------------------------------------+ > - | yscrollcommand | Used to comunicate with vertical scrollbars. | > - | | For some more information, see above. | > + | yscrollcommand | Used to communicate with vertical scrollbars. | > + | | For more information, see above. | > +----------------+---------------------------------------------------------+ > > > @@ -172,14 +175,14 @@ > +--------------+-----------------------------------------------------------+ > | image | Specifies an image to display. This is a list of 1 or more| > | | elements. The first element is the default image name. The| > - | | rest of the list if a sequence of statespec/value pairs as| > + | | rest of the list is a sequence of statespec/value pairs as| > | | defined by :meth:`Style.map`, specifying different images | > | | to use when the widget is in a particular state or a | > | | combination of states. All images in the list should have | > | | the same size. | > +--------------+-----------------------------------------------------------+ > | compound | Specifies how to display the image relative to the text, | > - | | in the case both text and images options are present. | > + | | in the case both text and image options are present. | > | | Valid values are: | > | | | > | | * text: display text only | > @@ -190,7 +193,7 @@ > | | otherwise the text. | > +--------------+-----------------------------------------------------------+ > | width | If greater than zero, specifies how much space, in | > - | | character widths, to allocate for the text label, if less | > + | | character widths, to allocate for the text label; if less | > | | than zero, specifies a minimum width. If zero or | > | | unspecified, the natural width of the text label is used. | > +--------------+-----------------------------------------------------------+ > @@ -217,27 +220,27 @@ > | flag | description | > +============+=============================================================+ > | active | The mouse cursor is over the widget and pressing a mouse | > - | | button will cause some action to occur | > + | | button will cause some action to occur. | > +------------+-------------------------------------------------------------+ > - | disabled | Widget is disabled under program control | > + | disabled | Widget is disabled under program control. | > +------------+-------------------------------------------------------------+ > - | focus | Widget has keyboard focus | > + | focus | Widget has keyboard focus. | > +------------+-------------------------------------------------------------+ > - | pressed | Widget is being pressed | > + | pressed | Widget is being pressed. | > +------------+-------------------------------------------------------------+ > | selected | "On", "true", or "current" for things like Checkbuttons and | > - | | radiobuttons | > + | | radiobuttons. | > +------------+-------------------------------------------------------------+ > | background | Windows and Mac have a notion of an "active" or foreground | > | | window. The *background* state is set for widgets in a | > | | background window, and cleared for those in the foreground | > - | | window | > + | | window. | > +------------+-------------------------------------------------------------+ > - | readonly | Widget should not allow user modification | > + | readonly | Widget should not allow user modification. | > +------------+-------------------------------------------------------------+ > - | alternate | A widget-specific alternate display format | > + | alternate | A widget-specific alternate display format. | > +------------+-------------------------------------------------------------+ > - | invalid | The widget's value is invalid | > + | invalid | The widget's value is invalid. | > +------------+-------------------------------------------------------------+ > > A state specification is a sequence of state names, optionally prefixed with > @@ -248,7 +251,7 @@ > ^^^^^^^^^^ > > Besides the methods described below, the class :class:`ttk.Widget` supports the > -methods :meth:`Tkinter.Widget.cget` and :meth:`Tkinter.Widget.configure`. > +:meth:`Tkinter.Widget.cget` and :meth:`Tkinter.Widget.configure` methods. > > .. class:: Widget > > @@ -264,14 +267,14 @@ > > Test the widget's state. If a callback is not specified, returns True > if the widget state matches *statespec* and False otherwise. If callback > - is specified then it is called with args if widget state matches > + is specified then it is called with *args* if widget state matches > *statespec*. > > > .. method:: state([statespec=None]) > > - Modify or inquire widget state. If *statespec* is specified, sets the > - widget state according to it and return a new *statespec* indicating > + Modify or read widget state. If *statespec* is specified, sets the > + widget state accordingly and returns a new *statespec* indicating > which flags were changed. If *statespec* is not specified, returns > the currently-enabled state flags. > > @@ -284,39 +287,40 @@ > The :class:`ttk.Combobox` widget combines a text field with a pop-down list of > values. This widget is a subclass of :class:`Entry`. > > -Besides the methods inherited from :class:`Widget`: :meth:`Widget.cget`, > +Besides the methods inherited from :class:`Widget` (:meth:`Widget.cget`, > :meth:`Widget.configure`, :meth:`Widget.identify`, :meth:`Widget.instate` > -and :meth:`Widget.state`, and the following inherited from :class:`Entry`: > -:meth:`Entry.bbox`, :meth:`Entry.delete`, :meth:`Entry.icursor`, > +and :meth:`Widget.state`) and those inherited from :class:`Entry` > +(:meth:`Entry.bbox`, :meth:`Entry.delete`, :meth:`Entry.icursor`, > :meth:`Entry.index`, :meth:`Entry.inset`, :meth:`Entry.selection`, > -:meth:`Entry.xview`, it has some other methods, described at > +:meth:`Entry.xview`), this class has some other methods, described at > :class:`ttk.Combobox`. > > > Options > ^^^^^^^ > > -This widget accepts the following specific options: > +This widget accepts the following options: This is the only modification I'm not happy with. This widget accepts other options beyond these mentioned below, but the ones mentioned below are really specific to this widget. > > +-----------------+--------------------------------------------------------+ > | option | description | > +=================+========================================================+ > | exportselection | Boolean value. If set, the widget selection is linked | > | | to the Window Manager selection (which can be returned | > - | | by invoking Misc.selection_get, for example). | > + | | by invoking :meth:`Misc.selection_get`, for example). | > +-----------------+--------------------------------------------------------+ > | justify | Specifies how the text is aligned within the widget. | > | | One of "left", "center", or "right". | > +-----------------+--------------------------------------------------------+ > | height | Specifies the height of the pop-down listbox, in rows. | > +-----------------+--------------------------------------------------------+ > - | postcommand | A script (possibly registered with Misc.register) that | > + | postcommand | A script (possibly registered with | > + | | :meth:`Misc.register`) that | > | | is called immediately before displaying the values. It | > | | may specify which values to display. | > +-----------------+--------------------------------------------------------+ > | state | One of "normal", "readonly", or "disabled". In the | > | | "readonly" state, the value may not be edited directly,| > - | | and the user can only selection of the values from the | > + | | and the user can only select one of the values from the| > | | dropdown list. In the "normal" state, the text field is| > | | directly editable. In the "disabled" state, no | > | | interaction is possible. | > @@ -338,7 +342,7 @@ > Virtual events > ^^^^^^^^^^^^^^ > > -The combobox widgets generates a **<>** virtual event > +The combobox widget generates a **<>** virtual event > when the user selects an element from the list of values. > > > @@ -367,7 +371,7 @@ > Notebook > -------- > > -Ttk Notebook widget manages a collection of windows and displays a single > +The Ttk Notebook widget manages a collection of windows and displays a single > one at a time. Each child window is associated with a tab, which the user > may select to change the currently-displayed window. > > @@ -385,12 +389,12 @@ > | | Otherwise, the maximum height of all panes is used. | > +---------+----------------------------------------------------------------+ > | padding | Specifies the amount of extra space to add around the outside | > - | | of the notebook. The padding is a list up to four length | > - | | specifications left top right bottom. If fewer than four | > + | | of the notebook. The padding is a list of up to four length | > + | | specifications: left top right bottom. If fewer than four | > | | elements are specified, bottom defaults to top, right defaults | > | | to left, and top defaults to left. | > +---------+----------------------------------------------------------------+ > - | width | If present and greater than zero, specified the desired width | > + | width | If present and greater than zero, specifies the desired width | > | | of the pane area (not including internal padding). Otherwise, | > | | the maximum width of all panes is used. | > +---------+----------------------------------------------------------------+ > @@ -424,7 +428,7 @@ > | | image described in :class:`Widget`. | > +-----------+--------------------------------------------------------------+ > | compound | Specifies how to display the image relative to the text, in | > - | | the case both options text and image are present. See | > + | | the case both text and image options are present. See | > | | `Label Options`_ for legal values. | > +-----------+--------------------------------------------------------------+ > | underline | Specifies the index (0-based) of a character to underline in | > @@ -437,15 +441,15 @@ > Tab Identifiers > ^^^^^^^^^^^^^^^ > > -The tab_id present in several methods of :class:`ttk.Notebook` may take any > +The *tab_id* present in several methods of :class:`ttk.Notebook` may take any > of the following forms: > > -* An integer between zero and the number of tabs > -* The name of a child window > -* A positional specification of the form "@x,y", which identifies the tab > -* The literal string "current", which identifies the currently-selected tab > +* An integer between zero and the number of tabs. > +* The name of a child window. > +* A positional specification of the form "@x,y", which identifies the tab. > +* The literal string "current", which identifies the currently-selected tab. > * The literal string "end", which returns the number of tabs (only valid for > - :meth:`Notebook.index`) > + :meth:`Notebook.index`). > > > Virtual Events > _______________________________________________ > Python-checkins mailing list > Python-checkins at python.org > http://mail.python.org/mailman/listinfo/python-checkins > -- -- Guilherme H. Polo Goncalves From python-checkins at python.org Sun Feb 1 15:09:05 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 1 Feb 2009 15:09:05 +0100 (CET) Subject: [Python-checkins] r69189 - in python/branches/release30-maint: Include/code.h Include/object.h Misc/NEWS Objects/object.c Objects/typeobject.c Message-ID: <20090201140905.1821B1E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 1 15:09:04 2009 New Revision: 69189 Log: Merged revisions 69188 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69188 | mark.dickinson | 2009-02-01 13:59:22 +0000 (Sun, 01 Feb 2009) | 6 lines Issue #1717, continued: remove PyObject_Compare and Py_CmpToRich declarations from object.h; don't inherit tp_compare slot on subclasses; and raise TypeError when initializing a type that has a nonzero tp_compare slot. Fix up comparison-related comments in object.c and code.h. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Include/code.h python/branches/release30-maint/Include/object.h python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Objects/object.c python/branches/release30-maint/Objects/typeobject.c Modified: python/branches/release30-maint/Include/code.h ============================================================================== --- python/branches/release30-maint/Include/code.h (original) +++ python/branches/release30-maint/Include/code.h Sun Feb 1 15:09:04 2009 @@ -20,7 +20,7 @@ PyObject *co_varnames; /* tuple of strings (local variable names) */ PyObject *co_freevars; /* tuple of strings (free variable names) */ PyObject *co_cellvars; /* tuple of strings (cell variable names) */ - /* The rest doesn't count for hash/cmp */ + /* The rest doesn't count for hash or comparisons */ PyObject *co_filename; /* unicode (where it was loaded from) */ PyObject *co_name; /* unicode (name, for reference) */ int co_firstlineno; /* first source line number */ Modified: python/branches/release30-maint/Include/object.h ============================================================================== --- python/branches/release30-maint/Include/object.h (original) +++ python/branches/release30-maint/Include/object.h Sun Feb 1 15:09:04 2009 @@ -426,10 +426,8 @@ PyAPI_FUNC(PyObject *) PyObject_Str(PyObject *); PyAPI_FUNC(PyObject *) PyObject_ASCII(PyObject *); PyAPI_FUNC(PyObject *) PyObject_Bytes(PyObject *); -PyAPI_FUNC(int) PyObject_Compare(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyObject_RichCompare(PyObject *, PyObject *, int); PyAPI_FUNC(int) PyObject_RichCompareBool(PyObject *, PyObject *, int); -PyAPI_FUNC(PyObject *) Py_CmpToRich(int op, int cmp); PyAPI_FUNC(PyObject *) PyObject_GetAttrString(PyObject *, const char *); PyAPI_FUNC(int) PyObject_SetAttrString(PyObject *, const char *, PyObject *); PyAPI_FUNC(int) PyObject_HasAttrString(PyObject *, const char *); Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sun Feb 1 15:09:04 2009 @@ -12,9 +12,11 @@ Core and Builtins ----------------- -- Issue #1717: Remove builtin cmp() function, C-API functions - PyObject_Cmp and PyObject_Compare, and the support function - Py_CmpToRich. +- Issue #1717: Removed builtin cmp() function, dropped tp_compare + slot, the C API functions PyObject_Compare and PyUnicode_Compare and + the type definition cmpfunc. The tp_compare slot is reserved for + future usage. An attempt to initialize a type with a nonzero + tp_compare slot will raise TypeError. - Issue #4707: round(x, n) now returns an integer if x is an integer. Previously it returned a float. Modified: python/branches/release30-maint/Objects/object.c ============================================================================== --- python/branches/release30-maint/Objects/object.c (original) +++ python/branches/release30-maint/Objects/object.c Sun Feb 1 15:09:04 2009 @@ -495,35 +495,19 @@ return PyBytes_FromObject(v); } -/* The new comparison philosophy is: we completely separate three-way - comparison from rich comparison. That is, PyObject_Compare() and - PyObject_Cmp() *just* use the tp_compare slot. And PyObject_RichCompare() - and PyObject_RichCompareBool() *just* use the tp_richcompare slot. +/* For Python 3.0.1 and later, the old three-way comparison has been + completely removed in favour of rich comparisons. PyObject_Compare() and + PyObject_Cmp() are gone, and the builtin cmp function no longer exists. + The old tp_compare slot will be renamed to tp_reserved, and should no + longer be used. Use tp_richcompare instead. See (*) below for practical amendments. - IOW, only cmp() uses tp_compare; the comparison operators (==, !=, <=, <, - >=, >) only use tp_richcompare. Note that list.sort() only uses <. + tp_richcompare gets called with a first argument of the appropriate type + and a second object of an arbitrary type. We never do any kind of + coercion. - (And yes, eventually we'll rip out cmp() and tp_compare.) - - The calling conventions are different: tp_compare only gets called with two - objects of the appropriate type; tp_richcompare gets called with a first - argument of the appropriate type and a second object of an arbitrary type. - We never do any kind of coercion. - - The return conventions are also different. - - The tp_compare slot should return a C int, as follows: - - -1 if a < b or if an exception occurred - 0 if a == b - +1 if a > b - - No other return values are allowed. PyObject_Compare() has the same - calling convention. - - The tp_richcompare slot should return an object, as follows: + The tp_richcompare slot should return an object, as follows: NULL if an exception occurred NotImplemented if the requested comparison is not implemented @@ -539,9 +523,6 @@ comparing the object pointer (i.e. falling back to the base object implementation). - - If three-way comparison is not implemented, it falls back on rich - comparison (but not the other way around!). - */ /* Map rich comparison operators to their swapped version, e.g. LT <--> GT */ Modified: python/branches/release30-maint/Objects/typeobject.c ============================================================================== --- python/branches/release30-maint/Objects/typeobject.c (original) +++ python/branches/release30-maint/Objects/typeobject.c Sun Feb 1 15:09:04 2009 @@ -3662,7 +3662,7 @@ type->tp_setattr = base->tp_setattr; type->tp_setattro = base->tp_setattro; } - /* tp_compare see tp_richcompare */ + /* tp_compare is ignored, see tp_richcompare */ COPYSLOT(tp_repr); /* tp_hash see tp_richcompare */ COPYSLOT(tp_call); @@ -3670,12 +3670,10 @@ { /* Copy comparison-related slots only when not overriding them anywhere */ - if (type->tp_compare == NULL && - type->tp_richcompare == NULL && + if (type->tp_richcompare == NULL && type->tp_hash == NULL && !overrides_hash(type)) { - type->tp_compare = base->tp_compare; type->tp_richcompare = base->tp_richcompare; type->tp_hash = base->tp_hash; } @@ -3888,6 +3886,13 @@ goto error; } + /* Check reserved slots */ + if (type->tp_compare) { + PyErr_Format(PyExc_TypeError, + "type %s has tp_compare", + type->tp_name); + } + /* All done -- set the ready flag */ assert(type->tp_dict != NULL); type->tp_flags = From python-checkins at python.org Sun Feb 1 15:18:11 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 1 Feb 2009 15:18:11 +0100 (CET) Subject: [Python-checkins] r69190 - in python/branches/py3k/Doc: includes/sqlite3/collation_reverse.py library/locale.rst library/operator.rst library/unittest.rst reference/expressions.rst tutorial/modules.rst Message-ID: <20090201141811.3EC381E4014@bag.python.org> Author: mark.dickinson Date: Sun Feb 1 15:18:10 2009 New Revision: 69190 Log: Issue #1717: documentation fixes related to the cmp removal. Modified: python/branches/py3k/Doc/includes/sqlite3/collation_reverse.py python/branches/py3k/Doc/library/locale.rst python/branches/py3k/Doc/library/operator.rst python/branches/py3k/Doc/library/unittest.rst python/branches/py3k/Doc/reference/expressions.rst python/branches/py3k/Doc/tutorial/modules.rst Modified: python/branches/py3k/Doc/includes/sqlite3/collation_reverse.py ============================================================================== --- python/branches/py3k/Doc/includes/sqlite3/collation_reverse.py (original) +++ python/branches/py3k/Doc/includes/sqlite3/collation_reverse.py Sun Feb 1 15:18:10 2009 @@ -1,7 +1,12 @@ import sqlite3 def collate_reverse(string1, string2): - return -cmp(string1, string2) + if string1 == string2: + return 0 + elif string1 < string2: + return 1 + else: + return -1 con = sqlite3.connect(":memory:") con.create_collation("reverse", collate_reverse) Modified: python/branches/py3k/Doc/library/locale.rst ============================================================================== --- python/branches/py3k/Doc/library/locale.rst (original) +++ python/branches/py3k/Doc/library/locale.rst Sun Feb 1 15:18:10 2009 @@ -225,12 +225,11 @@ .. function:: strxfrm(string) - .. index:: builtin: cmp - - Transforms a string to one that can be used for the built-in function - :func:`cmp`, and still returns locale-aware results. This function can be used - when the same string is compared repeatedly, e.g. when collating a sequence of - strings. + Transforms a string to one that can be used in locale-aware + comparisons. For example, ``strxfrm(s1) < strxfrm(s2)`` is + equivalent to ``strcoll(s1, s2) < 0``. This function can be used + when the same string is compared repeatedly, e.g. when collating a + sequence of strings. .. function:: format(format, val[, grouping[, monetary]]) Modified: python/branches/py3k/Doc/library/operator.rst ============================================================================== --- python/branches/py3k/Doc/library/operator.rst (original) +++ python/branches/py3k/Doc/library/operator.rst Sun Feb 1 15:18:10 2009 @@ -43,9 +43,9 @@ equivalent to ``a < b``, ``le(a, b)`` is equivalent to ``a <= b``, ``eq(a, b)`` is equivalent to ``a == b``, ``ne(a, b)`` is equivalent to ``a != b``, ``gt(a, b)`` is equivalent to ``a > b`` and ``ge(a, b)`` is equivalent to ``a - >= b``. Note that unlike the built-in :func:`cmp`, these functions can - return any value, which may or may not be interpretable as a Boolean value. - See :ref:`comparisons` for more information about rich comparisons. + >= b``. Note that these functions can return any value, which may + or may not be interpretable as a Boolean value. See + :ref:`comparisons` for more information about rich comparisons. The logical operations are also generally applicable to all objects, and support Modified: python/branches/py3k/Doc/library/unittest.rst ============================================================================== --- python/branches/py3k/Doc/library/unittest.rst (original) +++ python/branches/py3k/Doc/library/unittest.rst Sun Feb 1 15:18:10 2009 @@ -327,8 +327,9 @@ ``WidgetTestCase.testResize``. :class:`TestLoader` uses the ``'test'`` method name prefix to identify test methods automatically. -Note that the order in which the various test cases will be run is determined by -sorting the test function names with the built-in :func:`cmp` function. +Note that the order in which the various test cases will be run is +determined by sorting the test function names with respect to the +built-in ordering for strings. Often it is desirable to group suites of test cases together, so as to run tests for the whole system at once. This is easy, since :class:`TestSuite` instances @@ -921,9 +922,13 @@ .. attribute:: TestLoader.sortTestMethodsUsing Function to be used to compare method names when sorting them in - :meth:`getTestCaseNames` and all the :meth:`loadTestsFrom\*` methods. The - default value is the built-in :func:`cmp` function; the attribute can also be - set to :const:`None` to disable the sort. + :meth:`getTestCaseNames` and all the :meth:`loadTestsFrom\*` + methods. This should be a function that takes two arguments + ``self`` and ``other``, and returns ``-1`` if ``self`` precedes + ``other`` in the desired ordering, ``1`` if ``other`` precedes + ``self``, and ``0`` if ``self`` and ``other`` are equal. The + default ordering is the built-in ordering for strings. This + attribute can also be set to :const:`None` to disable the sort. .. attribute:: TestLoader.suiteClass Modified: python/branches/py3k/Doc/reference/expressions.rst ============================================================================== --- python/branches/py3k/Doc/reference/expressions.rst (original) +++ python/branches/py3k/Doc/reference/expressions.rst Sun Feb 1 15:18:10 2009 @@ -1022,8 +1022,8 @@ length. If not equal, the sequences are ordered the same as their first differing - elements. For example, ``cmp([1,2,x], [1,2,y])`` returns the same as - ``cmp(x,y)``. If the corresponding element does not exist, the shorter + elements. For example, ``[1,2,x] <= [1,2,y]`` has the same value as + ``x <= y``. If the corresponding element does not exist, the shorter sequence is ordered first (for example, ``[1,2] < [1,2,3]``). * Mappings (dictionaries) compare equal if and only if their sorted ``(key, Modified: python/branches/py3k/Doc/tutorial/modules.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/modules.rst (original) +++ python/branches/py3k/Doc/tutorial/modules.rst Sun Feb 1 15:18:10 2009 @@ -317,25 +317,25 @@ >>> dir(builtins) ['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'Buffer - Error', 'DeprecationWarning', 'EOFError', 'Ellipsis', 'EnvironmentError', 'Excep - tion', 'False', 'FloatingPointError', 'FutureWarning', 'GeneratorExit', 'IOError - ', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexError', 'KeyError', - 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'NameError', 'None', 'NotImp - lemented', 'NotImplementedError', 'OSError', 'OverflowError', 'PendingDeprecatio - nWarning', 'ReferenceError', 'RuntimeError', 'RuntimeWarning', 'StopIteration', - 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'TabError', 'True', - 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError', 'UnicodeEncodeError', ' - UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning', 'UserWarning', 'ValueE - rror', 'Warning', 'ZeroDivisionError', '__build_class__', '__debug__', '__doc__' - , '__import__', '__name__', 'abs', 'all', 'any', 'basestring', 'bin', 'bool', 'b - uffer', 'bytes', 'chr', 'chr8', 'classmethod', 'cmp', 'compile', 'complex', 'cop - yright', 'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'ex - ec', 'exit', 'filter', 'float', 'frozenset', 'getattr', 'globals', 'hasattr', 'h - ash', 'help', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', ' - len', 'license', 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', 'o - bject', 'oct', 'open', 'ord', 'pow', 'print', 'property', 'quit', 'range', 'repr - ', 'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'st - r', 'str8', 'sum', 'super', 'trunc', 'tuple', 'type', 'vars', 'zip'] + Error', 'BytesWarning', 'DeprecationWarning', 'EOFError', 'Ellipsis', 'Environme + ntError', 'Exception', 'False', 'FloatingPointError', 'FutureWarning', 'Generato + rExit', 'IOError', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexErr + or', 'KeyError', 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'NameError', + 'None', 'NotImplemented', 'NotImplementedError', 'OSError', 'OverflowError', 'P + endingDeprecationWarning', 'ReferenceError', 'RuntimeError', 'RuntimeWarning', ' + StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'Ta + bError', 'True', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError', 'Unicod + eEncodeError', 'UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning', 'UserW + arning', 'ValueError', 'Warning', 'ZeroDivisionError', '__build_class__', '__deb + ug__', '__doc__', '__import__', '__name__', '__package__', 'abs', 'all', 'any', + 'ascii', 'bin', 'bool', 'bytearray', 'bytes', 'chr', 'classmethod', 'compile', ' + complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate + ', 'eval', 'exec', 'exit', 'filter', 'float', 'format', 'frozenset', 'getattr', + 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'int', 'isinstance', + 'issubclass', 'iter', 'len', 'license', 'list', 'locals', 'map', 'max', 'memory + view', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property' + , 'quit', 'range', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 'sort + ed', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars', 'zip'] .. _tut-packages: From python-checkins at python.org Sun Feb 1 15:19:33 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 1 Feb 2009 15:19:33 +0100 (CET) Subject: [Python-checkins] r69191 - in python/branches/release30-maint: Doc/includes/sqlite3/collation_reverse.py Doc/library/locale.rst Doc/library/operator.rst Doc/library/unittest.rst Doc/reference/expressions.rst Doc/tutorial/modules.rst Message-ID: <20090201141933.5C64E1E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 1 15:19:33 2009 New Revision: 69191 Log: Merged revisions 69190 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69190 | mark.dickinson | 2009-02-01 14:18:10 +0000 (Sun, 01 Feb 2009) | 2 lines Issue #1717: documentation fixes related to the cmp removal. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/includes/sqlite3/collation_reverse.py python/branches/release30-maint/Doc/library/locale.rst python/branches/release30-maint/Doc/library/operator.rst python/branches/release30-maint/Doc/library/unittest.rst python/branches/release30-maint/Doc/reference/expressions.rst python/branches/release30-maint/Doc/tutorial/modules.rst Modified: python/branches/release30-maint/Doc/includes/sqlite3/collation_reverse.py ============================================================================== --- python/branches/release30-maint/Doc/includes/sqlite3/collation_reverse.py (original) +++ python/branches/release30-maint/Doc/includes/sqlite3/collation_reverse.py Sun Feb 1 15:19:33 2009 @@ -1,7 +1,12 @@ import sqlite3 def collate_reverse(string1, string2): - return -cmp(string1, string2) + if string1 == string2: + return 0 + elif string1 < string2: + return 1 + else: + return -1 con = sqlite3.connect(":memory:") con.create_collation("reverse", collate_reverse) Modified: python/branches/release30-maint/Doc/library/locale.rst ============================================================================== --- python/branches/release30-maint/Doc/library/locale.rst (original) +++ python/branches/release30-maint/Doc/library/locale.rst Sun Feb 1 15:19:33 2009 @@ -225,12 +225,11 @@ .. function:: strxfrm(string) - .. index:: builtin: cmp - - Transforms a string to one that can be used for the built-in function - :func:`cmp`, and still returns locale-aware results. This function can be used - when the same string is compared repeatedly, e.g. when collating a sequence of - strings. + Transforms a string to one that can be used in locale-aware + comparisons. For example, ``strxfrm(s1) < strxfrm(s2)`` is + equivalent to ``strcoll(s1, s2) < 0``. This function can be used + when the same string is compared repeatedly, e.g. when collating a + sequence of strings. .. function:: format(format, val[, grouping[, monetary]]) Modified: python/branches/release30-maint/Doc/library/operator.rst ============================================================================== --- python/branches/release30-maint/Doc/library/operator.rst (original) +++ python/branches/release30-maint/Doc/library/operator.rst Sun Feb 1 15:19:33 2009 @@ -43,9 +43,9 @@ equivalent to ``a < b``, ``le(a, b)`` is equivalent to ``a <= b``, ``eq(a, b)`` is equivalent to ``a == b``, ``ne(a, b)`` is equivalent to ``a != b``, ``gt(a, b)`` is equivalent to ``a > b`` and ``ge(a, b)`` is equivalent to ``a - >= b``. Note that unlike the built-in :func:`cmp`, these functions can - return any value, which may or may not be interpretable as a Boolean value. - See :ref:`comparisons` for more information about rich comparisons. + >= b``. Note that these functions can return any value, which may + or may not be interpretable as a Boolean value. See + :ref:`comparisons` for more information about rich comparisons. The logical operations are also generally applicable to all objects, and support Modified: python/branches/release30-maint/Doc/library/unittest.rst ============================================================================== --- python/branches/release30-maint/Doc/library/unittest.rst (original) +++ python/branches/release30-maint/Doc/library/unittest.rst Sun Feb 1 15:19:33 2009 @@ -327,8 +327,9 @@ ``WidgetTestCase.testResize``. :class:`TestLoader` uses the ``'test'`` method name prefix to identify test methods automatically. -Note that the order in which the various test cases will be run is determined by -sorting the test function names with the built-in :func:`cmp` function. +Note that the order in which the various test cases will be run is +determined by sorting the test function names with respect to the +built-in ordering for strings. Often it is desirable to group suites of test cases together, so as to run tests for the whole system at once. This is easy, since :class:`TestSuite` instances @@ -916,9 +917,13 @@ .. attribute:: TestLoader.sortTestMethodsUsing Function to be used to compare method names when sorting them in - :meth:`getTestCaseNames` and all the :meth:`loadTestsFrom\*` methods. The - default value is the built-in :func:`cmp` function; the attribute can also be - set to :const:`None` to disable the sort. + :meth:`getTestCaseNames` and all the :meth:`loadTestsFrom\*` + methods. This should be a function that takes two arguments + ``self`` and ``other``, and returns ``-1`` if ``self`` precedes + ``other`` in the desired ordering, ``1`` if ``other`` precedes + ``self``, and ``0`` if ``self`` and ``other`` are equal. The + default ordering is the built-in ordering for strings. This + attribute can also be set to :const:`None` to disable the sort. .. attribute:: TestLoader.suiteClass Modified: python/branches/release30-maint/Doc/reference/expressions.rst ============================================================================== --- python/branches/release30-maint/Doc/reference/expressions.rst (original) +++ python/branches/release30-maint/Doc/reference/expressions.rst Sun Feb 1 15:19:33 2009 @@ -1022,8 +1022,8 @@ length. If not equal, the sequences are ordered the same as their first differing - elements. For example, ``cmp([1,2,x], [1,2,y])`` returns the same as - ``cmp(x,y)``. If the corresponding element does not exist, the shorter + elements. For example, ``[1,2,x] <= [1,2,y]`` has the same value as + ``x <= y``. If the corresponding element does not exist, the shorter sequence is ordered first (for example, ``[1,2] < [1,2,3]``). * Mappings (dictionaries) compare equal if and only if their sorted ``(key, Modified: python/branches/release30-maint/Doc/tutorial/modules.rst ============================================================================== --- python/branches/release30-maint/Doc/tutorial/modules.rst (original) +++ python/branches/release30-maint/Doc/tutorial/modules.rst Sun Feb 1 15:19:33 2009 @@ -317,25 +317,25 @@ >>> dir(builtins) ['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'Buffer - Error', 'DeprecationWarning', 'EOFError', 'Ellipsis', 'EnvironmentError', 'Excep - tion', 'False', 'FloatingPointError', 'FutureWarning', 'GeneratorExit', 'IOError - ', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexError', 'KeyError', - 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'NameError', 'None', 'NotImp - lemented', 'NotImplementedError', 'OSError', 'OverflowError', 'PendingDeprecatio - nWarning', 'ReferenceError', 'RuntimeError', 'RuntimeWarning', 'StopIteration', - 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'TabError', 'True', - 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError', 'UnicodeEncodeError', ' - UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning', 'UserWarning', 'ValueE - rror', 'Warning', 'ZeroDivisionError', '__build_class__', '__debug__', '__doc__' - , '__import__', '__name__', 'abs', 'all', 'any', 'basestring', 'bin', 'bool', 'b - uffer', 'bytes', 'chr', 'chr8', 'classmethod', 'cmp', 'compile', 'complex', 'cop - yright', 'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'ex - ec', 'exit', 'filter', 'float', 'frozenset', 'getattr', 'globals', 'hasattr', 'h - ash', 'help', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', ' - len', 'license', 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', 'o - bject', 'oct', 'open', 'ord', 'pow', 'print', 'property', 'quit', 'range', 'repr - ', 'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'st - r', 'str8', 'sum', 'super', 'trunc', 'tuple', 'type', 'vars', 'zip'] + Error', 'BytesWarning', 'DeprecationWarning', 'EOFError', 'Ellipsis', 'Environme + ntError', 'Exception', 'False', 'FloatingPointError', 'FutureWarning', 'Generato + rExit', 'IOError', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexErr + or', 'KeyError', 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'NameError', + 'None', 'NotImplemented', 'NotImplementedError', 'OSError', 'OverflowError', 'P + endingDeprecationWarning', 'ReferenceError', 'RuntimeError', 'RuntimeWarning', ' + StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'Ta + bError', 'True', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError', 'Unicod + eEncodeError', 'UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning', 'UserW + arning', 'ValueError', 'Warning', 'ZeroDivisionError', '__build_class__', '__deb + ug__', '__doc__', '__import__', '__name__', '__package__', 'abs', 'all', 'any', + 'ascii', 'bin', 'bool', 'bytearray', 'bytes', 'chr', 'classmethod', 'compile', ' + complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate + ', 'eval', 'exec', 'exit', 'filter', 'float', 'format', 'frozenset', 'getattr', + 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'int', 'isinstance', + 'issubclass', 'iter', 'len', 'license', 'list', 'locals', 'map', 'max', 'memory + view', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property' + , 'quit', 'range', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 'sort + ed', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars', 'zip'] .. _tut-packages: From buildbot at python.org Sun Feb 1 15:49:49 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 14:49:49 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090201144949.C138D1E4002@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/203 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: 1 test failed: test_timeout ====================================================================== ERROR: testRecvTimeout (test.test_timeout.TimeoutTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_timeout.py", line 133, in testRecvTimeout self.sock.connect(self.addr_remote) socket.error: [Errno 110] Connection timed out make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun Feb 1 15:53:16 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 14:53:16 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.0 Message-ID: <20090201145316.901361E4002@bag.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/123 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: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/test/test_robotparser.py", line 225, in testPythonOrg parser.read() File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/robotparser.py", line 56, in read f = urllib.request.urlopen(self.url) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/request.py", line 1082, in http_open return self.do_open(http.client.HTTPConnection, req) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/request.py", line 1071, in do_open raise URLError(err) urllib.error.URLError: 1 test failed: test_robotparser ====================================================================== ERROR: testPythonOrg (test.test_robotparser.NetworkTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/request.py", line 1068, in do_open h.request(req.get_method(), req.get_selector(), req.data, headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/http/client.py", line 856, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/http/client.py", line 900, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/http/client.py", line 851, in endheaders self._send_output(message_body) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/http/client.py", line 709, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/http/client.py", line 663, in send self.connect() File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/http/client.py", line 647, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/socket.py", line 307, in create_connection raise error(msg) socket.error: [Errno 101] Network is unreachable Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/test/test_robotparser.py", line 225, in testPythonOrg parser.read() File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/robotparser.py", line 56, in read f = urllib.request.urlopen(self.url) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/request.py", line 1082, in http_open return self.do_open(http.client.HTTPConnection, req) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/request.py", line 1071, in do_open raise URLError(err) urllib.error.URLError: Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/test/test_robotparser.py", line 225, in testPythonOrg parser.read() File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/robotparser.py", line 56, in read f = urllib.request.urlopen(self.url) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/request.py", line 359, in open response = self._open(req, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/request.py", line 377, in _open '_open', req) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/request.py", line 337, in _call_chain result = func(*args) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/request.py", line 1082, in http_open return self.do_open(http.client.HTTPConnection, req) File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/urllib/request.py", line 1071, in do_open raise URLError(err) urllib.error.URLError: make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun Feb 1 16:08:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 15:08:50 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090201150850.5FC281E4002@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/234 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: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sun Feb 1 16:37:24 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 15:37:24 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090201153724.D4F241E4002@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/116 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 43, 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 Feb 1 17:44:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 16:44:05 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.0 Message-ID: <20090201164405.4C8441E4002@bag.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/89 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: mark.dickinson 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\test\test_urllibnet.py", line 108, in test_getcode open_url = urllib.request.FancyURLopener().open(URL) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\urllib\request.py", line 1448, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\urllib\request.py", line 1444, in open return getattr(self, name)(url) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\urllib\request.py", line 1618, in open_http return self._open_generic_http(http.client.HTTPConnection, url, data) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\urllib\request.py", line 1598, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\http\client.py", line 856, in request self._send_request(method, url, body, headers) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\http\client.py", line 900, in _send_request self.endheaders() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\http\client.py", line 851, in endheaders self._send_output(message_body) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\http\client.py", line 709, in _send_output self.send(msg) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\http\client.py", line 663, in send self.connect() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\http\client.py", line 647, in connect self.timeout) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\socket.py", line 307, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 1 test failed: test_urllibnet sincerely, -The Buildbot From python-checkins at python.org Sun Feb 1 21:36:08 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 1 Feb 2009 21:36:08 +0100 (CET) Subject: [Python-checkins] r69192 - python/branches/py3k/Objects/typeobject.c Message-ID: <20090201203608.817E81E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 1 21:36:08 2009 New Revision: 69192 Log: Remove exception for non-NULL tp_compare that was introduced in r69188. Modified: python/branches/py3k/Objects/typeobject.c Modified: python/branches/py3k/Objects/typeobject.c ============================================================================== --- python/branches/py3k/Objects/typeobject.c (original) +++ python/branches/py3k/Objects/typeobject.c Sun Feb 1 21:36:08 2009 @@ -3886,13 +3886,6 @@ goto error; } - /* Check reserved slots */ - if (type->tp_compare) { - PyErr_Format(PyExc_TypeError, - "type %s has tp_compare", - type->tp_name); - } - /* All done -- set the ready flag */ assert(type->tp_dict != NULL); type->tp_flags = From python-checkins at python.org Sun Feb 1 21:37:23 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 1 Feb 2009 21:37:23 +0100 (CET) Subject: [Python-checkins] r69193 - in python/branches/release30-maint: Objects/typeobject.c Message-ID: <20090201203723.4CA251E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 1 21:37:23 2009 New Revision: 69193 Log: Merged revisions 69192 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69192 | mark.dickinson | 2009-02-01 20:36:08 +0000 (Sun, 01 Feb 2009) | 2 lines Remove exception for non-NULL tp_compare that was introduced in r69188. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Objects/typeobject.c Modified: python/branches/release30-maint/Objects/typeobject.c ============================================================================== --- python/branches/release30-maint/Objects/typeobject.c (original) +++ python/branches/release30-maint/Objects/typeobject.c Sun Feb 1 21:37:23 2009 @@ -3886,13 +3886,6 @@ goto error; } - /* Check reserved slots */ - if (type->tp_compare) { - PyErr_Format(PyExc_TypeError, - "type %s has tp_compare", - type->tp_name); - } - /* All done -- set the ready flag */ assert(type->tp_dict != NULL); type->tp_flags = From buildbot at python.org Sun Feb 1 22:21:24 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 21:21:24 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090201212125.058031E400C@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/218 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_distutils test_posix ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 43, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.x.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.x.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 buildbot at python.org Sun Feb 1 23:15:24 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 01 Feb 2009 22:15:24 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090201221524.A435B1E4002@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/118 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_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 Sun Feb 1 23:57:18 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 1 Feb 2009 23:57:18 +0100 (CET) Subject: [Python-checkins] r69194 - python/branches/io-c/Modules/_bufferedio.c Message-ID: <20090201225718.948BD1E4002@bag.python.org> Author: antoine.pitrou Date: Sun Feb 1 23:57:18 2009 New Revision: 69194 Log: Fix downcasting warnings in 32-bit mode with 64-bit offsets (Windows) Modified: python/branches/io-c/Modules/_bufferedio.c Modified: python/branches/io-c/Modules/_bufferedio.c ============================================================================== --- python/branches/io-c/Modules/_bufferedio.c (original) +++ python/branches/io-c/Modules/_bufferedio.c Sun Feb 1 23:57:18 2009 @@ -742,7 +742,7 @@ all `n` bytes asked by the caller (and possibly more, so as to fill our buffer for the next reads). */ - have = READAHEAD(self); + have = Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t); if (have > 0) { if (n > have) n = have; @@ -810,7 +810,7 @@ ENTER_BUFFERED(self) /* First, try to find a line in the buffer */ - n = READAHEAD(self); + n = Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t); if (limit >= 0 && n > limit) n = limit; start = self->buffer + self->pos; @@ -1167,7 +1167,7 @@ { Py_ssize_t start, len, n; if (VALID_READ_BUFFER(self)) - start = self->read_end; + start = Py_SAFE_DOWNCAST(self->read_end, Py_off_t, Py_ssize_t); else start = 0; len = self->buffer_size - start; @@ -1194,7 +1194,7 @@ return NULL; /* First copy what we have in the current buffer. */ - current_size = READAHEAD(self); + current_size = Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t); data = NULL; if (current_size) { data = PyBytes_FromStringAndSize( @@ -1263,7 +1263,7 @@ } /* The number of bytes to read is specified, return at most n bytes. */ - current_size = READAHEAD(self); + current_size = Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t); if (n <= current_size) { /* Fast path: the data to read is fully buffered. */ res = PyBytes_FromStringAndSize(self->buffer + self->pos, n); @@ -1358,7 +1358,7 @@ { Py_ssize_t have, r; - have = READAHEAD(self); + have = Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t); /* Constraints: 1. we don't want to advance the file position. 2. we don't want to lose block alignment, so we can't shift the buffer @@ -1560,7 +1560,8 @@ while (self->write_pos < self->write_end) { n = _BufferedWriter_raw_write(self, self->buffer + self->write_pos, - self->write_end - self->write_pos); + Py_SAFE_DOWNCAST(self->write_end - self->write_pos, + Py_off_t, Py_ssize_t)); if (n == -1) { Py_ssize_t *w = _Buffered_check_blocking_error(); if (w == NULL) @@ -1574,7 +1575,7 @@ } self->write_pos += n; self->raw_pos = self->write_pos; - written += n; + written += Py_SAFE_DOWNCAST(n, Py_off_t, Py_ssize_t); } if (restore_pos) { @@ -1621,7 +1622,7 @@ self->pos = 0; self->raw_pos = 0; } - avail = self->buffer_size - self->pos; + avail = Py_SAFE_DOWNCAST(self->buffer_size - self->pos, Py_off_t, Py_ssize_t); if (buf.len <= avail) { memcpy(self->buffer + self->pos, buf.buf, buf.len); if (!VALID_WRITE_BUFFER(self)) { @@ -1645,12 +1646,14 @@ /* Make some place by shifting the buffer. */ assert(VALID_WRITE_BUFFER(self)); memmove(self->buffer, self->buffer + self->write_pos, - self->write_end - self->write_pos); + Py_SAFE_DOWNCAST(self->write_end - self->write_pos, + Py_off_t, Py_ssize_t)); self->write_end -= self->write_pos; self->raw_pos -= self->write_pos; self->pos -= self->write_pos; self->write_pos = 0; - avail = self->buffer_size - self->write_end; + avail = Py_SAFE_DOWNCAST(self->buffer_size - self->write_end, + Py_off_t, Py_ssize_t); if (buf.len <= avail) { /* Everything can be buffered */ PyErr_Clear(); From python-checkins at python.org Mon Feb 2 01:38:54 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 2 Feb 2009 01:38:54 +0100 (CET) Subject: [Python-checkins] r69195 - in python/trunk/Lib/lib-tk/test/test_ttk: support.py test_extensions.py test_style.py test_widgets.py Message-ID: <20090202003854.B2AA81E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 2 01:38:54 2009 New Revision: 69195 Log: Use a single Tcl interpreter through all these tests, this may help some failing buildbots. Modified: python/trunk/Lib/lib-tk/test/test_ttk/support.py python/trunk/Lib/lib-tk/test/test_ttk/test_extensions.py python/trunk/Lib/lib-tk/test/test_ttk/test_style.py python/trunk/Lib/lib-tk/test/test_ttk/test_widgets.py Modified: python/trunk/Lib/lib-tk/test/test_ttk/support.py ============================================================================== --- python/trunk/Lib/lib-tk/test/test_ttk/support.py (original) +++ python/trunk/Lib/lib-tk/test/test_ttk/support.py Mon Feb 2 01:38:54 2009 @@ -15,6 +15,14 @@ return root +def root_deiconify(): + root = get_tk_root() + root.deiconify() + +def root_withdraw(): + root = get_tk_root() + root.withdraw() + def simulate_mouse_click(widget, x, y): """Generate proper events to click at the x, y position (tries to act Modified: python/trunk/Lib/lib-tk/test/test_ttk/test_extensions.py ============================================================================== --- python/trunk/Lib/lib-tk/test/test_ttk/test_extensions.py (original) +++ python/trunk/Lib/lib-tk/test/test_ttk/test_extensions.py Mon Feb 2 01:38:54 2009 @@ -10,6 +10,13 @@ class LabeledScaleTest(unittest.TestCase): + def setUp(self): + support.root_deiconify() + + def tearDown(self): + support.root_withdraw() + + def test_widget_destroy(self): # automatically created variable x = ttk.LabeledScale() @@ -175,12 +182,12 @@ class OptionMenuTest(unittest.TestCase): def setUp(self): - self.root = support.get_tk_root() - self.textvar = Tkinter.StringVar(self.root) + support.root_deiconify() + self.textvar = Tkinter.StringVar() def tearDown(self): del self.textvar - self.root.destroy() + support.root_withdraw() def test_widget_destroy(self): Modified: python/trunk/Lib/lib-tk/test/test_ttk/test_style.py ============================================================================== --- python/trunk/Lib/lib-tk/test/test_ttk/test_style.py (original) +++ python/trunk/Lib/lib-tk/test/test_ttk/test_style.py Mon Feb 2 01:38:54 2009 @@ -10,15 +10,7 @@ class StyleTest(unittest.TestCase): def setUp(self): - self.root = support.get_tk_root() - self.style = ttk.Style(self.root) - - def tearDown(self): - # As tests have shown, these tests are likely to deliver - # <> events after the root is destroyed, so - # lets let them happen now. - self.root.update_idletasks() - self.root.destroy() + self.style = ttk.Style() def test_configure(self): Modified: python/trunk/Lib/lib-tk/test/test_ttk/test_widgets.py ============================================================================== --- python/trunk/Lib/lib-tk/test/test_ttk/test_widgets.py (original) +++ python/trunk/Lib/lib-tk/test/test_ttk/test_widgets.py Mon Feb 2 01:38:54 2009 @@ -12,12 +12,14 @@ """Tests methods available in every ttk widget.""" def setUp(self): + support.root_deiconify() self.widget = ttk.Button() self.widget.pack() self.widget.wait_visibility() def tearDown(self): self.widget.destroy() + support.root_withdraw() def test_identify(self): @@ -107,10 +109,12 @@ class ComboboxTest(unittest.TestCase): def setUp(self): + support.root_deiconify() self.combo = ttk.Combobox() def tearDown(self): self.combo.destroy() + support.root_withdraw() def _show_drop_down_listbox(self): width = self.combo.winfo_width() @@ -195,10 +199,12 @@ class EntryTest(unittest.TestCase): def setUp(self): + support.root_deiconify() self.entry = ttk.Entry() def tearDown(self): self.entry.destroy() + support.root_withdraw() def test_bbox(self): @@ -297,10 +303,12 @@ class PanedwindowTest(unittest.TestCase): def setUp(self): + support.root_deiconify() self.paned = ttk.Panedwindow() def tearDown(self): self.paned.destroy() + support.root_withdraw() def test_add(self): @@ -445,12 +453,14 @@ class ScaleTest(unittest.TestCase): def setUp(self): + support.root_deiconify() self.scale = ttk.Scale() self.scale.pack() self.scale.update() def tearDown(self): self.scale.destroy() + support.root_withdraw() def test_custom_event(self): @@ -519,6 +529,7 @@ class NotebookTest(unittest.TestCase): def setUp(self): + support.root_deiconify() self.nb = ttk.Notebook() self.child1 = ttk.Label() self.child2 = ttk.Label() @@ -529,6 +540,7 @@ self.child1.destroy() self.child2.destroy() self.nb.destroy() + support.root_withdraw() def test_tab_identifiers(self): @@ -708,13 +720,12 @@ class TreeviewTest(unittest.TestCase): def setUp(self): - self.root = support.get_tk_root() - self.tv = ttk.Treeview(self.root) + support.root_deiconify() + self.tv = ttk.Treeview() def tearDown(self): self.tv.destroy() - self.root.update_idletasks() - self.root.destroy() + support.root_withdraw() def test_bbox(self): From python-checkins at python.org Mon Feb 2 01:42:09 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 2 Feb 2009 01:42:09 +0100 (CET) Subject: [Python-checkins] r69196 - python/branches/release26-maint Message-ID: <20090202004209.6F3F21E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 2 01:42:09 2009 New Revision: 69196 Log: Blocked revisions 69169,69195 via svnmerge ........ r69169 | guilherme.polo | 2009-02-01 00:56:16 -0200 (Sun, 01 Feb 2009) | 3 lines Restore Tkinter.Tk._loadtk so this test doesn't fail for problems related to ttk. ........ r69195 | guilherme.polo | 2009-02-01 22:38:54 -0200 (Sun, 01 Feb 2009) | 3 lines Use a single Tcl interpreter through all these tests, this may help some failing buildbots. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Mon Feb 2 02:02:20 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 2 Feb 2009 02:02:20 +0100 (CET) Subject: [Python-checkins] r69197 - in python/branches/py3k: Lib/tkinter/test/support.py Lib/tkinter/test/test_ttk/test_extensions.py Lib/tkinter/test/test_ttk/test_style.py Lib/tkinter/test/test_ttk/test_widgets.py Message-ID: <20090202010220.BBE421E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 2 02:02:20 2009 New Revision: 69197 Log: Recorded merge of revisions 69195 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69195 | guilherme.polo | 2009-02-01 22:38:54 -0200 (Sun, 01 Feb 2009) | 3 lines Use a single Tcl interpreter through all these tests, this may help some failing buildbots. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/tkinter/test/support.py python/branches/py3k/Lib/tkinter/test/test_ttk/test_extensions.py python/branches/py3k/Lib/tkinter/test/test_ttk/test_style.py python/branches/py3k/Lib/tkinter/test/test_ttk/test_widgets.py Modified: python/branches/py3k/Lib/tkinter/test/support.py ============================================================================== --- python/branches/py3k/Lib/tkinter/test/support.py (original) +++ python/branches/py3k/Lib/tkinter/test/support.py Mon Feb 2 02:02:20 2009 @@ -15,6 +15,14 @@ return root +def root_deiconify(): + root = get_tk_root() + root.deiconify() + +def root_withdraw(): + root = get_tk_root() + root.withdraw() + def simulate_mouse_click(widget, x, y): """Generate proper events to click at the x, y position (tries to act Modified: python/branches/py3k/Lib/tkinter/test/test_ttk/test_extensions.py ============================================================================== --- python/branches/py3k/Lib/tkinter/test/test_ttk/test_extensions.py (original) +++ python/branches/py3k/Lib/tkinter/test/test_ttk/test_extensions.py Mon Feb 2 02:02:20 2009 @@ -10,6 +10,13 @@ class LabeledScaleTest(unittest.TestCase): + def setUp(self): + support.root_deiconify() + + def tearDown(self): + support.root_withdraw() + + def test_widget_destroy(self): # automatically created variable x = ttk.LabeledScale() @@ -175,12 +182,12 @@ class OptionMenuTest(unittest.TestCase): def setUp(self): - self.root = support.get_tk_root() - self.textvar = tkinter.StringVar(self.root) + support.root_deiconify() + self.textvar = tkinter.StringVar() def tearDown(self): del self.textvar - self.root.destroy() + support.root_withdraw() def test_widget_destroy(self): Modified: python/branches/py3k/Lib/tkinter/test/test_ttk/test_style.py ============================================================================== --- python/branches/py3k/Lib/tkinter/test/test_ttk/test_style.py (original) +++ python/branches/py3k/Lib/tkinter/test/test_ttk/test_style.py Mon Feb 2 02:02:20 2009 @@ -10,15 +10,7 @@ class StyleTest(unittest.TestCase): def setUp(self): - self.root = support.get_tk_root() - self.style = ttk.Style(self.root) - - def tearDown(self): - # As tests have shown, these tests are likely to deliver - # <> events after the root is destroyed, so - # lets let them happen now. - self.root.update_idletasks() - self.root.destroy() + self.style = ttk.Style() def test_configure(self): Modified: python/branches/py3k/Lib/tkinter/test/test_ttk/test_widgets.py ============================================================================== --- python/branches/py3k/Lib/tkinter/test/test_ttk/test_widgets.py (original) +++ python/branches/py3k/Lib/tkinter/test/test_ttk/test_widgets.py Mon Feb 2 02:02:20 2009 @@ -12,12 +12,14 @@ """Tests methods available in every ttk widget.""" def setUp(self): + support.root_deiconify() self.widget = ttk.Button() self.widget.pack() self.widget.wait_visibility() def tearDown(self): self.widget.destroy() + support.root_withdraw() def test_identify(self): @@ -107,10 +109,12 @@ class ComboboxTest(unittest.TestCase): def setUp(self): + support.root_deiconify() self.combo = ttk.Combobox() def tearDown(self): self.combo.destroy() + support.root_withdraw() def _show_drop_down_listbox(self): width = self.combo.winfo_width() @@ -195,10 +199,12 @@ class EntryTest(unittest.TestCase): def setUp(self): + support.root_deiconify() self.entry = ttk.Entry() def tearDown(self): self.entry.destroy() + support.root_withdraw() def test_bbox(self): @@ -297,10 +303,12 @@ class PanedwindowTest(unittest.TestCase): def setUp(self): + support.root_deiconify() self.paned = ttk.Panedwindow() def tearDown(self): self.paned.destroy() + support.root_withdraw() def test_add(self): @@ -445,12 +453,14 @@ class ScaleTest(unittest.TestCase): def setUp(self): + support.root_deiconify() self.scale = ttk.Scale() self.scale.pack() self.scale.update() def tearDown(self): self.scale.destroy() + support.root_withdraw() def test_custom_event(self): @@ -519,6 +529,7 @@ class NotebookTest(unittest.TestCase): def setUp(self): + support.root_deiconify() self.nb = ttk.Notebook() self.child1 = ttk.Label() self.child2 = ttk.Label() @@ -529,6 +540,7 @@ self.child1.destroy() self.child2.destroy() self.nb.destroy() + support.root_withdraw() def test_tab_identifiers(self): @@ -708,13 +720,12 @@ class TreeviewTest(unittest.TestCase): def setUp(self): - self.root = support.get_tk_root() - self.tv = ttk.Treeview(self.root) + support.root_deiconify() + self.tv = ttk.Treeview() def tearDown(self): self.tv.destroy() - self.root.update_idletasks() - self.root.destroy() + support.root_withdraw() def test_bbox(self): From buildbot at python.org Mon Feb 2 02:09:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 01:09:11 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090202010911.8547B1E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/580 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_asynchat make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Feb 2 03:01:32 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 02:01:32 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090202020132.EE0071E4002@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/83 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: gregory.p.smith,guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ppc/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/home/pybot/buildarea/2.6.klose-debian-ppc/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/home/pybot/buildarea/2.6.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/2.6.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') make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Feb 2 04:16:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 03:16:23 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090202031623.2EB6A1E4002@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/205 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: guilherme.polo 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_http_cookiejar.py", line 1438, in test_rejection c.load(filename, ignore_discard=True) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/http/cookiejar.py", line 1756, in load f.close() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/io.py", line 1469, in close self.buffer.close() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/io.py", line 749, in close self.raw.close() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/io.py", line 625, in close _fileio._FileIO.close(self) IOError: [Errno 9] Bad file descriptor 1 test failed: test_http_cookiejar make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Feb 2 06:29:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 05:29:37 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.6 Message-ID: <20090202052938.8041E1E4002@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/73 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: gregory.p.smith,guilherme.polo 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') sincerely, -The Buildbot From python-checkins at python.org Mon Feb 2 06:58:30 2009 From: python-checkins at python.org (brett.cannon) Date: Mon, 2 Feb 2009 06:58:30 +0100 (CET) Subject: [Python-checkins] r69198 - python/branches/py3k/Lib/importlib/NOTES Message-ID: <20090202055830.6C0C11E4002@bag.python.org> Author: brett.cannon Date: Mon Feb 2 06:58:30 2009 New Revision: 69198 Log: Note to move __package__ stuff over to rpartition to make Nick happy. Also make sure that accepting the empty string for top-level modules is okay. Modified: python/branches/py3k/Lib/importlib/NOTES Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Mon Feb 2 06:58:30 2009 @@ -1,6 +1,10 @@ to do ///// +* Use rpartition for getting the package of a module. + + + Make sure that an empty string is acceptable for __package__. + * Create meta_path importer for sys.path. + Create hook. From buildbot at python.org Mon Feb 2 07:32:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 06:32:09 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090202063209.7DACD1E4002@bag.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/168 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: brett.cannon BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Mon Feb 2 07:38:21 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 06:38:21 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090202063822.4D2121E4002@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/268 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: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Mon Feb 2 07:43:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 06:43:09 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090202064310.2E23B1E4002@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/220 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: 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.x.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 43, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.x.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.x.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 Mon Feb 2 07:49:12 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 2 Feb 2009 07:49:12 +0100 (CET) Subject: [Python-checkins] r69199 - sandbox/trunk/dbm_sqlite/alt/time_sqlite.py Message-ID: <20090202064912.89E711E4002@bag.python.org> Author: raymond.hettinger Date: Mon Feb 2 07:49:12 2009 New Revision: 69199 Log: Add a fragmentation step and a vacuum step. Record the results. Modified: sandbox/trunk/dbm_sqlite/alt/time_sqlite.py Modified: sandbox/trunk/dbm_sqlite/alt/time_sqlite.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/time_sqlite.py (original) +++ sandbox/trunk/dbm_sqlite/alt/time_sqlite.py Mon Feb 2 07:49:12 2009 @@ -1,16 +1,8 @@ ''' Testbench and timing routines to figure-out the fastest schema for shelves. -With unique index or primary key or no index. - Insertion speed (do we pay a high price for reindexing on every commit) - Individual Lookup speed (regular value, masked key, uncommitted key) - Speed of replacing vs inserting. - Speed of: - 'select *' - 'select * order by key' - 'select * order by rowid' - Do 'select key', 'select *', and 'select value' all produce the same order? +Todo: Delayed commits: How much insertion speed is gained by n-period commits @@ -19,19 +11,10 @@ Do 'select key', 'select *', and 'select value' all produce the same order? -Same tests, but first fragment the snot out of the db. - -What about deletions and fragmentation? -Cost and effects of vacuuming. -BLOB vs TEXT - ------------------------------------------------------------------ -no diff twixt "select *" and "select k,v" # prefer latter for specificity -no diff twixt "select *" and "select * by rowid" # prefer latter for specificity -no diff for "select *" whether unindexed, primary key, and indexed -? do those results hold after fragmenting -"order by key" is twice as slow as unordered, even with indexing -effect of "primary key" and a unique index is the same +With unique index or primary key or no index. + Insertion speed (do we pay a high price for reindexing on every commit) + Individual Lookup speed (regular value, masked key, uncommitted key) + ''' from random import * @@ -54,6 +37,22 @@ CREATE UNIQUE INDEX IF NOT EXISTS keyndx ON shelf (key); ''', 'UNIQ') + +MAKE_shelf = (''' + DROP INDEX IF EXISTS keyndx; DROP TABLE IF EXISTS shelf; + CREATE TABLE IF NOT EXISTS shelf (key BLOB NOT NULL, value BLOB NOT NULL); +''', 'UNINDEXED') +MAKE_shelf_PRIMARY = (''' + DROP INDEX IF EXISTS keyndx; DROP TABLE IF EXISTS shelf; + CREATE TABLE IF NOT EXISTS shelf (key BLOB PRIMARY KEY, value BLOB NOT NULL); +''', 'PRIMARY') +MAKE_shelf_UNIQUE = (''' + DROP INDEX IF EXISTS keyndx; DROP TABLE IF EXISTS shelf; + CREATE TABLE IF NOT EXISTS shelf (key BLOB NOT NULL, value BLOB NOT NULL); + CREATE UNIQUE INDEX IF NOT EXISTS keyndx ON shelf (key); +''', 'UNIQ') + + SELECTORS = [ 'SELECT * FROM shelf', 'SELECT * FROM shelf ORDER BY key', @@ -88,6 +87,18 @@ conn.commit() return conn +def fragmentit(conn, addlist, dellist, n=20): + # Make random adds and deletes, n at time + addlist = addlist[:] + dellist = dellist[:] + while len(addlist) >= n and len(dellist) >= n: + for i in range(n): + conn.execute('DELETE FROM shelf WHERE ROWID = ?', dellist.pop()) + conn.commit() + for i in range(n): + conn.execute('REPLACE INTO shelf (key, value) VALUES (?, ?)', addlist.pop()) + conn.commit() + def timeit(conn, stmt, n=20): conn.execute(stmt) # precompile start = clock() @@ -95,15 +106,133 @@ conn.execute(stmt).fetchall() return '%.2f' % (clock() - start) - +n, m = 2000, 6000 +fragment, vacuum = True, True seed('xyzpdqbingo') -items = populate(2000) +items = populate(n) +dellist = [(randrange(n),) for i in range(m)] +addlist = populate(m) for stmt in SELECTORS: print(stmt) for builder, name in [MAKE_shelf, MAKE_shelf_PRIMARY, MAKE_shelf_UNIQUE]: conn = setup(builder, items) + if fragment: + fragmentit(conn, addlist, dellist) + if vacuum: + conn.execute('VACUUM') print(sorted(timeit(conn, stmt, n=100) for i in range(6)), name) print() + - +''' Results: + +No difference between 'select *', 'select k,v', and 'select * by rowid' + Doesn't matter if the tables are unindexed, have a primary key, or a unique index. +Fragmented leaves timing ratios the same but takes 3.34 times longer. +Running a VACUUM after fragmenting doesn't speed things up. +"order by key" is twice as slow as unordered, even with indexing. +The effect of "primary key" and a unique index is the same +BLOB and TEXT types have the same timing + + + +Results for unfragmented: n, m = 2000, 6000 + +SELECT * FROM shelf +['0.38', '0.38', '0.38', '0.39', '0.39', '0.47'] UNINDEXED +['0.38', '0.38', '0.39', '0.39', '0.39', '0.41'] PRIMARY +['0.38', '0.38', '0.39', '0.39', '0.41', '0.42'] UNIQ + +SELECT * FROM shelf ORDER BY key +['1.63', '1.63', '1.63', '1.64', '1.64', '1.74'] UNINDEXED +['0.57', '0.57', '0.57', '0.58', '0.58', '0.63'] PRIMARY +['0.57', '0.57', '0.57', '0.58', '0.58', '0.71'] UNIQ + +SELECT * FROM shelf ORDER BY rowid +['0.38', '0.39', '0.39', '0.39', '0.39', '0.47'] UNINDEXED +['0.38', '0.38', '0.39', '0.39', '0.40', '0.43'] PRIMARY +['0.38', '0.38', '0.39', '0.39', '0.39', '0.44'] UNIQ + +SELECT key FROM shelf +['0.26', '0.26', '0.26', '0.26', '0.26', '0.29'] UNINDEXED +['0.26', '0.26', '0.26', '0.26', '0.26', '0.29'] PRIMARY +['0.26', '0.26', '0.26', '0.26', '0.27', '0.35'] UNIQ + +SELECT value FROM shelf +['0.26', '0.26', '0.26', '0.27', '0.27', '0.30'] UNINDEXED +['0.26', '0.26', '0.26', '0.26', '0.27', '0.28'] PRIMARY +['0.26', '0.26', '0.26', '0.26', '0.26', '0.32'] UNIQ + +SELECT key, value FROM shelf +['0.38', '0.38', '0.38', '0.38', '0.39', '0.44'] UNINDEXED +['0.38', '0.38', '0.38', '0.39', '0.40', '0.43'] PRIMARY +['0.38', '0.38', '0.38', '0.39', '0.39', '0.47'] UNIQ + + +----- Fragmented: n, m = 2000, 6000 + +SELECT * FROM shelf +['1.27', '1.28', '1.29', '1.30', '1.32', '1.39'] UNINDEXED +['1.29', '1.30', '1.31', '1.31', '1.31', '1.45'] PRIMARY +['1.29', '1.29', '1.29', '1.30', '1.31', '1.45'] UNIQ + +SELECT * FROM shelf ORDER BY key +['5.55', '5.58', '5.58', '5.59', '5.70', '5.75'] UNINDEXED +['1.91', '1.92', '1.92', '1.92', '1.93', '2.02'] PRIMARY +['1.91', '1.92', '1.94', '1.94', '2.08', '2.10'] UNIQ + +SELECT * FROM shelf ORDER BY rowid +['1.30', '1.30', '1.30', '1.31', '1.42', '1.48'] UNINDEXED +['1.28', '1.29', '1.29', '1.30', '1.30', '1.42'] PRIMARY +['1.29', '1.30', '1.31', '1.31', '1.39', '1.40'] UNIQ + +SELECT key FROM shelf +['0.90', '0.91', '0.91', '0.92', '0.92', '1.07'] UNINDEXED +['0.89', '0.91', '0.91', '0.91', '0.91', '1.02'] PRIMARY +['0.90', '0.91', '0.91', '0.92', '0.93', '1.06'] UNIQ + +SELECT value FROM shelf +['0.90', '0.91', '0.91', '0.91', '0.93', '1.06'] UNINDEXED +['0.89', '0.91', '0.91', '0.91', '0.92', '1.00'] PRIMARY +['0.90', '0.91', '0.91', '0.91', '0.92', '0.99'] UNIQ + +SELECT key, value FROM shelf +['1.29', '1.30', '1.30', '1.30', '1.31', '1.45'] UNINDEXED +['1.29', '1.29', '1.29', '1.29', '1.30', '1.41'] PRIMARY +['1.29', '1.29', '1.30', '1.30', '1.30', '1.45'] UNIQ + + +----- Fragmented, then vacuumed: n, m = 2000, 6000 + +SELECT * FROM shelf +['1.29', '1.29', '1.31', '1.31', '1.40', '1.49'] UNINDEXED +['1.32', '1.32', '1.32', '1.33', '1.33', '1.52'] PRIMARY +['1.28', '1.29', '1.31', '1.31', '1.32', '1.47'] UNIQ + +SELECT * FROM shelf ORDER BY key +['5.76', '5.77', '5.77', '5.77', '5.77', '5.81'] UNINDEXED +['1.91', '1.91', '1.91', '1.91', '1.92', '2.02'] PRIMARY +['1.89', '1.90', '1.91', '1.92', '1.92', '2.07'] UNIQ + +SELECT * FROM shelf ORDER BY rowid +['1.35', '1.37', '1.38', '1.51', '1.53', '1.56'] UNINDEXED +['1.28', '1.29', '1.30', '1.30', '1.30', '1.42'] PRIMARY +['1.32', '1.33', '1.33', '1.34', '1.34', '1.50'] UNIQ + +SELECT key FROM shelf +['0.88', '0.89', '0.90', '0.90', '0.90', '1.09'] UNINDEXED +['0.90', '0.91', '0.91', '0.92', '0.92', '1.02'] PRIMARY +['0.89', '0.89', '0.89', '0.89', '0.90', '1.01'] UNIQ + +SELECT value FROM shelf +['0.89', '0.90', '0.91', '0.91', '0.91', '1.10'] UNINDEXED +['0.91', '0.91', '0.91', '0.91', '1.03', '1.08'] PRIMARY +['0.90', '0.91', '0.92', '0.92', '0.92', '1.00'] UNIQ + +SELECT key, value FROM shelf +['1.29', '1.30', '1.30', '1.30', '1.31', '1.46'] UNINDEXED +['1.29', '1.29', '1.30', '1.30', '1.31', '1.38'] PRIMARY +['1.28', '1.30', '1.30', '1.30', '1.33', '1.40'] UNIQ + +''' From python-checkins at python.org Mon Feb 2 09:01:18 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Mon, 2 Feb 2009 09:01:18 +0100 (CET) Subject: [Python-checkins] r69200 - in python/trunk/Doc: c-api/allocation.rst c-api/arg.rst c-api/bool.rst c-api/buffer.rst c-api/bytearray.rst c-api/cell.rst c-api/class.rst c-api/cobject.rst c-api/complex.rst c-api/conversion.rst c-api/datetime.rst c-api/descriptor.rst c-api/dict.rst c-api/file.rst c-api/float.rst c-api/function.rst c-api/gcsupport.rst c-api/gen.rst c-api/import.rst c-api/int.rst c-api/iter.rst c-api/iterator.rst c-api/list.rst c-api/long.rst c-api/mapping.rst c-api/marshal.rst c-api/method.rst c-api/module.rst c-api/none.rst c-api/number.rst c-api/objbuffer.rst c-api/object.rst c-api/reflection.rst c-api/sequence.rst c-api/set.rst c-api/slice.rst c-api/string.rst c-api/structures.rst c-api/sys.rst c-api/tuple.rst c-api/type.rst c-api/typeobj.rst c-api/unicode.rst c-api/weakref.rst library/abc.rst library/ast.rst library/fractions.rst library/future_builtins.rst library/importlib.rst library/io.rst library/json.rst library/multiprocessing.rst library/plistlib.rst library/repr.rst library/scrolledtext.rst library/tix.rst library/turtle.rst reference/grammar.rst whatsnew/2.7.rst Message-ID: <20090202080118.318051E4002@bag.python.org> Author: hirokazu.yamamoto Date: Mon Feb 2 09:01:17 2009 New Revision: 69200 Log: Set native svn:eol-style property for text files. Modified: python/trunk/Doc/c-api/allocation.rst (props changed) python/trunk/Doc/c-api/arg.rst (props changed) python/trunk/Doc/c-api/bool.rst (props changed) python/trunk/Doc/c-api/buffer.rst (props changed) python/trunk/Doc/c-api/bytearray.rst (props changed) python/trunk/Doc/c-api/cell.rst (props changed) python/trunk/Doc/c-api/class.rst (props changed) python/trunk/Doc/c-api/cobject.rst (props changed) python/trunk/Doc/c-api/complex.rst (props changed) python/trunk/Doc/c-api/conversion.rst (props changed) python/trunk/Doc/c-api/datetime.rst (props changed) python/trunk/Doc/c-api/descriptor.rst (props changed) python/trunk/Doc/c-api/dict.rst (props changed) python/trunk/Doc/c-api/file.rst (props changed) python/trunk/Doc/c-api/float.rst (props changed) python/trunk/Doc/c-api/function.rst (props changed) python/trunk/Doc/c-api/gcsupport.rst (props changed) python/trunk/Doc/c-api/gen.rst (props changed) python/trunk/Doc/c-api/import.rst (props changed) python/trunk/Doc/c-api/int.rst (props changed) python/trunk/Doc/c-api/iter.rst (props changed) python/trunk/Doc/c-api/iterator.rst (props changed) python/trunk/Doc/c-api/list.rst (props changed) python/trunk/Doc/c-api/long.rst (props changed) python/trunk/Doc/c-api/mapping.rst (props changed) python/trunk/Doc/c-api/marshal.rst (props changed) python/trunk/Doc/c-api/method.rst (props changed) python/trunk/Doc/c-api/module.rst (props changed) python/trunk/Doc/c-api/none.rst (props changed) python/trunk/Doc/c-api/number.rst (props changed) python/trunk/Doc/c-api/objbuffer.rst (props changed) python/trunk/Doc/c-api/object.rst (props changed) python/trunk/Doc/c-api/reflection.rst (props changed) python/trunk/Doc/c-api/sequence.rst (props changed) python/trunk/Doc/c-api/set.rst (props changed) python/trunk/Doc/c-api/slice.rst (props changed) python/trunk/Doc/c-api/string.rst (props changed) python/trunk/Doc/c-api/structures.rst (props changed) python/trunk/Doc/c-api/sys.rst (props changed) python/trunk/Doc/c-api/tuple.rst (props changed) python/trunk/Doc/c-api/type.rst (props changed) python/trunk/Doc/c-api/typeobj.rst (props changed) python/trunk/Doc/c-api/unicode.rst (props changed) python/trunk/Doc/c-api/weakref.rst (props changed) python/trunk/Doc/library/abc.rst (props changed) python/trunk/Doc/library/ast.rst (props changed) python/trunk/Doc/library/fractions.rst (props changed) python/trunk/Doc/library/future_builtins.rst (props changed) python/trunk/Doc/library/importlib.rst (props changed) python/trunk/Doc/library/io.rst (props changed) python/trunk/Doc/library/json.rst (props changed) python/trunk/Doc/library/multiprocessing.rst (props changed) python/trunk/Doc/library/plistlib.rst (props changed) python/trunk/Doc/library/repr.rst (props changed) python/trunk/Doc/library/scrolledtext.rst (props changed) python/trunk/Doc/library/tix.rst (props changed) python/trunk/Doc/library/turtle.rst (props changed) python/trunk/Doc/reference/grammar.rst (props changed) python/trunk/Doc/whatsnew/2.7.rst (props changed) From python-checkins at python.org Mon Feb 2 09:27:16 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Mon, 2 Feb 2009 09:27:16 +0100 (CET) Subject: [Python-checkins] r69201 - in python/branches/release26-maint: Doc/c-api/allocation.rst Doc/c-api/arg.rst Doc/c-api/bool.rst Doc/c-api/buffer.rst Doc/c-api/bytearray.rst Doc/c-api/cell.rst Doc/c-api/class.rst Doc/c-api/cobject.rst Doc/c-api/complex.rst Doc/c-api/conversion.rst Doc/c-api/datetime.rst Doc/c-api/descriptor.rst Doc/c-api/dict.rst Doc/c-api/file.rst Doc/c-api/float.rst Doc/c-api/function.rst Doc/c-api/gcsupport.rst Doc/c-api/gen.rst Doc/c-api/import.rst Doc/c-api/int.rst Doc/c-api/iter.rst Doc/c-api/iterator.rst Doc/c-api/list.rst Doc/c-api/long.rst Doc/c-api/mapping.rst Doc/c-api/marshal.rst Doc/c-api/method.rst Doc/c-api/module.rst Doc/c-api/none.rst Doc/c-api/number.rst Doc/c-api/objbuffer.rst Doc/c-api/object.rst Doc/c-api/reflection.rst Doc/c-api/sequence.rst Doc/c-api/set.rst Doc/c-api/slice.rst Doc/c-api/string.rst Doc/c-api/structures.rst Doc/c-api/sys.rst Doc/c-api/tuple.rst Doc/c-api/type.rst Doc/c-api/typeobj.rst Doc/c-api/unicode.rst Doc/c-api/weakref.rst Doc/library/abc.rst Doc/library/ast.rst Doc/library/fractions.rst Doc/library/future_builtins.rst Doc/library/io.rst Doc/library/json.rst Doc/library/multiprocessing.rst Doc/library/plistlib.rst Doc/library/repr.rst Doc/library/scrolledtext.rst Doc/library/tix.rst Doc/library/turtle.rst Doc/reference/grammar.rst Message-ID: <20090202082716.A51971E4002@bag.python.org> Author: hirokazu.yamamoto Date: Mon Feb 2 09:27:16 2009 New Revision: 69201 Log: Merged revisions 69200 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69200 | hirokazu.yamamoto | 2009-02-02 17:01:17 +0900 | 1 line Set native svn:eol-style property for text files. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/c-api/allocation.rst (props changed) python/branches/release26-maint/Doc/c-api/arg.rst (props changed) python/branches/release26-maint/Doc/c-api/bool.rst (props changed) python/branches/release26-maint/Doc/c-api/buffer.rst (props changed) python/branches/release26-maint/Doc/c-api/bytearray.rst (props changed) python/branches/release26-maint/Doc/c-api/cell.rst (props changed) python/branches/release26-maint/Doc/c-api/class.rst (props changed) python/branches/release26-maint/Doc/c-api/cobject.rst (props changed) python/branches/release26-maint/Doc/c-api/complex.rst (props changed) python/branches/release26-maint/Doc/c-api/conversion.rst (props changed) python/branches/release26-maint/Doc/c-api/datetime.rst (props changed) python/branches/release26-maint/Doc/c-api/descriptor.rst (props changed) python/branches/release26-maint/Doc/c-api/dict.rst (props changed) python/branches/release26-maint/Doc/c-api/file.rst (props changed) python/branches/release26-maint/Doc/c-api/float.rst (props changed) python/branches/release26-maint/Doc/c-api/function.rst (props changed) python/branches/release26-maint/Doc/c-api/gcsupport.rst (props changed) python/branches/release26-maint/Doc/c-api/gen.rst (props changed) python/branches/release26-maint/Doc/c-api/import.rst (props changed) python/branches/release26-maint/Doc/c-api/int.rst (props changed) python/branches/release26-maint/Doc/c-api/iter.rst (props changed) python/branches/release26-maint/Doc/c-api/iterator.rst (props changed) python/branches/release26-maint/Doc/c-api/list.rst (props changed) python/branches/release26-maint/Doc/c-api/long.rst (props changed) python/branches/release26-maint/Doc/c-api/mapping.rst (props changed) python/branches/release26-maint/Doc/c-api/marshal.rst (props changed) python/branches/release26-maint/Doc/c-api/method.rst (props changed) python/branches/release26-maint/Doc/c-api/module.rst (props changed) python/branches/release26-maint/Doc/c-api/none.rst (props changed) python/branches/release26-maint/Doc/c-api/number.rst (props changed) python/branches/release26-maint/Doc/c-api/objbuffer.rst (props changed) python/branches/release26-maint/Doc/c-api/object.rst (props changed) python/branches/release26-maint/Doc/c-api/reflection.rst (props changed) python/branches/release26-maint/Doc/c-api/sequence.rst (props changed) python/branches/release26-maint/Doc/c-api/set.rst (props changed) python/branches/release26-maint/Doc/c-api/slice.rst (props changed) python/branches/release26-maint/Doc/c-api/string.rst (props changed) python/branches/release26-maint/Doc/c-api/structures.rst (props changed) python/branches/release26-maint/Doc/c-api/sys.rst (props changed) python/branches/release26-maint/Doc/c-api/tuple.rst (props changed) python/branches/release26-maint/Doc/c-api/type.rst (props changed) python/branches/release26-maint/Doc/c-api/typeobj.rst (props changed) python/branches/release26-maint/Doc/c-api/unicode.rst (props changed) python/branches/release26-maint/Doc/c-api/weakref.rst (props changed) python/branches/release26-maint/Doc/library/abc.rst (props changed) python/branches/release26-maint/Doc/library/ast.rst (props changed) python/branches/release26-maint/Doc/library/fractions.rst (props changed) python/branches/release26-maint/Doc/library/future_builtins.rst (props changed) python/branches/release26-maint/Doc/library/io.rst (props changed) python/branches/release26-maint/Doc/library/json.rst (props changed) python/branches/release26-maint/Doc/library/multiprocessing.rst (props changed) python/branches/release26-maint/Doc/library/plistlib.rst (props changed) python/branches/release26-maint/Doc/library/repr.rst (props changed) python/branches/release26-maint/Doc/library/scrolledtext.rst (props changed) python/branches/release26-maint/Doc/library/tix.rst (props changed) python/branches/release26-maint/Doc/library/turtle.rst (props changed) python/branches/release26-maint/Doc/reference/grammar.rst (props changed) From buildbot at python.org Mon Feb 2 09:56:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 08:56:52 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 2.6 Message-ID: <20090202085652.805051E4010@bag.python.org> The Buildbot has detected a new failure of OS X x86 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%202.6/builds/37 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_docxmlrpc test_exceptions make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Feb 2 10:07:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 09:07:57 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 2.6 Message-ID: <20090202090757.8A1171E4002@bag.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/56 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: hirokazu.yamamoto BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Mon Feb 2 10:15:41 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Mon, 2 Feb 2009 10:15:41 +0100 (CET) Subject: [Python-checkins] r69202 - in python/branches/py3k: Doc/c-api/allocation.rst Doc/c-api/arg.rst Doc/c-api/bool.rst Doc/c-api/buffer.rst Doc/c-api/bytearray.rst Doc/c-api/bytes.rst Doc/c-api/cell.rst Doc/c-api/cobject.rst Doc/c-api/complex.rst Doc/c-api/conversion.rst Doc/c-api/datetime.rst Doc/c-api/descriptor.rst Doc/c-api/dict.rst Doc/c-api/file.rst Doc/c-api/float.rst Doc/c-api/function.rst Doc/c-api/gcsupport.rst Doc/c-api/gen.rst Doc/c-api/import.rst Doc/c-api/iter.rst Doc/c-api/iterator.rst Doc/c-api/list.rst Doc/c-api/long.rst Doc/c-api/mapping.rst Doc/c-api/marshal.rst Doc/c-api/method.rst Doc/c-api/module.rst Doc/c-api/none.rst Doc/c-api/number.rst Doc/c-api/objbuffer.rst Doc/c-api/object.rst Doc/c-api/objimpl.rst Doc/c-api/reflection.rst Doc/c-api/sequence.rst Doc/c-api/set.rst Doc/c-api/slice.rst Doc/c-api/structures.rst Doc/c-api/sys.rst Doc/c-api/tuple.rst Doc/c-api/type.rst Doc/c-api/typeobj.rst Doc/c-api/unicode.rst Doc/c-api/weakref.rst Doc/library/ast.rst Doc/library/copyreg.rst Doc/library/fractions.rst Doc/library/html.entities.rst Doc/library/importlib.rst Doc/library/io.rst Doc/library/json.rst Doc/library/multiprocessing.rst Doc/library/plistlib.rst Doc/library/reprlib.rst Doc/reference/grammar.rst Doc/whatsnew/2.7.rst Message-ID: <20090202091541.BC9061E4002@bag.python.org> Author: hirokazu.yamamoto Date: Mon Feb 2 10:15:41 2009 New Revision: 69202 Log: Merged revisions 69200 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69200 | hirokazu.yamamoto | 2009-02-02 17:01:17 +0900 | 1 line Set native svn:eol-style property for text files. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/c-api/allocation.rst (props changed) python/branches/py3k/Doc/c-api/arg.rst (props changed) python/branches/py3k/Doc/c-api/bool.rst (props changed) python/branches/py3k/Doc/c-api/buffer.rst (props changed) python/branches/py3k/Doc/c-api/bytearray.rst (props changed) python/branches/py3k/Doc/c-api/bytes.rst (props changed) python/branches/py3k/Doc/c-api/cell.rst (props changed) python/branches/py3k/Doc/c-api/cobject.rst (props changed) python/branches/py3k/Doc/c-api/complex.rst (props changed) python/branches/py3k/Doc/c-api/conversion.rst (props changed) python/branches/py3k/Doc/c-api/datetime.rst (props changed) python/branches/py3k/Doc/c-api/descriptor.rst (props changed) python/branches/py3k/Doc/c-api/dict.rst (props changed) python/branches/py3k/Doc/c-api/file.rst (props changed) python/branches/py3k/Doc/c-api/float.rst (props changed) python/branches/py3k/Doc/c-api/function.rst (props changed) python/branches/py3k/Doc/c-api/gcsupport.rst (props changed) python/branches/py3k/Doc/c-api/gen.rst (props changed) python/branches/py3k/Doc/c-api/import.rst (props changed) python/branches/py3k/Doc/c-api/iter.rst (props changed) python/branches/py3k/Doc/c-api/iterator.rst (props changed) python/branches/py3k/Doc/c-api/list.rst (props changed) python/branches/py3k/Doc/c-api/long.rst (props changed) python/branches/py3k/Doc/c-api/mapping.rst (props changed) python/branches/py3k/Doc/c-api/marshal.rst (props changed) python/branches/py3k/Doc/c-api/method.rst (props changed) python/branches/py3k/Doc/c-api/module.rst (props changed) python/branches/py3k/Doc/c-api/none.rst (props changed) python/branches/py3k/Doc/c-api/number.rst (props changed) python/branches/py3k/Doc/c-api/objbuffer.rst (props changed) python/branches/py3k/Doc/c-api/object.rst (props changed) python/branches/py3k/Doc/c-api/objimpl.rst (props changed) python/branches/py3k/Doc/c-api/reflection.rst (props changed) python/branches/py3k/Doc/c-api/sequence.rst (props changed) python/branches/py3k/Doc/c-api/set.rst (props changed) python/branches/py3k/Doc/c-api/slice.rst (props changed) python/branches/py3k/Doc/c-api/structures.rst (props changed) python/branches/py3k/Doc/c-api/sys.rst (props changed) python/branches/py3k/Doc/c-api/tuple.rst (props changed) python/branches/py3k/Doc/c-api/type.rst (props changed) python/branches/py3k/Doc/c-api/typeobj.rst (props changed) python/branches/py3k/Doc/c-api/unicode.rst (props changed) python/branches/py3k/Doc/c-api/weakref.rst (props changed) python/branches/py3k/Doc/library/ast.rst (props changed) python/branches/py3k/Doc/library/copyreg.rst (props changed) python/branches/py3k/Doc/library/fractions.rst (props changed) python/branches/py3k/Doc/library/html.entities.rst (props changed) python/branches/py3k/Doc/library/importlib.rst (props changed) python/branches/py3k/Doc/library/io.rst (props changed) python/branches/py3k/Doc/library/json.rst (props changed) python/branches/py3k/Doc/library/multiprocessing.rst (props changed) python/branches/py3k/Doc/library/plistlib.rst (props changed) python/branches/py3k/Doc/library/reprlib.rst (props changed) python/branches/py3k/Doc/reference/grammar.rst (props changed) python/branches/py3k/Doc/whatsnew/2.7.rst (props changed) From buildbot at python.org Mon Feb 2 10:25:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 09:25:20 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090202092520.5FD8A1E4002@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/85 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: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Mon Feb 2 10:46:30 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Mon, 2 Feb 2009 10:46:30 +0100 (CET) Subject: [Python-checkins] r69203 - in python/branches/release30-maint: Doc/c-api/allocation.rst Doc/c-api/arg.rst Doc/c-api/bool.rst Doc/c-api/buffer.rst Doc/c-api/bytearray.rst Doc/c-api/bytes.rst Doc/c-api/cell.rst Doc/c-api/cobject.rst Doc/c-api/complex.rst Doc/c-api/conversion.rst Doc/c-api/datetime.rst Doc/c-api/descriptor.rst Doc/c-api/dict.rst Doc/c-api/file.rst Doc/c-api/float.rst Doc/c-api/function.rst Doc/c-api/gcsupport.rst Doc/c-api/gen.rst Doc/c-api/import.rst Doc/c-api/iter.rst Doc/c-api/iterator.rst Doc/c-api/list.rst Doc/c-api/long.rst Doc/c-api/mapping.rst Doc/c-api/marshal.rst Doc/c-api/method.rst Doc/c-api/module.rst Doc/c-api/none.rst Doc/c-api/number.rst Doc/c-api/objbuffer.rst Doc/c-api/object.rst Doc/c-api/objimpl.rst Doc/c-api/reflection.rst Doc/c-api/sequence.rst Doc/c-api/set.rst Doc/c-api/slice.rst Doc/c-api/structures.rst Doc/c-api/sys.rst Doc/c-api/tuple.rst Doc/c-api/type.rst Doc/c-api/typeobj.rst Doc/c-api/unicode.rst Doc/c-api/weakref.rst Doc/library/ast.rst Doc/library/copyreg.rst Doc/library/fractions.rst Doc/library/html.entities.rst Doc/library/io.rst Doc/library/json.rst Doc/library/multiprocessing.rst Doc/library/plistlib.rst Doc/library/reprlib.rst Doc/reference/grammar.rst Doc/whatsnew/2.7.rst Message-ID: <20090202094630.C1A921E4002@bag.python.org> Author: hirokazu.yamamoto Date: Mon Feb 2 10:46:30 2009 New Revision: 69203 Log: Merged revisions 69202 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69202 | hirokazu.yamamoto | 2009-02-02 18:15:41 +0900 | 9 lines Merged revisions 69200 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69200 | hirokazu.yamamoto | 2009-02-02 17:01:17 +0900 | 1 line Set native svn:eol-style property for text files. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/c-api/allocation.rst (props changed) python/branches/release30-maint/Doc/c-api/arg.rst (props changed) python/branches/release30-maint/Doc/c-api/bool.rst (props changed) python/branches/release30-maint/Doc/c-api/buffer.rst (props changed) python/branches/release30-maint/Doc/c-api/bytearray.rst (props changed) python/branches/release30-maint/Doc/c-api/bytes.rst (props changed) python/branches/release30-maint/Doc/c-api/cell.rst (props changed) python/branches/release30-maint/Doc/c-api/cobject.rst (props changed) python/branches/release30-maint/Doc/c-api/complex.rst (props changed) python/branches/release30-maint/Doc/c-api/conversion.rst (props changed) python/branches/release30-maint/Doc/c-api/datetime.rst (props changed) python/branches/release30-maint/Doc/c-api/descriptor.rst (props changed) python/branches/release30-maint/Doc/c-api/dict.rst (props changed) python/branches/release30-maint/Doc/c-api/file.rst (props changed) python/branches/release30-maint/Doc/c-api/float.rst (props changed) python/branches/release30-maint/Doc/c-api/function.rst (props changed) python/branches/release30-maint/Doc/c-api/gcsupport.rst (props changed) python/branches/release30-maint/Doc/c-api/gen.rst (props changed) python/branches/release30-maint/Doc/c-api/import.rst (props changed) python/branches/release30-maint/Doc/c-api/iter.rst (props changed) python/branches/release30-maint/Doc/c-api/iterator.rst (props changed) python/branches/release30-maint/Doc/c-api/list.rst (props changed) python/branches/release30-maint/Doc/c-api/long.rst (props changed) python/branches/release30-maint/Doc/c-api/mapping.rst (props changed) python/branches/release30-maint/Doc/c-api/marshal.rst (props changed) python/branches/release30-maint/Doc/c-api/method.rst (props changed) python/branches/release30-maint/Doc/c-api/module.rst (props changed) python/branches/release30-maint/Doc/c-api/none.rst (props changed) python/branches/release30-maint/Doc/c-api/number.rst (props changed) python/branches/release30-maint/Doc/c-api/objbuffer.rst (props changed) python/branches/release30-maint/Doc/c-api/object.rst (props changed) python/branches/release30-maint/Doc/c-api/objimpl.rst (props changed) python/branches/release30-maint/Doc/c-api/reflection.rst (props changed) python/branches/release30-maint/Doc/c-api/sequence.rst (props changed) python/branches/release30-maint/Doc/c-api/set.rst (props changed) python/branches/release30-maint/Doc/c-api/slice.rst (props changed) python/branches/release30-maint/Doc/c-api/structures.rst (props changed) python/branches/release30-maint/Doc/c-api/sys.rst (props changed) python/branches/release30-maint/Doc/c-api/tuple.rst (props changed) python/branches/release30-maint/Doc/c-api/type.rst (props changed) python/branches/release30-maint/Doc/c-api/typeobj.rst (props changed) python/branches/release30-maint/Doc/c-api/unicode.rst (props changed) python/branches/release30-maint/Doc/c-api/weakref.rst (props changed) python/branches/release30-maint/Doc/library/ast.rst (props changed) python/branches/release30-maint/Doc/library/copyreg.rst (props changed) python/branches/release30-maint/Doc/library/fractions.rst (props changed) python/branches/release30-maint/Doc/library/html.entities.rst (props changed) python/branches/release30-maint/Doc/library/io.rst (props changed) python/branches/release30-maint/Doc/library/json.rst (props changed) python/branches/release30-maint/Doc/library/multiprocessing.rst (props changed) python/branches/release30-maint/Doc/library/plistlib.rst (props changed) python/branches/release30-maint/Doc/library/reprlib.rst (props changed) python/branches/release30-maint/Doc/reference/grammar.rst (props changed) python/branches/release30-maint/Doc/whatsnew/2.7.rst (props changed) From buildbot at python.org Mon Feb 2 11:44:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 10:44:05 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20090202104406.8E5B61E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%203.0/builds/101 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: 51 tests failed: test__locale test_bool test_builtin test_cmath test_cmd_line test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_tw test_coding test_compile test_contextlib test_csv test_decimal test_defaultdict test_distutils test_doctest test_email test_fileinput test_http_cookiejar test_inspect test_iter test_lib2to3 test_list test_logging test_mailbox test_math test_mmap test_modulefinder test_multiprocessing test_mutants test_pep352 test_pipes test_platform test_popen test_posix test_runpy test_sax test_site test_ssl test_subprocess test_sundry test_tarfile test_tcl test_tempfile test_traceback test_xml_etree_c test_xmlrpc test_zipfile test_zipimport test_zipimport_support Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test__locale.py", line 7, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/platform.py", line 1152, in uname File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/platform.py", line 908, in _syscmd_uname File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_print (test.test_bool.BoolTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_bool.py", line 30, in test_print File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_input (test.test_builtin.BuiltinTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_builtin.py", line 972, in test_input File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_builtin.py", line 789, in write_testfile File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_open (test.test_builtin.BuiltinTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_builtin.py", line 800, in test_open File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_builtin.py", line 789, in write_testfile File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_specific_values (test.test_cmath.CMathTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_cmath.py", line 309, in test_specific_values File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_math.py", line 31, in parse_testfile File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_site_flag (test.test_cmd_line.CmdLineTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_cmd_line.py", line 69, in test_site_flag File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/distutils/util.py", line 119, in get_platform File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_mapping_file (test.test_codecmaps_cn.TestGB18030Map) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 289, in test_mapping_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 326, in _test_mapping_file_ucm File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_mapping_file (test.test_codecmaps_cn.TestGB2312Map) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 291, in test_mapping_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 297, in _test_mapping_file_plain File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_mapping_file (test.test_codecmaps_cn.TestGBKMap) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 291, in test_mapping_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 297, in _test_mapping_file_plain File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_mapping_file (test.test_codecmaps_hk.TestBig5HKSCSMap) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 291, in test_mapping_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 297, in _test_mapping_file_plain File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_mapping_file (test.test_codecmaps_jp.TestCP932Map) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 291, in test_mapping_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 297, in _test_mapping_file_plain File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_mapping_file (test.test_codecmaps_jp.TestEUCJISX0213Map) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 291, in test_mapping_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 297, in _test_mapping_file_plain File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_mapping_file (test.test_codecmaps_jp.TestEUCJPCOMPATMap) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 291, in test_mapping_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 297, in _test_mapping_file_plain File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_mapping_file (test.test_codecmaps_jp.TestSJISCOMPATMap) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 291, in test_mapping_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 297, in _test_mapping_file_plain File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_mapping_file (test.test_codecmaps_jp.TestSJISX0213Map) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 291, in test_mapping_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 297, in _test_mapping_file_plain File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_mapping_file (test.test_codecmaps_tw.TestBIG5Map) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 291, in test_mapping_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 297, in _test_mapping_file_plain File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_mapping_file (test.test_codecmaps_tw.TestCP950Map) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 291, in test_mapping_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_multibytecodec_support.py", line 297, in _test_mapping_file_plain File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_file_parse (test.test_coding.CodingTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_coding.py", line 39, in test_file_parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_compile_ast (test.test_compile.TestSpecifics) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_compile.py", line 385, in test_compile_ast File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: testWithOpen (test.test_contextlib.FileContextTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_contextlib.py", line 264, in testWithOpen File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_char_write (test.test_csv.TestArrayWrites) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 683, in test_char_write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_double_write (test.test_csv.TestArrayWrites) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 661, in test_double_write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_float_write (test.test_csv.TestArrayWrites) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 672, in test_float_write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_int_write (test.test_csv.TestArrayWrites) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 650, in test_int_write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_blankline (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 406, in test_blankline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 383, in readerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_dubious_quote (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 473, in test_dubious_quote File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 383, in readerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_empty_fields (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 409, in test_empty_fields File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 383, in readerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_inline_quote (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 427, in test_inline_quote File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 383, in readerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_inline_quotes (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 430, in test_inline_quotes File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 383, in readerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_lone_quote (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 438, in test_lone_quote File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 383, in readerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_newlines (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 491, in test_newlines File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 392, in writerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_null (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 476, in test_null File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 394, in writerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_quote_and_quote (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): ====================================================================== ERROR: test_quote_fieldsep (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 488, in test_quote_fieldsep File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 392, in writerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_quoted (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 452, in test_quoted File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 383, in readerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_quoted_nl (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 470, in test_quoted_nl File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 383, in readerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_quoted_quote (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 458, in test_quoted_quote File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 383, in readerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_quoted_quotes (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 424, in test_quoted_quotes File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 383, in readerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_quotes (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 485, in test_quotes File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 392, in writerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_quotes_and_more (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 435, in test_quotes_and_more File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 383, in readerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_simple (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 482, in test_simple File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 392, in writerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_single (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 479, in test_single File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 392, in writerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_single_quoted_quote (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 421, in test_single_quoted_quote File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 383, in readerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_singlequoted (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 412, in test_singlequoted File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 383, in readerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_singlequoted_left_empty (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 415, in test_singlequoted_left_empty File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 383, in readerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_singlequoted_right_empty (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 418, in test_singlequoted_right_empty File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 383, in readerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_space_and_quote (test.test_csv.TestDialectExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 446, in test_space_and_quote File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 383, in readerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_space_dialect (test.test_csv.TestDialectRegistry) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 333, in test_space_dialect File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_read_dict_fieldnames_chain (test.test_csv.TestDictFields) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 563, in test_read_dict_fieldnames_chain File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_read_dict_fieldnames_from_file (test.test_csv.TestDictFields) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 553, in test_read_dict_fieldnames_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_read_dict_fields (test.test_csv.TestDictFields) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 535, in test_read_dict_fields File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_read_dict_no_fieldnames (test.test_csv.TestDictFields) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 543, in test_read_dict_no_fieldnames File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_read_long (test.test_csv.TestDictFields) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 573, in test_read_long File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_read_long_with_rest (test.test_csv.TestDictFields) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 582, in test_read_long_with_rest File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_read_long_with_rest_no_fieldnames (test.test_csv.TestDictFields) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 591, in test_read_long_with_rest_no_fieldnames File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_read_short (test.test_csv.TestDictFields) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 600, in test_read_short File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_write_simple_dict (test.test_csv.TestDictFields) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 525, in test_write_simple_dict File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/csv.py", line 139, in writerow File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_escape_fieldsep (test.test_csv.TestEscapedExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 501, in test_escape_fieldsep File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 392, in writerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_read_escape_fieldsep (test.test_csv.TestEscapedExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 504, in test_read_escape_fieldsep File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 383, in readerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_read_escape_fieldsep (test.test_csv.TestQuotedEscapedExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 517, in test_read_escape_fieldsep File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 383, in readerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_write_escape_fieldsep (test.test_csv.TestQuotedEscapedExcel) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 514, in test_write_escape_fieldsep File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 392, in writerAssertEqual File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_write_arg_valid (test.test_csv.Test_Csv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 130, in test_write_arg_valid File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 123, in _write_test File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_write_bigfield (test.test_csv.Test_Csv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 151, in test_write_bigfield File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 123, in _write_test File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_write_escape (test.test_csv.Test_Csv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 168, in test_write_escape File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 123, in _write_test File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_write_quoting (test.test_csv.Test_Csv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 154, in test_write_quoting File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 123, in _write_test File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_writerows (test.test_csv.Test_Csv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_csv.py", line 195, in test_writerows File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_abs (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_add (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_and (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_base (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_clamp (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_class (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_compare (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_comparetotal (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_comparetotmag (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_copy (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_copyabs (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_copynegate (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_copysign (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddAbs (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddAdd (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddAnd (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddBase (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddCanonical (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddClass (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddCompare (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddCompareSig (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddCompareTotal (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddCompareTotalMag (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddCopy (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddCopyAbs (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddCopyNegate (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddCopySign (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddDivide (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddDivideInt (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddEncode (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddFMA (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddInvert (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddLogB (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddMax (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddMaxMag (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddMin (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddMinMag (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddMinus (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddMultiply (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddNextMinus (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddNextPlus (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddNextToward (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddOr (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddPlus (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddQuantize (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddReduce (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddRemainder (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddRemainderNear (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddRotate (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddSameQuantum (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddScaleB (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddShift (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddSubtract (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddToIntegral (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ddXor (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_decDouble (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_decQuad (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_decSingle (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_divide (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_divideint (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqAbs (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqAdd (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqAnd (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqBase (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqCanonical (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqClass (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqCompare (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqCompareSig (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqCompareTotal (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqCompareTotalMag (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqCopy (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqCopyAbs (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqCopyNegate (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqCopySign (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqDivide (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqDivideInt (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqEncode (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqFMA (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqInvert (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqLogB (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqMax (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqMaxMag (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqMin (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqMinMag (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqMinus (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqMultiply (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqNextMinus (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqNextPlus (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqNextToward (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqOr (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqPlus (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqQuantize (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqReduce (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqRemainder (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqRemainderNear (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqRotate (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqSameQuantum (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqScaleB (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqShift (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqSubtract (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqToIntegral (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dqXor (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dsBase (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dsEncode (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_exp (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_extra (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_fma (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_inexact (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_invert (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_ln (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_log10 (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_logb (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_max (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_maxmag (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_min (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_minmag (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_minus (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_multiply (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_nextminus (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_nextplus (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_nexttoward (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_or (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_plus (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_power (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_powersqrt (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_quantize (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_randomBound32 (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_randoms (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_reduce (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_remainder (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_remainderNear (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_rescale (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_rotate (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_rounding (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_samequantum (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_scaleb (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_shift (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_squareroot (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_subtract (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_testall (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_tointegral (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_tointegralx (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_xor (test.test_decimal.DecimalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 1556, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_decimal.py", line 199, in eval_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_print (test.test_defaultdict.TestDefaultDict) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_defaultdict.py", line 86, in test_print File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_recursive_repr (test.test_defaultdict.TestDefaultDict) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_defaultdict.py", line 162, in test_recursive_repr File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' Traceback (most recent call last): File "./Lib/test/regrtest.py", line 603, in runtest_inner File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_distutils.py", line 13, in test_main File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/distutils/tests/__init__.py", line 28, in test_suite File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/distutils/tests/test_build_ext.py", line 8, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/distutils/command/build_ext.py", line 34, in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/distutils/command/build_ext.py", line 64, in build_ext File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/distutils/util.py", line 119, in get_platform File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_MIME_digest (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1944, in test_MIME_digest File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_MIME_digest_with_part_headers (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1952, in test_MIME_digest_with_part_headers File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_content_type (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 2007, in test_content_type File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dsn (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1964, in test_dsn File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_long_header (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1948, in test_long_header File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_message_external_body_idempotent (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 2000, in test_message_external_body_idempotent File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_mixed_with_image (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1956, in test_mixed_with_image File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_more_rfc2231_parameters (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1988, in test_more_rfc2231_parameters File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_multipart_no_parts (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1976, in test_multipart_no_parts File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_multipart_one_part (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1972, in test_multipart_one_part File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_multipart_report (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1960, in test_multipart_report File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_nested_multipart_mixeds (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1996, in test_nested_multipart_mixeds File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_no_start_boundary (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1980, in test_no_start_boundary File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_parse_text_message (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1921, in test_parse_text_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_parse_untyped_message (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1933, in test_parse_untyped_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_parser (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 2038, in test_parser File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_preamble_epilogue (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1968, in test_preamble_epilogue File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_rfc2231_charset (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1984, in test_rfc2231_charset File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_simple_multipart (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1940, in test_simple_multipart File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_text_plain_in_a_multipart_digest (email.test.test_email.TestIdempotent) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1992, in test_text_plain_in_a_multipart_digest File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1908, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_body_line_iterator (email.test.test_email.TestIterators) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 2353, in test_body_line_iterator File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_typed_subpart_iterator (email.test.test_email.TestIterators) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 2368, in test_typed_subpart_iterator File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_typed_subpart_iterator_default_type (email.test.test_email.TestIterators) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 2385, in test_typed_subpart_iterator_default_type File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_bad_multipart (email.test.test_email.TestMIMEMessage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1603, in setUp File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_default_multipart_constructor (email.test.test_email.TestMIMEMessage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1603, in setUp File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_default_type (email.test.test_email.TestMIMEMessage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1603, in setUp File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_default_type_non_parsed (email.test.test_email.TestMIMEMessage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1603, in setUp File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_default_type_with_explicit_container_type (email.test.test_email.TestMIMEMessage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1603, in setUp File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_dsn (email.test.test_email.TestMIMEMessage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1603, in setUp File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_epilogue (email.test.test_email.TestMIMEMessage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1603, in setUp File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_generate (email.test.test_email.TestMIMEMessage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1603, in setUp File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_mime_attachments_in_constructor (email.test.test_email.TestMIMEMessage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1603, in setUp File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_no_nl_preamble (email.test.test_email.TestMIMEMessage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1603, in setUp File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_parse_message_rfc822 (email.test.test_email.TestMIMEMessage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1603, in setUp File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_type_error (email.test.test_email.TestMIMEMessage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1603, in setUp File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_valid_argument (email.test.test_email.TestMIMEMessage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1603, in setUp File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_as_string (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 234, in test_as_string File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_decoded_generator (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 212, in test_decoded_generator File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_del_param (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 336, in test_del_param File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_all (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 75, in test_get_all File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_boundary (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 155, in test_get_boundary File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_charsets (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 121, in test_get_charsets File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_content_maintype_from_message_explicit (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 415, in test_get_content_maintype_from_message_explicit File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_content_maintype_from_message_implicit (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 411, in test_get_content_maintype_from_message_implicit File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_content_maintype_from_message_text_plain_explicit (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 423, in test_get_content_maintype_from_message_text_plain_explicit File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_content_maintype_from_message_text_plain_implicit (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 419, in test_get_content_maintype_from_message_text_plain_implicit File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_content_subtype_from_message_explicit (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 440, in test_get_content_subtype_from_message_explicit File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_content_subtype_from_message_implicit (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 436, in test_get_content_subtype_from_message_implicit File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_content_subtype_from_message_text_plain_explicit (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 448, in test_get_content_subtype_from_message_text_plain_explicit File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_content_subtype_from_message_text_plain_implicit (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 444, in test_get_content_subtype_from_message_text_plain_implicit File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_content_type_from_message_explicit (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 389, in test_get_content_type_from_message_explicit File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_content_type_from_message_implicit (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 384, in test_get_content_type_from_message_implicit File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_content_type_from_message_text_plain_explicit (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 398, in test_get_content_type_from_message_text_plain_explicit File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_content_type_from_message_text_plain_implicit (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 394, in test_get_content_type_from_message_text_plain_implicit File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_decoded_payload (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 183, in test_get_decoded_payload File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_filename (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 138, in test_get_filename File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_filename_with_name_parameter (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 149, in test_get_filename_with_name_parameter File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_param_funky_continuation_lines (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 299, in test_get_param_funky_continuation_lines File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_set_boundary (email.test.test_email.TestMessageAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 163, in test_set_boundary File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_message_from_file (email.test.test_email.TestMiscellaneous) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 2069, in test_message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_message_from_file_with_class (email.test.test_email.TestMiscellaneous) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 2104, in test_message_from_file_with_class File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_message_from_string (email.test.test_email.TestMiscellaneous) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 2058, in test_message_from_string File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_message_from_string_with_class (email.test.test_email.TestMiscellaneous) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 2082, in test_message_from_string_with_class File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_partial_falls_inside_message_delivery_status (email.test.test_email.TestMiscellaneous) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 2309, in test_partial_falls_inside_message_delivery_status File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_boundary_in_non_multipart (email.test.test_email.TestMultipart) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1385, in test_boundary_in_non_multipart File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_double_boundary (email.test.test_email.TestMultipart) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1345, in test_double_boundary File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_message_external_body (email.test.test_email.TestMultipart) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1330, in test_message_external_body File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_nested_inner_contains_outer_boundary (email.test.test_email.TestMultipart) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1354, in test_nested_inner_contains_outer_boundary File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_nested_with_same_boundary (email.test.test_email.TestMultipart) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1372, in test_nested_with_same_boundary File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_lying_multipart (email.test.test_email.TestNonConformant) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1513, in test_lying_multipart File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_missing_start_boundary (email.test.test_email.TestNonConformant) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1521, in test_missing_start_boundary File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_multipart_no_boundary (email.test.test_email.TestNonConformant) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1455, in test_multipart_no_boundary File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_no_separating_blank_line (email.test.test_email.TestNonConformant) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1502, in test_no_separating_blank_line File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_no_start_boundary (email.test.test_email.TestNonConformant) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1485, in test_no_start_boundary File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_parse_missing_minor_type (email.test.test_email.TestNonConformant) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1438, in test_parse_missing_minor_type File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_same_boundary_inner_outer (email.test.test_email.TestNonConformant) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 1445, in test_same_boundary_inner_outer File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_crlf_separation (email.test.test_email.TestParsers) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 2455, in test_crlf_separation File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_header_parser (email.test.test_email.TestParsers) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 2409, in test_header_parser File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 88, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_multipart_digest_with_extra_mime_headers (email.test.test_email.TestParsers) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 2467, in test_multipart_digest_with_extra_mime_headers File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_del_param (email.test.test_email.TestRFC2231) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 3127, in test_del_param File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_param (email.test.test_email.TestRFC2231) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 3082, in test_get_param File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_rfc2231_get_content_charset (email.test.test_email.TestRFC2231) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 3157, in test_rfc2231_get_content_charset File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_set_param (email.test.test_email.TestRFC2231) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 3099, in test_set_param File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/test/test_email.py", line 67, in _msgobj File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/__init__.py", line 46, in message_from_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/email/parser.py", line 68, in parse File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1739, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_buffer_sizes (test.test_fileinput.BufferSizesTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_fileinput.py", line 39, in test_buffer_sizes File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_fileinput.py", line 24, in writeTmp File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_fileno (test.test_fileinput.FileInputTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_fileinput.py", line 179, in test_fileno File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_fileinput.py", line 24, in writeTmp File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_files_that_dont_end_with_newline (test.test_fileinput.FileInputTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_fileinput.py", line 152, in test_files_that_dont_end_with_newline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_fileinput.py", line 24, in writeTmp File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_opening_mode (test.test_fileinput.FileInputTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_fileinput.py", line 204, in test_opening_mode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/fileinput.py", line 253, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/fileinput.py", line 348, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 541, in readlines File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_zero_byte_files (test.test_fileinput.FileInputTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_fileinput.py", line 128, in test_zero_byte_files File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_fileinput.py", line 24, in writeTmp File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_missing_value (test.test_http_cookiejar.CookieTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_http_cookiejar.py", line 355, in test_missing_value File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/http/cookiejar.py", line 2049, in save File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_bad_magic (test.test_http_cookiejar.FileCookieJarTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_http_cookiejar.py", line 253, in test_bad_magic File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_lwp_valueless_cookie (test.test_http_cookiejar.FileCookieJarTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_http_cookiejar.py", line 228, in test_lwp_valueless_cookie File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/http/cookiejar.py", line 1852, in save File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_mozilla (test.test_http_cookiejar.LWPCookieTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_http_cookiejar.py", line 1499, in test_mozilla File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_http_cookiejar.py", line 1490, in save_and_restore File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/http/cookiejar.py", line 2049, in save File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_rejection (test.test_http_cookiejar.LWPCookieTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_http_cookiejar.py", line 1434, in test_rejection File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/http/cookiejar.py", line 1852, in save File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' Traceback (most recent call last): File "./Lib/test/regrtest.py", line 603, in runtest_inner File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_inspect.py", line 482, in test_main File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/support.py", line 709, in run_unittest File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/unittest.py", line 639, in makeSuite File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/unittest.py", line 536, in loadTestsFromTestCase File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/unittest.py", line 387, in __init__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/unittest.py", line 423, in addTests File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_inspect.py", line 175, in __init__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_builtin_list (test.test_iter.TestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_iter.py", line 257, in test_builtin_list File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_builtin_map (test.test_iter.TestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_iter.py", line 400, in test_builtin_map File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_builtin_max_min (test.test_iter.TestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_iter.py", line 366, in test_builtin_max_min File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_builtin_tuple (test.test_iter.TestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_iter.py", line 290, in test_builtin_tuple File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_builtin_zip (test.test_iter.TestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_iter.py", line 446, in test_builtin_zip File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_countOf (test.test_iter.TestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_iter.py", line 595, in test_countOf File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_in_and_not_in (test.test_iter.TestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_iter.py", line 558, in test_in_and_not_in File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_indexOf (test.test_iter.TestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_iter.py", line 629, in test_indexOf File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_iter_file (test.test_iter.TestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_iter.py", line 228, in test_iter_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_unicode_join_endcase (test.test_iter.TestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_iter.py", line 514, in test_unicode_join_endcase File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_unpack_iter (test.test_iter.TestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_iter.py", line 740, in test_unpack_iter File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_writelines (test.test_iter.TestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_iter.py", line 659, in test_writelines File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 551, in writelines File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_refactor_file (lib2to3.tests.test_refactor.TestRefactoringTool) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/lib2to3/tests/test_refactor.py", line 126, in test_refactor_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1730, in read File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_print (test.test_list.ListTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/list_tests.py", line 70, in test_print File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_config0_ok (test.test_logging.ConfigFileTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_logging.py", line 645, in test_config0_ok File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_logging.py", line 636, in apply_config File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_config1_ok (test.test_logging.ConfigFileTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_logging.py", line 660, in test_config1_ok File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_logging.py", line 636, in apply_config File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_config4_ok (test.test_logging.ConfigFileTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_logging.py", line 683, in test_config4_ok File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_logging.py", line 636, in apply_config File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_config5_ok (test.test_logging.ConfigFileTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_logging.py", line 696, in test_config5_ok File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_logging.py", line 660, in test_config1_ok File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_logging.py", line 636, in apply_config File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_config6_ok (test.test_logging.ConfigFileTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_logging.py", line 699, in test_config6_ok File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_logging.py", line 660, in test_config1_ok File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_logging.py", line 636, in apply_config File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_add (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 66, in test_add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_add_MM (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 471, in test_add_MM File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 200, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_clean (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 593, in test_clean File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_clear (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 298, in test_clear File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_close (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 388, in test_close File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 392, in _test_flush_or_close File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_consistent_factory (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 514, in test_consistent_factory File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 200, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_contains (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 239, in test_contains File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_create_tmp (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 646, in test_create_tmp File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_delitem (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 86, in test_delitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 90, in _test_remove_or_delitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_directory_in_folder (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 703, in test_directory_in_folder File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 200, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_discard (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 114, in test_discard File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_file_permissions (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 719, in test_file_permissions File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 200, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_flush (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 376, in test_flush File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 392, in _test_flush_or_close File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_get (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 126, in test_get File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_get_MM (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 480, in test_get_MM File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 200, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_get_file (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 168, in test_get_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_get_folder (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 563, in test_get_folder File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_get_message (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 151, in test_get_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_get_string (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 161, in test_get_string File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_getitem (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 141, in test_getitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_items (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 206, in test_items File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 213, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_iter (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 193, in test_iter File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 213, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_iteritems (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 202, in test_iteritems File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 213, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_iterkeys (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 179, in test_iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 213, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_itervalues (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 188, in test_itervalues File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 213, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_keys (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 183, in test_keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 213, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_len (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 260, in test_len File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_lookup (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 675, in test_lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_pop (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 308, in test_pop File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_popitem (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 328, in test_popitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_refresh (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 658, in test_refresh File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_remove (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 82, in test_remove File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 90, in _test_remove_or_delitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_set_MM (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 490, in test_set_MM File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 200, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_set_item (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 269, in test_set_item File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_update (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 342, in test_update File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_values (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 197, in test_values File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 213, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 241, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_add (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 66, in test_add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_add_and_close (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 780, in test_add_and_close File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_add_from_string (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 754, in test_add_from_string File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_add_mbox_or_mmdf_message (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 762, in test_add_mbox_or_mmdf_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_clear (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 298, in test_clear File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_close (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 388, in test_close File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 392, in _test_flush_or_close File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_contains (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 238, in test_contains File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 550, in __contains__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_delitem (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 86, in test_delitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 90, in _test_remove_or_delitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_discard (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 114, in test_discard File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_file_perms (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 849, in test_file_perms File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_flush (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 376, in test_flush File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 392, in _test_flush_or_close File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 126, in test_get File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_file (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 168, in test_get_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_message (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 151, in test_get_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_string (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 161, in test_get_string File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_getitem (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 141, in test_getitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_items (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 206, in test_items File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 125, in items File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 116, in iteritems File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_iter (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 193, in test_iter File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 100, in itervalues File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_iteritems (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 202, in test_iteritems File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 125, in items File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 116, in iteritems File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_iterkeys (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 179, in test_iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_itervalues (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 188, in test_itervalues File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 112, in values File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 100, in itervalues File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_keys (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 183, in test_keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_len (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 259, in test_len File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 555, in __len__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_open_close_open (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 768, in test_open_close_open File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_pop (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 308, in test_pop File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_popitem (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 328, in test_popitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_relock (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 823, in test_relock File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_remove (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 82, in test_remove File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 90, in _test_remove_or_delitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_set_item (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 269, in test_set_item File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_update (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 342, in test_update File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_values (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 197, in test_values File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 112, in values File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 100, in itervalues File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 746, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_add (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 66, in test_add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_add_and_close (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 780, in test_add_and_close File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_add_from_string (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 754, in test_add_from_string File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_add_mbox_or_mmdf_message (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 762, in test_add_mbox_or_mmdf_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_clear (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 298, in test_clear File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_close (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 388, in test_close File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 392, in _test_flush_or_close File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_contains (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 238, in test_contains File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 550, in __contains__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_delitem (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 86, in test_delitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 90, in _test_remove_or_delitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_discard (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 114, in test_discard File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_flush (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 376, in test_flush File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 392, in _test_flush_or_close File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 126, in test_get File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_file (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 168, in test_get_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_message (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 151, in test_get_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_string (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 161, in test_get_string File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_getitem (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 141, in test_getitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_items (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 206, in test_items File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 125, in items File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 116, in iteritems File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_iter (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 193, in test_iter File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 100, in itervalues File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_iteritems (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 202, in test_iteritems File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 125, in items File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 116, in iteritems File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_iterkeys (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 179, in test_iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_itervalues (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 188, in test_itervalues File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 112, in values File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 100, in itervalues File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_keys (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 183, in test_keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_len (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 259, in test_len File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 555, in __len__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_open_close_open (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 768, in test_open_close_open File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_pop (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 308, in test_pop File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_popitem (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 328, in test_popitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_relock (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 823, in test_relock File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_remove (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 82, in test_remove File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 90, in _test_remove_or_delitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_set_item (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 269, in test_set_item File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_update (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 342, in test_update File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_values (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 197, in test_values File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 112, in values File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 100, in itervalues File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 782, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_add (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 66, in test_add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_clear (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 298, in test_clear File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_close (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 388, in test_close File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 392, in _test_flush_or_close File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_contains (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 239, in test_contains File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_delitem (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 86, in test_delitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 90, in _test_remove_or_delitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_discard (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 114, in test_discard File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_flush (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 376, in test_flush File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 392, in _test_flush_or_close File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_get (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 126, in test_get File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_get_file (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 168, in test_get_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_get_folder (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 884, in test_get_folder File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_get_message (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 151, in test_get_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_get_string (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 161, in test_get_string File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_getitem (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 141, in test_getitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_items (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 206, in test_items File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 213, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_iter (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 193, in test_iter File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 213, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_iteritems (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 202, in test_iteritems File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 213, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_iterkeys (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 179, in test_iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 213, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_itervalues (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 188, in test_itervalues File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 213, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_keys (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 183, in test_keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 213, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_len (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 260, in test_len File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_pack (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 944, in test_pack File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 200, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_pop (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 308, in test_pop File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_popitem (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 328, in test_popitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_remove (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 82, in test_remove File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 90, in _test_remove_or_delitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_sequences (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 916, in test_sequences File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1022, in get_sequences File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_set_item (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 269, in test_set_item File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_update (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 342, in test_update File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_values (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 197, in test_values File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 213, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 832, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 205, in _dump_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_add (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 66, in test_add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1125, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_clear (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 298, in test_clear File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1125, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_close (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 388, in test_close File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 392, in _test_flush_or_close File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1125, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_contains (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 238, in test_contains File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 550, in __contains__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_delitem (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 86, in test_delitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 90, in _test_remove_or_delitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1125, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_discard (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 114, in test_discard File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1125, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_flush (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 376, in test_flush File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 392, in _test_flush_or_close File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1125, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 126, in test_get File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1125, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_file (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 168, in test_get_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1125, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_message (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 151, in test_get_message File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1125, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_get_string (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 161, in test_get_string File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1125, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_getitem (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 141, in test_getitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1125, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_items (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 206, in test_items File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 125, in items File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 116, in iteritems File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_iter (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 193, in test_iter File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 100, in itervalues File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_iteritems (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 202, in test_iteritems File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 125, in items File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 116, in iteritems File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_iterkeys (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 179, in test_iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_itervalues (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 188, in test_itervalues File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 112, in values File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 100, in itervalues File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_keys (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 183, in test_keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_labels (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 994, in test_labels File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1193, in get_labels File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_len (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 259, in test_len File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 555, in __len__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_pop (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 308, in test_pop File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1125, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_popitem (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 328, in test_popitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1125, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_remove (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 82, in test_remove File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 90, in _test_remove_or_delitem File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1125, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_set_item (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 269, in test_set_item File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1125, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_update (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 342, in test_update File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1125, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 524, in add File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_values (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 197, in test_values File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 209, in _check_iteration File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 112, in values File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 100, in itervalues File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 96, in keys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 544, in iterkeys File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 650, in _lookup File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/mailbox.py", line 1208, in _generate_toc File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_initialize_with_file (test.test_mailbox.TestMessage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 1037, in test_initialize_with_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_initialize_with_file (test.test_mailbox.TestMaildirMessage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 1037, in test_initialize_with_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_initialize_with_file (test.test_mailbox.TestMboxMessage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 1037, in test_initialize_with_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_initialize_with_file (test.test_mailbox.TestMHMessage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 1037, in test_initialize_with_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_initialize_with_file (test.test_mailbox.TestBabylMessage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 1037, in test_initialize_with_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_initialize_with_file (test.test_mailbox.TestMMDFMessage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 1037, in test_initialize_with_file File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_nonempty_maildir_both (test.test_mailbox.MaildirTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 1808, in test_nonempty_maildir_both File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 1770, in createMessage File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_nonempty_maildir_cur (test.test_mailbox.MaildirTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 1792, in test_nonempty_maildir_cur File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 1770, in createMessage File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_nonempty_maildir_new (test.test_mailbox.MaildirTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 1800, in test_nonempty_maildir_new File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mailbox.py", line 1770, in createMessage File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_testfile (test.test_math.MathTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_math.py", line 862, in test_testfile File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_math.py", line 31, in parse_testfile File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1746, in __next__ File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1819, in readline File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1567, in _read_chunk File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1301, in decode File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 23, in decode AttributeError: 'NoneType' object has no attribute 'charmap_decode' ====================================================================== ERROR: test_find_end (test.test_mmap.MmapTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mmap.py", line 262, in test_find_end File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_rfind (test.test_mmap.MmapTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_mmap.py", line 280, in test_rfind File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_absolute_imports (test.test_modulefinder.ModuleFinderTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 264, in test_absolute_imports File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 223, in _do_test File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 216, in create_package File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_maybe (test.test_modulefinder.ModuleFinderTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 256, in test_maybe File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 223, in _do_test File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 216, in create_package File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_maybe_new (test.test_modulefinder.ModuleFinderTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 261, in test_maybe_new File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 223, in _do_test File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 216, in create_package File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_package (test.test_modulefinder.ModuleFinderTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 253, in test_package File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 223, in _do_test File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 216, in create_package File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_relative_imports (test.test_modulefinder.ModuleFinderTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 267, in test_relative_imports File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 223, in _do_test File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 216, in create_package File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_relative_imports_2 (test.test_modulefinder.ModuleFinderTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 270, in test_relative_imports_2 File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 223, in _do_test File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 216, in create_package File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' ====================================================================== ERROR: test_relative_imports_3 (test.test_modulefinder.ModuleFinderTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 273, in test_relative_imports_3 File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 223, in _do_test File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/test/test_modulefinder.py", line 216, in create_package File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/io.py", line 1496, in write File "/Users/buildbot/buildarea/3.0.heller-x86-osx5/build/Lib/encodings/mac_roman.py", line 19, in encode AttributeError: 'NoneType' object has no attribute 'charmap_encode' sincerely, -The Buildbot From python-checkins at python.org Mon Feb 2 11:48:00 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 2 Feb 2009 11:48:00 +0100 (CET) Subject: [Python-checkins] r69204 - sandbox/trunk/dbm_sqlite/alt/dbsqlite.py Message-ID: <20090202104800.2B0BB1E4002@bag.python.org> Author: raymond.hettinger Date: Mon Feb 2 11:47:59 2009 New Revision: 69204 Log: Using a primary key. Separate index no longer needed. Modified: sandbox/trunk/dbm_sqlite/alt/dbsqlite.py Modified: sandbox/trunk/dbm_sqlite/alt/dbsqlite.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbsqlite.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbsqlite.py Mon Feb 2 11:47:59 2009 @@ -34,7 +34,6 @@ self.conn = sqlite3.connect(filename) self.conn.text_factory = bytes self.conn.execute(MAKE_SHELF) - self.conn.execute(MAKE_INDEX) self.conn.commit() def __len__(self): From python-checkins at python.org Mon Feb 2 15:23:17 2009 From: python-checkins at python.org (martin.v.loewis) Date: Mon, 2 Feb 2009 15:23:17 +0100 (CET) Subject: [Python-checkins] r69205 - in python/trunk: Misc/NEWS PC/getpathp.c Message-ID: <20090202142317.469B31E4002@bag.python.org> Author: martin.v.loewis Date: Mon Feb 2 15:23:16 2009 New Revision: 69205 Log: Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. Modified: python/trunk/Misc/NEWS python/trunk/PC/getpathp.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Feb 2 15:23:16 2009 @@ -397,6 +397,8 @@ Build ----- +- Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. + - Issue #4895: Use _strdup on Windows CE. - Issue #4472: "configure --enable-shared" now works on OSX Modified: python/trunk/PC/getpathp.c ============================================================================== --- python/trunk/PC/getpathp.c (original) +++ python/trunk/PC/getpathp.c Mon Feb 2 15:23:16 2009 @@ -201,6 +201,7 @@ } #ifdef MS_WINDOWS +#ifdef Py_ENABLE_SHARED /* a string loaded from the DLL at startup.*/ extern const char *PyWin_DLLVersionString; @@ -363,6 +364,7 @@ free(keyBuf); return retval; } +#endif /* Py_ENABLE_SHARED */ #endif /* MS_WINDOWS */ static void @@ -380,6 +382,7 @@ but makes no mention of the null terminator. Play it safe. PLUS Windows itself defines MAX_PATH as the same, but anyway... */ +#ifdef Py_ENABLE_SHARED wprogpath[MAXPATHLEN]=_T('\0'); if (PyWin_DLLhModule && GetModuleFileName(PyWin_DLLhModule, wprogpath, MAXPATHLEN)) { @@ -388,6 +391,9 @@ dllpath, MAXPATHLEN+1, NULL, NULL); } +#else + dllpath[0] = 0; +#endif wprogpath[MAXPATHLEN]=_T('\0'); if (GetModuleFileName(NULL, wprogpath, MAXPATHLEN)) { WideCharToMultiByte(CP_ACP, 0, @@ -398,9 +404,13 @@ } #else /* static init of progpath ensures final char remains \0 */ +#ifdef Py_ENABLE_SHARED if (PyWin_DLLhModule) if (!GetModuleFileName(PyWin_DLLhModule, dllpath, MAXPATHLEN)) dllpath[0] = 0; +#else + dllpath[0] = 0; +#endif if (GetModuleFileName(NULL, progpath, MAXPATHLEN)) return; #endif @@ -501,8 +511,10 @@ } skiphome = pythonhome==NULL ? 0 : 1; +#ifdef Py_ENABLE_SHARED machinepath = getpythonregpath(HKEY_LOCAL_MACHINE, skiphome); userpath = getpythonregpath(HKEY_CURRENT_USER, skiphome); +#endif /* We only use the default relative PYTHONPATH if we havent anything better to use! */ skipdefault = envpath!=NULL || pythonhome!=NULL || \ From python-checkins at python.org Mon Feb 2 15:24:18 2009 From: python-checkins at python.org (martin.v.loewis) Date: Mon, 2 Feb 2009 15:24:18 +0100 (CET) Subject: [Python-checkins] r69206 - in python/branches/release26-maint: Misc/NEWS PC/getpathp.c Message-ID: <20090202142418.9480E1E4002@bag.python.org> Author: martin.v.loewis Date: Mon Feb 2 15:24:18 2009 New Revision: 69206 Log: Merged revisions 69205 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69205 | martin.v.loewis | 2009-02-02 15:23:16 +0100 (Mo, 02 Feb 2009) | 1 line Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/PC/getpathp.c Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Mon Feb 2 15:24:18 2009 @@ -311,6 +311,8 @@ Build ----- +- Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. + - Issue #4895: Use _strdup on Windows CE. - Issue #4472: "configure --enable-shared" now works on OSX Modified: python/branches/release26-maint/PC/getpathp.c ============================================================================== --- python/branches/release26-maint/PC/getpathp.c (original) +++ python/branches/release26-maint/PC/getpathp.c Mon Feb 2 15:24:18 2009 @@ -201,6 +201,7 @@ } #ifdef MS_WINDOWS +#ifdef Py_ENABLE_SHARED /* a string loaded from the DLL at startup.*/ extern const char *PyWin_DLLVersionString; @@ -363,6 +364,7 @@ free(keyBuf); return retval; } +#endif /* Py_ENABLE_SHARED */ #endif /* MS_WINDOWS */ static void @@ -380,6 +382,7 @@ but makes no mention of the null terminator. Play it safe. PLUS Windows itself defines MAX_PATH as the same, but anyway... */ +#ifdef Py_ENABLE_SHARED wprogpath[MAXPATHLEN]=_T('\0'); if (PyWin_DLLhModule && GetModuleFileName(PyWin_DLLhModule, wprogpath, MAXPATHLEN)) { @@ -388,6 +391,9 @@ dllpath, MAXPATHLEN+1, NULL, NULL); } +#else + dllpath[0] = 0; +#endif wprogpath[MAXPATHLEN]=_T('\0'); if (GetModuleFileName(NULL, wprogpath, MAXPATHLEN)) { WideCharToMultiByte(CP_ACP, 0, @@ -398,9 +404,13 @@ } #else /* static init of progpath ensures final char remains \0 */ +#ifdef Py_ENABLE_SHARED if (PyWin_DLLhModule) if (!GetModuleFileName(PyWin_DLLhModule, dllpath, MAXPATHLEN)) dllpath[0] = 0; +#else + dllpath[0] = 0; +#endif if (GetModuleFileName(NULL, progpath, MAXPATHLEN)) return; #endif @@ -501,8 +511,10 @@ } skiphome = pythonhome==NULL ? 0 : 1; +#ifdef Py_ENABLE_SHARED machinepath = getpythonregpath(HKEY_LOCAL_MACHINE, skiphome); userpath = getpythonregpath(HKEY_CURRENT_USER, skiphome); +#endif /* We only use the default relative PYTHONPATH if we havent anything better to use! */ skipdefault = envpath!=NULL || pythonhome!=NULL || \ From python-checkins at python.org Mon Feb 2 16:32:22 2009 From: python-checkins at python.org (martin.v.loewis) Date: Mon, 2 Feb 2009 16:32:22 +0100 (CET) Subject: [Python-checkins] r69207 - in python/branches/py3k: Misc/NEWS PC/getpathp.c Message-ID: <20090202153222.55B771E403B@bag.python.org> Author: martin.v.loewis Date: Mon Feb 2 16:32:22 2009 New Revision: 69207 Log: Merged revisions 69205 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69205 | martin.v.loewis | 2009-02-02 15:23:16 +0100 (Mo, 02 Feb 2009) | 1 line Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/PC/getpathp.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon Feb 2 16:32:22 2009 @@ -375,6 +375,8 @@ Build ----- +- Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. + - Issue #4895: Use _strdup on Windows CE. - Issue #4472: "configure --enable-shared" now works on OSX Modified: python/branches/py3k/PC/getpathp.c ============================================================================== --- python/branches/py3k/PC/getpathp.c (original) +++ python/branches/py3k/PC/getpathp.c Mon Feb 2 16:32:22 2009 @@ -200,6 +200,7 @@ } #ifdef MS_WINDOWS +#ifdef Py_ENABLE_SHARED /* a string loaded from the DLL at startup.*/ extern const char *PyWin_DLLVersionString; @@ -349,6 +350,7 @@ free(keyBuf); return retval; } +#endif /* Py_ENABLE_SHARED */ #endif /* MS_WINDOWS */ static void @@ -359,11 +361,15 @@ wchar_t *prog = Py_GetProgramName(); #ifdef MS_WINDOWS +#ifdef Py_ENABLE_SHARED extern HANDLE PyWin_DLLhModule; /* static init of progpath ensures final char remains \0 */ if (PyWin_DLLhModule) if (!GetModuleFileNameW(PyWin_DLLhModule, dllpath, MAXPATHLEN)) dllpath[0] = 0; +#else + dllpath[0] = 0; +#endif if (GetModuleFileNameW(NULL, progpath, MAXPATHLEN)) return; #endif @@ -471,8 +477,10 @@ } skiphome = pythonhome==NULL ? 0 : 1; +#ifdef Py_ENABLE_SHARED machinepath = getpythonregpath(HKEY_LOCAL_MACHINE, skiphome); userpath = getpythonregpath(HKEY_CURRENT_USER, skiphome); +#endif /* We only use the default relative PYTHONPATH if we havent anything better to use! */ skipdefault = envpath!=NULL || pythonhome!=NULL || \ From python-checkins at python.org Mon Feb 2 16:34:13 2009 From: python-checkins at python.org (martin.v.loewis) Date: Mon, 2 Feb 2009 16:34:13 +0100 (CET) Subject: [Python-checkins] r69208 - in python/branches/release30-maint: Misc/NEWS PC/getpathp.c Message-ID: <20090202153413.19C2A1E4002@bag.python.org> Author: martin.v.loewis Date: Mon Feb 2 16:34:12 2009 New Revision: 69208 Log: Merged revisions 69207 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69207 | martin.v.loewis | 2009-02-02 16:32:22 +0100 (Mo, 02 Feb 2009) | 9 lines Merged revisions 69205 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69205 | martin.v.loewis | 2009-02-02 15:23:16 +0100 (Mo, 02 Feb 2009) | 1 line Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/PC/getpathp.c Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Mon Feb 2 16:34:12 2009 @@ -252,6 +252,8 @@ Build ----- +- Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. + - Issue #4472: "configure --enable-shared" now works on OSX - Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds. Modified: python/branches/release30-maint/PC/getpathp.c ============================================================================== --- python/branches/release30-maint/PC/getpathp.c (original) +++ python/branches/release30-maint/PC/getpathp.c Mon Feb 2 16:34:12 2009 @@ -200,6 +200,7 @@ } #ifdef MS_WINDOWS +#ifdef Py_ENABLE_SHARED /* a string loaded from the DLL at startup.*/ extern const char *PyWin_DLLVersionString; @@ -349,6 +350,7 @@ free(keyBuf); return retval; } +#endif /* Py_ENABLE_SHARED */ #endif /* MS_WINDOWS */ static void @@ -359,11 +361,15 @@ wchar_t *prog = Py_GetProgramName(); #ifdef MS_WINDOWS +#ifdef Py_ENABLE_SHARED extern HANDLE PyWin_DLLhModule; /* static init of progpath ensures final char remains \0 */ if (PyWin_DLLhModule) if (!GetModuleFileNameW(PyWin_DLLhModule, dllpath, MAXPATHLEN)) dllpath[0] = 0; +#else + dllpath[0] = 0; +#endif if (GetModuleFileNameW(NULL, progpath, MAXPATHLEN)) return; #endif @@ -471,8 +477,10 @@ } skiphome = pythonhome==NULL ? 0 : 1; +#ifdef Py_ENABLE_SHARED machinepath = getpythonregpath(HKEY_LOCAL_MACHINE, skiphome); userpath = getpythonregpath(HKEY_CURRENT_USER, skiphome); +#endif /* We only use the default relative PYTHONPATH if we havent anything better to use! */ skipdefault = envpath!=NULL || pythonhome!=NULL || \ From buildbot at python.org Mon Feb 2 16:55:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 15:55:17 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090202155517.F05291E4002@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/270 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 failed slave lost sincerely, -The Buildbot From python-checkins at python.org Mon Feb 2 17:04:04 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Mon, 2 Feb 2009 17:04:04 +0100 (CET) Subject: [Python-checkins] r69209 - in python/branches/py3k/Lib: http/client.py xmlrpc/client.py Message-ID: <20090202160404.C8CFD1E4002@bag.python.org> Author: kristjan.jonsson Date: Mon Feb 2 17:04:04 2009 New Revision: 69209 Log: merging / reimplementing r68532 from the trunk to Py3k Enable buffering for HTTPResponse's fp. read() behaves identically for buffered and non-buffered IO. read(n) also won't block if n bytes are availble on the socket. There is therefore no reason not to use buffering. The reason 2.x disables buffering by default, that some clients may be accessing the underlying socket directly and so bypass the buffering buffer, doesn't apply in 3.x with its redesigned IO library. See issue 4448 and issue 4879 Modified: python/branches/py3k/Lib/http/client.py python/branches/py3k/Lib/xmlrpc/client.py Modified: python/branches/py3k/Lib/http/client.py ============================================================================== --- python/branches/py3k/Lib/http/client.py (original) +++ python/branches/py3k/Lib/http/client.py Mon Feb 2 17:04:04 2009 @@ -265,14 +265,14 @@ # accepts iso-8859-1. def __init__(self, sock, debuglevel=0, strict=0, method=None): - # XXX If the response includes a content-length header, we + # If the response includes a content-length header, we # need to make sure that the client doesn't read more than the # specified number of bytes. If it does, it will block until # the server times out and closes the connection. (The only - # applies to HTTP/1.1 connections.) Since some clients access - # self.fp directly rather than calling read(), this is a little - # tricky. - self.fp = sock.makefile("rb", 0) + # applies to HTTP/1.1 connections.) This will happen if a self.fp.read() + # is done (without a size) whether self.fp is buffered or not. + # So, no self.fp.read() by clients unless they know what they are doing. + self.fp = sock.makefile("rb") self.debuglevel = debuglevel self.strict = strict self._method = method Modified: python/branches/py3k/Lib/xmlrpc/client.py ============================================================================== --- python/branches/py3k/Lib/xmlrpc/client.py (original) +++ python/branches/py3k/Lib/xmlrpc/client.py Mon Feb 2 17:04:04 2009 @@ -1129,7 +1129,7 @@ self.verbose = verbose - return self._parse_response(resp, None) + return self.parse_response(resp) ## # Create parser. @@ -1212,29 +1212,12 @@ # @return Response tuple and target method. def parse_response(self, file): - # compatibility interface - return self._parse_response(file, None) - - ## - # Parse response (alternate interface). This is similar to the - # parse_response method, but also provides direct access to the - # underlying socket object (where available). - # - # @param file Stream. - # @param sock Socket handle (or None, if the socket object - # could not be accessed). - # @return Response tuple and target method. - - def _parse_response(self, file, sock): # read response from input file/socket, and parse it p, u = self.getparser() while 1: - if sock: - response = sock.recv(1024) - else: - response = file.read(1024) + response = file.read(1024) if not response: break if self.verbose: From buildbot at python.org Mon Feb 2 18:20:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 17:20:06 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090202172007.0613B1E4015@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/240 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: kristjan.jonsson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_urllib test_urllib2net ====================================================================== ERROR: test_empty_socket (test.test_urllib.urlopen_HttpTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_urllib.py", line 194, in test_empty_socket self.assertRaises(IOError, urlopen, "http://something") File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/unittest.py", line 344, in failUnlessRaises callableObj(*args, **kwargs) File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_urllib.py", line 33, in urlopen return opener.open(url) File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/urllib/request.py", line 1444, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/urllib/request.py", line 1618, in open_http return self._open_generic_http(http.client.HTTPConnection, url, data) File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/urllib/request.py", line 1601, in _open_generic_http response = http_conn.getresponse() File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/http/client.py", line 937, in getresponse method=self._method) File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/http/client.py", line 275, in __init__ self.fp = sock.makefile("rb") TypeError: makefile() takes exactly 3 positional arguments (2 given) ====================================================================== ERROR: test_read (test.test_urllib.urlopen_HttpTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_urllib.py", line 168, in test_read fp = urlopen("http://python.org/") File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_urllib.py", line 33, in urlopen return opener.open(url) File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/urllib/request.py", line 1444, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/urllib/request.py", line 1618, in open_http return self._open_generic_http(http.client.HTTPConnection, url, data) File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/urllib/request.py", line 1601, in _open_generic_http response = http_conn.getresponse() File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/http/client.py", line 937, in getresponse method=self._method) File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/http/client.py", line 275, in __init__ self.fp = sock.makefile("rb") TypeError: makefile() takes exactly 3 positional arguments (2 given) ====================================================================== ERROR: test_read_bogus (test.test_urllib.urlopen_HttpTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_urllib.py", line 185, in test_read_bogus self.assertRaises(IOError, urlopen, "http://python.org/") File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/unittest.py", line 344, in failUnlessRaises callableObj(*args, **kwargs) File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_urllib.py", line 33, in urlopen return opener.open(url) File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/urllib/request.py", line 1444, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/urllib/request.py", line 1618, in open_http return self._open_generic_http(http.client.HTTPConnection, url, data) File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/urllib/request.py", line 1601, in _open_generic_http response = http_conn.getresponse() File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/http/client.py", line 937, in getresponse method=self._method) File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/http/client.py", line 275, in __init__ self.fp = sock.makefile("rb") TypeError: makefile() takes exactly 3 positional arguments (2 given) ====================================================================== ERROR: test_http_basic (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_urllib2net.py", line 198, in test_http_basic self.assertTrue(u.fp._sock.gettimeout() is None) AttributeError: 'BufferedReader' object has no attribute '_sock' ====================================================================== ERROR: test_http_default_timeout (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_urllib2net.py", line 207, in test_http_default_timeout self.assertEqual(u.fp._sock.gettimeout(), 60) AttributeError: 'BufferedReader' object has no attribute '_sock' ====================================================================== ERROR: test_http_no_timeout (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_urllib2net.py", line 216, in test_http_no_timeout self.assertTrue(u.fp._sock.gettimeout() is None) AttributeError: 'BufferedReader' object has no attribute '_sock' ====================================================================== ERROR: test_http_timeout (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_urllib2net.py", line 220, in test_http_timeout self.assertEqual(u.fp._sock.gettimeout(), 120) AttributeError: 'BufferedReader' object has no attribute '_sock' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Feb 2 18:27:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 17:27:45 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090202172745.D53E21E4002@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/209 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: kristjan.jonsson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_urllib test_urllib2net ====================================================================== ERROR: test_empty_socket (test.test_urllib.urlopen_HttpTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_urllib.py", line 194, in test_empty_socket self.assertRaises(IOError, urlopen, "http://something") File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/unittest.py", line 344, in failUnlessRaises callableObj(*args, **kwargs) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_urllib.py", line 33, in urlopen return opener.open(url) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 1444, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 1618, 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 1601, in _open_generic_http response = http_conn.getresponse() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/http/client.py", line 937, in getresponse method=self._method) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/http/client.py", line 275, in __init__ self.fp = sock.makefile("rb") TypeError: makefile() takes exactly 3 positional arguments (2 given) ====================================================================== ERROR: test_read (test.test_urllib.urlopen_HttpTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_urllib.py", line 168, in test_read fp = urlopen("http://python.org/") File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_urllib.py", line 33, in urlopen return opener.open(url) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 1444, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 1618, 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 1601, in _open_generic_http response = http_conn.getresponse() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/http/client.py", line 937, in getresponse method=self._method) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/http/client.py", line 275, in __init__ self.fp = sock.makefile("rb") TypeError: makefile() takes exactly 3 positional arguments (2 given) ====================================================================== ERROR: test_read_bogus (test.test_urllib.urlopen_HttpTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_urllib.py", line 185, in test_read_bogus self.assertRaises(IOError, urlopen, "http://python.org/") File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/unittest.py", line 344, in failUnlessRaises callableObj(*args, **kwargs) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_urllib.py", line 33, in urlopen return opener.open(url) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 1444, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 1618, 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 1601, in _open_generic_http response = http_conn.getresponse() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/http/client.py", line 937, in getresponse method=self._method) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/http/client.py", line 275, in __init__ self.fp = sock.makefile("rb") TypeError: makefile() takes exactly 3 positional arguments (2 given) ====================================================================== ERROR: test_http_basic (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 198, in test_http_basic self.assertTrue(u.fp._sock.gettimeout() is None) AttributeError: 'BufferedReader' object has no attribute '_sock' ====================================================================== ERROR: test_http_default_timeout (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 207, in test_http_default_timeout self.assertEqual(u.fp._sock.gettimeout(), 60) AttributeError: 'BufferedReader' object has no attribute '_sock' ====================================================================== ERROR: test_http_no_timeout (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 216, in test_http_no_timeout self.assertTrue(u.fp._sock.gettimeout() is None) AttributeError: 'BufferedReader' object has no attribute '_sock' ====================================================================== ERROR: test_http_timeout (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 220, in test_http_timeout self.assertEqual(u.fp._sock.gettimeout(), 120) AttributeError: 'BufferedReader' object has no attribute '_sock' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Feb 2 18:33:16 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 17:33:16 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090202173316.A30B41E4002@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/120 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 43, 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 Feb 2 20:19:36 2009 From: python-checkins at python.org (brett.cannon) Date: Mon, 2 Feb 2009 20:19:36 +0100 (CET) Subject: [Python-checkins] r69210 - python/branches/py3k/Lib/importlib/_bootstrap.py Message-ID: <20090202191936.DAAB61E4015@bag.python.org> Author: brett.cannon Date: Mon Feb 2 20:19:36 2009 New Revision: 69210 Log: To prevent another screw-up on my part where my prototype gets lost thanks to an ``svn revert`` (gee, maybe more atomic commits by use of something like a DVCS would help with this? Wish someone would get on that ...), I am checking in an untested, work-in-progress meta path finder to handle sys.path. Modified: python/branches/py3k/Lib/importlib/_bootstrap.py Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Mon Feb 2 20:19:36 2009 @@ -589,6 +589,82 @@ super(PyFileImporter, self).__init__(path_entry) +class SysPathFinder: + + """Meta path finder for sys.(path|path_hooks|path_importer_cache).""" + + def _default_hook(self, path): + """Use the default hook on 'path'. + + If the path will not work for the default hook then raise ImportError. + + """ + # TODO(brett.cannon) Implement + raise ImportError + + # The list of implicit hooks cannot be a class attribute because of + # bootstrapping issues for accessing imp. + def _implicit_hooks(self, path): + """Return a list of the implicit path hooks.""" + return [self._default_hook, imp.NullImporter] + + def _path_hooks(self, path): + """Search sys.path_hooks for a finder for 'path'. + + Guaranteed to return a finder for the path as NullImporter is the + default importer for any path that does not have an explicit finder. + + """ + for hook in sys.path_hooks + self._implicit_hooks(): + try: + return hook(path) + except ImportError: + continue + else: + # This point should never be reached thanks to NullImporter. + raise SystemError("no hook could find an importer for " + "{0}".format(path)) + + def _path_importer_cache(self, path): + """Get the finder for the path from sys.path_importer_cache. + + If the path is not in the cache, find the appropriate finder and cache + it. If None is cached, get the default finder and cache that + (if applicable). + + Because of NullImporter, some finder should be returned. The only + explicit fail case is if None is cached but the path cannot be used for + the default hook, for which ImportError is raised. + + """ + try: + finder = sys.path_importer_cache(path); + except KeyError: + finder = self._path_hooks(path) + sys.path_importer_cache[path] = finder + else: + if finder is None: + # Raises ImportError on failure. + finder = self._default_hook(path) + sys.path_importer_cache[path] = finder + return finder + + def find_module(self, fullname, path=None): + """Find the module on sys.path or 'path'.""" + if not path: + path = sys.path + for entry in path: + try: + finder = self._path_importer_cache(entry) + except ImportError: + continue + loader = finder.find_module(fullname) + if loader: + return loader + else: + return None + + class ImportLockContext(object): """Context manager for the import lock.""" From python-checkins at python.org Mon Feb 2 21:23:30 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 2 Feb 2009 21:23:30 +0100 (CET) Subject: [Python-checkins] r69211 - python/trunk/Lib/lib-tk/test/test_ttk/test_extensions.py Message-ID: <20090202202330.0B6561E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 2 21:23:29 2009 New Revision: 69211 Log: Restore the previous geometry before leaving the test Modified: python/trunk/Lib/lib-tk/test/test_ttk/test_extensions.py Modified: python/trunk/Lib/lib-tk/test/test_ttk/test_extensions.py ============================================================================== --- python/trunk/Lib/lib-tk/test/test_ttk/test_extensions.py (original) +++ python/trunk/Lib/lib-tk/test/test_ttk/test_extensions.py Mon Feb 2 21:23:29 2009 @@ -167,14 +167,15 @@ x.update() width, height = x.master.winfo_width(), x.master.winfo_height() - width, height = width * 2, height * 2 + width_new, height_new = width * 2, height * 2 x.value = 3 x.update() - x.master.wm_geometry("%dx%d" % (width, height)) + x.master.wm_geometry("%dx%d" % (width_new, height_new)) self.failUnlessEqual(int(x.label.place_info()['x']), x.scale.coords()[0]) + # Reset geometry x.master.wm_geometry("%dx%d" % (width, height)) x.destroy() From python-checkins at python.org Mon Feb 2 21:28:59 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 2 Feb 2009 21:28:59 +0100 (CET) Subject: [Python-checkins] r69212 - python/trunk/Lib/lib-tk/test/runtktests.py Message-ID: <20090202202859.59BD31E403E@bag.python.org> Author: guilherme.polo Date: Mon Feb 2 21:28:59 2009 New Revision: 69212 Log: Moving to importlib Modified: python/trunk/Lib/lib-tk/test/runtktests.py Modified: python/trunk/Lib/lib-tk/test/runtktests.py ============================================================================== --- python/trunk/Lib/lib-tk/test/runtktests.py (original) +++ python/trunk/Lib/lib-tk/test/runtktests.py Mon Feb 2 21:28:59 2009 @@ -9,6 +9,7 @@ import os import sys import unittest +import importlib import test.test_support this_dir_path = os.path.abspath(os.path.dirname(__file__)) @@ -44,10 +45,8 @@ for name in filenames: try: - yield __import__( - "%s.%s" % (pkg_name, name[:-len(py_ext)]), - fromlist=[''] - ) + yield importlib.import_module( + ".%s" % name[:-len(py_ext)], pkg_name) except test.test_support.ResourceDenied: if gui: raise From python-checkins at python.org Mon Feb 2 21:32:30 2009 From: python-checkins at python.org (brett.cannon) Date: Mon, 2 Feb 2009 21:32:30 +0100 (CET) Subject: [Python-checkins] r69213 - python/branches/py3k/Lib/importlib/NOTES Message-ID: <20090202203230.46A171E4002@bag.python.org> Author: brett.cannon Date: Mon Feb 2 21:32:29 2009 New Revision: 69213 Log: Add some notes for importlib to package up what is in Python 2.7 as well as modules that can probably get replaced by importlib at some point. Modified: python/branches/py3k/Lib/importlib/NOTES Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Mon Feb 2 21:32:29 2009 @@ -1,6 +1,8 @@ to do ///// +* Create sandbox directory for a distutils packaging of what is in Python 2.7. + * Use rpartition for getting the package of a module. + Make sure that an empty string is acceptable for __package__. @@ -77,3 +79,9 @@ - Relative name from sys.path. * Bootstrap importlib as implementation of builtins.__import__ + +* Replace standard library modules. + + + imp + + py_compile + + compileall From python-checkins at python.org Mon Feb 2 21:36:44 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 2 Feb 2009 21:36:44 +0100 (CET) Subject: [Python-checkins] r69214 - in python/branches/py3k: Include/object.h Misc/NEWS Modules/_bytesio.c Modules/_collectionsmodule.c Modules/_csv.c Modules/_ctypes/_ctypes.c Modules/_ctypes/callbacks.c Modules/_ctypes/callproc.c Modules/_ctypes/cfield.c Modules/_ctypes/stgdict.c Modules/_curses_panel.c Modules/_cursesmodule.c Modules/_dbmmodule.c Modules/_elementtree.c Modules/_fileio.c Modules/_functoolsmodule.c Modules/_gdbmmodule.c Modules/_hashopenssl.c Modules/_lsprof.c Modules/_multiprocessing/connection.h Modules/_multiprocessing/semaphore.c Modules/_pickle.c Modules/_randommodule.c Modules/_sqlite/cache.c Modules/_sqlite/connection.c Modules/_sqlite/cursor.c Modules/_sqlite/prepare_protocol.c Modules/_sqlite/row.c Modules/_sqlite/statement.c Modules/_sre.c Modules/_ssl.c Modules/_stringio.c Modules/_struct.c Modules/_testcapimodule.c Modules/_threadmodule.c Modules/_tkinter.c Modules/arraymodule.c Modules/bz2module.c Modules/cjkcodecs/multibytecodec.c Modules/datetimemodule.c Modules/itertoolsmodule.c Modules/md5module.c Modules/mmapmodule.c Modules/operator.c Modules/ossaudiodev.c Modules/parsermodule.c Modules/pyexpat.c Modules/selectmodule.c Modules/sha1module.c Modules/sha256module.c Modules/sha512module.c Modules/socketmodule.c Modules/unicodedata.c Modules/xxmodule.c Modules/xxsubtype.c Modules/zipimport.c Modules/zlibmodule.c Objects/boolobject.c Objects/bytearrayobject.c Objects/bytesobject.c Objects/cellobject.c Objects/classobject.c Objects/cobject.c Objects/codeobject.c Objects/complexobject.c Objects/descrobject.c Objects/dictobject.c Objects/enumobject.c Objects/exceptions.c Objects/fileobject.c Objects/floatobject.c Objects/frameobject.c Objects/funcobject.c Objects/genobject.c Objects/iterobject.c Objects/listobject.c Objects/longobject.c Objects/memoryobject.c Objects/methodobject.c Objects/moduleobject.c Objects/object.c Objects/rangeobject.c Objects/setobject.c Objects/sliceobject.c Objects/stringlib/string_format.h Objects/structseq.c Objects/tupleobject.c Objects/typeobject.c Objects/unicodeobject.c Objects/weakrefobject.c PC/_msi.c PC/_subprocess.c PC/winreg.c Parser/asdl_c.py Python/Python-ast.c Python/bltinmodule.c Python/import.c Python/symtable.c Python/traceback.c Message-ID: <20090202203644.7B9501E4002@bag.python.org> Author: mark.dickinson Date: Mon Feb 2 21:36:42 2009 New Revision: 69214 Log: Issue #1717: rename tp_compare to tp_reserved. I'll change the type of tp_compare in a separate commit, for ease of reversion should things go wrong. Modified: python/branches/py3k/Include/object.h python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_bytesio.c python/branches/py3k/Modules/_collectionsmodule.c python/branches/py3k/Modules/_csv.c python/branches/py3k/Modules/_ctypes/_ctypes.c python/branches/py3k/Modules/_ctypes/callbacks.c python/branches/py3k/Modules/_ctypes/callproc.c python/branches/py3k/Modules/_ctypes/cfield.c python/branches/py3k/Modules/_ctypes/stgdict.c python/branches/py3k/Modules/_curses_panel.c python/branches/py3k/Modules/_cursesmodule.c python/branches/py3k/Modules/_dbmmodule.c python/branches/py3k/Modules/_elementtree.c python/branches/py3k/Modules/_fileio.c python/branches/py3k/Modules/_functoolsmodule.c python/branches/py3k/Modules/_gdbmmodule.c python/branches/py3k/Modules/_hashopenssl.c python/branches/py3k/Modules/_lsprof.c python/branches/py3k/Modules/_multiprocessing/connection.h python/branches/py3k/Modules/_multiprocessing/semaphore.c python/branches/py3k/Modules/_pickle.c python/branches/py3k/Modules/_randommodule.c python/branches/py3k/Modules/_sqlite/cache.c python/branches/py3k/Modules/_sqlite/connection.c python/branches/py3k/Modules/_sqlite/cursor.c python/branches/py3k/Modules/_sqlite/prepare_protocol.c python/branches/py3k/Modules/_sqlite/row.c python/branches/py3k/Modules/_sqlite/statement.c python/branches/py3k/Modules/_sre.c python/branches/py3k/Modules/_ssl.c python/branches/py3k/Modules/_stringio.c python/branches/py3k/Modules/_struct.c python/branches/py3k/Modules/_testcapimodule.c python/branches/py3k/Modules/_threadmodule.c python/branches/py3k/Modules/_tkinter.c python/branches/py3k/Modules/arraymodule.c python/branches/py3k/Modules/bz2module.c python/branches/py3k/Modules/cjkcodecs/multibytecodec.c python/branches/py3k/Modules/datetimemodule.c python/branches/py3k/Modules/itertoolsmodule.c python/branches/py3k/Modules/md5module.c python/branches/py3k/Modules/mmapmodule.c python/branches/py3k/Modules/operator.c python/branches/py3k/Modules/ossaudiodev.c python/branches/py3k/Modules/parsermodule.c python/branches/py3k/Modules/pyexpat.c python/branches/py3k/Modules/selectmodule.c python/branches/py3k/Modules/sha1module.c python/branches/py3k/Modules/sha256module.c python/branches/py3k/Modules/sha512module.c python/branches/py3k/Modules/socketmodule.c python/branches/py3k/Modules/unicodedata.c python/branches/py3k/Modules/xxmodule.c python/branches/py3k/Modules/xxsubtype.c python/branches/py3k/Modules/zipimport.c python/branches/py3k/Modules/zlibmodule.c python/branches/py3k/Objects/boolobject.c python/branches/py3k/Objects/bytearrayobject.c python/branches/py3k/Objects/bytesobject.c python/branches/py3k/Objects/cellobject.c python/branches/py3k/Objects/classobject.c python/branches/py3k/Objects/cobject.c python/branches/py3k/Objects/codeobject.c python/branches/py3k/Objects/complexobject.c python/branches/py3k/Objects/descrobject.c python/branches/py3k/Objects/dictobject.c python/branches/py3k/Objects/enumobject.c python/branches/py3k/Objects/exceptions.c python/branches/py3k/Objects/fileobject.c python/branches/py3k/Objects/floatobject.c python/branches/py3k/Objects/frameobject.c python/branches/py3k/Objects/funcobject.c python/branches/py3k/Objects/genobject.c python/branches/py3k/Objects/iterobject.c python/branches/py3k/Objects/listobject.c python/branches/py3k/Objects/longobject.c python/branches/py3k/Objects/memoryobject.c python/branches/py3k/Objects/methodobject.c python/branches/py3k/Objects/moduleobject.c python/branches/py3k/Objects/object.c python/branches/py3k/Objects/rangeobject.c python/branches/py3k/Objects/setobject.c python/branches/py3k/Objects/sliceobject.c python/branches/py3k/Objects/stringlib/string_format.h python/branches/py3k/Objects/structseq.c python/branches/py3k/Objects/tupleobject.c python/branches/py3k/Objects/typeobject.c python/branches/py3k/Objects/unicodeobject.c python/branches/py3k/Objects/weakrefobject.c python/branches/py3k/PC/_msi.c python/branches/py3k/PC/_subprocess.c python/branches/py3k/PC/winreg.c python/branches/py3k/Parser/asdl_c.py python/branches/py3k/Python/Python-ast.c python/branches/py3k/Python/bltinmodule.c python/branches/py3k/Python/import.c python/branches/py3k/Python/symtable.c python/branches/py3k/Python/traceback.c Modified: python/branches/py3k/Include/object.h ============================================================================== --- python/branches/py3k/Include/object.h (original) +++ python/branches/py3k/Include/object.h Mon Feb 2 21:36:42 2009 @@ -297,7 +297,7 @@ printfunc tp_print; getattrfunc tp_getattr; setattrfunc tp_setattr; - cmpfunc tp_compare; + cmpfunc tp_reserved; reprfunc tp_repr; /* Method suites for standard classes */ Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon Feb 2 21:36:42 2009 @@ -14,9 +14,8 @@ - Issue #1717: Removed builtin cmp() function, dropped tp_compare slot, the C API functions PyObject_Compare and PyUnicode_Compare and - the type definition cmpfunc. The tp_compare slot is reserved for - future usage. An attempt to initialize a type with a nonzero - tp_compare slot will raise TypeError. + the type definition cmpfunc. The tp_compare slot has been renamed + to tp_reserved, and is reserved for future usage. - Issue #4707: round(x, n) now returns an integer if x is an integer. Previously it returned a float. Modified: python/branches/py3k/Modules/_bytesio.c ============================================================================== --- python/branches/py3k/Modules/_bytesio.c (original) +++ python/branches/py3k/Modules/_bytesio.c Mon Feb 2 21:36:42 2009 @@ -698,7 +698,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/_collectionsmodule.c ============================================================================== --- python/branches/py3k/Modules/_collectionsmodule.c (original) +++ python/branches/py3k/Modules/_collectionsmodule.c Mon Feb 2 21:36:42 2009 @@ -848,7 +848,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ deque_repr, /* tp_repr */ 0, /* tp_as_number */ &deque_as_sequence, /* tp_as_sequence */ @@ -978,7 +978,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1061,7 +1061,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1318,7 +1318,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)defdict_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/_csv.c ============================================================================== --- python/branches/py3k/Modules/_csv.c (original) +++ python/branches/py3k/Modules/_csv.c Mon Feb 2 21:36:42 2009 @@ -443,7 +443,7 @@ (printfunc)0, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -864,7 +864,7 @@ (printfunc)0, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ (reprfunc)0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1286,7 +1286,7 @@ (printfunc)0, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ (reprfunc)0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/_ctypes/_ctypes.c ============================================================================== --- python/branches/py3k/Modules/_ctypes/_ctypes.c (original) +++ python/branches/py3k/Modules/_ctypes/_ctypes.c Mon Feb 2 21:36:42 2009 @@ -179,7 +179,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -713,7 +713,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &CDataType_as_sequence, /* tp_as_sequence */ @@ -755,7 +755,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &CDataType_as_sequence, /* tp_as_sequence */ @@ -988,7 +988,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &CDataType_as_sequence, /* tp_as_sequence */ @@ -1390,7 +1390,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &CDataType_as_sequence, /* tp_as_sequence */ @@ -2059,7 +2059,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &CDataType_as_sequence, /* tp_as_sequence */ @@ -2277,7 +2277,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &CDataType_as_sequence, /* tp_as_sequence */ @@ -2560,7 +2560,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3889,7 +3889,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)CFuncPtr_repr, /* tp_repr */ &CFuncPtr_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -4032,7 +4032,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -4074,7 +4074,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -4383,7 +4383,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &Array_as_sequence, /* tp_as_sequence */ @@ -4615,7 +4615,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)&Simple_repr, /* tp_repr */ &Simple_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -4992,7 +4992,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ &Pointer_as_number, /* tp_as_number */ &Pointer_as_sequence, /* tp_as_sequence */ @@ -5086,7 +5086,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/_ctypes/callbacks.c ============================================================================== --- python/branches/py3k/Modules/_ctypes/callbacks.c (original) +++ python/branches/py3k/Modules/_ctypes/callbacks.c Mon Feb 2 21:36:42 2009 @@ -50,7 +50,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/_ctypes/callproc.c ============================================================================== --- python/branches/py3k/Modules/_ctypes/callproc.c (original) +++ python/branches/py3k/Modules/_ctypes/callproc.c Mon Feb 2 21:36:42 2009 @@ -512,7 +512,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)PyCArg_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/_ctypes/cfield.c ============================================================================== --- python/branches/py3k/Modules/_ctypes/cfield.c (original) +++ python/branches/py3k/Modules/_ctypes/cfield.c Mon Feb 2 21:36:42 2009 @@ -289,7 +289,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)CField_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/_ctypes/stgdict.c ============================================================================== --- python/branches/py3k/Modules/_ctypes/stgdict.c (original) +++ python/branches/py3k/Modules/_ctypes/stgdict.c Mon Feb 2 21:36:42 2009 @@ -111,7 +111,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/_curses_panel.c ============================================================================== --- python/branches/py3k/Modules/_curses_panel.c (original) +++ python/branches/py3k/Modules/_curses_panel.c Mon Feb 2 21:36:42 2009 @@ -341,7 +341,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/_cursesmodule.c ============================================================================== --- python/branches/py3k/Modules/_cursesmodule.c (original) +++ python/branches/py3k/Modules/_cursesmodule.c Mon Feb 2 21:36:42 2009 @@ -1662,7 +1662,7 @@ 0, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/_dbmmodule.c ============================================================================== --- python/branches/py3k/Modules/_dbmmodule.c (original) +++ python/branches/py3k/Modules/_dbmmodule.c Mon Feb 2 21:36:42 2009 @@ -337,7 +337,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ &dbm_as_sequence, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/_elementtree.c ============================================================================== --- python/branches/py3k/Modules/_elementtree.c (original) +++ python/branches/py3k/Modules/_elementtree.c Mon Feb 2 21:36:42 2009 @@ -1379,7 +1379,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ (setattrfunc)element_setattr, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)element_repr, /* tp_repr */ 0, /* tp_as_number */ &element_as_sequence, /* tp_as_sequence */ @@ -1803,7 +1803,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2559,7 +2559,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/_fileio.c ============================================================================== --- python/branches/py3k/Modules/_fileio.c (original) +++ python/branches/py3k/Modules/_fileio.c Mon Feb 2 21:36:42 2009 @@ -907,7 +907,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)fileio_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/_functoolsmodule.c ============================================================================== --- python/branches/py3k/Modules/_functoolsmodule.c (original) +++ python/branches/py3k/Modules/_functoolsmodule.c Mon Feb 2 21:36:42 2009 @@ -206,7 +206,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/_gdbmmodule.c ============================================================================== --- python/branches/py3k/Modules/_gdbmmodule.c (original) +++ python/branches/py3k/Modules/_gdbmmodule.c Mon Feb 2 21:36:42 2009 @@ -390,7 +390,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ &dbm_as_sequence, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/_hashopenssl.c ============================================================================== --- python/branches/py3k/Modules/_hashopenssl.c (original) +++ python/branches/py3k/Modules/_hashopenssl.c Mon Feb 2 21:36:42 2009 @@ -407,7 +407,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ (reprfunc)EVP_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/_lsprof.c ============================================================================== --- python/branches/py3k/Modules/_lsprof.c (original) +++ python/branches/py3k/Modules/_lsprof.c Mon Feb 2 21:36:42 2009 @@ -820,7 +820,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/_multiprocessing/connection.h ============================================================================== --- python/branches/py3k/Modules/_multiprocessing/connection.h (original) +++ python/branches/py3k/Modules/_multiprocessing/connection.h Mon Feb 2 21:36:42 2009 @@ -487,7 +487,7 @@ /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, - /* tp_compare */ 0, + /* tp_reserved */ 0, /* tp_repr */ (reprfunc)connection_repr, /* tp_as_number */ 0, /* tp_as_sequence */ 0, Modified: python/branches/py3k/Modules/_multiprocessing/semaphore.c ============================================================================== --- python/branches/py3k/Modules/_multiprocessing/semaphore.c (original) +++ python/branches/py3k/Modules/_multiprocessing/semaphore.c Mon Feb 2 21:36:42 2009 @@ -592,7 +592,7 @@ /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, - /* tp_compare */ 0, + /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, Modified: python/branches/py3k/Modules/_pickle.c ============================================================================== --- python/branches/py3k/Modules/_pickle.c (original) +++ python/branches/py3k/Modules/_pickle.c Mon Feb 2 21:36:42 2009 @@ -2677,7 +2677,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -4534,7 +4534,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/_randommodule.c ============================================================================== --- python/branches/py3k/Modules/_randommodule.c (original) +++ python/branches/py3k/Modules/_randommodule.c Mon Feb 2 21:36:42 2009 @@ -459,7 +459,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/_sqlite/cache.c ============================================================================== --- python/branches/py3k/Modules/_sqlite/cache.c (original) +++ python/branches/py3k/Modules/_sqlite/cache.c Mon Feb 2 21:36:42 2009 @@ -282,7 +282,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -324,7 +324,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/_sqlite/connection.c ============================================================================== --- python/branches/py3k/Modules/_sqlite/connection.c (original) +++ python/branches/py3k/Modules/_sqlite/connection.c Mon Feb 2 21:36:42 2009 @@ -1350,7 +1350,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/_sqlite/cursor.c ============================================================================== --- python/branches/py3k/Modules/_sqlite/cursor.c (original) +++ python/branches/py3k/Modules/_sqlite/cursor.c Mon Feb 2 21:36:42 2009 @@ -1066,7 +1066,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/_sqlite/prepare_protocol.c ============================================================================== --- python/branches/py3k/Modules/_sqlite/prepare_protocol.c (original) +++ python/branches/py3k/Modules/_sqlite/prepare_protocol.c Mon Feb 2 21:36:42 2009 @@ -42,7 +42,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/_sqlite/row.c ============================================================================== --- python/branches/py3k/Modules/_sqlite/row.c (original) +++ python/branches/py3k/Modules/_sqlite/row.c Mon Feb 2 21:36:42 2009 @@ -210,7 +210,7 @@ (printfunc)pysqlite_row_print, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/_sqlite/statement.c ============================================================================== --- python/branches/py3k/Modules/_sqlite/statement.c (original) +++ python/branches/py3k/Modules/_sqlite/statement.c Mon Feb 2 21:36:42 2009 @@ -464,7 +464,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/_sre.c ============================================================================== --- python/branches/py3k/Modules/_sre.c (original) +++ python/branches/py3k/Modules/_sre.c Mon Feb 2 21:36:42 2009 @@ -2625,7 +2625,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3635,7 +3635,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3819,7 +3819,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/_ssl.c ============================================================================== --- python/branches/py3k/Modules/_ssl.c (original) +++ python/branches/py3k/Modules/_ssl.c Mon Feb 2 21:36:42 2009 @@ -1432,7 +1432,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/_stringio.c ============================================================================== --- python/branches/py3k/Modules/_stringio.c (original) +++ python/branches/py3k/Modules/_stringio.c Mon Feb 2 21:36:42 2009 @@ -322,7 +322,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/_struct.c ============================================================================== --- python/branches/py3k/Modules/_struct.c (original) +++ python/branches/py3k/Modules/_struct.c Mon Feb 2 21:36:42 2009 @@ -1853,7 +1853,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/_testcapimodule.c ============================================================================== --- python/branches/py3k/Modules/_testcapimodule.c (original) +++ python/branches/py3k/Modules/_testcapimodule.c Mon Feb 2 21:36:42 2009 @@ -187,7 +187,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1322,7 +1322,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/_threadmodule.c ============================================================================== --- python/branches/py3k/Modules/_threadmodule.c (original) +++ python/branches/py3k/Modules/_threadmodule.c Mon Feb 2 21:36:42 2009 @@ -129,7 +129,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -358,7 +358,7 @@ /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, - /* tp_compare */ 0, + /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, Modified: python/branches/py3k/Modules/_tkinter.c ============================================================================== --- python/branches/py3k/Modules/_tkinter.c (original) +++ python/branches/py3k/Modules/_tkinter.c Mon Feb 2 21:36:42 2009 @@ -869,7 +869,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ (reprfunc)PyTclObject_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -2351,7 +2351,7 @@ 0, /*tp_print */ 0, /*tp_getattr */ 0, /*tp_setattr */ - 0, /*tp_compare */ + 0, /*tp_reserved */ Tktt_Repr, /*tp_repr */ 0, /*tp_as_number */ 0, /*tp_as_sequence */ @@ -2677,7 +2677,7 @@ 0, /*tp_print */ 0, /*tp_getattr */ 0, /*tp_setattr */ - 0, /*tp_compare */ + 0, /*tp_reserved */ 0, /*tp_repr */ 0, /*tp_as_number */ 0, /*tp_as_sequence */ Modified: python/branches/py3k/Modules/arraymodule.c ============================================================================== --- python/branches/py3k/Modules/arraymodule.c (original) +++ python/branches/py3k/Modules/arraymodule.c Mon Feb 2 21:36:42 2009 @@ -2013,7 +2013,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)array_repr, /* tp_repr */ 0, /* tp_as_number*/ &array_as_sequence, /* tp_as_sequence*/ @@ -2116,7 +2116,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/bz2module.c ============================================================================== --- python/branches/py3k/Modules/bz2module.c (original) +++ python/branches/py3k/Modules/bz2module.c Mon Feb 2 21:36:42 2009 @@ -1339,7 +1339,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1622,7 +1622,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1851,7 +1851,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/cjkcodecs/multibytecodec.c ============================================================================== --- python/branches/py3k/Modules/cjkcodecs/multibytecodec.c (original) +++ python/branches/py3k/Modules/cjkcodecs/multibytecodec.c Mon Feb 2 21:36:42 2009 @@ -705,7 +705,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -990,7 +990,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1199,7 +1199,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1529,7 +1529,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1749,7 +1749,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/datetimemodule.c ============================================================================== --- python/branches/py3k/Modules/datetimemodule.c (original) +++ python/branches/py3k/Modules/datetimemodule.c Mon Feb 2 21:36:42 2009 @@ -1427,7 +1427,7 @@ * Miscellaneous helpers. */ -/* For various reasons, we need to use tp_richcompare instead of tp_compare. +/* For various reasons, we need to use tp_richcompare instead of tp_reserved. * The comparisons here all most naturally compute a cmp()-like result. * This little helper turns that into a bool result for rich comparisons. */ @@ -2138,7 +2138,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)delta_repr, /* tp_repr */ &delta_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2709,7 +2709,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)date_repr, /* tp_repr */ &date_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2963,7 +2963,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3478,7 +3478,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)time_repr, /* tp_repr */ &time_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -4606,7 +4606,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)datetime_repr, /* tp_repr */ &datetime_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/itertoolsmodule.c ============================================================================== --- python/branches/py3k/Modules/itertoolsmodule.c (original) +++ python/branches/py3k/Modules/itertoolsmodule.c Mon Feb 2 21:36:42 2009 @@ -148,7 +148,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -279,7 +279,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -432,7 +432,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -588,7 +588,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -783,7 +783,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -925,7 +925,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1064,7 +1064,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1257,7 +1257,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1388,7 +1388,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1556,7 +1556,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1804,7 +1804,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2027,7 +2027,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2273,7 +2273,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2544,7 +2544,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2700,7 +2700,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2843,7 +2843,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2994,7 +2994,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)count_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3129,7 +3129,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)repeat_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3355,7 +3355,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/md5module.c ============================================================================== --- python/branches/py3k/Modules/md5module.c (original) +++ python/branches/py3k/Modules/md5module.c Mon Feb 2 21:36:42 2009 @@ -476,7 +476,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/mmapmodule.c ============================================================================== --- python/branches/py3k/Modules/mmapmodule.c (original) +++ python/branches/py3k/Modules/mmapmodule.c Mon Feb 2 21:36:42 2009 @@ -930,7 +930,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &mmap_as_sequence, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/operator.c ============================================================================== --- python/branches/py3k/Modules/operator.c (original) +++ python/branches/py3k/Modules/operator.c Mon Feb 2 21:36:42 2009 @@ -334,7 +334,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -508,7 +508,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -639,7 +639,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/ossaudiodev.c ============================================================================== --- python/branches/py3k/Modules/ossaudiodev.c (original) +++ python/branches/py3k/Modules/ossaudiodev.c Mon Feb 2 21:36:42 2009 @@ -849,7 +849,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -881,7 +881,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/parsermodule.c ============================================================================== --- python/branches/py3k/Modules/parsermodule.c (original) +++ python/branches/py3k/Modules/parsermodule.c Mon Feb 2 21:36:42 2009 @@ -203,7 +203,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/pyexpat.c ============================================================================== --- python/branches/py3k/Modules/pyexpat.c (original) +++ python/branches/py3k/Modules/pyexpat.c Mon Feb 2 21:36:42 2009 @@ -1622,7 +1622,7 @@ (printfunc)0, /*tp_print*/ 0, /*tp_getattr*/ (setattrfunc)xmlparse_setattr, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ (reprfunc)0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/selectmodule.c ============================================================================== --- python/branches/py3k/Modules/selectmodule.c (original) +++ python/branches/py3k/Modules/selectmodule.c Mon Feb 2 21:36:42 2009 @@ -639,7 +639,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1097,7 +1097,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1310,7 +1310,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)kqueue_event_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1665,7 +1665,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/sha1module.c ============================================================================== --- python/branches/py3k/Modules/sha1module.c (original) +++ python/branches/py3k/Modules/sha1module.c Mon Feb 2 21:36:42 2009 @@ -452,7 +452,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/sha256module.c ============================================================================== --- python/branches/py3k/Modules/sha256module.c (original) +++ python/branches/py3k/Modules/sha256module.c Mon Feb 2 21:36:42 2009 @@ -545,7 +545,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -579,7 +579,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/sha512module.c ============================================================================== --- python/branches/py3k/Modules/sha512module.c (original) +++ python/branches/py3k/Modules/sha512module.c Mon Feb 2 21:36:42 2009 @@ -611,7 +611,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -645,7 +645,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/socketmodule.c ============================================================================== --- python/branches/py3k/Modules/socketmodule.c (original) +++ python/branches/py3k/Modules/socketmodule.c Mon Feb 2 21:36:42 2009 @@ -2860,7 +2860,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)sock_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/unicodedata.c ============================================================================== --- python/branches/py3k/Modules/unicodedata.c (original) +++ python/branches/py3k/Modules/unicodedata.c Mon Feb 2 21:36:42 2009 @@ -1144,7 +1144,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/xxmodule.c ============================================================================== --- python/branches/py3k/Modules/xxmodule.c (original) +++ python/branches/py3k/Modules/xxmodule.c Mon Feb 2 21:36:42 2009 @@ -106,7 +106,7 @@ 0, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)Xxo_setattr, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -224,7 +224,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -279,7 +279,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Modules/xxsubtype.c ============================================================================== --- python/branches/py3k/Modules/xxsubtype.c (original) +++ python/branches/py3k/Modules/xxsubtype.c Mon Feb 2 21:36:42 2009 @@ -109,7 +109,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -200,7 +200,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/zipimport.c ============================================================================== --- python/branches/py3k/Modules/zipimport.c (original) +++ python/branches/py3k/Modules/zipimport.c Mon Feb 2 21:36:42 2009 @@ -597,7 +597,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)zipimporter_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Modules/zlibmodule.c ============================================================================== --- python/branches/py3k/Modules/zlibmodule.c (original) +++ python/branches/py3k/Modules/zlibmodule.c Mon Feb 2 21:36:42 2009 @@ -982,7 +982,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1013,7 +1013,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Objects/boolobject.c ============================================================================== --- python/branches/py3k/Objects/boolobject.c (original) +++ python/branches/py3k/Objects/boolobject.c Mon Feb 2 21:36:42 2009 @@ -139,7 +139,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ bool_repr, /* tp_repr */ &bool_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/bytearrayobject.c ============================================================================== --- python/branches/py3k/Objects/bytearrayobject.c (original) +++ python/branches/py3k/Objects/bytearrayobject.c Mon Feb 2 21:36:42 2009 @@ -3182,7 +3182,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)bytes_repr, /* tp_repr */ 0, /* tp_as_number */ &bytes_as_sequence, /* tp_as_sequence */ @@ -3291,7 +3291,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/bytesobject.c ============================================================================== --- python/branches/py3k/Objects/bytesobject.c (original) +++ python/branches/py3k/Objects/bytesobject.c Mon Feb 2 21:36:42 2009 @@ -3089,7 +3089,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)string_repr, /* tp_repr */ 0, /* tp_as_number */ &string_as_sequence, /* tp_as_sequence */ @@ -3423,7 +3423,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/cellobject.c ============================================================================== --- python/branches/py3k/Objects/cellobject.c (original) +++ python/branches/py3k/Objects/cellobject.c Mon Feb 2 21:36:42 2009 @@ -154,7 +154,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)cell_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/classobject.c ============================================================================== --- python/branches/py3k/Objects/classobject.c (original) +++ python/branches/py3k/Objects/classobject.c Mon Feb 2 21:36:42 2009 @@ -348,7 +348,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)method_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -614,7 +614,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)instancemethod_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/cobject.c ============================================================================== --- python/branches/py3k/Objects/cobject.c (original) +++ python/branches/py3k/Objects/cobject.c Mon Feb 2 21:36:42 2009 @@ -137,7 +137,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Objects/codeobject.c ============================================================================== --- python/branches/py3k/Objects/codeobject.c (original) +++ python/branches/py3k/Objects/codeobject.c Mon Feb 2 21:36:42 2009 @@ -399,7 +399,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)code_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/complexobject.c ============================================================================== --- python/branches/py3k/Objects/complexobject.c (original) +++ python/branches/py3k/Objects/complexobject.c Mon Feb 2 21:36:42 2009 @@ -1087,7 +1087,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)complex_repr, /* tp_repr */ &complex_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/descrobject.c ============================================================================== --- python/branches/py3k/Objects/descrobject.c (original) +++ python/branches/py3k/Objects/descrobject.c Mon Feb 2 21:36:42 2009 @@ -392,7 +392,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)method_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -430,7 +430,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)method_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -467,7 +467,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)member_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -504,7 +504,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)getset_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -541,7 +541,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)wrapperdescr_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -790,7 +790,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &proxy_as_sequence, /* tp_as_sequence */ @@ -1023,7 +1023,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)wrapper_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1355,7 +1355,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/dictobject.c ============================================================================== --- python/branches/py3k/Objects/dictobject.c (original) +++ python/branches/py3k/Objects/dictobject.c Mon Feb 2 21:36:42 2009 @@ -2032,7 +2032,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)dict_repr, /* tp_repr */ 0, /* tp_as_number */ &dict_as_sequence, /* tp_as_sequence */ @@ -2226,7 +2226,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2298,7 +2298,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2384,7 +2384,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2699,7 +2699,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ &dictviews_as_number, /* tp_as_number */ &dictkeys_as_sequence, /* tp_as_sequence */ @@ -2783,7 +2783,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ &dictviews_as_number, /* tp_as_number */ &dictitems_as_sequence, /* tp_as_sequence */ @@ -2848,7 +2848,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &dictvalues_as_sequence, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/enumobject.c ============================================================================== --- python/branches/py3k/Objects/enumobject.c (original) +++ python/branches/py3k/Objects/enumobject.c Mon Feb 2 21:36:42 2009 @@ -176,7 +176,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -326,7 +326,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/exceptions.c ============================================================================== --- python/branches/py3k/Objects/exceptions.c (original) +++ python/branches/py3k/Objects/exceptions.c Mon Feb 2 21:36:42 2009 @@ -320,7 +320,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /* tp_compare; */ + 0, /* tp_reserved; */ (reprfunc)BaseException_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Objects/fileobject.c ============================================================================== --- python/branches/py3k/Objects/fileobject.c (original) +++ python/branches/py3k/Objects/fileobject.c Mon Feb 2 21:36:42 2009 @@ -490,7 +490,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)stdprinter_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/floatobject.c ============================================================================== --- python/branches/py3k/Objects/floatobject.c (original) +++ python/branches/py3k/Objects/floatobject.c Mon Feb 2 21:36:42 2009 @@ -1819,7 +1819,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)float_repr, /* tp_repr */ &float_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/frameobject.c ============================================================================== --- python/branches/py3k/Objects/frameobject.c (original) +++ python/branches/py3k/Objects/frameobject.c Mon Feb 2 21:36:42 2009 @@ -546,7 +546,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/funcobject.c ============================================================================== --- python/branches/py3k/Objects/funcobject.c (original) +++ python/branches/py3k/Objects/funcobject.c Mon Feb 2 21:36:42 2009 @@ -659,7 +659,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)func_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -805,7 +805,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -952,7 +952,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/genobject.c ============================================================================== --- python/branches/py3k/Objects/genobject.c (original) +++ python/branches/py3k/Objects/genobject.c Mon Feb 2 21:36:42 2009 @@ -333,7 +333,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)gen_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/iterobject.c ============================================================================== --- python/branches/py3k/Objects/iterobject.c (original) +++ python/branches/py3k/Objects/iterobject.c Mon Feb 2 21:36:42 2009 @@ -103,7 +103,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -207,7 +207,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/listobject.c ============================================================================== --- python/branches/py3k/Objects/listobject.c (original) +++ python/branches/py3k/Objects/listobject.c Mon Feb 2 21:36:42 2009 @@ -1784,7 +1784,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2565,7 +2565,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)list_repr, /* tp_repr */ 0, /* tp_as_number */ &list_as_sequence, /* tp_as_sequence */ @@ -2631,7 +2631,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2753,7 +2753,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/longobject.c ============================================================================== --- python/branches/py3k/Objects/longobject.c (original) +++ python/branches/py3k/Objects/longobject.c Mon Feb 2 21:36:42 2009 @@ -3967,7 +3967,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ long_repr, /* tp_repr */ &long_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/memoryobject.c ============================================================================== --- python/branches/py3k/Objects/memoryobject.c (original) +++ python/branches/py3k/Objects/memoryobject.c Mon Feb 2 21:36:42 2009 @@ -805,7 +805,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)memory_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/methodobject.c ============================================================================== --- python/branches/py3k/Objects/methodobject.c (original) +++ python/branches/py3k/Objects/methodobject.c Mon Feb 2 21:36:42 2009 @@ -254,7 +254,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)meth_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/moduleobject.c ============================================================================== --- python/branches/py3k/Objects/moduleobject.c (original) +++ python/branches/py3k/Objects/moduleobject.c Mon Feb 2 21:36:42 2009 @@ -379,7 +379,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)module_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/object.c ============================================================================== --- python/branches/py3k/Objects/object.c (original) +++ python/branches/py3k/Objects/object.c Mon Feb 2 21:36:42 2009 @@ -503,7 +503,7 @@ /* For Python 3.0.1 and later, the old three-way comparison has been completely removed in favour of rich comparisons. PyObject_Compare() and PyObject_Cmp() are gone, and the builtin cmp function no longer exists. - The old tp_compare slot will be renamed to tp_reserved, and should no + The old tp_compare slot has been renamed to tp_reserved, and should no longer be used. Use tp_richcompare instead. See (*) below for practical amendments. @@ -1433,7 +1433,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ none_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1464,7 +1464,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ NotImplemented_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Objects/rangeobject.c ============================================================================== --- python/branches/py3k/Objects/rangeobject.c (original) +++ python/branches/py3k/Objects/rangeobject.c Mon Feb 2 21:36:42 2009 @@ -289,7 +289,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)range_repr, /* tp_repr */ 0, /* tp_as_number */ &range_as_sequence, /* tp_as_sequence */ @@ -385,7 +385,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -537,7 +537,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/setobject.c ============================================================================== --- python/branches/py3k/Objects/setobject.c (original) +++ python/branches/py3k/Objects/setobject.c Mon Feb 2 21:36:42 2009 @@ -876,7 +876,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2104,7 +2104,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)set_repr, /* tp_repr */ &set_as_number, /* tp_as_number */ &set_as_sequence, /* tp_as_sequence */ @@ -2201,7 +2201,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)set_repr, /* tp_repr */ &frozenset_as_number, /* tp_as_number */ &set_as_sequence, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/sliceobject.c ============================================================================== --- python/branches/py3k/Objects/sliceobject.c (original) +++ python/branches/py3k/Objects/sliceobject.c Mon Feb 2 21:36:42 2009 @@ -31,7 +31,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ ellipsis_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -352,7 +352,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)slice_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 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 Mon Feb 2 21:36:42 2009 @@ -1064,7 +1064,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1197,7 +1197,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/structseq.c ============================================================================== --- python/branches/py3k/Objects/structseq.c (original) +++ python/branches/py3k/Objects/structseq.c Mon Feb 2 21:36:42 2009 @@ -440,7 +440,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)structseq_repr, /* tp_repr */ 0, /* tp_as_number */ &structseq_as_sequence, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/tupleobject.c ============================================================================== --- python/branches/py3k/Objects/tupleobject.c (original) +++ python/branches/py3k/Objects/tupleobject.c Mon Feb 2 21:36:42 2009 @@ -727,7 +727,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)tuplerepr, /* tp_repr */ 0, /* tp_as_number */ &tuple_as_sequence, /* tp_as_sequence */ @@ -930,7 +930,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/typeobject.c ============================================================================== --- python/branches/py3k/Objects/typeobject.c (original) +++ python/branches/py3k/Objects/typeobject.c Mon Feb 2 21:36:42 2009 @@ -2584,7 +2584,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)type_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3357,7 +3357,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ object_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3662,7 +3662,7 @@ type->tp_setattr = base->tp_setattr; type->tp_setattro = base->tp_setattro; } - /* tp_compare is ignored, see tp_richcompare */ + /* tp_reserved is ignored */ COPYSLOT(tp_repr); /* tp_hash see tp_richcompare */ COPYSLOT(tp_call); @@ -6250,7 +6250,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ super_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k/Objects/unicodeobject.c (original) +++ python/branches/py3k/Objects/unicodeobject.c Mon Feb 2 21:36:42 2009 @@ -4566,7 +4566,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -9493,7 +9493,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ unicode_repr, /* tp_repr */ &unicode_as_number, /* tp_as_number */ &unicode_as_sequence, /* tp_as_sequence */ @@ -9799,7 +9799,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Objects/weakrefobject.c ============================================================================== --- python/branches/py3k/Objects/weakrefobject.c (original) +++ python/branches/py3k/Objects/weakrefobject.c Mon Feb 2 21:36:42 2009 @@ -342,7 +342,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ (reprfunc)weakref_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -642,7 +642,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)proxy_repr, /* tp_repr */ &proxy_as_number, /* tp_as_number */ &proxy_as_sequence, /* tp_as_sequence */ @@ -675,7 +675,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (unaryfunc)proxy_repr, /* tp_repr */ &proxy_as_number, /* tp_as_number */ &proxy_as_sequence, /* tp_as_sequence */ Modified: python/branches/py3k/PC/_msi.c ============================================================================== --- python/branches/py3k/PC/_msi.c (original) +++ python/branches/py3k/PC/_msi.c Mon Feb 2 21:36:42 2009 @@ -473,7 +473,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -643,7 +643,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -791,7 +791,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -908,7 +908,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/PC/_subprocess.c ============================================================================== --- python/branches/py3k/PC/_subprocess.c (original) +++ python/branches/py3k/PC/_subprocess.c Mon Feb 2 21:36:42 2009 @@ -133,7 +133,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ &sp_handle_as_number, /*tp_as_number */ 0, /*tp_as_sequence */ Modified: python/branches/py3k/PC/winreg.c ============================================================================== --- python/branches/py3k/PC/winreg.c (original) +++ python/branches/py3k/PC/winreg.c Mon Feb 2 21:36:42 2009 @@ -485,7 +485,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ &PyHKEY_NumberMethods, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Parser/asdl_c.py ============================================================================== --- python/branches/py3k/Parser/asdl_c.py (original) +++ python/branches/py3k/Parser/asdl_c.py Mon Feb 2 21:36:42 2009 @@ -662,7 +662,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Python/Python-ast.c ============================================================================== --- python/branches/py3k/Python/Python-ast.c (original) +++ python/branches/py3k/Python/Python-ast.c Mon Feb 2 21:36:42 2009 @@ -479,7 +479,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Python/bltinmodule.c ============================================================================== --- python/branches/py3k/Python/bltinmodule.c (original) +++ python/branches/py3k/Python/bltinmodule.c Mon Feb 2 21:36:42 2009 @@ -416,7 +416,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1017,7 +1017,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2166,7 +2166,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Python/import.c ============================================================================== --- python/branches/py3k/Python/import.c (original) +++ python/branches/py3k/Python/import.c Mon Feb 2 21:36:42 2009 @@ -3295,7 +3295,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/py3k/Python/symtable.c ============================================================================== --- python/branches/py3k/Python/symtable.c (original) +++ python/branches/py3k/Python/symtable.c Mon Feb 2 21:36:42 2009 @@ -130,7 +130,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)ste_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Python/traceback.c ============================================================================== --- python/branches/py3k/Python/traceback.c (original) +++ python/branches/py3k/Python/traceback.c Mon Feb 2 21:36:42 2009 @@ -72,7 +72,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ From python-checkins at python.org Mon Feb 2 21:41:31 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 2 Feb 2009 21:41:31 +0100 (CET) Subject: [Python-checkins] r69215 - in python/branches/release30-maint: Include/object.h Misc/NEWS Modules/_bytesio.c Modules/_collectionsmodule.c Modules/_csv.c Modules/_ctypes/_ctypes.c Modules/_ctypes/callbacks.c Modules/_ctypes/callproc.c Modules/_ctypes/cfield.c Modules/_ctypes/stgdict.c Modules/_curses_panel.c Modules/_cursesmodule.c Modules/_dbmmodule.c Modules/_elementtree.c Modules/_fileio.c Modules/_functoolsmodule.c Modules/_gdbmmodule.c Modules/_hashopenssl.c Modules/_lsprof.c Modules/_multiprocessing/connection.h Modules/_multiprocessing/semaphore.c Modules/_pickle.c Modules/_randommodule.c Modules/_sqlite/cache.c Modules/_sqlite/connection.c Modules/_sqlite/cursor.c Modules/_sqlite/prepare_protocol.c Modules/_sqlite/row.c Modules/_sqlite/statement.c Modules/_sre.c Modules/_ssl.c Modules/_stringio.c Modules/_struct.c Modules/_testcapimodule.c Modules/_threadmodule.c Modules/_tkinter.c Modules/arraymodule.c Modules/bz2module.c Modules/cjkcodecs/multibytecodec.c Modules/datetimemodule.c Modules/itertoolsmodule.c Modules/md5module.c Modules/mmapmodule.c Modules/operator.c Modules/ossaudiodev.c Modules/parsermodule.c Modules/pyexpat.c Modules/selectmodule.c Modules/sha1module.c Modules/sha256module.c Modules/sha512module.c Modules/socketmodule.c Modules/unicodedata.c Modules/xxmodule.c Modules/xxsubtype.c Modules/zipimport.c Modules/zlibmodule.c Objects/boolobject.c Objects/bytearrayobject.c Objects/bytesobject.c Objects/cellobject.c Objects/classobject.c Objects/cobject.c Objects/codeobject.c Objects/complexobject.c Objects/descrobject.c Objects/dictobject.c Objects/enumobject.c Objects/exceptions.c Objects/fileobject.c Objects/floatobject.c Objects/frameobject.c Objects/funcobject.c Objects/genobject.c Objects/iterobject.c Objects/listobject.c Objects/longobject.c Objects/memoryobject.c Objects/methodobject.c Objects/moduleobject.c Objects/object.c Objects/rangeobject.c Objects/setobject.c Objects/sliceobject.c Objects/stringlib/string_format.h Objects/structseq.c Objects/tupleobject.c Objects/typeobject.c Objects/unicodeobject.c Objects/weakrefobject.c PC/_msi.c PC/_subprocess.c PC/winreg.c Parser/asdl_c.py Python/Python-ast.c Python/bltinmodule.c Python/import.c Python/symtable.c Python/traceback.c Message-ID: <20090202204131.6CB6E1E4002@bag.python.org> Author: mark.dickinson Date: Mon Feb 2 21:41:29 2009 New Revision: 69215 Log: Merged revisions 69214 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69214 | mark.dickinson | 2009-02-02 20:36:42 +0000 (Mon, 02 Feb 2009) | 4 lines Issue #1717: rename tp_compare to tp_reserved. I'll change the type of tp_compare in a separate commit, for ease of reversion should things go wrong. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Include/object.h python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/_bytesio.c python/branches/release30-maint/Modules/_collectionsmodule.c python/branches/release30-maint/Modules/_csv.c python/branches/release30-maint/Modules/_ctypes/_ctypes.c python/branches/release30-maint/Modules/_ctypes/callbacks.c python/branches/release30-maint/Modules/_ctypes/callproc.c python/branches/release30-maint/Modules/_ctypes/cfield.c python/branches/release30-maint/Modules/_ctypes/stgdict.c python/branches/release30-maint/Modules/_curses_panel.c python/branches/release30-maint/Modules/_cursesmodule.c python/branches/release30-maint/Modules/_dbmmodule.c python/branches/release30-maint/Modules/_elementtree.c python/branches/release30-maint/Modules/_fileio.c python/branches/release30-maint/Modules/_functoolsmodule.c python/branches/release30-maint/Modules/_gdbmmodule.c python/branches/release30-maint/Modules/_hashopenssl.c python/branches/release30-maint/Modules/_lsprof.c python/branches/release30-maint/Modules/_multiprocessing/connection.h python/branches/release30-maint/Modules/_multiprocessing/semaphore.c python/branches/release30-maint/Modules/_pickle.c python/branches/release30-maint/Modules/_randommodule.c python/branches/release30-maint/Modules/_sqlite/cache.c python/branches/release30-maint/Modules/_sqlite/connection.c python/branches/release30-maint/Modules/_sqlite/cursor.c python/branches/release30-maint/Modules/_sqlite/prepare_protocol.c python/branches/release30-maint/Modules/_sqlite/row.c python/branches/release30-maint/Modules/_sqlite/statement.c python/branches/release30-maint/Modules/_sre.c python/branches/release30-maint/Modules/_ssl.c python/branches/release30-maint/Modules/_stringio.c python/branches/release30-maint/Modules/_struct.c python/branches/release30-maint/Modules/_testcapimodule.c python/branches/release30-maint/Modules/_threadmodule.c python/branches/release30-maint/Modules/_tkinter.c python/branches/release30-maint/Modules/arraymodule.c python/branches/release30-maint/Modules/bz2module.c python/branches/release30-maint/Modules/cjkcodecs/multibytecodec.c python/branches/release30-maint/Modules/datetimemodule.c python/branches/release30-maint/Modules/itertoolsmodule.c python/branches/release30-maint/Modules/md5module.c python/branches/release30-maint/Modules/mmapmodule.c python/branches/release30-maint/Modules/operator.c python/branches/release30-maint/Modules/ossaudiodev.c python/branches/release30-maint/Modules/parsermodule.c python/branches/release30-maint/Modules/pyexpat.c python/branches/release30-maint/Modules/selectmodule.c python/branches/release30-maint/Modules/sha1module.c python/branches/release30-maint/Modules/sha256module.c python/branches/release30-maint/Modules/sha512module.c python/branches/release30-maint/Modules/socketmodule.c python/branches/release30-maint/Modules/unicodedata.c python/branches/release30-maint/Modules/xxmodule.c python/branches/release30-maint/Modules/xxsubtype.c python/branches/release30-maint/Modules/zipimport.c python/branches/release30-maint/Modules/zlibmodule.c python/branches/release30-maint/Objects/boolobject.c python/branches/release30-maint/Objects/bytearrayobject.c python/branches/release30-maint/Objects/bytesobject.c python/branches/release30-maint/Objects/cellobject.c python/branches/release30-maint/Objects/classobject.c python/branches/release30-maint/Objects/cobject.c python/branches/release30-maint/Objects/codeobject.c python/branches/release30-maint/Objects/complexobject.c python/branches/release30-maint/Objects/descrobject.c python/branches/release30-maint/Objects/dictobject.c python/branches/release30-maint/Objects/enumobject.c python/branches/release30-maint/Objects/exceptions.c python/branches/release30-maint/Objects/fileobject.c python/branches/release30-maint/Objects/floatobject.c python/branches/release30-maint/Objects/frameobject.c python/branches/release30-maint/Objects/funcobject.c python/branches/release30-maint/Objects/genobject.c python/branches/release30-maint/Objects/iterobject.c python/branches/release30-maint/Objects/listobject.c python/branches/release30-maint/Objects/longobject.c python/branches/release30-maint/Objects/memoryobject.c python/branches/release30-maint/Objects/methodobject.c python/branches/release30-maint/Objects/moduleobject.c python/branches/release30-maint/Objects/object.c python/branches/release30-maint/Objects/rangeobject.c python/branches/release30-maint/Objects/setobject.c python/branches/release30-maint/Objects/sliceobject.c python/branches/release30-maint/Objects/stringlib/string_format.h python/branches/release30-maint/Objects/structseq.c python/branches/release30-maint/Objects/tupleobject.c python/branches/release30-maint/Objects/typeobject.c python/branches/release30-maint/Objects/unicodeobject.c python/branches/release30-maint/Objects/weakrefobject.c python/branches/release30-maint/PC/_msi.c python/branches/release30-maint/PC/_subprocess.c python/branches/release30-maint/PC/winreg.c python/branches/release30-maint/Parser/asdl_c.py python/branches/release30-maint/Python/Python-ast.c python/branches/release30-maint/Python/bltinmodule.c python/branches/release30-maint/Python/import.c python/branches/release30-maint/Python/symtable.c python/branches/release30-maint/Python/traceback.c Modified: python/branches/release30-maint/Include/object.h ============================================================================== --- python/branches/release30-maint/Include/object.h (original) +++ python/branches/release30-maint/Include/object.h Mon Feb 2 21:41:29 2009 @@ -297,7 +297,7 @@ printfunc tp_print; getattrfunc tp_getattr; setattrfunc tp_setattr; - cmpfunc tp_compare; + cmpfunc tp_reserved; reprfunc tp_repr; /* Method suites for standard classes */ Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Mon Feb 2 21:41:29 2009 @@ -14,9 +14,8 @@ - Issue #1717: Removed builtin cmp() function, dropped tp_compare slot, the C API functions PyObject_Compare and PyUnicode_Compare and - the type definition cmpfunc. The tp_compare slot is reserved for - future usage. An attempt to initialize a type with a nonzero - tp_compare slot will raise TypeError. + the type definition cmpfunc. The tp_compare slot has been renamed + to tp_reserved, and is reserved for future usage. - Issue #4707: round(x, n) now returns an integer if x is an integer. Previously it returned a float. Modified: python/branches/release30-maint/Modules/_bytesio.c ============================================================================== --- python/branches/release30-maint/Modules/_bytesio.c (original) +++ python/branches/release30-maint/Modules/_bytesio.c Mon Feb 2 21:41:29 2009 @@ -698,7 +698,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/_collectionsmodule.c ============================================================================== --- python/branches/release30-maint/Modules/_collectionsmodule.c (original) +++ python/branches/release30-maint/Modules/_collectionsmodule.c Mon Feb 2 21:41:29 2009 @@ -848,7 +848,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ deque_repr, /* tp_repr */ 0, /* tp_as_number */ &deque_as_sequence, /* tp_as_sequence */ @@ -978,7 +978,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1061,7 +1061,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1318,7 +1318,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)defdict_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/_csv.c ============================================================================== --- python/branches/release30-maint/Modules/_csv.c (original) +++ python/branches/release30-maint/Modules/_csv.c Mon Feb 2 21:41:29 2009 @@ -443,7 +443,7 @@ (printfunc)0, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -864,7 +864,7 @@ (printfunc)0, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ (reprfunc)0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1286,7 +1286,7 @@ (printfunc)0, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ (reprfunc)0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 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 Mon Feb 2 21:41:29 2009 @@ -179,7 +179,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -713,7 +713,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &CDataType_as_sequence, /* tp_as_sequence */ @@ -755,7 +755,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &CDataType_as_sequence, /* tp_as_sequence */ @@ -988,7 +988,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &CDataType_as_sequence, /* tp_as_sequence */ @@ -1390,7 +1390,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &CDataType_as_sequence, /* tp_as_sequence */ @@ -2059,7 +2059,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &CDataType_as_sequence, /* tp_as_sequence */ @@ -2277,7 +2277,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &CDataType_as_sequence, /* tp_as_sequence */ @@ -2560,7 +2560,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3889,7 +3889,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)CFuncPtr_repr, /* tp_repr */ &CFuncPtr_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -4032,7 +4032,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -4074,7 +4074,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -4383,7 +4383,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &Array_as_sequence, /* tp_as_sequence */ @@ -4615,7 +4615,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)&Simple_repr, /* tp_repr */ &Simple_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -4992,7 +4992,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ &Pointer_as_number, /* tp_as_number */ &Pointer_as_sequence, /* tp_as_sequence */ @@ -5086,7 +5086,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/_ctypes/callbacks.c ============================================================================== --- python/branches/release30-maint/Modules/_ctypes/callbacks.c (original) +++ python/branches/release30-maint/Modules/_ctypes/callbacks.c Mon Feb 2 21:41:29 2009 @@ -50,7 +50,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/_ctypes/callproc.c ============================================================================== --- python/branches/release30-maint/Modules/_ctypes/callproc.c (original) +++ python/branches/release30-maint/Modules/_ctypes/callproc.c Mon Feb 2 21:41:29 2009 @@ -512,7 +512,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)PyCArg_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 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 Mon Feb 2 21:41:29 2009 @@ -289,7 +289,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)CField_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/_ctypes/stgdict.c ============================================================================== --- python/branches/release30-maint/Modules/_ctypes/stgdict.c (original) +++ python/branches/release30-maint/Modules/_ctypes/stgdict.c Mon Feb 2 21:41:29 2009 @@ -111,7 +111,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/_curses_panel.c ============================================================================== --- python/branches/release30-maint/Modules/_curses_panel.c (original) +++ python/branches/release30-maint/Modules/_curses_panel.c Mon Feb 2 21:41:29 2009 @@ -341,7 +341,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/_cursesmodule.c ============================================================================== --- python/branches/release30-maint/Modules/_cursesmodule.c (original) +++ python/branches/release30-maint/Modules/_cursesmodule.c Mon Feb 2 21:41:29 2009 @@ -1662,7 +1662,7 @@ 0, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/_dbmmodule.c ============================================================================== --- python/branches/release30-maint/Modules/_dbmmodule.c (original) +++ python/branches/release30-maint/Modules/_dbmmodule.c Mon Feb 2 21:41:29 2009 @@ -337,7 +337,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ &dbm_as_sequence, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/_elementtree.c ============================================================================== --- python/branches/release30-maint/Modules/_elementtree.c (original) +++ python/branches/release30-maint/Modules/_elementtree.c Mon Feb 2 21:41:29 2009 @@ -1379,7 +1379,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ (setattrfunc)element_setattr, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)element_repr, /* tp_repr */ 0, /* tp_as_number */ &element_as_sequence, /* tp_as_sequence */ @@ -1803,7 +1803,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2559,7 +2559,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/_fileio.c ============================================================================== --- python/branches/release30-maint/Modules/_fileio.c (original) +++ python/branches/release30-maint/Modules/_fileio.c Mon Feb 2 21:41:29 2009 @@ -907,7 +907,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)fileio_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/_functoolsmodule.c ============================================================================== --- python/branches/release30-maint/Modules/_functoolsmodule.c (original) +++ python/branches/release30-maint/Modules/_functoolsmodule.c Mon Feb 2 21:41:29 2009 @@ -206,7 +206,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/_gdbmmodule.c ============================================================================== --- python/branches/release30-maint/Modules/_gdbmmodule.c (original) +++ python/branches/release30-maint/Modules/_gdbmmodule.c Mon Feb 2 21:41:29 2009 @@ -390,7 +390,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ &dbm_as_sequence, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/_hashopenssl.c ============================================================================== --- python/branches/release30-maint/Modules/_hashopenssl.c (original) +++ python/branches/release30-maint/Modules/_hashopenssl.c Mon Feb 2 21:41:29 2009 @@ -339,7 +339,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ EVP_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/_lsprof.c ============================================================================== --- python/branches/release30-maint/Modules/_lsprof.c (original) +++ python/branches/release30-maint/Modules/_lsprof.c Mon Feb 2 21:41:29 2009 @@ -820,7 +820,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/_multiprocessing/connection.h ============================================================================== --- python/branches/release30-maint/Modules/_multiprocessing/connection.h (original) +++ python/branches/release30-maint/Modules/_multiprocessing/connection.h Mon Feb 2 21:41:29 2009 @@ -487,7 +487,7 @@ /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, - /* tp_compare */ 0, + /* tp_reserved */ 0, /* tp_repr */ (reprfunc)connection_repr, /* tp_as_number */ 0, /* tp_as_sequence */ 0, Modified: python/branches/release30-maint/Modules/_multiprocessing/semaphore.c ============================================================================== --- python/branches/release30-maint/Modules/_multiprocessing/semaphore.c (original) +++ python/branches/release30-maint/Modules/_multiprocessing/semaphore.c Mon Feb 2 21:41:29 2009 @@ -592,7 +592,7 @@ /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, - /* tp_compare */ 0, + /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, Modified: python/branches/release30-maint/Modules/_pickle.c ============================================================================== --- python/branches/release30-maint/Modules/_pickle.c (original) +++ python/branches/release30-maint/Modules/_pickle.c Mon Feb 2 21:41:29 2009 @@ -2677,7 +2677,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -4545,7 +4545,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/_randommodule.c ============================================================================== --- python/branches/release30-maint/Modules/_randommodule.c (original) +++ python/branches/release30-maint/Modules/_randommodule.c Mon Feb 2 21:41:29 2009 @@ -459,7 +459,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/_sqlite/cache.c ============================================================================== --- python/branches/release30-maint/Modules/_sqlite/cache.c (original) +++ python/branches/release30-maint/Modules/_sqlite/cache.c Mon Feb 2 21:41:29 2009 @@ -282,7 +282,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -324,7 +324,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/_sqlite/connection.c ============================================================================== --- python/branches/release30-maint/Modules/_sqlite/connection.c (original) +++ python/branches/release30-maint/Modules/_sqlite/connection.c Mon Feb 2 21:41:29 2009 @@ -1350,7 +1350,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/_sqlite/cursor.c ============================================================================== --- python/branches/release30-maint/Modules/_sqlite/cursor.c (original) +++ python/branches/release30-maint/Modules/_sqlite/cursor.c Mon Feb 2 21:41:29 2009 @@ -1066,7 +1066,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/_sqlite/prepare_protocol.c ============================================================================== --- python/branches/release30-maint/Modules/_sqlite/prepare_protocol.c (original) +++ python/branches/release30-maint/Modules/_sqlite/prepare_protocol.c Mon Feb 2 21:41:29 2009 @@ -42,7 +42,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/_sqlite/row.c ============================================================================== --- python/branches/release30-maint/Modules/_sqlite/row.c (original) +++ python/branches/release30-maint/Modules/_sqlite/row.c Mon Feb 2 21:41:29 2009 @@ -210,7 +210,7 @@ (printfunc)pysqlite_row_print, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/_sqlite/statement.c ============================================================================== --- python/branches/release30-maint/Modules/_sqlite/statement.c (original) +++ python/branches/release30-maint/Modules/_sqlite/statement.c Mon Feb 2 21:41:29 2009 @@ -464,7 +464,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/_sre.c ============================================================================== --- python/branches/release30-maint/Modules/_sre.c (original) +++ python/branches/release30-maint/Modules/_sre.c Mon Feb 2 21:41:29 2009 @@ -2625,7 +2625,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3635,7 +3635,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3819,7 +3819,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/_ssl.c ============================================================================== --- python/branches/release30-maint/Modules/_ssl.c (original) +++ python/branches/release30-maint/Modules/_ssl.c Mon Feb 2 21:41:29 2009 @@ -1432,7 +1432,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/_stringio.c ============================================================================== --- python/branches/release30-maint/Modules/_stringio.c (original) +++ python/branches/release30-maint/Modules/_stringio.c Mon Feb 2 21:41:29 2009 @@ -322,7 +322,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/_struct.c ============================================================================== --- python/branches/release30-maint/Modules/_struct.c (original) +++ python/branches/release30-maint/Modules/_struct.c Mon Feb 2 21:41:29 2009 @@ -1853,7 +1853,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/_testcapimodule.c ============================================================================== --- python/branches/release30-maint/Modules/_testcapimodule.c (original) +++ python/branches/release30-maint/Modules/_testcapimodule.c Mon Feb 2 21:41:29 2009 @@ -187,7 +187,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1284,7 +1284,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/_threadmodule.c ============================================================================== --- python/branches/release30-maint/Modules/_threadmodule.c (original) +++ python/branches/release30-maint/Modules/_threadmodule.c Mon Feb 2 21:41:29 2009 @@ -129,7 +129,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -358,7 +358,7 @@ /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, - /* tp_compare */ 0, + /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, Modified: python/branches/release30-maint/Modules/_tkinter.c ============================================================================== --- python/branches/release30-maint/Modules/_tkinter.c (original) +++ python/branches/release30-maint/Modules/_tkinter.c Mon Feb 2 21:41:29 2009 @@ -869,7 +869,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ (reprfunc)PyTclObject_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -2351,7 +2351,7 @@ 0, /*tp_print */ 0, /*tp_getattr */ 0, /*tp_setattr */ - 0, /*tp_compare */ + 0, /*tp_reserved */ Tktt_Repr, /*tp_repr */ 0, /*tp_as_number */ 0, /*tp_as_sequence */ @@ -2677,7 +2677,7 @@ 0, /*tp_print */ 0, /*tp_getattr */ 0, /*tp_setattr */ - 0, /*tp_compare */ + 0, /*tp_reserved */ 0, /*tp_repr */ 0, /*tp_as_number */ 0, /*tp_as_sequence */ Modified: python/branches/release30-maint/Modules/arraymodule.c ============================================================================== --- python/branches/release30-maint/Modules/arraymodule.c (original) +++ python/branches/release30-maint/Modules/arraymodule.c Mon Feb 2 21:41:29 2009 @@ -2013,7 +2013,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)array_repr, /* tp_repr */ 0, /* tp_as_number*/ &array_as_sequence, /* tp_as_sequence*/ @@ -2116,7 +2116,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/bz2module.c ============================================================================== --- python/branches/release30-maint/Modules/bz2module.c (original) +++ python/branches/release30-maint/Modules/bz2module.c Mon Feb 2 21:41:29 2009 @@ -1307,7 +1307,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1590,7 +1590,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1819,7 +1819,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/cjkcodecs/multibytecodec.c ============================================================================== --- python/branches/release30-maint/Modules/cjkcodecs/multibytecodec.c (original) +++ python/branches/release30-maint/Modules/cjkcodecs/multibytecodec.c Mon Feb 2 21:41:29 2009 @@ -705,7 +705,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -990,7 +990,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1199,7 +1199,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1529,7 +1529,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1749,7 +1749,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/datetimemodule.c ============================================================================== --- python/branches/release30-maint/Modules/datetimemodule.c (original) +++ python/branches/release30-maint/Modules/datetimemodule.c Mon Feb 2 21:41:29 2009 @@ -1427,7 +1427,7 @@ * Miscellaneous helpers. */ -/* For various reasons, we need to use tp_richcompare instead of tp_compare. +/* For various reasons, we need to use tp_richcompare instead of tp_reserved. * The comparisons here all most naturally compute a cmp()-like result. * This little helper turns that into a bool result for rich comparisons. */ @@ -2138,7 +2138,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)delta_repr, /* tp_repr */ &delta_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2709,7 +2709,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)date_repr, /* tp_repr */ &date_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2963,7 +2963,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3478,7 +3478,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)time_repr, /* tp_repr */ &time_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -4606,7 +4606,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)datetime_repr, /* tp_repr */ &datetime_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/itertoolsmodule.c ============================================================================== --- python/branches/release30-maint/Modules/itertoolsmodule.c (original) +++ python/branches/release30-maint/Modules/itertoolsmodule.c Mon Feb 2 21:41:29 2009 @@ -148,7 +148,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -279,7 +279,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -432,7 +432,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -588,7 +588,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -783,7 +783,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -926,7 +926,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1066,7 +1066,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1261,7 +1261,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1393,7 +1393,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1561,7 +1561,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1808,7 +1808,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2030,7 +2030,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2301,7 +2301,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2445,7 +2445,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2596,7 +2596,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)count_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2731,7 +2731,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)repeat_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2959,7 +2959,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/md5module.c ============================================================================== --- python/branches/release30-maint/Modules/md5module.c (original) +++ python/branches/release30-maint/Modules/md5module.c Mon Feb 2 21:41:29 2009 @@ -476,7 +476,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/mmapmodule.c ============================================================================== --- python/branches/release30-maint/Modules/mmapmodule.c (original) +++ python/branches/release30-maint/Modules/mmapmodule.c Mon Feb 2 21:41:29 2009 @@ -930,7 +930,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &mmap_as_sequence, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/operator.c ============================================================================== --- python/branches/release30-maint/Modules/operator.c (original) +++ python/branches/release30-maint/Modules/operator.c Mon Feb 2 21:41:29 2009 @@ -334,7 +334,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -508,7 +508,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -639,7 +639,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/ossaudiodev.c ============================================================================== --- python/branches/release30-maint/Modules/ossaudiodev.c (original) +++ python/branches/release30-maint/Modules/ossaudiodev.c Mon Feb 2 21:41:29 2009 @@ -849,7 +849,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -881,7 +881,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/parsermodule.c ============================================================================== --- python/branches/release30-maint/Modules/parsermodule.c (original) +++ python/branches/release30-maint/Modules/parsermodule.c Mon Feb 2 21:41:29 2009 @@ -203,7 +203,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/pyexpat.c ============================================================================== --- python/branches/release30-maint/Modules/pyexpat.c (original) +++ python/branches/release30-maint/Modules/pyexpat.c Mon Feb 2 21:41:29 2009 @@ -1622,7 +1622,7 @@ (printfunc)0, /*tp_print*/ 0, /*tp_getattr*/ (setattrfunc)xmlparse_setattr, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ (reprfunc)0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/selectmodule.c ============================================================================== --- python/branches/release30-maint/Modules/selectmodule.c (original) +++ python/branches/release30-maint/Modules/selectmodule.c Mon Feb 2 21:41:29 2009 @@ -639,7 +639,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1097,7 +1097,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1310,7 +1310,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)kqueue_event_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1665,7 +1665,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/sha1module.c ============================================================================== --- python/branches/release30-maint/Modules/sha1module.c (original) +++ python/branches/release30-maint/Modules/sha1module.c Mon Feb 2 21:41:29 2009 @@ -452,7 +452,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/sha256module.c ============================================================================== --- python/branches/release30-maint/Modules/sha256module.c (original) +++ python/branches/release30-maint/Modules/sha256module.c Mon Feb 2 21:41:29 2009 @@ -545,7 +545,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -579,7 +579,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/sha512module.c ============================================================================== --- python/branches/release30-maint/Modules/sha512module.c (original) +++ python/branches/release30-maint/Modules/sha512module.c Mon Feb 2 21:41:29 2009 @@ -611,7 +611,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -645,7 +645,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/socketmodule.c ============================================================================== --- python/branches/release30-maint/Modules/socketmodule.c (original) +++ python/branches/release30-maint/Modules/socketmodule.c Mon Feb 2 21:41:29 2009 @@ -2860,7 +2860,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)sock_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/unicodedata.c ============================================================================== --- python/branches/release30-maint/Modules/unicodedata.c (original) +++ python/branches/release30-maint/Modules/unicodedata.c Mon Feb 2 21:41:29 2009 @@ -1144,7 +1144,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/xxmodule.c ============================================================================== --- python/branches/release30-maint/Modules/xxmodule.c (original) +++ python/branches/release30-maint/Modules/xxmodule.c Mon Feb 2 21:41:29 2009 @@ -106,7 +106,7 @@ 0, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)Xxo_setattr, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -224,7 +224,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -279,7 +279,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Modules/xxsubtype.c ============================================================================== --- python/branches/release30-maint/Modules/xxsubtype.c (original) +++ python/branches/release30-maint/Modules/xxsubtype.c Mon Feb 2 21:41:29 2009 @@ -109,7 +109,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -200,7 +200,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/zipimport.c ============================================================================== --- python/branches/release30-maint/Modules/zipimport.c (original) +++ python/branches/release30-maint/Modules/zipimport.c Mon Feb 2 21:41:29 2009 @@ -597,7 +597,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)zipimporter_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Modules/zlibmodule.c ============================================================================== --- python/branches/release30-maint/Modules/zlibmodule.c (original) +++ python/branches/release30-maint/Modules/zlibmodule.c Mon Feb 2 21:41:29 2009 @@ -977,7 +977,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1008,7 +1008,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Objects/boolobject.c ============================================================================== --- python/branches/release30-maint/Objects/boolobject.c (original) +++ python/branches/release30-maint/Objects/boolobject.c Mon Feb 2 21:41:29 2009 @@ -139,7 +139,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ bool_repr, /* tp_repr */ &bool_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/bytearrayobject.c ============================================================================== --- python/branches/release30-maint/Objects/bytearrayobject.c (original) +++ python/branches/release30-maint/Objects/bytearrayobject.c Mon Feb 2 21:41:29 2009 @@ -3174,7 +3174,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)bytes_repr, /* tp_repr */ 0, /* tp_as_number */ &bytes_as_sequence, /* tp_as_sequence */ @@ -3283,7 +3283,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/bytesobject.c ============================================================================== --- python/branches/release30-maint/Objects/bytesobject.c (original) +++ python/branches/release30-maint/Objects/bytesobject.c Mon Feb 2 21:41:29 2009 @@ -3081,7 +3081,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)string_repr, /* tp_repr */ 0, /* tp_as_number */ &string_as_sequence, /* tp_as_sequence */ @@ -3415,7 +3415,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/cellobject.c ============================================================================== --- python/branches/release30-maint/Objects/cellobject.c (original) +++ python/branches/release30-maint/Objects/cellobject.c Mon Feb 2 21:41:29 2009 @@ -154,7 +154,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)cell_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/classobject.c ============================================================================== --- python/branches/release30-maint/Objects/classobject.c (original) +++ python/branches/release30-maint/Objects/classobject.c Mon Feb 2 21:41:29 2009 @@ -348,7 +348,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)method_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -614,7 +614,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)instancemethod_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/cobject.c ============================================================================== --- python/branches/release30-maint/Objects/cobject.c (original) +++ python/branches/release30-maint/Objects/cobject.c Mon Feb 2 21:41:29 2009 @@ -137,7 +137,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Objects/codeobject.c ============================================================================== --- python/branches/release30-maint/Objects/codeobject.c (original) +++ python/branches/release30-maint/Objects/codeobject.c Mon Feb 2 21:41:29 2009 @@ -399,7 +399,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)code_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/complexobject.c ============================================================================== --- python/branches/release30-maint/Objects/complexobject.c (original) +++ python/branches/release30-maint/Objects/complexobject.c Mon Feb 2 21:41:29 2009 @@ -1087,7 +1087,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)complex_repr, /* tp_repr */ &complex_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/descrobject.c ============================================================================== --- python/branches/release30-maint/Objects/descrobject.c (original) +++ python/branches/release30-maint/Objects/descrobject.c Mon Feb 2 21:41:29 2009 @@ -392,7 +392,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)method_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -430,7 +430,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)method_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -467,7 +467,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)member_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -504,7 +504,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)getset_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -541,7 +541,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)wrapperdescr_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -790,7 +790,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &proxy_as_sequence, /* tp_as_sequence */ @@ -1023,7 +1023,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)wrapper_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1355,7 +1355,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/dictobject.c ============================================================================== --- python/branches/release30-maint/Objects/dictobject.c (original) +++ python/branches/release30-maint/Objects/dictobject.c Mon Feb 2 21:41:29 2009 @@ -2032,7 +2032,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)dict_repr, /* tp_repr */ 0, /* tp_as_number */ &dict_as_sequence, /* tp_as_sequence */ @@ -2226,7 +2226,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2298,7 +2298,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2384,7 +2384,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2699,7 +2699,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ &dictviews_as_number, /* tp_as_number */ &dictkeys_as_sequence, /* tp_as_sequence */ @@ -2783,7 +2783,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ &dictviews_as_number, /* tp_as_number */ &dictitems_as_sequence, /* tp_as_sequence */ @@ -2848,7 +2848,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &dictvalues_as_sequence, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/enumobject.c ============================================================================== --- python/branches/release30-maint/Objects/enumobject.c (original) +++ python/branches/release30-maint/Objects/enumobject.c Mon Feb 2 21:41:29 2009 @@ -176,7 +176,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -326,7 +326,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/exceptions.c ============================================================================== --- python/branches/release30-maint/Objects/exceptions.c (original) +++ python/branches/release30-maint/Objects/exceptions.c Mon Feb 2 21:41:29 2009 @@ -320,7 +320,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /* tp_compare; */ + 0, /* tp_reserved; */ (reprfunc)BaseException_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Objects/fileobject.c ============================================================================== --- python/branches/release30-maint/Objects/fileobject.c (original) +++ python/branches/release30-maint/Objects/fileobject.c Mon Feb 2 21:41:29 2009 @@ -490,7 +490,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)stdprinter_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/floatobject.c ============================================================================== --- python/branches/release30-maint/Objects/floatobject.c (original) +++ python/branches/release30-maint/Objects/floatobject.c Mon Feb 2 21:41:29 2009 @@ -1819,7 +1819,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)float_repr, /* tp_repr */ &float_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/frameobject.c ============================================================================== --- python/branches/release30-maint/Objects/frameobject.c (original) +++ python/branches/release30-maint/Objects/frameobject.c Mon Feb 2 21:41:29 2009 @@ -546,7 +546,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/funcobject.c ============================================================================== --- python/branches/release30-maint/Objects/funcobject.c (original) +++ python/branches/release30-maint/Objects/funcobject.c Mon Feb 2 21:41:29 2009 @@ -659,7 +659,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)func_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -805,7 +805,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -952,7 +952,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/genobject.c ============================================================================== --- python/branches/release30-maint/Objects/genobject.c (original) +++ python/branches/release30-maint/Objects/genobject.c Mon Feb 2 21:41:29 2009 @@ -333,7 +333,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)gen_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/iterobject.c ============================================================================== --- python/branches/release30-maint/Objects/iterobject.c (original) +++ python/branches/release30-maint/Objects/iterobject.c Mon Feb 2 21:41:29 2009 @@ -103,7 +103,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -207,7 +207,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/listobject.c ============================================================================== --- python/branches/release30-maint/Objects/listobject.c (original) +++ python/branches/release30-maint/Objects/listobject.c Mon Feb 2 21:41:29 2009 @@ -1784,7 +1784,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2565,7 +2565,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)list_repr, /* tp_repr */ 0, /* tp_as_number */ &list_as_sequence, /* tp_as_sequence */ @@ -2631,7 +2631,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2753,7 +2753,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/longobject.c ============================================================================== --- python/branches/release30-maint/Objects/longobject.c (original) +++ python/branches/release30-maint/Objects/longobject.c Mon Feb 2 21:41:29 2009 @@ -3896,7 +3896,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ long_repr, /* tp_repr */ &long_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/memoryobject.c ============================================================================== --- python/branches/release30-maint/Objects/memoryobject.c (original) +++ python/branches/release30-maint/Objects/memoryobject.c Mon Feb 2 21:41:29 2009 @@ -805,7 +805,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)memory_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/methodobject.c ============================================================================== --- python/branches/release30-maint/Objects/methodobject.c (original) +++ python/branches/release30-maint/Objects/methodobject.c Mon Feb 2 21:41:29 2009 @@ -254,7 +254,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)meth_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/moduleobject.c ============================================================================== --- python/branches/release30-maint/Objects/moduleobject.c (original) +++ python/branches/release30-maint/Objects/moduleobject.c Mon Feb 2 21:41:29 2009 @@ -379,7 +379,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)module_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/object.c ============================================================================== --- python/branches/release30-maint/Objects/object.c (original) +++ python/branches/release30-maint/Objects/object.c Mon Feb 2 21:41:29 2009 @@ -498,7 +498,7 @@ /* For Python 3.0.1 and later, the old three-way comparison has been completely removed in favour of rich comparisons. PyObject_Compare() and PyObject_Cmp() are gone, and the builtin cmp function no longer exists. - The old tp_compare slot will be renamed to tp_reserved, and should no + The old tp_compare slot has been renamed to tp_reserved, and should no longer be used. Use tp_richcompare instead. See (*) below for practical amendments. @@ -1414,7 +1414,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ none_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1445,7 +1445,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ NotImplemented_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Objects/rangeobject.c ============================================================================== --- python/branches/release30-maint/Objects/rangeobject.c (original) +++ python/branches/release30-maint/Objects/rangeobject.c Mon Feb 2 21:41:29 2009 @@ -289,7 +289,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)range_repr, /* tp_repr */ 0, /* tp_as_number */ &range_as_sequence, /* tp_as_sequence */ @@ -385,7 +385,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -537,7 +537,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/setobject.c ============================================================================== --- python/branches/release30-maint/Objects/setobject.c (original) +++ python/branches/release30-maint/Objects/setobject.c Mon Feb 2 21:41:29 2009 @@ -876,7 +876,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2104,7 +2104,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)set_repr, /* tp_repr */ &set_as_number, /* tp_as_number */ &set_as_sequence, /* tp_as_sequence */ @@ -2201,7 +2201,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)set_repr, /* tp_repr */ &frozenset_as_number, /* tp_as_number */ &set_as_sequence, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/sliceobject.c ============================================================================== --- python/branches/release30-maint/Objects/sliceobject.c (original) +++ python/branches/release30-maint/Objects/sliceobject.c Mon Feb 2 21:41:29 2009 @@ -31,7 +31,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ ellipsis_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -352,7 +352,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)slice_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 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 Mon Feb 2 21:41:29 2009 @@ -1064,7 +1064,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1197,7 +1197,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/structseq.c ============================================================================== --- python/branches/release30-maint/Objects/structseq.c (original) +++ python/branches/release30-maint/Objects/structseq.c Mon Feb 2 21:41:29 2009 @@ -440,7 +440,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)structseq_repr, /* tp_repr */ 0, /* tp_as_number */ &structseq_as_sequence, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/tupleobject.c ============================================================================== --- python/branches/release30-maint/Objects/tupleobject.c (original) +++ python/branches/release30-maint/Objects/tupleobject.c Mon Feb 2 21:41:29 2009 @@ -727,7 +727,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)tuplerepr, /* tp_repr */ 0, /* tp_as_number */ &tuple_as_sequence, /* tp_as_sequence */ @@ -930,7 +930,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/typeobject.c ============================================================================== --- python/branches/release30-maint/Objects/typeobject.c (original) +++ python/branches/release30-maint/Objects/typeobject.c Mon Feb 2 21:41:29 2009 @@ -2584,7 +2584,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)type_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3357,7 +3357,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ object_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3662,7 +3662,7 @@ type->tp_setattr = base->tp_setattr; type->tp_setattro = base->tp_setattro; } - /* tp_compare is ignored, see tp_richcompare */ + /* tp_reserved is ignored */ COPYSLOT(tp_repr); /* tp_hash see tp_richcompare */ COPYSLOT(tp_call); @@ -6246,7 +6246,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ super_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/unicodeobject.c ============================================================================== --- python/branches/release30-maint/Objects/unicodeobject.c (original) +++ python/branches/release30-maint/Objects/unicodeobject.c Mon Feb 2 21:41:29 2009 @@ -4368,7 +4368,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -9294,7 +9294,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ unicode_repr, /* tp_repr */ &unicode_as_number, /* tp_as_number */ &unicode_as_sequence, /* tp_as_sequence */ @@ -9600,7 +9600,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Objects/weakrefobject.c ============================================================================== --- python/branches/release30-maint/Objects/weakrefobject.c (original) +++ python/branches/release30-maint/Objects/weakrefobject.c Mon Feb 2 21:41:29 2009 @@ -342,7 +342,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ (reprfunc)weakref_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -642,7 +642,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)proxy_repr, /* tp_repr */ &proxy_as_number, /* tp_as_number */ &proxy_as_sequence, /* tp_as_sequence */ @@ -675,7 +675,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (unaryfunc)proxy_repr, /* tp_repr */ &proxy_as_number, /* tp_as_number */ &proxy_as_sequence, /* tp_as_sequence */ Modified: python/branches/release30-maint/PC/_msi.c ============================================================================== --- python/branches/release30-maint/PC/_msi.c (original) +++ python/branches/release30-maint/PC/_msi.c Mon Feb 2 21:41:29 2009 @@ -473,7 +473,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -643,7 +643,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -791,7 +791,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -908,7 +908,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/PC/_subprocess.c ============================================================================== --- python/branches/release30-maint/PC/_subprocess.c (original) +++ python/branches/release30-maint/PC/_subprocess.c Mon Feb 2 21:41:29 2009 @@ -133,7 +133,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ &sp_handle_as_number, /*tp_as_number */ 0, /*tp_as_sequence */ Modified: python/branches/release30-maint/PC/winreg.c ============================================================================== --- python/branches/release30-maint/PC/winreg.c (original) +++ python/branches/release30-maint/PC/winreg.c Mon Feb 2 21:41:29 2009 @@ -485,7 +485,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ &PyHKEY_NumberMethods, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Parser/asdl_c.py ============================================================================== --- python/branches/release30-maint/Parser/asdl_c.py (original) +++ python/branches/release30-maint/Parser/asdl_c.py Mon Feb 2 21:41:29 2009 @@ -662,7 +662,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Python/Python-ast.c ============================================================================== --- python/branches/release30-maint/Python/Python-ast.c (original) +++ python/branches/release30-maint/Python/Python-ast.c Mon Feb 2 21:41:29 2009 @@ -479,7 +479,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Python/bltinmodule.c ============================================================================== --- python/branches/release30-maint/Python/bltinmodule.c (original) +++ python/branches/release30-maint/Python/bltinmodule.c Mon Feb 2 21:41:29 2009 @@ -417,7 +417,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1018,7 +1018,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2169,7 +2169,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Python/import.c ============================================================================== --- python/branches/release30-maint/Python/import.c (original) +++ python/branches/release30-maint/Python/import.c Mon Feb 2 21:41:29 2009 @@ -3290,7 +3290,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/release30-maint/Python/symtable.c ============================================================================== --- python/branches/release30-maint/Python/symtable.c (original) +++ python/branches/release30-maint/Python/symtable.c Mon Feb 2 21:41:29 2009 @@ -130,7 +130,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)ste_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Python/traceback.c ============================================================================== --- python/branches/release30-maint/Python/traceback.c (original) +++ python/branches/release30-maint/Python/traceback.c Mon Feb 2 21:41:29 2009 @@ -72,7 +72,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ From python-checkins at python.org Mon Feb 2 21:58:54 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 2 Feb 2009 21:58:54 +0100 (CET) Subject: [Python-checkins] r69216 - in python/branches/py3k-issue1717: Doc/c-api/allocation.rst Doc/c-api/arg.rst Doc/c-api/bool.rst Doc/c-api/buffer.rst Doc/c-api/bytearray.rst Doc/c-api/bytes.rst Doc/c-api/cell.rst Doc/c-api/cobject.rst Doc/c-api/complex.rst Doc/c-api/conversion.rst Doc/c-api/datetime.rst Doc/c-api/descriptor.rst Doc/c-api/dict.rst Doc/c-api/file.rst Doc/c-api/float.rst Doc/c-api/function.rst Doc/c-api/gcsupport.rst Doc/c-api/gen.rst Doc/c-api/import.rst Doc/c-api/iter.rst Doc/c-api/iterator.rst Doc/c-api/list.rst Doc/c-api/long.rst Doc/c-api/mapping.rst Doc/c-api/marshal.rst Doc/c-api/method.rst Doc/c-api/module.rst Doc/c-api/none.rst Doc/c-api/number.rst Doc/c-api/objbuffer.rst Doc/c-api/object.rst Doc/c-api/objimpl.rst Doc/c-api/reflection.rst Doc/c-api/sequence.rst Doc/c-api/set.rst Doc/c-api/slice.rst Doc/c-api/structures.rst Doc/c-api/sys.rst Doc/c-api/tuple.rst Doc/c-api/type.rst Doc/c-api/typeobj.rst Doc/c-api/unicode.rst Doc/c-api/weakref.rst Doc/library/ast.rst Doc/library/copyreg.rst Doc/library/fractions.rst Doc/library/html.entities.rst Doc/library/importlib.rst Doc/library/io.rst Doc/library/json.rst Doc/library/multiprocessing.rst Doc/library/plistlib.rst Doc/library/reprlib.rst Doc/reference/grammar.rst Doc/whatsnew/2.7.rst Include/code.h Lib/http/client.py Lib/importlib/NOTES Lib/importlib/_bootstrap.py Lib/tkinter/test/support.py Lib/tkinter/test/test_ttk/test_extensions.py Lib/tkinter/test/test_ttk/test_style.py Lib/tkinter/test/test_ttk/test_widgets.py Lib/xmlrpc/client.py Misc/NEWS Modules/_multiprocessing/connection.h Modules/_multiprocessing/semaphore.c Modules/_testcapimodule.c Modules/_threadmodule.c Modules/itertoolsmodule.c Objects/typeobject.c Objects/unicodeobject.c PC/getpathp.c Parser/asdl_c.py Python/Python-ast.c Message-ID: <20090202205854.25BD51E4045@bag.python.org> Author: mark.dickinson Date: Mon Feb 2 21:58:52 2009 New Revision: 69216 Log: Merged revisions 69188,69190,69192,69197-69198,69202,69207,69209-69210,69213-69214 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69188 | mark.dickinson | 2009-02-01 13:59:22 +0000 (Sun, 01 Feb 2009) | 6 lines Issue #1717, continued: remove PyObject_Compare and Py_CmpToRich declarations from object.h; don't inherit tp_compare slot on subclasses; and raise TypeError when initializing a type that has a nonzero tp_compare slot. Fix up comparison-related comments in object.c and code.h. ................ r69190 | mark.dickinson | 2009-02-01 14:18:10 +0000 (Sun, 01 Feb 2009) | 2 lines Issue #1717: documentation fixes related to the cmp removal. ................ r69192 | mark.dickinson | 2009-02-01 20:36:08 +0000 (Sun, 01 Feb 2009) | 2 lines Remove exception for non-NULL tp_compare that was introduced in r69188. ................ r69197 | guilherme.polo | 2009-02-02 01:02:20 +0000 (Mon, 02 Feb 2009) | 10 lines Recorded merge of revisions 69195 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69195 | guilherme.polo | 2009-02-01 22:38:54 -0200 (Sun, 01 Feb 2009) | 3 lines Use a single Tcl interpreter through all these tests, this may help some failing buildbots. ........ ................ r69198 | brett.cannon | 2009-02-02 05:58:30 +0000 (Mon, 02 Feb 2009) | 3 lines Note to move __package__ stuff over to rpartition to make Nick happy. Also make sure that accepting the empty string for top-level modules is okay. ................ r69202 | hirokazu.yamamoto | 2009-02-02 09:15:41 +0000 (Mon, 02 Feb 2009) | 9 lines Merged revisions 69200 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69200 | hirokazu.yamamoto | 2009-02-02 17:01:17 +0900 | 1 line Set native svn:eol-style property for text files. ........ ................ r69207 | martin.v.loewis | 2009-02-02 15:32:22 +0000 (Mon, 02 Feb 2009) | 9 lines Merged revisions 69205 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69205 | martin.v.loewis | 2009-02-02 15:23:16 +0100 (Mo, 02 Feb 2009) | 1 line Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. ........ ................ r69209 | kristjan.jonsson | 2009-02-02 16:04:04 +0000 (Mon, 02 Feb 2009) | 4 lines merging / reimplementing r68532 from the trunk to Py3k Enable buffering for HTTPResponse's fp. read() behaves identically for buffered and non-buffered IO. read(n) also won't block if n bytes are availble on the socket. There is therefore no reason not to use buffering. The reason 2.x disables buffering by default, that some clients may be accessing the underlying socket directly and so bypass the buffering buffer, doesn't apply in 3.x with its redesigned IO library. See issue 4448 and issue 4879 ................ r69210 | brett.cannon | 2009-02-02 19:19:36 +0000 (Mon, 02 Feb 2009) | 5 lines To prevent another screw-up on my part where my prototype gets lost thanks to an ``svn revert`` (gee, maybe more atomic commits by use of something like a DVCS would help with this? Wish someone would get on that ...), I am checking in an untested, work-in-progress meta path finder to handle sys.path. ................ r69213 | brett.cannon | 2009-02-02 20:32:29 +0000 (Mon, 02 Feb 2009) | 1 line Add some notes for importlib to package up what is in Python 2.7 as well as modules that can probably get replaced by importlib at some point. ................ r69214 | mark.dickinson | 2009-02-02 20:36:42 +0000 (Mon, 02 Feb 2009) | 4 lines Issue #1717: rename tp_compare to tp_reserved. I'll change the type of tp_compare in a separate commit, for ease of reversion should things go wrong. ................ Modified: python/branches/py3k-issue1717/ (props changed) python/branches/py3k-issue1717/Doc/c-api/allocation.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/arg.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/bool.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/buffer.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/bytearray.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/bytes.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/cell.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/cobject.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/complex.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/conversion.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/datetime.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/descriptor.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/dict.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/file.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/float.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/function.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/gcsupport.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/gen.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/import.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/iter.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/iterator.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/list.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/long.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/mapping.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/marshal.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/method.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/module.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/none.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/number.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/objbuffer.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/object.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/objimpl.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/reflection.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/sequence.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/set.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/slice.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/structures.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/sys.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/tuple.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/type.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/typeobj.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/unicode.rst (props changed) python/branches/py3k-issue1717/Doc/c-api/weakref.rst (props changed) python/branches/py3k-issue1717/Doc/library/ast.rst (props changed) python/branches/py3k-issue1717/Doc/library/copyreg.rst (props changed) python/branches/py3k-issue1717/Doc/library/fractions.rst (props changed) python/branches/py3k-issue1717/Doc/library/html.entities.rst (props changed) python/branches/py3k-issue1717/Doc/library/importlib.rst (props changed) python/branches/py3k-issue1717/Doc/library/io.rst (props changed) python/branches/py3k-issue1717/Doc/library/json.rst (props changed) python/branches/py3k-issue1717/Doc/library/multiprocessing.rst (props changed) python/branches/py3k-issue1717/Doc/library/plistlib.rst (props changed) python/branches/py3k-issue1717/Doc/library/reprlib.rst (props changed) python/branches/py3k-issue1717/Doc/reference/grammar.rst (props changed) python/branches/py3k-issue1717/Doc/whatsnew/2.7.rst (props changed) python/branches/py3k-issue1717/Include/code.h python/branches/py3k-issue1717/Lib/http/client.py python/branches/py3k-issue1717/Lib/importlib/NOTES python/branches/py3k-issue1717/Lib/importlib/_bootstrap.py python/branches/py3k-issue1717/Lib/tkinter/test/support.py python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_extensions.py python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_style.py python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_widgets.py python/branches/py3k-issue1717/Lib/xmlrpc/client.py python/branches/py3k-issue1717/Misc/NEWS python/branches/py3k-issue1717/Modules/_multiprocessing/connection.h python/branches/py3k-issue1717/Modules/_multiprocessing/semaphore.c python/branches/py3k-issue1717/Modules/_testcapimodule.c python/branches/py3k-issue1717/Modules/_threadmodule.c python/branches/py3k-issue1717/Modules/itertoolsmodule.c python/branches/py3k-issue1717/Objects/typeobject.c python/branches/py3k-issue1717/Objects/unicodeobject.c python/branches/py3k-issue1717/PC/getpathp.c python/branches/py3k-issue1717/Parser/asdl_c.py python/branches/py3k-issue1717/Python/Python-ast.c Modified: python/branches/py3k-issue1717/Include/code.h ============================================================================== --- python/branches/py3k-issue1717/Include/code.h (original) +++ python/branches/py3k-issue1717/Include/code.h Mon Feb 2 21:58:52 2009 @@ -20,7 +20,7 @@ PyObject *co_varnames; /* tuple of strings (local variable names) */ PyObject *co_freevars; /* tuple of strings (free variable names) */ PyObject *co_cellvars; /* tuple of strings (cell variable names) */ - /* The rest doesn't count for hash */ + /* The rest doesn't count for hash or comparisons */ PyObject *co_filename; /* unicode (where it was loaded from) */ PyObject *co_name; /* unicode (name, for reference) */ int co_firstlineno; /* first source line number */ Modified: python/branches/py3k-issue1717/Lib/http/client.py ============================================================================== --- python/branches/py3k-issue1717/Lib/http/client.py (original) +++ python/branches/py3k-issue1717/Lib/http/client.py Mon Feb 2 21:58:52 2009 @@ -265,14 +265,14 @@ # accepts iso-8859-1. def __init__(self, sock, debuglevel=0, strict=0, method=None): - # XXX If the response includes a content-length header, we + # If the response includes a content-length header, we # need to make sure that the client doesn't read more than the # specified number of bytes. If it does, it will block until # the server times out and closes the connection. (The only - # applies to HTTP/1.1 connections.) Since some clients access - # self.fp directly rather than calling read(), this is a little - # tricky. - self.fp = sock.makefile("rb", 0) + # applies to HTTP/1.1 connections.) This will happen if a self.fp.read() + # is done (without a size) whether self.fp is buffered or not. + # So, no self.fp.read() by clients unless they know what they are doing. + self.fp = sock.makefile("rb") self.debuglevel = debuglevel self.strict = strict self._method = method Modified: python/branches/py3k-issue1717/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/NOTES (original) +++ python/branches/py3k-issue1717/Lib/importlib/NOTES Mon Feb 2 21:58:52 2009 @@ -1,6 +1,12 @@ to do ///// +* Create sandbox directory for a distutils packaging of what is in Python 2.7. + +* Use rpartition for getting the package of a module. + + + Make sure that an empty string is acceptable for __package__. + * Create meta_path importer for sys.path. + Create hook. @@ -73,3 +79,9 @@ - Relative name from sys.path. * Bootstrap importlib as implementation of builtins.__import__ + +* Replace standard library modules. + + + imp + + py_compile + + compileall Modified: python/branches/py3k-issue1717/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k-issue1717/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k-issue1717/Lib/importlib/_bootstrap.py Mon Feb 2 21:58:52 2009 @@ -589,6 +589,82 @@ super(PyFileImporter, self).__init__(path_entry) +class SysPathFinder: + + """Meta path finder for sys.(path|path_hooks|path_importer_cache).""" + + def _default_hook(self, path): + """Use the default hook on 'path'. + + If the path will not work for the default hook then raise ImportError. + + """ + # TODO(brett.cannon) Implement + raise ImportError + + # The list of implicit hooks cannot be a class attribute because of + # bootstrapping issues for accessing imp. + def _implicit_hooks(self, path): + """Return a list of the implicit path hooks.""" + return [self._default_hook, imp.NullImporter] + + def _path_hooks(self, path): + """Search sys.path_hooks for a finder for 'path'. + + Guaranteed to return a finder for the path as NullImporter is the + default importer for any path that does not have an explicit finder. + + """ + for hook in sys.path_hooks + self._implicit_hooks(): + try: + return hook(path) + except ImportError: + continue + else: + # This point should never be reached thanks to NullImporter. + raise SystemError("no hook could find an importer for " + "{0}".format(path)) + + def _path_importer_cache(self, path): + """Get the finder for the path from sys.path_importer_cache. + + If the path is not in the cache, find the appropriate finder and cache + it. If None is cached, get the default finder and cache that + (if applicable). + + Because of NullImporter, some finder should be returned. The only + explicit fail case is if None is cached but the path cannot be used for + the default hook, for which ImportError is raised. + + """ + try: + finder = sys.path_importer_cache(path); + except KeyError: + finder = self._path_hooks(path) + sys.path_importer_cache[path] = finder + else: + if finder is None: + # Raises ImportError on failure. + finder = self._default_hook(path) + sys.path_importer_cache[path] = finder + return finder + + def find_module(self, fullname, path=None): + """Find the module on sys.path or 'path'.""" + if not path: + path = sys.path + for entry in path: + try: + finder = self._path_importer_cache(entry) + except ImportError: + continue + loader = finder.find_module(fullname) + if loader: + return loader + else: + return None + + class ImportLockContext(object): """Context manager for the import lock.""" Modified: python/branches/py3k-issue1717/Lib/tkinter/test/support.py ============================================================================== --- python/branches/py3k-issue1717/Lib/tkinter/test/support.py (original) +++ python/branches/py3k-issue1717/Lib/tkinter/test/support.py Mon Feb 2 21:58:52 2009 @@ -15,6 +15,14 @@ return root +def root_deiconify(): + root = get_tk_root() + root.deiconify() + +def root_withdraw(): + root = get_tk_root() + root.withdraw() + def simulate_mouse_click(widget, x, y): """Generate proper events to click at the x, y position (tries to act Modified: python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_extensions.py ============================================================================== --- python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_extensions.py (original) +++ python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_extensions.py Mon Feb 2 21:58:52 2009 @@ -10,6 +10,13 @@ class LabeledScaleTest(unittest.TestCase): + def setUp(self): + support.root_deiconify() + + def tearDown(self): + support.root_withdraw() + + def test_widget_destroy(self): # automatically created variable x = ttk.LabeledScale() @@ -175,12 +182,12 @@ class OptionMenuTest(unittest.TestCase): def setUp(self): - self.root = support.get_tk_root() - self.textvar = tkinter.StringVar(self.root) + support.root_deiconify() + self.textvar = tkinter.StringVar() def tearDown(self): del self.textvar - self.root.destroy() + support.root_withdraw() def test_widget_destroy(self): Modified: python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_style.py ============================================================================== --- python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_style.py (original) +++ python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_style.py Mon Feb 2 21:58:52 2009 @@ -10,15 +10,7 @@ class StyleTest(unittest.TestCase): def setUp(self): - self.root = support.get_tk_root() - self.style = ttk.Style(self.root) - - def tearDown(self): - # As tests have shown, these tests are likely to deliver - # <> events after the root is destroyed, so - # lets let them happen now. - self.root.update_idletasks() - self.root.destroy() + self.style = ttk.Style() def test_configure(self): Modified: python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_widgets.py ============================================================================== --- python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_widgets.py (original) +++ python/branches/py3k-issue1717/Lib/tkinter/test/test_ttk/test_widgets.py Mon Feb 2 21:58:52 2009 @@ -12,12 +12,14 @@ """Tests methods available in every ttk widget.""" def setUp(self): + support.root_deiconify() self.widget = ttk.Button() self.widget.pack() self.widget.wait_visibility() def tearDown(self): self.widget.destroy() + support.root_withdraw() def test_identify(self): @@ -107,10 +109,12 @@ class ComboboxTest(unittest.TestCase): def setUp(self): + support.root_deiconify() self.combo = ttk.Combobox() def tearDown(self): self.combo.destroy() + support.root_withdraw() def _show_drop_down_listbox(self): width = self.combo.winfo_width() @@ -195,10 +199,12 @@ class EntryTest(unittest.TestCase): def setUp(self): + support.root_deiconify() self.entry = ttk.Entry() def tearDown(self): self.entry.destroy() + support.root_withdraw() def test_bbox(self): @@ -297,10 +303,12 @@ class PanedwindowTest(unittest.TestCase): def setUp(self): + support.root_deiconify() self.paned = ttk.Panedwindow() def tearDown(self): self.paned.destroy() + support.root_withdraw() def test_add(self): @@ -445,12 +453,14 @@ class ScaleTest(unittest.TestCase): def setUp(self): + support.root_deiconify() self.scale = ttk.Scale() self.scale.pack() self.scale.update() def tearDown(self): self.scale.destroy() + support.root_withdraw() def test_custom_event(self): @@ -519,6 +529,7 @@ class NotebookTest(unittest.TestCase): def setUp(self): + support.root_deiconify() self.nb = ttk.Notebook() self.child1 = ttk.Label() self.child2 = ttk.Label() @@ -529,6 +540,7 @@ self.child1.destroy() self.child2.destroy() self.nb.destroy() + support.root_withdraw() def test_tab_identifiers(self): @@ -708,13 +720,12 @@ class TreeviewTest(unittest.TestCase): def setUp(self): - self.root = support.get_tk_root() - self.tv = ttk.Treeview(self.root) + support.root_deiconify() + self.tv = ttk.Treeview() def tearDown(self): self.tv.destroy() - self.root.update_idletasks() - self.root.destroy() + support.root_withdraw() def test_bbox(self): Modified: python/branches/py3k-issue1717/Lib/xmlrpc/client.py ============================================================================== --- python/branches/py3k-issue1717/Lib/xmlrpc/client.py (original) +++ python/branches/py3k-issue1717/Lib/xmlrpc/client.py Mon Feb 2 21:58:52 2009 @@ -1129,7 +1129,7 @@ self.verbose = verbose - return self._parse_response(resp, None) + return self.parse_response(resp) ## # Create parser. @@ -1212,29 +1212,12 @@ # @return Response tuple and target method. def parse_response(self, file): - # compatibility interface - return self._parse_response(file, None) - - ## - # Parse response (alternate interface). This is similar to the - # parse_response method, but also provides direct access to the - # underlying socket object (where available). - # - # @param file Stream. - # @param sock Socket handle (or None, if the socket object - # could not be accessed). - # @return Response tuple and target method. - - def _parse_response(self, file, sock): # read response from input file/socket, and parse it p, u = self.getparser() while 1: - if sock: - response = sock.recv(1024) - else: - response = file.read(1024) + response = file.read(1024) if not response: break if self.verbose: Modified: python/branches/py3k-issue1717/Misc/NEWS ============================================================================== --- python/branches/py3k-issue1717/Misc/NEWS (original) +++ python/branches/py3k-issue1717/Misc/NEWS Mon Feb 2 21:58:52 2009 @@ -14,8 +14,8 @@ - Issue #1717: Removed builtin cmp() function, dropped tp_compare slot, the C API functions PyObject_Compare and PyUnicode_Compare and - the type definition cmpfunc. The tp_compare slot is reserved for - future usage. + the type definition cmpfunc. The tp_compare slot has been renamed + to tp_reserved, and is reserved for future usage. - Issue #4707: round(x, n) now returns an integer if x is an integer. Previously it returned a float. @@ -374,6 +374,8 @@ Build ----- +- Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. + - Issue #4895: Use _strdup on Windows CE. - Issue #4472: "configure --enable-shared" now works on OSX Modified: python/branches/py3k-issue1717/Modules/_multiprocessing/connection.h ============================================================================== --- python/branches/py3k-issue1717/Modules/_multiprocessing/connection.h (original) +++ python/branches/py3k-issue1717/Modules/_multiprocessing/connection.h Mon Feb 2 21:58:52 2009 @@ -487,7 +487,7 @@ /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, - /* tp_reserved */ 0, + /* tp_reserved */ 0, /* tp_repr */ (reprfunc)connection_repr, /* tp_as_number */ 0, /* tp_as_sequence */ 0, Modified: python/branches/py3k-issue1717/Modules/_multiprocessing/semaphore.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_multiprocessing/semaphore.c (original) +++ python/branches/py3k-issue1717/Modules/_multiprocessing/semaphore.c Mon Feb 2 21:58:52 2009 @@ -592,7 +592,7 @@ /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, - /* tp_reserved */ 0, + /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, Modified: python/branches/py3k-issue1717/Modules/_testcapimodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_testcapimodule.c (original) +++ python/branches/py3k-issue1717/Modules/_testcapimodule.c Mon Feb 2 21:58:52 2009 @@ -187,7 +187,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k-issue1717/Modules/_threadmodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_threadmodule.c (original) +++ python/branches/py3k-issue1717/Modules/_threadmodule.c Mon Feb 2 21:58:52 2009 @@ -358,7 +358,7 @@ /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, - /* tp_reserved */ 0, + /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, Modified: python/branches/py3k-issue1717/Modules/itertoolsmodule.c ============================================================================== --- python/branches/py3k-issue1717/Modules/itertoolsmodule.c (original) +++ python/branches/py3k-issue1717/Modules/itertoolsmodule.c Mon Feb 2 21:58:52 2009 @@ -2273,7 +2273,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2700,7 +2700,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k-issue1717/Objects/typeobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/typeobject.c (original) +++ python/branches/py3k-issue1717/Objects/typeobject.c Mon Feb 2 21:58:52 2009 @@ -3662,7 +3662,7 @@ type->tp_setattr = base->tp_setattr; type->tp_setattro = base->tp_setattro; } - /* tp_reserved is ignored, see tp_richcompare */ + /* tp_reserved is ignored */ COPYSLOT(tp_repr); /* tp_hash see tp_richcompare */ COPYSLOT(tp_call); Modified: python/branches/py3k-issue1717/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k-issue1717/Objects/unicodeobject.c (original) +++ python/branches/py3k-issue1717/Objects/unicodeobject.c Mon Feb 2 21:58:52 2009 @@ -4566,7 +4566,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -9493,7 +9493,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ unicode_repr, /* tp_repr */ &unicode_as_number, /* tp_as_number */ &unicode_as_sequence, /* tp_as_sequence */ @@ -9799,7 +9799,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k-issue1717/PC/getpathp.c ============================================================================== --- python/branches/py3k-issue1717/PC/getpathp.c (original) +++ python/branches/py3k-issue1717/PC/getpathp.c Mon Feb 2 21:58:52 2009 @@ -200,6 +200,7 @@ } #ifdef MS_WINDOWS +#ifdef Py_ENABLE_SHARED /* a string loaded from the DLL at startup.*/ extern const char *PyWin_DLLVersionString; @@ -349,6 +350,7 @@ free(keyBuf); return retval; } +#endif /* Py_ENABLE_SHARED */ #endif /* MS_WINDOWS */ static void @@ -359,11 +361,15 @@ wchar_t *prog = Py_GetProgramName(); #ifdef MS_WINDOWS +#ifdef Py_ENABLE_SHARED extern HANDLE PyWin_DLLhModule; /* static init of progpath ensures final char remains \0 */ if (PyWin_DLLhModule) if (!GetModuleFileNameW(PyWin_DLLhModule, dllpath, MAXPATHLEN)) dllpath[0] = 0; +#else + dllpath[0] = 0; +#endif if (GetModuleFileNameW(NULL, progpath, MAXPATHLEN)) return; #endif @@ -471,8 +477,10 @@ } skiphome = pythonhome==NULL ? 0 : 1; +#ifdef Py_ENABLE_SHARED machinepath = getpythonregpath(HKEY_LOCAL_MACHINE, skiphome); userpath = getpythonregpath(HKEY_CURRENT_USER, skiphome); +#endif /* We only use the default relative PYTHONPATH if we havent anything better to use! */ skipdefault = envpath!=NULL || pythonhome!=NULL || \ Modified: python/branches/py3k-issue1717/Parser/asdl_c.py ============================================================================== --- python/branches/py3k-issue1717/Parser/asdl_c.py (original) +++ python/branches/py3k-issue1717/Parser/asdl_c.py Mon Feb 2 21:58:52 2009 @@ -662,7 +662,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k-issue1717/Python/Python-ast.c ============================================================================== --- python/branches/py3k-issue1717/Python/Python-ast.c (original) +++ python/branches/py3k-issue1717/Python/Python-ast.c Mon Feb 2 21:58:52 2009 @@ -479,7 +479,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ From python-checkins at python.org Mon Feb 2 22:08:32 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 2 Feb 2009 22:08:32 +0100 (CET) Subject: [Python-checkins] r69217 - python/trunk/Modules/_tkinter.c Message-ID: <20090202210832.4906C1E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 2 22:08:32 2009 New Revision: 69217 Log: Fix for issue #1581476 Modified: python/trunk/Modules/_tkinter.c Modified: python/trunk/Modules/_tkinter.c ============================================================================== --- python/trunk/Modules/_tkinter.c (original) +++ python/trunk/Modules/_tkinter.c Mon Feb 2 22:08:32 2009 @@ -1284,8 +1284,7 @@ int objc, i; PyObject *res = NULL; TkappObject *self = (TkappObject*)selfptr; - /* Could add TCL_EVAL_GLOBAL if wrapped by GlobalCall... */ - int flags = TCL_EVAL_DIRECT; + int flags = TCL_EVAL_DIRECT | TCL_EVAL_GLOBAL; /* If args is a single tuple, replace with contents of tuple */ if (1 == PyTuple_Size(args)){ From buildbot at python.org Mon Feb 2 22:10:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 21:10:14 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090202211014.D6FCF1E402C@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/4571 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Mon Feb 2 22:11:16 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 2 Feb 2009 22:11:16 +0100 (CET) Subject: [Python-checkins] r69218 - python/branches/py3k/Include/object.h Message-ID: <20090202211116.824301E4010@bag.python.org> Author: mark.dickinson Date: Mon Feb 2 22:11:16 2009 New Revision: 69218 Log: Change type of tp_reserved from cmpfunc to (void *); remove definition of cmpfunc. Modified: python/branches/py3k/Include/object.h Modified: python/branches/py3k/Include/object.h ============================================================================== --- python/branches/py3k/Include/object.h (original) +++ python/branches/py3k/Include/object.h Mon Feb 2 22:11:16 2009 @@ -274,7 +274,6 @@ typedef PyObject *(*getattrofunc)(PyObject *, PyObject *); typedef int (*setattrfunc)(PyObject *, char *, PyObject *); typedef int (*setattrofunc)(PyObject *, PyObject *, PyObject *); -typedef int (*cmpfunc)(PyObject *, PyObject *); typedef PyObject *(*reprfunc)(PyObject *); typedef long (*hashfunc)(PyObject *); typedef PyObject *(*richcmpfunc) (PyObject *, PyObject *, int); @@ -297,7 +296,7 @@ printfunc tp_print; getattrfunc tp_getattr; setattrfunc tp_setattr; - cmpfunc tp_reserved; + void *tp_reserved; /* formerly known as tp_compare */ reprfunc tp_repr; /* Method suites for standard classes */ From python-checkins at python.org Mon Feb 2 22:14:14 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 2 Feb 2009 22:14:14 +0100 (CET) Subject: [Python-checkins] r69219 - python/trunk/Misc/NEWS Message-ID: <20090202211414.A443D1E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 2 22:14:14 2009 New Revision: 69219 Log: NEWS entry for issue #1581476 Modified: python/trunk/Misc/NEWS Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Feb 2 22:14:14 2009 @@ -145,6 +145,8 @@ Library ------- +- Issue #1581476: Always use the Tcl global namespace when calling into Tcl. + - Issue #2047: shutil.move() could believe that its destination path was inside its source path if it began with the same letters (e.g. "src" vs. "src.new"). From python-checkins at python.org Mon Feb 2 22:15:41 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 2 Feb 2009 22:15:41 +0100 (CET) Subject: [Python-checkins] r69220 - in python/branches/release26-maint: Misc/NEWS Modules/_tkinter.c Message-ID: <20090202211541.9F8731E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 2 22:15:41 2009 New Revision: 69220 Log: Merged revisions 69217,69219 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69217 | guilherme.polo | 2009-02-02 19:08:32 -0200 (Mon, 02 Feb 2009) | 1 line Fix for issue #1581476 ........ r69219 | guilherme.polo | 2009-02-02 19:14:14 -0200 (Mon, 02 Feb 2009) | 1 line NEWS entry for issue #1581476 ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/_tkinter.c Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Mon Feb 2 22:15:41 2009 @@ -76,6 +76,8 @@ Library ------- +- Issue #1581476: Always use the Tcl global namespace when calling into Tcl. + - Issue #2047: shutil.move() could believe that its destination path was inside its source path if it began with the same letters (e.g. "src" vs. "src.new"). Modified: python/branches/release26-maint/Modules/_tkinter.c ============================================================================== --- python/branches/release26-maint/Modules/_tkinter.c (original) +++ python/branches/release26-maint/Modules/_tkinter.c Mon Feb 2 22:15:41 2009 @@ -1284,8 +1284,7 @@ int objc, i; PyObject *res = NULL; TkappObject *self = (TkappObject*)selfptr; - /* Could add TCL_EVAL_GLOBAL if wrapped by GlobalCall... */ - int flags = TCL_EVAL_DIRECT; + int flags = TCL_EVAL_DIRECT | TCL_EVAL_GLOBAL; /* If args is a single tuple, replace with contents of tuple */ if (1 == PyTuple_Size(args)){ From python-checkins at python.org Mon Feb 2 22:16:47 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 2 Feb 2009 22:16:47 +0100 (CET) Subject: [Python-checkins] r69221 - in python/branches/release30-maint: Include/object.h Message-ID: <20090202211647.869111E4002@bag.python.org> Author: mark.dickinson Date: Mon Feb 2 22:16:47 2009 New Revision: 69221 Log: Merged revisions 69218 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69218 | mark.dickinson | 2009-02-02 21:11:16 +0000 (Mon, 02 Feb 2009) | 3 lines Change type of tp_reserved from cmpfunc to (void *); remove definition of cmpfunc. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Include/object.h Modified: python/branches/release30-maint/Include/object.h ============================================================================== --- python/branches/release30-maint/Include/object.h (original) +++ python/branches/release30-maint/Include/object.h Mon Feb 2 22:16:47 2009 @@ -274,7 +274,6 @@ typedef PyObject *(*getattrofunc)(PyObject *, PyObject *); typedef int (*setattrfunc)(PyObject *, char *, PyObject *); typedef int (*setattrofunc)(PyObject *, PyObject *, PyObject *); -typedef int (*cmpfunc)(PyObject *, PyObject *); typedef PyObject *(*reprfunc)(PyObject *); typedef long (*hashfunc)(PyObject *); typedef PyObject *(*richcmpfunc) (PyObject *, PyObject *, int); @@ -297,7 +296,7 @@ printfunc tp_print; getattrfunc tp_getattr; setattrfunc tp_setattr; - cmpfunc tp_reserved; + void *tp_reserved; /* formerly known as tp_compare */ reprfunc tp_repr; /* Method suites for standard classes */ From python-checkins at python.org Mon Feb 2 22:17:10 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 2 Feb 2009 22:17:10 +0100 (CET) Subject: [Python-checkins] r69222 - in python/branches/py3k: Misc/NEWS Modules/_tkinter.c Message-ID: <20090202211710.2454F1E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 2 22:17:09 2009 New Revision: 69222 Log: Merged revisions 69217,69219 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69217 | guilherme.polo | 2009-02-02 19:08:32 -0200 (Mon, 02 Feb 2009) | 1 line Fix for issue #1581476 ........ r69219 | guilherme.polo | 2009-02-02 19:14:14 -0200 (Mon, 02 Feb 2009) | 1 line NEWS entry for issue #1581476 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_tkinter.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon Feb 2 22:17:09 2009 @@ -152,6 +152,8 @@ Library ------- +- Issue #1581476: Always use the Tcl global namespace when calling into Tcl. + - Fix a bug in the trace module where a bytes object from co_lnotab had its items being passed through ord(). Modified: python/branches/py3k/Modules/_tkinter.c ============================================================================== --- python/branches/py3k/Modules/_tkinter.c (original) +++ python/branches/py3k/Modules/_tkinter.c Mon Feb 2 22:17:09 2009 @@ -1236,8 +1236,7 @@ int objc, i; PyObject *res = NULL; TkappObject *self = (TkappObject*)selfptr; - /* Could add TCL_EVAL_GLOBAL if wrapped by GlobalCall... */ - int flags = TCL_EVAL_DIRECT; + int flags = TCL_EVAL_DIRECT | TCL_EVAL_GLOBAL; /* If args is a single tuple, replace with contents of tuple */ if (1 == PyTuple_Size(args)){ From python-checkins at python.org Mon Feb 2 22:23:52 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 2 Feb 2009 22:23:52 +0100 (CET) Subject: [Python-checkins] r69223 - in python/branches/release30-maint: Misc/NEWS Modules/_tkinter.c Message-ID: <20090202212352.B19061E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 2 22:23:52 2009 New Revision: 69223 Log: Merged revisions 69222 via svnmerge from svn+ssh://pythondev/python/branches/py3k ................ r69222 | guilherme.polo | 2009-02-02 19:17:09 -0200 (Mon, 02 Feb 2009) | 13 lines Merged revisions 69217,69219 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69217 | guilherme.polo | 2009-02-02 19:08:32 -0200 (Mon, 02 Feb 2009) | 1 line Fix for issue #1581476 ........ r69219 | guilherme.polo | 2009-02-02 19:14:14 -0200 (Mon, 02 Feb 2009) | 1 line NEWS entry for issue #1581476 ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/_tkinter.c Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Mon Feb 2 22:23:52 2009 @@ -108,6 +108,8 @@ Library ------- +- Issue #1581476: Always use the Tcl global namespace when calling into Tcl. + - Issue #2047: shutil.move() could believe that its destination path was inside its source path if it began with the same letters (e.g. "src" vs. "src.new"). Modified: python/branches/release30-maint/Modules/_tkinter.c ============================================================================== --- python/branches/release30-maint/Modules/_tkinter.c (original) +++ python/branches/release30-maint/Modules/_tkinter.c Mon Feb 2 22:23:52 2009 @@ -1236,8 +1236,7 @@ int objc, i; PyObject *res = NULL; TkappObject *self = (TkappObject*)selfptr; - /* Could add TCL_EVAL_GLOBAL if wrapped by GlobalCall... */ - int flags = TCL_EVAL_DIRECT; + int flags = TCL_EVAL_DIRECT | TCL_EVAL_GLOBAL; /* If args is a single tuple, replace with contents of tuple */ if (1 == PyTuple_Size(args)){ From python-checkins at python.org Mon Feb 2 22:29:40 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 2 Feb 2009 22:29:40 +0100 (CET) Subject: [Python-checkins] r69224 - in python/branches/py3k: Doc/c-api/typeobj.rst Doc/extending/newtypes.rst Doc/includes/noddy.c Doc/includes/noddy2.c Doc/includes/noddy3.c Doc/includes/noddy4.c Doc/includes/shoddy.c Doc/includes/typestruct.h Tools/framer/framer/slots.py Message-ID: <20090202212940.5EAC51E4002@bag.python.org> Author: mark.dickinson Date: Mon Feb 2 22:29:40 2009 New Revision: 69224 Log: Issue #1717, continued: Doc fixes and other cleanup related to renaming of tp_compare. Modified: python/branches/py3k/Doc/c-api/typeobj.rst python/branches/py3k/Doc/extending/newtypes.rst 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 python/branches/py3k/Doc/includes/shoddy.c python/branches/py3k/Doc/includes/typestruct.h python/branches/py3k/Tools/framer/framer/slots.py Modified: python/branches/py3k/Doc/c-api/typeobj.rst ============================================================================== --- python/branches/py3k/Doc/c-api/typeobj.rst (original) +++ python/branches/py3k/Doc/c-api/typeobj.rst Mon Feb 2 22:29:40 2009 @@ -23,7 +23,7 @@ Typedefs: unaryfunc, binaryfunc, ternaryfunc, inquiry, intargfunc, intintargfunc, intobjargproc, intintobjargproc, objobjargproc, destructor, freefunc, printfunc, getattrfunc, getattrofunc, setattrfunc, setattrofunc, -cmpfunc, reprfunc, hashfunc +reprfunc, hashfunc The structure definition for :ctype:`PyTypeObject` can be found in :file:`Include/object.h`. For convenience of reference, this repeats the @@ -244,19 +244,9 @@ the subtype's :attr:`tp_setattr` and :attr:`tp_setattro` are both *NULL*. -.. cmember:: cmpfunc PyTypeObject.tp_compare +.. cmember:: void* PyTypeObject.tp_reserved - An optional pointer to the three-way comparison function. - - The signature is the same as for :cfunc:`PyObject_Compare`. The function should - return ``1`` if *self* greater than *other*, ``0`` if *self* is equal to - *other*, and ``-1`` if *self* less than *other*. It should return ``-1`` and - set an exception condition when an error occurred during the comparison. - - This field is inherited by subtypes together with :attr:`tp_richcompare` and - :attr:`tp_hash`: a subtypes inherits all three of :attr:`tp_compare`, - :attr:`tp_richcompare`, and :attr:`tp_hash` when the subtype's - :attr:`tp_compare`, :attr:`tp_richcompare`, and :attr:`tp_hash` are all *NULL*. + Reserved slot, formerly known as tp_compare. .. cmember:: reprfunc PyTypeObject.tp_repr @@ -329,14 +319,13 @@ the Python level will result in the ``tp_hash`` slot being set to :cfunc:`PyObject_HashNotImplemented`. - When this field is not set, two possibilities exist: if the :attr:`tp_compare` - and :attr:`tp_richcompare` fields are both *NULL*, a default hash value based on - the object's address is returned; otherwise, a :exc:`TypeError` is raised. - - This field is inherited by subtypes together with :attr:`tp_richcompare` and - :attr:`tp_compare`: a subtypes inherits all three of :attr:`tp_compare`, - :attr:`tp_richcompare`, and :attr:`tp_hash`, when the subtype's - :attr:`tp_compare`, :attr:`tp_richcompare` and :attr:`tp_hash` are all *NULL*. + When this field is not set, an attempt to take the hash of the + object raises :exc:`TypeError`. + + This field is inherited by subtypes together with + :attr:`tp_richcompare`: a subtype inherits both of + :attr:`tp_richcompare` and :attr:`tp_hash`, when the subtype's + :attr:`tp_richcompare` and :attr:`tp_hash` are both *NULL*. .. cmember:: ternaryfunc PyTypeObject.tp_call @@ -596,10 +585,10 @@ comparisons makes sense (e.g. ``==`` and ``!=``, but not ``<`` and friends), directly raise :exc:`TypeError` in the rich comparison function. - This field is inherited by subtypes together with :attr:`tp_compare` and - :attr:`tp_hash`: a subtype inherits all three of :attr:`tp_compare`, - :attr:`tp_richcompare`, and :attr:`tp_hash`, when the subtype's - :attr:`tp_compare`, :attr:`tp_richcompare`, and :attr:`tp_hash` are all *NULL*. + This field is inherited by subtypes together with :attr:`tp_hash`: + a subtype inherits :attr:`tp_richcompare` and :attr:`tp_hash` when + the subtype's :attr:`tp_richcompare` and :attr:`tp_hash` are both + *NULL*. The following constants are defined to be used as the third argument for :attr:`tp_richcompare` and for :cfunc:`PyObject_RichCompare`: Modified: python/branches/py3k/Doc/extending/newtypes.rst ============================================================================== --- python/branches/py3k/Doc/extending/newtypes.rst (original) +++ python/branches/py3k/Doc/extending/newtypes.rst Mon Feb 2 22:29:40 2009 @@ -80,7 +80,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1484,10 +1484,10 @@ comes with the source distribution of Python. In order to learn how to implement any specific method for your new data type, -do the following: Download and unpack the Python source distribution. Go the -:file:`Objects` directory, then search the C source files for ``tp_`` plus the -function you want (for example, ``tp_compare``). You will find examples of the -function you want to implement. +do the following: Download and unpack the Python source distribution. Go to +the :file:`Objects` directory, then search the C source files for ``tp_`` plus +the function you want (for example, ``tp_richcompare``). You will find examples +of the function you want to implement. When you need to verify that an object is an instance of the type you are implementing, use the :cfunc:`PyObject_TypeCheck` function. A sample of its use Modified: python/branches/py3k/Doc/includes/noddy.c ============================================================================== --- python/branches/py3k/Doc/includes/noddy.c (original) +++ python/branches/py3k/Doc/includes/noddy.c Mon Feb 2 22:29:40 2009 @@ -14,7 +14,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Doc/includes/noddy2.c ============================================================================== --- python/branches/py3k/Doc/includes/noddy2.c (original) +++ python/branches/py3k/Doc/includes/noddy2.c Mon Feb 2 22:29:40 2009 @@ -131,7 +131,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Doc/includes/noddy3.c ============================================================================== --- python/branches/py3k/Doc/includes/noddy3.c (original) +++ python/branches/py3k/Doc/includes/noddy3.c Mon Feb 2 22:29:40 2009 @@ -184,7 +184,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Doc/includes/noddy4.c ============================================================================== --- python/branches/py3k/Doc/includes/noddy4.c (original) +++ python/branches/py3k/Doc/includes/noddy4.c Mon Feb 2 22:29:40 2009 @@ -165,7 +165,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Doc/includes/shoddy.c ============================================================================== --- python/branches/py3k/Doc/includes/shoddy.c (original) +++ python/branches/py3k/Doc/includes/shoddy.c Mon Feb 2 22:29:40 2009 @@ -39,7 +39,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/py3k/Doc/includes/typestruct.h ============================================================================== --- python/branches/py3k/Doc/includes/typestruct.h (original) +++ python/branches/py3k/Doc/includes/typestruct.h Mon Feb 2 22:29:40 2009 @@ -9,7 +9,7 @@ printfunc tp_print; getattrfunc tp_getattr; setattrfunc tp_setattr; - cmpfunc tp_compare; + void *tp_reserved; reprfunc tp_repr; /* Method suites for standard classes */ Modified: python/branches/py3k/Tools/framer/framer/slots.py ============================================================================== --- python/branches/py3k/Tools/framer/framer/slots.py (original) +++ python/branches/py3k/Tools/framer/framer/slots.py Mon Feb 2 22:29:40 2009 @@ -15,7 +15,7 @@ Slot("tp_print", "printfunc"), Slot("tp_getattr", "getattrfunc"), Slot("tp_setattr", "setattrfunc"), - Slot("tp_compare", "cmpfunc", "__cmp__"), + Slot("tp_reserved", "void*"), Slot("tp_repr", "reprfunc", "__repr__"), Slot("tp_as_number"), Slot("tp_as_sequence"), From python-checkins at python.org Mon Feb 2 22:37:16 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 2 Feb 2009 22:37:16 +0100 (CET) Subject: [Python-checkins] r69225 - in python/branches/release30-maint: Doc/c-api/typeobj.rst Doc/extending/newtypes.rst Doc/includes/noddy.c Doc/includes/noddy2.c Doc/includes/noddy3.c Doc/includes/noddy4.c Doc/includes/shoddy.c Doc/includes/typestruct.h Tools/framer/framer/slots.py Message-ID: <20090202213716.CBB4D1E4002@bag.python.org> Author: mark.dickinson Date: Mon Feb 2 22:37:16 2009 New Revision: 69225 Log: Merged revisions 69224 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69224 | mark.dickinson | 2009-02-02 21:29:40 +0000 (Mon, 02 Feb 2009) | 3 lines Issue #1717, continued: Doc fixes and other cleanup related to renaming of tp_compare. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/c-api/typeobj.rst python/branches/release30-maint/Doc/extending/newtypes.rst python/branches/release30-maint/Doc/includes/noddy.c python/branches/release30-maint/Doc/includes/noddy2.c python/branches/release30-maint/Doc/includes/noddy3.c python/branches/release30-maint/Doc/includes/noddy4.c python/branches/release30-maint/Doc/includes/shoddy.c python/branches/release30-maint/Doc/includes/typestruct.h python/branches/release30-maint/Tools/framer/framer/slots.py Modified: python/branches/release30-maint/Doc/c-api/typeobj.rst ============================================================================== --- python/branches/release30-maint/Doc/c-api/typeobj.rst (original) +++ python/branches/release30-maint/Doc/c-api/typeobj.rst Mon Feb 2 22:37:16 2009 @@ -23,7 +23,7 @@ Typedefs: unaryfunc, binaryfunc, ternaryfunc, inquiry, intargfunc, intintargfunc, intobjargproc, intintobjargproc, objobjargproc, destructor, freefunc, printfunc, getattrfunc, getattrofunc, setattrfunc, setattrofunc, -cmpfunc, reprfunc, hashfunc +reprfunc, hashfunc The structure definition for :ctype:`PyTypeObject` can be found in :file:`Include/object.h`. For convenience of reference, this repeats the @@ -244,19 +244,9 @@ the subtype's :attr:`tp_setattr` and :attr:`tp_setattro` are both *NULL*. -.. cmember:: cmpfunc PyTypeObject.tp_compare +.. cmember:: void* PyTypeObject.tp_reserved - An optional pointer to the three-way comparison function. - - The signature is the same as for :cfunc:`PyObject_Compare`. The function should - return ``1`` if *self* greater than *other*, ``0`` if *self* is equal to - *other*, and ``-1`` if *self* less than *other*. It should return ``-1`` and - set an exception condition when an error occurred during the comparison. - - This field is inherited by subtypes together with :attr:`tp_richcompare` and - :attr:`tp_hash`: a subtypes inherits all three of :attr:`tp_compare`, - :attr:`tp_richcompare`, and :attr:`tp_hash` when the subtype's - :attr:`tp_compare`, :attr:`tp_richcompare`, and :attr:`tp_hash` are all *NULL*. + Reserved slot, formerly known as tp_compare. .. cmember:: reprfunc PyTypeObject.tp_repr @@ -329,14 +319,13 @@ the Python level will result in the ``tp_hash`` slot being set to :cfunc:`PyObject_HashNotImplemented`. - When this field is not set, two possibilities exist: if the :attr:`tp_compare` - and :attr:`tp_richcompare` fields are both *NULL*, a default hash value based on - the object's address is returned; otherwise, a :exc:`TypeError` is raised. - - This field is inherited by subtypes together with :attr:`tp_richcompare` and - :attr:`tp_compare`: a subtypes inherits all three of :attr:`tp_compare`, - :attr:`tp_richcompare`, and :attr:`tp_hash`, when the subtype's - :attr:`tp_compare`, :attr:`tp_richcompare` and :attr:`tp_hash` are all *NULL*. + When this field is not set, an attempt to take the hash of the + object raises :exc:`TypeError`. + + This field is inherited by subtypes together with + :attr:`tp_richcompare`: a subtype inherits both of + :attr:`tp_richcompare` and :attr:`tp_hash`, when the subtype's + :attr:`tp_richcompare` and :attr:`tp_hash` are both *NULL*. .. cmember:: ternaryfunc PyTypeObject.tp_call @@ -596,10 +585,10 @@ comparisons makes sense (e.g. ``==`` and ``!=``, but not ``<`` and friends), directly raise :exc:`TypeError` in the rich comparison function. - This field is inherited by subtypes together with :attr:`tp_compare` and - :attr:`tp_hash`: a subtype inherits all three of :attr:`tp_compare`, - :attr:`tp_richcompare`, and :attr:`tp_hash`, when the subtype's - :attr:`tp_compare`, :attr:`tp_richcompare`, and :attr:`tp_hash` are all *NULL*. + This field is inherited by subtypes together with :attr:`tp_hash`: + a subtype inherits :attr:`tp_richcompare` and :attr:`tp_hash` when + the subtype's :attr:`tp_richcompare` and :attr:`tp_hash` are both + *NULL*. The following constants are defined to be used as the third argument for :attr:`tp_richcompare` and for :cfunc:`PyObject_RichCompare`: Modified: python/branches/release30-maint/Doc/extending/newtypes.rst ============================================================================== --- python/branches/release30-maint/Doc/extending/newtypes.rst (original) +++ python/branches/release30-maint/Doc/extending/newtypes.rst Mon Feb 2 22:37:16 2009 @@ -80,7 +80,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1484,10 +1484,10 @@ comes with the source distribution of Python. In order to learn how to implement any specific method for your new data type, -do the following: Download and unpack the Python source distribution. Go the -:file:`Objects` directory, then search the C source files for ``tp_`` plus the -function you want (for example, ``tp_compare``). You will find examples of the -function you want to implement. +do the following: Download and unpack the Python source distribution. Go to +the :file:`Objects` directory, then search the C source files for ``tp_`` plus +the function you want (for example, ``tp_richcompare``). You will find examples +of the function you want to implement. When you need to verify that an object is an instance of the type you are implementing, use the :cfunc:`PyObject_TypeCheck` function. A sample of its use Modified: python/branches/release30-maint/Doc/includes/noddy.c ============================================================================== --- python/branches/release30-maint/Doc/includes/noddy.c (original) +++ python/branches/release30-maint/Doc/includes/noddy.c Mon Feb 2 22:37:16 2009 @@ -14,7 +14,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Doc/includes/noddy2.c ============================================================================== --- python/branches/release30-maint/Doc/includes/noddy2.c (original) +++ python/branches/release30-maint/Doc/includes/noddy2.c Mon Feb 2 22:37:16 2009 @@ -131,7 +131,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Doc/includes/noddy3.c ============================================================================== --- python/branches/release30-maint/Doc/includes/noddy3.c (original) +++ python/branches/release30-maint/Doc/includes/noddy3.c Mon Feb 2 22:37:16 2009 @@ -184,7 +184,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Doc/includes/noddy4.c ============================================================================== --- python/branches/release30-maint/Doc/includes/noddy4.c (original) +++ python/branches/release30-maint/Doc/includes/noddy4.c Mon Feb 2 22:37:16 2009 @@ -165,7 +165,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Doc/includes/shoddy.c ============================================================================== --- python/branches/release30-maint/Doc/includes/shoddy.c (original) +++ python/branches/release30-maint/Doc/includes/shoddy.c Mon Feb 2 22:37:16 2009 @@ -39,7 +39,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/release30-maint/Doc/includes/typestruct.h ============================================================================== --- python/branches/release30-maint/Doc/includes/typestruct.h (original) +++ python/branches/release30-maint/Doc/includes/typestruct.h Mon Feb 2 22:37:16 2009 @@ -9,7 +9,7 @@ printfunc tp_print; getattrfunc tp_getattr; setattrfunc tp_setattr; - cmpfunc tp_compare; + void *tp_reserved; reprfunc tp_repr; /* Method suites for standard classes */ Modified: python/branches/release30-maint/Tools/framer/framer/slots.py ============================================================================== --- python/branches/release30-maint/Tools/framer/framer/slots.py (original) +++ python/branches/release30-maint/Tools/framer/framer/slots.py Mon Feb 2 22:37:16 2009 @@ -15,7 +15,7 @@ Slot("tp_print", "printfunc"), Slot("tp_getattr", "getattrfunc"), Slot("tp_setattr", "setattrfunc"), - Slot("tp_compare", "cmpfunc", "__cmp__"), + Slot("tp_reserved", "void*"), Slot("tp_repr", "reprfunc", "__repr__"), Slot("tp_as_number"), Slot("tp_as_sequence"), From python-checkins at python.org Mon Feb 2 22:42:24 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 2 Feb 2009 22:42:24 +0100 (CET) Subject: [Python-checkins] r69226 - in python/branches/py3k-issue1717: Doc/c-api/typeobj.rst Doc/extending/newtypes.rst Misc/NEWS Modules/_tkinter.c Message-ID: <20090202214224.8AE631E4002@bag.python.org> Author: mark.dickinson Date: Mon Feb 2 22:42:24 2009 New Revision: 69226 Log: Merged revisions 69218,69222,69224 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69218 | mark.dickinson | 2009-02-02 21:11:16 +0000 (Mon, 02 Feb 2009) | 3 lines Change type of tp_reserved from cmpfunc to (void *); remove definition of cmpfunc. ................ r69222 | guilherme.polo | 2009-02-02 21:17:09 +0000 (Mon, 02 Feb 2009) | 13 lines Merged revisions 69217,69219 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69217 | guilherme.polo | 2009-02-02 19:08:32 -0200 (Mon, 02 Feb 2009) | 1 line Fix for issue #1581476 ........ r69219 | guilherme.polo | 2009-02-02 19:14:14 -0200 (Mon, 02 Feb 2009) | 1 line NEWS entry for issue #1581476 ........ ................ r69224 | mark.dickinson | 2009-02-02 21:29:40 +0000 (Mon, 02 Feb 2009) | 3 lines Issue #1717, continued: Doc fixes and other cleanup related to renaming of tp_compare. ................ Modified: python/branches/py3k-issue1717/ (props changed) python/branches/py3k-issue1717/Doc/c-api/typeobj.rst python/branches/py3k-issue1717/Doc/extending/newtypes.rst python/branches/py3k-issue1717/Misc/NEWS python/branches/py3k-issue1717/Modules/_tkinter.c Modified: python/branches/py3k-issue1717/Doc/c-api/typeobj.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/c-api/typeobj.rst (original) +++ python/branches/py3k-issue1717/Doc/c-api/typeobj.rst Mon Feb 2 22:42:24 2009 @@ -246,7 +246,7 @@ .. cmember:: void* PyTypeObject.tp_reserved - Reserved slot, formaly known as tp_compare. + Reserved slot, formerly known as tp_compare. .. cmember:: reprfunc PyTypeObject.tp_repr @@ -319,14 +319,13 @@ the Python level will result in the ``tp_hash`` slot being set to :cfunc:`PyObject_HashNotImplemented`. - When this field is not set, two possibilities exist: if the :attr:`tp_reserved` - and :attr:`tp_richcompare` fields are both *NULL*, a default hash value based on - the object's address is returned; otherwise, a :exc:`TypeError` is raised. - - This field is inherited by subtypes together with :attr:`tp_richcompare` and - :attr:`tp_reserved`: a subtypes inherits all three of :attr:`tp_reserved`, - :attr:`tp_richcompare`, and :attr:`tp_hash`, when the subtype's - :attr:`tp_reserved`, :attr:`tp_richcompare` and :attr:`tp_hash` are all *NULL*. + When this field is not set, an attempt to take the hash of the + object raises :exc:`TypeError`. + + This field is inherited by subtypes together with + :attr:`tp_richcompare`: a subtype inherits both of + :attr:`tp_richcompare` and :attr:`tp_hash`, when the subtype's + :attr:`tp_richcompare` and :attr:`tp_hash` are both *NULL*. .. cmember:: ternaryfunc PyTypeObject.tp_call @@ -586,10 +585,10 @@ comparisons makes sense (e.g. ``==`` and ``!=``, but not ``<`` and friends), directly raise :exc:`TypeError` in the rich comparison function. - This field is inherited by subtypes together with :attr:`tp_reserved` and - :attr:`tp_hash`: a subtype inherits all three of :attr:`tp_reserved`, - :attr:`tp_richcompare`, and :attr:`tp_hash`, when the subtype's - :attr:`tp_reserved`, :attr:`tp_richcompare`, and :attr:`tp_hash` are all *NULL*. + This field is inherited by subtypes together with :attr:`tp_hash`: + a subtype inherits :attr:`tp_richcompare` and :attr:`tp_hash` when + the subtype's :attr:`tp_richcompare` and :attr:`tp_hash` are both + *NULL*. The following constants are defined to be used as the third argument for :attr:`tp_richcompare` and for :cfunc:`PyObject_RichCompare`: Modified: python/branches/py3k-issue1717/Doc/extending/newtypes.rst ============================================================================== --- python/branches/py3k-issue1717/Doc/extending/newtypes.rst (original) +++ python/branches/py3k-issue1717/Doc/extending/newtypes.rst Mon Feb 2 22:42:24 2009 @@ -1253,7 +1253,7 @@ greater than, respectively; as of Python 2.2, this is no longer allowed. In the future, other return values may be assigned a different meaning.) - A :attr:`tp_reserved` handler may raise an exception. In this case it should + A :attr:`tp_compare` handler may raise an exception. In this case it should return a negative value. The caller has to test for the exception using :cfunc:`PyErr_Occurred`. @@ -1484,10 +1484,10 @@ comes with the source distribution of Python. In order to learn how to implement any specific method for your new data type, -do the following: Download and unpack the Python source distribution. Go the -:file:`Objects` directory, then search the C source files for ``tp_`` plus the -function you want (for example, ``tp_reserved``). You will find examples of the -function you want to implement. +do the following: Download and unpack the Python source distribution. Go to +the :file:`Objects` directory, then search the C source files for ``tp_`` plus +the function you want (for example, ``tp_richcompare``). You will find examples +of the function you want to implement. When you need to verify that an object is an instance of the type you are implementing, use the :cfunc:`PyObject_TypeCheck` function. A sample of its use Modified: python/branches/py3k-issue1717/Misc/NEWS ============================================================================== --- python/branches/py3k-issue1717/Misc/NEWS (original) +++ python/branches/py3k-issue1717/Misc/NEWS Mon Feb 2 22:42:24 2009 @@ -152,6 +152,8 @@ Library ------- +- Issue #1581476: Always use the Tcl global namespace when calling into Tcl. + - Fix a bug in the trace module where a bytes object from co_lnotab had its items being passed through ord(). Modified: python/branches/py3k-issue1717/Modules/_tkinter.c ============================================================================== --- python/branches/py3k-issue1717/Modules/_tkinter.c (original) +++ python/branches/py3k-issue1717/Modules/_tkinter.c Mon Feb 2 22:42:24 2009 @@ -1236,8 +1236,7 @@ int objc, i; PyObject *res = NULL; TkappObject *self = (TkappObject*)selfptr; - /* Could add TCL_EVAL_GLOBAL if wrapped by GlobalCall... */ - int flags = TCL_EVAL_DIRECT; + int flags = TCL_EVAL_DIRECT | TCL_EVAL_GLOBAL; /* If args is a single tuple, replace with contents of tuple */ if (1 == PyTuple_Size(args)){ From python-checkins at python.org Mon Feb 2 22:50:13 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 2 Feb 2009 22:50:13 +0100 (CET) Subject: [Python-checkins] r69227 - in python/trunk: Include/abstract.h Lib/test/test_iterlen.py Misc/NEWS Objects/abstract.c Objects/bytearrayobject.c Objects/listobject.c Python/bltinmodule.c Message-ID: <20090202215013.9B1051E4039@bag.python.org> Author: raymond.hettinger Date: Mon Feb 2 22:50:13 2009 New Revision: 69227 Log: Issue 1242657: list(obj) can swallow KeyboardInterrupt. Modified: python/trunk/Include/abstract.h python/trunk/Lib/test/test_iterlen.py python/trunk/Misc/NEWS python/trunk/Objects/abstract.c python/trunk/Objects/bytearrayobject.c python/trunk/Objects/listobject.c python/trunk/Python/bltinmodule.c Modified: python/trunk/Include/abstract.h ============================================================================== --- python/trunk/Include/abstract.h (original) +++ python/trunk/Include/abstract.h Mon Feb 2 22:50:13 2009 @@ -438,7 +438,7 @@ /* Guess the size of object o using len(o) or o.__length_hint__(). If neither of those return a non-negative value, then return the - default value. This function never fails. All exceptions are cleared. + default value. If one of the calls fails, this function returns -1. */ PyAPI_FUNC(PyObject *) PyObject_GetItem(PyObject *o, PyObject *key); Modified: python/trunk/Lib/test/test_iterlen.py ============================================================================== --- python/trunk/Lib/test/test_iterlen.py (original) +++ python/trunk/Lib/test/test_iterlen.py Mon Feb 2 22:50:13 2009 @@ -195,6 +195,36 @@ d.extend(xrange(20)) self.assertEqual(len(it), 0) +## -- Check to make sure exceptions are not suppressed by __length_hint__() + + +class BadLen(object): + def __iter__(self): return iter(range(10)) + def __len__(self): + raise RuntimeError('hello') + +class BadLengthHint(object): + def __iter__(self): return iter(range(10)) + def __length_hint__(self): + raise RuntimeError('hello') + +class TestLengthHintExceptions(unittest.TestCase): + + def test_issue1242657(self): + self.assertRaises(RuntimeError, list, BadLen()) + self.assertRaises(RuntimeError, list, BadLengthHint()) + self.assertRaises(RuntimeError, [].extend, BadLen()) + self.assertRaises(RuntimeError, [].extend, BadLengthHint()) + self.assertRaises(RuntimeError, zip, BadLen()) + self.assertRaises(RuntimeError, zip, BadLengthHint()) + self.assertRaises(RuntimeError, filter, None, BadLen()) + self.assertRaises(RuntimeError, filter, None, BadLengthHint()) + self.assertRaises(RuntimeError, map, chr, BadLen()) + self.assertRaises(RuntimeError, map, chr, BadLengthHint()) + b = bytearray(range(10)) + self.assertRaises(RuntimeError, b.extend, BadLen()) + self.assertRaises(RuntimeError, b.extend, BadLengthHint()) + def test_main(): unittests = [ TestRepeat, @@ -209,6 +239,7 @@ TestSet, TestList, TestListReversed, + TestLengthHintExceptions, ] test_support.run_unittest(*unittests) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Feb 2 22:50:13 2009 @@ -14,6 +14,10 @@ - Issue #4978: Passing keyword arguments as unicode strings is now allowed. +- Issue 1242657: the __len__() and __length_hint__() calls in several tools + were suppressing all exceptions. These include list(), filter(), map(), + zip(), and bytearray(). + - os.ftruncate raises OSErrors instead of IOErrors for consistency with other os functions. Modified: python/trunk/Objects/abstract.c ============================================================================== --- python/trunk/Objects/abstract.c (original) +++ python/trunk/Objects/abstract.c Mon Feb 2 22:50:13 2009 @@ -85,8 +85,8 @@ /* The length hint function returns a non-negative value from o.__len__() or o.__length_hint__(). If those methods aren't found or return a negative - value, then the defaultvalue is returned. This function never fails. - Accordingly, it will mask exceptions raised in either method. + value, then the defaultvalue is returned. If one of the calls fails, + this function returns -1. */ Py_ssize_t @@ -100,29 +100,32 @@ rv = PyObject_Size(o); if (rv >= 0) return rv; - if (PyErr_Occurred()) + if (PyErr_Occurred()) { + if (!PyErr_ExceptionMatches(PyExc_TypeError) && + !PyErr_ExceptionMatches(PyExc_AttributeError)) + return -1; PyErr_Clear(); + } /* cache a hashed version of the attribute string */ if (hintstrobj == NULL) { hintstrobj = PyString_InternFromString("__length_hint__"); if (hintstrobj == NULL) - goto defaultcase; + return -1; } /* try o.__length_hint__() */ ro = PyObject_CallMethodObjArgs(o, hintstrobj, NULL); - if (ro == NULL) - goto defaultcase; + if (ro == NULL) { + if (!PyErr_ExceptionMatches(PyExc_TypeError) && + !PyErr_ExceptionMatches(PyExc_AttributeError)) + return -1; + PyErr_Clear(); + return defaultvalue; + } rv = PyInt_AsLong(ro); Py_DECREF(ro); - if (rv >= 0) - return rv; - -defaultcase: - if (PyErr_Occurred()) - PyErr_Clear(); - return defaultvalue; + return rv; } PyObject * @@ -2128,7 +2131,7 @@ { PyObject *it; /* iter(v) */ Py_ssize_t n; /* guess for result tuple size */ - PyObject *result; + PyObject *result = NULL; Py_ssize_t j; if (v == NULL) @@ -2153,6 +2156,8 @@ /* Guess result size and allocate space. */ n = _PyObject_LengthHint(v, 10); + if (n == -1) + goto Fail; result = PyTuple_New(n); if (result == NULL) goto Fail; Modified: python/trunk/Objects/bytearrayobject.c ============================================================================== --- python/trunk/Objects/bytearrayobject.c (original) +++ python/trunk/Objects/bytearrayobject.c Mon Feb 2 22:50:13 2009 @@ -2691,6 +2691,10 @@ /* Try to determine the length of the argument. 32 is abitrary. */ buf_size = _PyObject_LengthHint(arg, 32); + if (buf_size == -1) { + Py_DECREF(it); + return NULL; + } bytes_obj = PyByteArray_FromStringAndSize(NULL, buf_size); if (bytes_obj == NULL) Modified: python/trunk/Objects/listobject.c ============================================================================== --- python/trunk/Objects/listobject.c (original) +++ python/trunk/Objects/listobject.c Mon Feb 2 22:50:13 2009 @@ -838,6 +838,10 @@ /* Guess a result list size. */ n = _PyObject_LengthHint(b, 8); + if (n == -1) { + Py_DECREF(it); + return NULL; + } m = Py_SIZE(self); mn = m + n; if (mn >= m) { Modified: python/trunk/Python/bltinmodule.c ============================================================================== --- python/trunk/Python/bltinmodule.c (original) +++ python/trunk/Python/bltinmodule.c Mon Feb 2 22:50:13 2009 @@ -268,6 +268,8 @@ /* Guess a result list size. */ len = _PyObject_LengthHint(seq, 8); + if (len == -1) + goto Fail_it; /* Get a result list. */ if (PyList_Check(seq) && seq->ob_refcnt == 1) { From buildbot at python.org Mon Feb 2 23:22:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 22:22:06 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 2.6 Message-ID: <20090202222206.B38CE1E4002@bag.python.org> The Buildbot has detected a new failure of OS X x86 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%202.6/builds/39 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bz2 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Feb 2 23:44:07 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 2 Feb 2009 23:44:07 +0100 (CET) Subject: [Python-checkins] r69228 - in python/branches/release26-maint: Include/abstract.h Lib/test/test_iterlen.py Misc/NEWS Objects/abstract.c Objects/bytearrayobject.c Objects/listobject.c Python/bltinmodule.c Message-ID: <20090202224407.3E4D51E4002@bag.python.org> Author: raymond.hettinger Date: Mon Feb 2 23:44:06 2009 New Revision: 69228 Log: Issue 1242657: list(obj) can swallow KeyboardInterrupt Modified: python/branches/release26-maint/Include/abstract.h python/branches/release26-maint/Lib/test/test_iterlen.py python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Objects/abstract.c python/branches/release26-maint/Objects/bytearrayobject.c python/branches/release26-maint/Objects/listobject.c python/branches/release26-maint/Python/bltinmodule.c Modified: python/branches/release26-maint/Include/abstract.h ============================================================================== --- python/branches/release26-maint/Include/abstract.h (original) +++ python/branches/release26-maint/Include/abstract.h Mon Feb 2 23:44:06 2009 @@ -438,7 +438,7 @@ /* Guess the size of object o using len(o) or o.__length_hint__(). If neither of those return a non-negative value, then return the - default value. This function never fails. All exceptions are cleared. + default value. If one of the calls fails, this function returns -1. */ PyAPI_FUNC(PyObject *) PyObject_GetItem(PyObject *o, PyObject *key); Modified: python/branches/release26-maint/Lib/test/test_iterlen.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_iterlen.py (original) +++ python/branches/release26-maint/Lib/test/test_iterlen.py Mon Feb 2 23:44:06 2009 @@ -195,6 +195,36 @@ d.extend(xrange(20)) self.assertEqual(len(it), 0) +## -- Check to make sure exceptions are not suppressed by __length_hint__() + + +class BadLen(object): + def __iter__(self): return iter(range(10)) + def __len__(self): + raise RuntimeError('hello') + +class BadLengthHint(object): + def __iter__(self): return iter(range(10)) + def __length_hint__(self): + raise RuntimeError('hello') + +class TestLengthHintExceptions(unittest.TestCase): + + def test_issue1242657(self): + self.assertRaises(RuntimeError, list, BadLen()) + self.assertRaises(RuntimeError, list, BadLengthHint()) + self.assertRaises(RuntimeError, [].extend, BadLen()) + self.assertRaises(RuntimeError, [].extend, BadLengthHint()) + self.assertRaises(RuntimeError, zip, BadLen()) + self.assertRaises(RuntimeError, zip, BadLengthHint()) + self.assertRaises(RuntimeError, filter, None, BadLen()) + self.assertRaises(RuntimeError, filter, None, BadLengthHint()) + self.assertRaises(RuntimeError, map, chr, BadLen()) + self.assertRaises(RuntimeError, map, chr, BadLengthHint()) + b = bytearray(range(10)) + self.assertRaises(RuntimeError, b.extend, BadLen()) + self.assertRaises(RuntimeError, b.extend, BadLengthHint()) + def test_main(): unittests = [ TestRepeat, @@ -209,6 +239,7 @@ TestSet, TestList, TestListReversed, + TestLengthHintExceptions, ] test_support.run_unittest(*unittests) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Mon Feb 2 23:44:06 2009 @@ -15,6 +15,10 @@ - Issue #5013: Fixed a bug in FileHandler which occurred when the delay parameter was set. +- Issue 1242657: the __len__() and __length_hint__() calls in several tools + were suppressing all exceptions. These include list(), filter(), map(), + zip(), and bytearray(). + - Issue #4935: The overflow checking code in the expandtabs() method common to str, bytes and bytearray could be optimized away by the compiler, letting the interpreter segfault instead of raising an error. Modified: python/branches/release26-maint/Objects/abstract.c ============================================================================== --- python/branches/release26-maint/Objects/abstract.c (original) +++ python/branches/release26-maint/Objects/abstract.c Mon Feb 2 23:44:06 2009 @@ -85,8 +85,8 @@ /* The length hint function returns a non-negative value from o.__len__() or o.__length_hint__(). If those methods aren't found or return a negative - value, then the defaultvalue is returned. This function never fails. - Accordingly, it will mask exceptions raised in either method. + value, then the defaultvalue is returned. If one of the calls fails, + this function returns -1. */ Py_ssize_t @@ -100,29 +100,32 @@ rv = PyObject_Size(o); if (rv >= 0) return rv; - if (PyErr_Occurred()) + if (PyErr_Occurred()) { + if (!PyErr_ExceptionMatches(PyExc_TypeError) && + !PyErr_ExceptionMatches(PyExc_AttributeError)) + return -1; PyErr_Clear(); + } /* cache a hashed version of the attribute string */ if (hintstrobj == NULL) { hintstrobj = PyString_InternFromString("__length_hint__"); if (hintstrobj == NULL) - goto defaultcase; + return -1; } /* try o.__length_hint__() */ ro = PyObject_CallMethodObjArgs(o, hintstrobj, NULL); - if (ro == NULL) - goto defaultcase; + if (ro == NULL) { + if (!PyErr_ExceptionMatches(PyExc_TypeError) && + !PyErr_ExceptionMatches(PyExc_AttributeError)) + return -1; + PyErr_Clear(); + return defaultvalue; + } rv = PyInt_AsLong(ro); Py_DECREF(ro); - if (rv >= 0) - return rv; - -defaultcase: - if (PyErr_Occurred()) - PyErr_Clear(); - return defaultvalue; + return rv; } PyObject * @@ -2114,7 +2117,7 @@ { PyObject *it; /* iter(v) */ Py_ssize_t n; /* guess for result tuple size */ - PyObject *result; + PyObject *result = NULL; Py_ssize_t j; if (v == NULL) @@ -2139,6 +2142,8 @@ /* Guess result size and allocate space. */ n = _PyObject_LengthHint(v, 10); + if (n == -1) + goto Fail; result = PyTuple_New(n); if (result == NULL) goto Fail; Modified: python/branches/release26-maint/Objects/bytearrayobject.c ============================================================================== --- python/branches/release26-maint/Objects/bytearrayobject.c (original) +++ python/branches/release26-maint/Objects/bytearrayobject.c Mon Feb 2 23:44:06 2009 @@ -2679,6 +2679,10 @@ /* Try to determine the length of the argument. 32 is abitrary. */ buf_size = _PyObject_LengthHint(arg, 32); + if (buf_size == -1) { + Py_DECREF(it); + return NULL; + } bytes_obj = PyByteArray_FromStringAndSize(NULL, buf_size); if (bytes_obj == NULL) Modified: python/branches/release26-maint/Objects/listobject.c ============================================================================== --- python/branches/release26-maint/Objects/listobject.c (original) +++ python/branches/release26-maint/Objects/listobject.c Mon Feb 2 23:44:06 2009 @@ -838,6 +838,10 @@ /* Guess a result list size. */ n = _PyObject_LengthHint(b, 8); + if (n == -1) { + Py_DECREF(it); + return NULL; + } m = Py_SIZE(self); mn = m + n; if (mn >= m) { Modified: python/branches/release26-maint/Python/bltinmodule.c ============================================================================== --- python/branches/release26-maint/Python/bltinmodule.c (original) +++ python/branches/release26-maint/Python/bltinmodule.c Mon Feb 2 23:44:06 2009 @@ -268,6 +268,8 @@ /* Guess a result list size. */ len = _PyObject_LengthHint(seq, 8); + if (len == -1) + goto Fail_it; /* Get a result list. */ if (PyList_Check(seq) && seq->ob_refcnt == 1) { From buildbot at python.org Mon Feb 2 23:44:16 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 22:44:16 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090202224417.129CE1E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/583 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_poplib.py", line 131, in run asyncore.loop(timeout=0.1, count=1) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 204, in loop poll_fun(timeout, map) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 141, in poll read(obj) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 78, in read obj.handle_error() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 74, in read obj.handle_read_event() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 413, in handle_read_event self.handle_read() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_ssl.py", line 408, in handle_read self.send(data.lower()) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 519, in send self.initiate_send() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 506, in initiate_send num_sent = dispatcher.send(self, self.out_buffer[:512]) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 349, in send result = self.socket.send(data) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/socket.py", line 165, in _dummy raise error(EBADF, 'Bad file descriptor') error: [Errno 9] Bad file descriptor sincerely, -The Buildbot From buildbot at python.org Mon Feb 2 23:47:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 22:47:20 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090202224720.4FB751E401D@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/802 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: guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_subprocess make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Feb 2 23:55:10 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 2 Feb 2009 23:55:10 +0100 (CET) Subject: [Python-checkins] r69229 - in python/branches/py3k: Include/abstract.h Lib/test/test_iterlen.py Misc/NEWS Objects/abstract.c Objects/bytearrayobject.c Objects/listobject.c Message-ID: <20090202225510.2D9941E4002@bag.python.org> Author: raymond.hettinger Date: Mon Feb 2 23:55:09 2009 New Revision: 69229 Log: Issue 1242657: list(obj) can swallow KeyboardInterrupt. Modified: python/branches/py3k/Include/abstract.h python/branches/py3k/Lib/test/test_iterlen.py python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/abstract.c python/branches/py3k/Objects/bytearrayobject.c python/branches/py3k/Objects/listobject.c Modified: python/branches/py3k/Include/abstract.h ============================================================================== --- python/branches/py3k/Include/abstract.h (original) +++ python/branches/py3k/Include/abstract.h Mon Feb 2 23:55:09 2009 @@ -392,7 +392,7 @@ /* Guess the size of object o using len(o) or o.__length_hint__(). If neither of those return a non-negative value, then return the - default value. This function never fails. All exceptions are cleared. + default value. If one of the calls fails, this function returns -1. */ PyAPI_FUNC(PyObject *) PyObject_GetItem(PyObject *o, PyObject *key); Modified: python/branches/py3k/Lib/test/test_iterlen.py ============================================================================== --- python/branches/py3k/Lib/test/test_iterlen.py (original) +++ python/branches/py3k/Lib/test/test_iterlen.py Mon Feb 2 23:55:09 2009 @@ -195,6 +195,29 @@ d.extend(range(20)) self.assertEqual(len(it), 0) +## -- Check to make sure exceptions are not suppressed by __length_hint__() + + +class BadLen(object): + def __iter__(self): return iter(range(10)) + def __len__(self): + raise RuntimeError('hello') + +class BadLengthHint(object): + def __iter__(self): return iter(range(10)) + def __length_hint__(self): + raise RuntimeError('hello') + +class TestLengthHintExceptions(unittest.TestCase): + + def test_issue1242657(self): + self.assertRaises(RuntimeError, list, BadLen()) + self.assertRaises(RuntimeError, list, BadLengthHint()) + self.assertRaises(RuntimeError, [].extend, BadLen()) + self.assertRaises(RuntimeError, [].extend, BadLengthHint()) + b = bytearray(range(10)) + self.assertRaises(RuntimeError, b.extend, BadLen()) + self.assertRaises(RuntimeError, b.extend, BadLengthHint()) def test_main(): unittests = [ @@ -210,6 +233,7 @@ TestSet, TestList, TestListReversed, + TestLengthHintExceptions, ] support.run_unittest(*unittests) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon Feb 2 23:55:09 2009 @@ -17,6 +17,9 @@ the type definition cmpfunc. The tp_compare slot has been renamed to tp_reserved, and is reserved for future usage. +- Issue 1242657: the __len__() and __length_hint__() calls in several tools + were suppressing all exceptions. These include list() and bytearray(). + - Issue #4707: round(x, n) now returns an integer if x is an integer. Previously it returned a float. Modified: python/branches/py3k/Objects/abstract.c ============================================================================== --- python/branches/py3k/Objects/abstract.c (original) +++ python/branches/py3k/Objects/abstract.c Mon Feb 2 23:55:09 2009 @@ -67,8 +67,8 @@ /* The length hint function returns a non-negative value from o.__len__() or o.__length_hint__(). If those methods aren't found or return a negative - value, then the defaultvalue is returned. This function never fails. - Accordingly, it will mask exceptions raised in either method. + value, then the defaultvalue is returned. If one of the calls fails, + this function returns -1. */ Py_ssize_t @@ -82,29 +82,32 @@ rv = PyObject_Size(o); if (rv >= 0) return rv; - if (PyErr_Occurred()) + if (PyErr_Occurred()) { + if (!PyErr_ExceptionMatches(PyExc_TypeError) && + !PyErr_ExceptionMatches(PyExc_AttributeError)) + return -1; PyErr_Clear(); + } /* cache a hashed version of the attribute string */ if (hintstrobj == NULL) { hintstrobj = PyUnicode_InternFromString("__length_hint__"); if (hintstrobj == NULL) - goto defaultcase; + return -1; } /* try o.__length_hint__() */ ro = PyObject_CallMethodObjArgs(o, hintstrobj, NULL); - if (ro == NULL) - goto defaultcase; + if (ro == NULL) { + if (!PyErr_ExceptionMatches(PyExc_TypeError) && + !PyErr_ExceptionMatches(PyExc_AttributeError)) + return -1; + PyErr_Clear(); + return defaultvalue; + } rv = PyLong_AsSsize_t(ro); Py_DECREF(ro); - if (rv >= 0) - return rv; - -defaultcase: - if (PyErr_Occurred()) - PyErr_Clear(); - return defaultvalue; + return rv; } PyObject * @@ -1742,7 +1745,7 @@ { PyObject *it; /* iter(v) */ Py_ssize_t n; /* guess for result tuple size */ - PyObject *result; + PyObject *result = NULL; Py_ssize_t j; if (v == NULL) @@ -1767,6 +1770,8 @@ /* Guess result size and allocate space. */ n = _PyObject_LengthHint(v, 10); + if (n == -1) + goto Fail; result = PyTuple_New(n); if (result == NULL) goto Fail; Modified: python/branches/py3k/Objects/bytearrayobject.c ============================================================================== --- python/branches/py3k/Objects/bytearrayobject.c (original) +++ python/branches/py3k/Objects/bytearrayobject.c Mon Feb 2 23:55:09 2009 @@ -2616,6 +2616,10 @@ /* Try to determine the length of the argument. 32 is abitrary. */ buf_size = _PyObject_LengthHint(arg, 32); + if (buf_size == -1) { + Py_DECREF(it); + return NULL; + } bytes_obj = PyByteArray_FromStringAndSize(NULL, buf_size); if (bytes_obj == NULL) Modified: python/branches/py3k/Objects/listobject.c ============================================================================== --- python/branches/py3k/Objects/listobject.c (original) +++ python/branches/py3k/Objects/listobject.c Mon Feb 2 23:55:09 2009 @@ -802,6 +802,10 @@ /* Guess a result list size. */ n = _PyObject_LengthHint(b, 8); + if (n == -1) { + Py_DECREF(it); + return NULL; + } m = Py_SIZE(self); mn = m + n; if (mn >= m) { From buildbot at python.org Tue Feb 3 00:38:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 23:38:22 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090202233822.274111E4002@bag.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/176 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 failed slave lost sincerely, -The Buildbot From python-checkins at python.org Tue Feb 3 00:42:37 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 3 Feb 2009 00:42:37 +0100 (CET) Subject: [Python-checkins] r69230 - in python/branches/release30-maint: Include/abstract.h Lib/test/test_iterlen.py Misc/NEWS Objects/abstract.c Objects/bytearrayobject.c Objects/listobject.c Message-ID: <20090202234237.243351E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 3 00:42:36 2009 New Revision: 69230 Log: Issue 1242657: list(obj) can swallow KeyboardInterrupt. Modified: python/branches/release30-maint/Include/abstract.h python/branches/release30-maint/Lib/test/test_iterlen.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Objects/abstract.c python/branches/release30-maint/Objects/bytearrayobject.c python/branches/release30-maint/Objects/listobject.c Modified: python/branches/release30-maint/Include/abstract.h ============================================================================== --- python/branches/release30-maint/Include/abstract.h (original) +++ python/branches/release30-maint/Include/abstract.h Tue Feb 3 00:42:36 2009 @@ -392,7 +392,7 @@ /* Guess the size of object o using len(o) or o.__length_hint__(). If neither of those return a non-negative value, then return the - default value. This function never fails. All exceptions are cleared. + default value. If one of the calls fails, this function returns -1. */ PyAPI_FUNC(PyObject *) PyObject_GetItem(PyObject *o, PyObject *key); Modified: python/branches/release30-maint/Lib/test/test_iterlen.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_iterlen.py (original) +++ python/branches/release30-maint/Lib/test/test_iterlen.py Tue Feb 3 00:42:36 2009 @@ -195,6 +195,29 @@ d.extend(range(20)) self.assertEqual(len(it), 0) +## -- Check to make sure exceptions are not suppressed by __length_hint__() + + +class BadLen(object): + def __iter__(self): return iter(range(10)) + def __len__(self): + raise RuntimeError('hello') + +class BadLengthHint(object): + def __iter__(self): return iter(range(10)) + def __length_hint__(self): + raise RuntimeError('hello') + +class TestLengthHintExceptions(unittest.TestCase): + + def test_issue1242657(self): + self.assertRaises(RuntimeError, list, BadLen()) + self.assertRaises(RuntimeError, list, BadLengthHint()) + self.assertRaises(RuntimeError, [].extend, BadLen()) + self.assertRaises(RuntimeError, [].extend, BadLengthHint()) + b = bytearray(range(10)) + self.assertRaises(RuntimeError, b.extend, BadLen()) + self.assertRaises(RuntimeError, b.extend, BadLengthHint()) def test_main(): unittests = [ @@ -210,6 +233,7 @@ TestSet, TestList, TestListReversed, + TestLengthHintExceptions, ] support.run_unittest(*unittests) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Tue Feb 3 00:42:36 2009 @@ -17,6 +17,9 @@ the type definition cmpfunc. The tp_compare slot has been renamed to tp_reserved, and is reserved for future usage. +- Issue 1242657: the __len__() and __length_hint__() calls in several tools + were suppressing all exceptions. These include list() and bytearray(). + - Issue #4707: round(x, n) now returns an integer if x is an integer. Previously it returned a float. Modified: python/branches/release30-maint/Objects/abstract.c ============================================================================== --- python/branches/release30-maint/Objects/abstract.c (original) +++ python/branches/release30-maint/Objects/abstract.c Tue Feb 3 00:42:36 2009 @@ -67,8 +67,8 @@ /* The length hint function returns a non-negative value from o.__len__() or o.__length_hint__(). If those methods aren't found or return a negative - value, then the defaultvalue is returned. This function never fails. - Accordingly, it will mask exceptions raised in either method. + value, then the defaultvalue is returned. If one of the calls fails, + this function returns -1. */ Py_ssize_t @@ -82,29 +82,32 @@ rv = PyObject_Size(o); if (rv >= 0) return rv; - if (PyErr_Occurred()) + if (PyErr_Occurred()) { + if (!PyErr_ExceptionMatches(PyExc_TypeError) && + !PyErr_ExceptionMatches(PyExc_AttributeError)) + return -1; PyErr_Clear(); + } /* cache a hashed version of the attribute string */ if (hintstrobj == NULL) { hintstrobj = PyUnicode_InternFromString("__length_hint__"); if (hintstrobj == NULL) - goto defaultcase; + return -1; } /* try o.__length_hint__() */ ro = PyObject_CallMethodObjArgs(o, hintstrobj, NULL); - if (ro == NULL) - goto defaultcase; + if (ro == NULL) { + if (!PyErr_ExceptionMatches(PyExc_TypeError) && + !PyErr_ExceptionMatches(PyExc_AttributeError)) + return -1; + PyErr_Clear(); + return defaultvalue; + } rv = PyLong_AsSsize_t(ro); Py_DECREF(ro); - if (rv >= 0) - return rv; - -defaultcase: - if (PyErr_Occurred()) - PyErr_Clear(); - return defaultvalue; + return rv; } PyObject * @@ -1742,7 +1745,7 @@ { PyObject *it; /* iter(v) */ Py_ssize_t n; /* guess for result tuple size */ - PyObject *result; + PyObject *result = NULL; Py_ssize_t j; if (v == NULL) @@ -1767,6 +1770,8 @@ /* Guess result size and allocate space. */ n = _PyObject_LengthHint(v, 10); + if (n == -1) + goto Fail; result = PyTuple_New(n); if (result == NULL) goto Fail; Modified: python/branches/release30-maint/Objects/bytearrayobject.c ============================================================================== --- python/branches/release30-maint/Objects/bytearrayobject.c (original) +++ python/branches/release30-maint/Objects/bytearrayobject.c Tue Feb 3 00:42:36 2009 @@ -2608,6 +2608,10 @@ /* Try to determine the length of the argument. 32 is abitrary. */ buf_size = _PyObject_LengthHint(arg, 32); + if (buf_size == -1) { + Py_DECREF(it); + return NULL; + } bytes_obj = PyByteArray_FromStringAndSize(NULL, buf_size); if (bytes_obj == NULL) Modified: python/branches/release30-maint/Objects/listobject.c ============================================================================== --- python/branches/release30-maint/Objects/listobject.c (original) +++ python/branches/release30-maint/Objects/listobject.c Tue Feb 3 00:42:36 2009 @@ -802,6 +802,10 @@ /* Guess a result list size. */ n = _PyObject_LengthHint(b, 8); + if (n == -1) { + Py_DECREF(it); + return NULL; + } m = Py_SIZE(self); mn = m + n; if (mn >= m) { From buildbot at python.org Tue Feb 3 00:54:08 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 02 Feb 2009 23:54:08 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090202235408.B9CD71E4002@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/87 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: guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Tue Feb 3 01:36:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 03 Feb 2009 00:36:48 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 3.0 Message-ID: <20090203003648.B53F11E4002@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/131 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: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Unknown signal 32 sincerely, -The Buildbot From python-checkins at python.org Tue Feb 3 02:00:17 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 3 Feb 2009 02:00:17 +0100 (CET) Subject: [Python-checkins] r69231 - in sandbox/trunk/dbm_sqlite/alt: dbsqlite.py time_sqlite.py Message-ID: <20090203010017.CC3AC1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 3 02:00:17 2009 New Revision: 69231 Log: Faster __contains__ test. Modified: sandbox/trunk/dbm_sqlite/alt/dbsqlite.py sandbox/trunk/dbm_sqlite/alt/time_sqlite.py Modified: sandbox/trunk/dbm_sqlite/alt/dbsqlite.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbsqlite.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbsqlite.py Tue Feb 3 02:00:17 2009 @@ -53,8 +53,8 @@ return iter(self.keys()) def __contains__(self, key): - GET_ITEM = 'SELECT value FROM shelf WHERE key = ?' - return self.conn.execute(GET_ITEM, (key,)).fetchone() is not None + HAS_ITEM = 'SELECT 1 FROM shelf WHERE key = ?' + return self.conn.execute(HAS_ITEM, (key,)).fetchone() is not None def __getitem__(self, key): GET_ITEM = 'SELECT value FROM shelf WHERE key = ?' @@ -63,7 +63,7 @@ raise KeyError(key) return item[0] - def __setitem__(self, key, value): + def __setitem__(self, key, value): ADD_ITEM = 'REPLACE INTO shelf (key, value) VALUES (?,?)' self.conn.execute(ADD_ITEM, (key, value)) #self.conn.commit() @@ -71,7 +71,7 @@ def __delitem__(self, key): if key not in self: raise KeyError(key) - DEL_ITEM = 'DELETE FROM shelf WHERE key = ?' + DEL_ITEM = 'DELETE FROM shelf WHERE key = ?' self.conn.execute(DEL_ITEM, (key,)) #self.conn.commit() @@ -84,8 +84,8 @@ if kwds: self.update(kwds) - def clear(self): - CLEAR_ALL = 'DELETE FROM shelf; VACUUM;' + def clear(self): + CLEAR_ALL = 'DELETE FROM shelf; VACUUM;' self.conn.executescript(CLEAR_ALL) self.conn.commit() @@ -96,27 +96,27 @@ self.conn = None def __del__(self): - self.close() + self.close() class ListRepr: def __repr__(self): - return repr(list(self)) + return repr(list(self)) class SQLhashKeysView(collections.KeysView, ListRepr): - + def __iter__(self): GET_KEYS = 'SELECT key FROM shelf ORDER BY ROWID' return map(itemgetter(0), self._mapping.conn.cursor().execute(GET_KEYS)) class SQLhashValuesView(collections.ValuesView, ListRepr): - + def __iter__(self): GET_VALUES = 'SELECT value FROM shelf ORDER BY ROWID' return map(itemgetter(0), self._mapping.conn.cursor().execute(GET_VALUES)) class SQLhashItemsView(collections.ValuesView, ListRepr): - + def __iter__(self): GET_ITEMS = 'SELECT key, value FROM shelf ORDER BY ROWID' return iter(self._mapping.conn.cursor().execute(GET_ITEMS)) @@ -131,7 +131,7 @@ for d in SQLhash(), SQLhash('example'): print(list(d), "start") d['abc'] = 'lmno' - print(d['abc']) + print(d['abc']) d['abc'] = 'rsvp' d['xyz'] = 'pdq' print(d.items()) @@ -140,7 +140,7 @@ print(list(d), 'list') d.update(p='x', q='y', r='z') print(d.items()) - + del d['abc'] try: print(d['abc']) @@ -148,7 +148,7 @@ pass else: raise Exception('oh noooo!') - + try: del d['abc'] except KeyError: Modified: sandbox/trunk/dbm_sqlite/alt/time_sqlite.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/time_sqlite.py (original) +++ sandbox/trunk/dbm_sqlite/alt/time_sqlite.py Tue Feb 3 02:00:17 2009 @@ -22,31 +22,34 @@ import sqlite3 import os from time import clock +from itertools import chain -MAKE_shelf = (''' +MAKE_SHELF = (''' DROP INDEX IF EXISTS keyndx; DROP TABLE IF EXISTS shelf; CREATE TABLE IF NOT EXISTS shelf (key TEXT NOT NULL, value TEXT NOT NULL); ''', 'UNINDEXED') -MAKE_shelf_PRIMARY = (''' + +MAKE_SHELF_PRIMARY = (''' DROP INDEX IF EXISTS keyndx; DROP TABLE IF EXISTS shelf; CREATE TABLE IF NOT EXISTS shelf (key PRIMARY KEY, value TEXT NOT NULL); ''', 'PRIMARY') -MAKE_shelf_UNIQUE = (''' + +MAKE_SHELF_UNIQUE = (''' DROP INDEX IF EXISTS keyndx; DROP TABLE IF EXISTS shelf; CREATE TABLE IF NOT EXISTS shelf (key TEXT NOT NULL, value TEXT NOT NULL); CREATE UNIQUE INDEX IF NOT EXISTS keyndx ON shelf (key); ''', 'UNIQ') -MAKE_shelf = (''' +MAKE_SHELF = (''' DROP INDEX IF EXISTS keyndx; DROP TABLE IF EXISTS shelf; CREATE TABLE IF NOT EXISTS shelf (key BLOB NOT NULL, value BLOB NOT NULL); ''', 'UNINDEXED') -MAKE_shelf_PRIMARY = (''' +MAKE_SHELF_PRIMARY = (''' DROP INDEX IF EXISTS keyndx; DROP TABLE IF EXISTS shelf; CREATE TABLE IF NOT EXISTS shelf (key BLOB PRIMARY KEY, value BLOB NOT NULL); ''', 'PRIMARY') -MAKE_shelf_UNIQUE = (''' +MAKE_SHELF_UNIQUE = (''' DROP INDEX IF EXISTS keyndx; DROP TABLE IF EXISTS shelf; CREATE TABLE IF NOT EXISTS shelf (key BLOB NOT NULL, value BLOB NOT NULL); CREATE UNIQUE INDEX IF NOT EXISTS keyndx ON shelf (key); @@ -62,6 +65,12 @@ 'SELECT key, value FROM shelf', ] +FINDKEY = [ + 'SELECT key FROM shelf WHERE key = ?', + 'SELECT value FROM shelf WHERE key = ?', + 'SELECT 1 FROM shelf WHERE key = ?', +] + def populate(n=100, m=5): items = [] for i in range(n): @@ -71,7 +80,7 @@ if len(set(k for k,v in items)) != n: return populate(n, m) return items - + def setup(BUILDER, items=None): filename = 'tmpshl' try: @@ -99,32 +108,49 @@ conn.execute('REPLACE INTO shelf (key, value) VALUES (?, ?)', addlist.pop()) conn.commit() -def timeit(conn, stmt, n=20): - conn.execute(stmt) # precompile - start = clock() - for i in range(n): - conn.execute(stmt).fetchall() +def timeit(conn, stmt, args=(), n=20): + if args: + conn.execute(stmt, args) # precompile + else: + conn.execute(stmt) # precompile + start = clock() + if args: + for i in range(n): + conn.execute(stmt, args).fetchone() + else: + for i in range(n): + conn.execute(stmt).fetchall() return '%.2f' % (clock() - start) - + n, m = 2000, 6000 fragment, vacuum = True, True seed('xyzpdqbingo') items = populate(n) -dellist = [(randrange(n),) for i in range(m)] -addlist = populate(m) -for stmt in SELECTORS: - print(stmt) - for builder, name in [MAKE_shelf, MAKE_shelf_PRIMARY, MAKE_shelf_UNIQUE]: - conn = setup(builder, items) - if fragment: - fragmentit(conn, addlist, dellist) - if vacuum: - conn.execute('VACUUM') - print(sorted(timeit(conn, stmt, n=100) for i in range(6)), name) - print() +if 0: + dellist = [(randrange(n),) for i in range(m)] + addlist = populate(m) + for stmt in SELECTORS: + print(stmt) + for builder, name in [MAKE_SHELF, MAKE_SHELF_PRIMARY, MAKE_SHELF_UNIQUE]: + conn = setup(builder, items) + if fragment: + fragmentit(conn, addlist, dellist) + if vacuum: + conn.execute('VACUUM') + print(sorted(timeit(conn, stmt, (), n=100) for i in range(6)), name) + print() +else: + pairs = sample(items, 3) + conn = setup(MAKE_SHELF_PRIMARY[0], items) + for stmt in FINDKEY: + print(stmt) + for key in chain.from_iterable(pairs): + print(sorted(timeit(conn, stmt, (key,), n=10000) for i in range(6)), key) + print() + + - ''' Results: No difference between 'select *', 'select k,v', and 'select * by rowid' @@ -135,9 +161,12 @@ The effect of "primary key" and a unique index is the same BLOB and TEXT types have the same timing +Search for a single key: + Missing key search 8% faster than a found key + "SELECT 1" is 3% faster than "SELECT key" which is 3% faster than "SELECT value" -Results for unfragmented: n, m = 2000, 6000 +----- Unfragmented: n, m = 2000, 6000 SELECT * FROM shelf ['0.38', '0.38', '0.38', '0.39', '0.39', '0.47'] UNINDEXED @@ -235,4 +264,31 @@ ['1.29', '1.29', '1.30', '1.30', '1.31', '1.38'] PRIMARY ['1.28', '1.30', '1.30', '1.30', '1.33', '1.40'] UNIQ + +----- Search for a single key (alternating between found and not found) ---- + +SELECT key FROM shelf WHERE key = ? +['0.59', '0.59', '0.59', '0.59', '0.60', '0.64'] b'YzLgm' +['0.55', '0.56', '0.56', '0.56', '0.56', '0.58'] b'rsgVk' +['0.59', '0.59', '0.59', '0.59', '0.59', '0.59'] b'Echad' +['0.55', '0.56', '0.56', '0.56', '0.56', '0.56'] b'uMwIL' +['0.59', '0.59', '0.59', '0.59', '0.59', '0.60'] b'jgmOI' +['0.55', '0.55', '0.56', '0.56', '0.56', '0.56'] b'oNJuV' + +SELECT value FROM shelf WHERE key = ? +['0.61', '0.62', '0.62', '0.62', '0.62', '0.62'] b'YzLgm' +['0.56', '0.57', '0.57', '0.57', '0.57', '0.57'] b'rsgVk' +['0.61', '0.61', '0.61', '0.62', '0.62', '0.62'] b'Echad' +['0.57', '0.57', '0.57', '0.57', '0.57', '0.58'] b'uMwIL' +['0.61', '0.61', '0.61', '0.62', '0.62', '0.62'] b'jgmOI' +['0.56', '0.56', '0.57', '0.57', '0.57', '0.57'] b'oNJuV' + +SELECT 1 FROM shelf WHERE key = ? +['0.57', '0.57', '0.58', '0.58', '0.58', '0.58'] b'YzLgm' +['0.55', '0.55', '0.55', '0.55', '0.55', '0.56'] b'rsgVk' +['0.57', '0.57', '0.57', '0.58', '0.58', '0.58'] b'Echad' +['0.55', '0.55', '0.55', '0.56', '0.56', '0.56'] b'uMwIL' +['0.57', '0.57', '0.57', '0.58', '0.58', '0.58'] b'jgmOI' +['0.55', '0.55', '0.55', '0.56', '0.56', '0.57'] b'oNJuV' + ''' From python-checkins at python.org Tue Feb 3 02:24:47 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 3 Feb 2009 02:24:47 +0100 (CET) Subject: [Python-checkins] r69232 - in sandbox/trunk/dbm_sqlite/alt: dbsqlite.py time_sqlite.py Message-ID: <20090203012447.C4C991E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 3 02:24:46 2009 New Revision: 69232 Log: Faster version of __len__(). Modified: sandbox/trunk/dbm_sqlite/alt/dbsqlite.py sandbox/trunk/dbm_sqlite/alt/time_sqlite.py Modified: sandbox/trunk/dbm_sqlite/alt/dbsqlite.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbsqlite.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbsqlite.py Tue Feb 3 02:24:46 2009 @@ -37,7 +37,7 @@ self.conn.commit() def __len__(self): - GET_LEN = 'SELECT COUNT(*) FROM shelf' + GET_LEN = 'SELECT MAX(ROWID) FROM shelf' return self.conn.execute(GET_LEN).fetchone()[0] def keys(self): @@ -63,7 +63,7 @@ raise KeyError(key) return item[0] - def __setitem__(self, key, value): + def __setitem__(self, key, value): ADD_ITEM = 'REPLACE INTO shelf (key, value) VALUES (?,?)' self.conn.execute(ADD_ITEM, (key, value)) #self.conn.commit() @@ -71,7 +71,7 @@ def __delitem__(self, key): if key not in self: raise KeyError(key) - DEL_ITEM = 'DELETE FROM shelf WHERE key = ?' + DEL_ITEM = 'DELETE FROM shelf WHERE key = ?' self.conn.execute(DEL_ITEM, (key,)) #self.conn.commit() @@ -84,8 +84,8 @@ if kwds: self.update(kwds) - def clear(self): - CLEAR_ALL = 'DELETE FROM shelf; VACUUM;' + def clear(self): + CLEAR_ALL = 'DELETE FROM shelf; VACUUM;' self.conn.executescript(CLEAR_ALL) self.conn.commit() @@ -96,27 +96,27 @@ self.conn = None def __del__(self): - self.close() + self.close() class ListRepr: def __repr__(self): - return repr(list(self)) + return repr(list(self)) class SQLhashKeysView(collections.KeysView, ListRepr): - + def __iter__(self): GET_KEYS = 'SELECT key FROM shelf ORDER BY ROWID' return map(itemgetter(0), self._mapping.conn.cursor().execute(GET_KEYS)) class SQLhashValuesView(collections.ValuesView, ListRepr): - + def __iter__(self): GET_VALUES = 'SELECT value FROM shelf ORDER BY ROWID' return map(itemgetter(0), self._mapping.conn.cursor().execute(GET_VALUES)) class SQLhashItemsView(collections.ValuesView, ListRepr): - + def __iter__(self): GET_ITEMS = 'SELECT key, value FROM shelf ORDER BY ROWID' return iter(self._mapping.conn.cursor().execute(GET_ITEMS)) @@ -131,7 +131,7 @@ for d in SQLhash(), SQLhash('example'): print(list(d), "start") d['abc'] = 'lmno' - print(d['abc']) + print(d['abc']) d['abc'] = 'rsvp' d['xyz'] = 'pdq' print(d.items()) @@ -140,7 +140,7 @@ print(list(d), 'list') d.update(p='x', q='y', r='z') print(d.items()) - + del d['abc'] try: print(d['abc']) @@ -148,7 +148,7 @@ pass else: raise Exception('oh noooo!') - + try: del d['abc'] except KeyError: Modified: sandbox/trunk/dbm_sqlite/alt/time_sqlite.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/time_sqlite.py (original) +++ sandbox/trunk/dbm_sqlite/alt/time_sqlite.py Tue Feb 3 02:24:46 2009 @@ -63,6 +63,8 @@ 'SELECT key FROM shelf', 'SELECT value FROM shelf', 'SELECT key, value FROM shelf', + 'SELECT COUNT(*) FROM shelf', + 'SELECT MAX(ROWID) FROM shelf', ] FINDKEY = [ @@ -123,12 +125,13 @@ return '%.2f' % (clock() - start) n, m = 2000, 6000 -fragment, vacuum = True, True + seed('xyzpdqbingo') items = populate(n) -if 0: - dellist = [(randrange(n),) for i in range(m)] - addlist = populate(m) +if 1: + fragment, vacuum = False, False +## dellist = [(randrange(n),) for i in range(m)] +## addlist = populate(m) for stmt in SELECTORS: print(stmt) for builder, name in [MAKE_SHELF, MAKE_SHELF_PRIMARY, MAKE_SHELF_UNIQUE]: @@ -137,7 +140,7 @@ fragmentit(conn, addlist, dellist) if vacuum: conn.execute('VACUUM') - print(sorted(timeit(conn, stmt, (), n=100) for i in range(6)), name) + print(sorted(timeit(conn, stmt, (), n=10000) for i in range(6)), name) print() else: pairs = sample(items, 3) @@ -165,6 +168,10 @@ Missing key search 8% faster than a found key "SELECT 1" is 3% faster than "SELECT key" which is 3% faster than "SELECT value" +Finding the length of the table: + "SELECT MAX(ROWID)" beats "SELECT COUNT(*)" + Disassembly shows the former goes straight to the last record, + while the latter does a full table scan. ----- Unfragmented: n, m = 2000, 6000 @@ -291,4 +298,12 @@ ['0.57', '0.57', '0.57', '0.58', '0.58', '0.58'] b'jgmOI' ['0.55', '0.55', '0.55', '0.56', '0.56', '0.57'] b'oNJuV' + +----- Find length of the table ----- + +SELECT COUNT(*) FROM shelf +['2.36', '2.37', '2.37', '2.37', '2.39', '2.47'] PRIMARY + +SELECT MAX(ROWID) FROM shelf +['0.50', '0.50', '0.50', '0.50', '0.51', '0.55'] PRIMARY ''' From buildbot at python.org Tue Feb 3 02:35:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 03 Feb 2009 01:35:28 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090203013529.961EB1E4021@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/122 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: guilherme.polo,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 Tue Feb 3 02:47:16 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 3 Feb 2009 02:47:16 +0100 (CET) Subject: [Python-checkins] r69233 - python/branches/py3k Message-ID: <20090203014716.E9A581E4002@bag.python.org> Author: benjamin.peterson Date: Tue Feb 3 02:47:16 2009 New Revision: 69233 Log: Blocked revisions 68532,69161,69227 via svnmerge ........ r68532 | kristjan.jonsson | 2009-01-11 10:23:37 -0600 (Sun, 11 Jan 2009) | 1 line Issue 4879: Allow buffering for HTTPResponse ........ r69161 | gregory.p.smith | 2009-01-31 18:24:21 -0600 (Sat, 31 Jan 2009) | 2 lines wording for for issue4903. ........ r69227 | raymond.hettinger | 2009-02-02 15:50:13 -0600 (Mon, 02 Feb 2009) | 1 line Issue 1242657: list(obj) can swallow KeyboardInterrupt. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Tue Feb 3 03:12:11 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 3 Feb 2009 03:12:11 +0100 (CET) Subject: [Python-checkins] r69234 - in python/branches/py3k: Lib/test/test_iterlen.py Objects/abstract.c Message-ID: <20090203021211.018471E400C@bag.python.org> Author: raymond.hettinger Date: Tue Feb 3 03:12:10 2009 New Revision: 69234 Log: Validate that __length_hint__ returns a usable result. Modified: python/branches/py3k/Lib/test/test_iterlen.py python/branches/py3k/Objects/abstract.c Modified: python/branches/py3k/Lib/test/test_iterlen.py ============================================================================== --- python/branches/py3k/Lib/test/test_iterlen.py (original) +++ python/branches/py3k/Lib/test/test_iterlen.py Tue Feb 3 03:12:10 2009 @@ -208,6 +208,11 @@ def __length_hint__(self): raise RuntimeError('hello') +class NoneLengthHint(object): + def __iter__(self): return iter(range(10)) + def __length_hint__(self): + return None + class TestLengthHintExceptions(unittest.TestCase): def test_issue1242657(self): @@ -219,6 +224,11 @@ self.assertRaises(RuntimeError, b.extend, BadLen()) self.assertRaises(RuntimeError, b.extend, BadLengthHint()) + def test_invalid_hint(self): + # Make sure an invalid result doesn't muck-up the works + self.assertEqual(list(NoneLengthHint()), list(range(10))) + + def test_main(): unittests = [ TestRepeat, Modified: python/branches/py3k/Objects/abstract.c ============================================================================== --- python/branches/py3k/Objects/abstract.c (original) +++ python/branches/py3k/Objects/abstract.c Tue Feb 3 03:12:10 2009 @@ -105,7 +105,7 @@ PyErr_Clear(); return defaultvalue; } - rv = PyLong_AsSsize_t(ro); + rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue; Py_DECREF(ro); return rv; } From python-checkins at python.org Tue Feb 3 03:14:51 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 3 Feb 2009 03:14:51 +0100 (CET) Subject: [Python-checkins] r69235 - sandbox/trunk/dbm_sqlite/alt/dbsqlite.py Message-ID: <20090203021451.811411E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 3 03:14:51 2009 New Revision: 69235 Log: Fix-up __len__ to handle an empty table. Modified: sandbox/trunk/dbm_sqlite/alt/dbsqlite.py Modified: sandbox/trunk/dbm_sqlite/alt/dbsqlite.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbsqlite.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbsqlite.py Tue Feb 3 03:14:51 2009 @@ -37,8 +37,8 @@ self.conn.commit() def __len__(self): - GET_LEN = 'SELECT MAX(ROWID) FROM shelf' - return self.conn.execute(GET_LEN).fetchone()[0] + GET_LEN = 'SELECT MAX(ROWID) FROM shelf' # returns None if count is zero + return self.conn.execute(GET_LEN).fetchone()[0] or 0 def keys(self): return SQLhashKeysView(self) @@ -129,6 +129,7 @@ if __name__ in '__main___': for d in SQLhash(), SQLhash('example'): + list(d) print(list(d), "start") d['abc'] = 'lmno' print(d['abc']) From python-checkins at python.org Tue Feb 3 03:15:22 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 3 Feb 2009 03:15:22 +0100 (CET) Subject: [Python-checkins] r69236 - in python/branches/release30-maint: Lib/test/test_iterlen.py Objects/abstract.c Message-ID: <20090203021522.6463A1E402D@bag.python.org> Author: raymond.hettinger Date: Tue Feb 3 03:15:22 2009 New Revision: 69236 Log: Validate that __length_hint__ returns a usable result. Modified: python/branches/release30-maint/Lib/test/test_iterlen.py python/branches/release30-maint/Objects/abstract.c Modified: python/branches/release30-maint/Lib/test/test_iterlen.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_iterlen.py (original) +++ python/branches/release30-maint/Lib/test/test_iterlen.py Tue Feb 3 03:15:22 2009 @@ -208,6 +208,11 @@ def __length_hint__(self): raise RuntimeError('hello') +class NoneLengthHint(object): + def __iter__(self): return iter(range(10)) + def __length_hint__(self): + return None + class TestLengthHintExceptions(unittest.TestCase): def test_issue1242657(self): @@ -219,6 +224,11 @@ self.assertRaises(RuntimeError, b.extend, BadLen()) self.assertRaises(RuntimeError, b.extend, BadLengthHint()) + def test_invalid_hint(self): + # Make sure an invalid result doesn't muck-up the works + self.assertEqual(list(NoneLengthHint()), list(range(10))) + + def test_main(): unittests = [ TestRepeat, Modified: python/branches/release30-maint/Objects/abstract.c ============================================================================== --- python/branches/release30-maint/Objects/abstract.c (original) +++ python/branches/release30-maint/Objects/abstract.c Tue Feb 3 03:15:22 2009 @@ -105,7 +105,7 @@ PyErr_Clear(); return defaultvalue; } - rv = PyLong_AsSsize_t(ro); + rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue; Py_DECREF(ro); return rv; } From python-checkins at python.org Tue Feb 3 03:23:19 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 3 Feb 2009 03:23:19 +0100 (CET) Subject: [Python-checkins] r69237 - in python/trunk: Lib/test/test_iterlen.py Objects/abstract.c Message-ID: <20090203022319.ED2661E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 3 03:23:19 2009 New Revision: 69237 Log: Validate that __length_hint__ returns a usable result. Modified: python/trunk/Lib/test/test_iterlen.py python/trunk/Objects/abstract.c Modified: python/trunk/Lib/test/test_iterlen.py ============================================================================== --- python/trunk/Lib/test/test_iterlen.py (original) +++ python/trunk/Lib/test/test_iterlen.py Tue Feb 3 03:23:19 2009 @@ -208,6 +208,11 @@ def __length_hint__(self): raise RuntimeError('hello') +class NoneLengthHint(object): + def __iter__(self): return iter(range(10)) + def __length_hint__(self): + return None + class TestLengthHintExceptions(unittest.TestCase): def test_issue1242657(self): @@ -225,6 +230,11 @@ self.assertRaises(RuntimeError, b.extend, BadLen()) self.assertRaises(RuntimeError, b.extend, BadLengthHint()) + def test_invalid_hint(self): + # Make sure an invalid result doesn't muck-up the works + self.assertEqual(list(NoneLengthHint()), list(range(10))) + + def test_main(): unittests = [ TestRepeat, Modified: python/trunk/Objects/abstract.c ============================================================================== --- python/trunk/Objects/abstract.c (original) +++ python/trunk/Objects/abstract.c Tue Feb 3 03:23:19 2009 @@ -123,7 +123,7 @@ PyErr_Clear(); return defaultvalue; } - rv = PyInt_AsLong(ro); + rv = rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue; Py_DECREF(ro); return rv; } From python-checkins at python.org Tue Feb 3 03:28:02 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 3 Feb 2009 03:28:02 +0100 (CET) Subject: [Python-checkins] r69238 - in python/branches/release26-maint: Lib/test/test_iterlen.py Objects/abstract.c Message-ID: <20090203022802.6E16F1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 3 03:28:00 2009 New Revision: 69238 Log: Validate that __length_hint__ returns a usable result. Modified: python/branches/release26-maint/Lib/test/test_iterlen.py python/branches/release26-maint/Objects/abstract.c Modified: python/branches/release26-maint/Lib/test/test_iterlen.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_iterlen.py (original) +++ python/branches/release26-maint/Lib/test/test_iterlen.py Tue Feb 3 03:28:00 2009 @@ -208,6 +208,11 @@ def __length_hint__(self): raise RuntimeError('hello') +class NoneLengthHint(object): + def __iter__(self): return iter(range(10)) + def __length_hint__(self): + return None + class TestLengthHintExceptions(unittest.TestCase): def test_issue1242657(self): @@ -225,6 +230,11 @@ self.assertRaises(RuntimeError, b.extend, BadLen()) self.assertRaises(RuntimeError, b.extend, BadLengthHint()) + def test_invalid_hint(self): + # Make sure an invalid result doesn't muck-up the works + self.assertEqual(list(NoneLengthHint()), list(range(10))) + + def test_main(): unittests = [ TestRepeat, Modified: python/branches/release26-maint/Objects/abstract.c ============================================================================== --- python/branches/release26-maint/Objects/abstract.c (original) +++ python/branches/release26-maint/Objects/abstract.c Tue Feb 3 03:28:00 2009 @@ -123,7 +123,7 @@ PyErr_Clear(); return defaultvalue; } - rv = PyInt_AsLong(ro); + rv = rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue; Py_DECREF(ro); return rv; } From python-checkins at python.org Tue Feb 3 03:30:19 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 3 Feb 2009 03:30:19 +0100 (CET) Subject: [Python-checkins] r69239 - python/branches/py3k Message-ID: <20090203023019.C96731E4042@bag.python.org> Author: benjamin.peterson Date: Tue Feb 3 03:30:19 2009 New Revision: 69239 Log: Blocked revisions 69237 via svnmerge ........ r69237 | raymond.hettinger | 2009-02-02 20:23:19 -0600 (Mon, 02 Feb 2009) | 1 line Validate that __length_hint__ returns a usable result. ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Tue Feb 3 03:59:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 03 Feb 2009 02:59:26 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090203025926.748DF1E4002@bag.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/80 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 python-checkins at python.org Tue Feb 3 04:18:15 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 3 Feb 2009 04:18:15 +0100 (CET) Subject: [Python-checkins] r69240 - python/trunk/Doc/library/operator.rst Message-ID: <20090203031815.07AE51E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 3 04:18:14 2009 New Revision: 69240 Log: Record operator deprecations in docs. Modified: python/trunk/Doc/library/operator.rst Modified: python/trunk/Doc/library/operator.rst ============================================================================== --- python/trunk/Doc/library/operator.rst (original) +++ python/trunk/Doc/library/operator.rst Tue Feb 3 04:18:14 2009 @@ -269,6 +269,9 @@ .. function:: repeat(a, b) __repeat__(a, b) + .. deprecated:: 2.7 + Use :func:`__mul__` instead. + Return ``a * b`` where *a* is a sequence and *b* is an integer. @@ -387,6 +390,9 @@ .. function:: irepeat(a, b) __irepeat__(a, b) + .. deprecated:: 2.7 + Use :func:`__imul__` instead. + ``a = irepeat(a, b)`` is equivalent to ``a *= b`` where *a* is a sequence and *b* is an integer. @@ -427,33 +433,14 @@ The :mod:`operator` module also defines a few predicates to test the type of -objects. - -.. note:: - - Be careful not to misinterpret the results of these functions; only - :func:`isCallable` has any measure of reliability with instance objects. - For example: - - >>> class C: - ... pass - ... - >>> import operator - >>> obj = C() - >>> operator.isMappingType(obj) - True - -.. note:: - - Python 3 is expected to introduce abstract base classes for - collection types, so it should be possible to write, for example, - ``isinstance(obj, collections.Mapping)`` and ``isinstance(obj, - collections.Sequence)``. +objects; however, these are not all reliable. It is preferable to test +abstract base classes instead (see :mod:`collections` and +:mod:`numbers` for details). .. function:: isCallable(obj) .. deprecated:: 2.0 - Use the :func:`callable` built-in function instead. + Use ``isinstance(x, collections.Callable)`` instead. Returns true if the object *obj* can be called like a function, otherwise it returns false. True is returned for functions, bound and unbound methods, class @@ -462,6 +449,9 @@ .. function:: isMappingType(obj) + .. deprecated:: 2.7 + Use ``isinstance(x, collections.Mapping)`` instead. + Returns true if the object *obj* supports the mapping interface. This is true for dictionaries and all instance objects defining :meth:`__getitem__`. @@ -474,6 +464,9 @@ .. function:: isNumberType(obj) + .. deprecated:: 2.7 + Use ``isinstance(x, numbers.Number)`` instead. + Returns true if the object *obj* represents a number. This is true for all numeric types implemented in C. @@ -486,6 +479,9 @@ .. function:: isSequenceType(obj) + .. deprecated:: 2.7 + Use ``isinstance(x, collections.Sequence)`` instead. + Returns true if the object *obj* supports the sequence protocol. This returns true for all objects which define sequence methods in C, and for all instance objects defining :meth:`__getitem__`. From python-checkins at python.org Tue Feb 3 04:36:28 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 3 Feb 2009 04:36:28 +0100 (CET) Subject: [Python-checkins] r69241 - python/branches/release26-maint/Doc/library/operator.rst Message-ID: <20090203033628.697511E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 3 04:36:27 2009 New Revision: 69241 Log: Record operator deprecations in docs. Modified: python/branches/release26-maint/Doc/library/operator.rst Modified: python/branches/release26-maint/Doc/library/operator.rst ============================================================================== --- python/branches/release26-maint/Doc/library/operator.rst (original) +++ python/branches/release26-maint/Doc/library/operator.rst Tue Feb 3 04:36:27 2009 @@ -241,7 +241,7 @@ Delete the slice of *a* from index *b* to index *c-1*. .. deprecated:: 2.6 - This function is removed in Python 3.x. Use :func:`delitem` with a slice + This function is removed in Python 3.0. Use :func:`delitem` with a slice index. @@ -257,7 +257,7 @@ Return the slice of *a* from index *b* to index *c-1*. .. deprecated:: 2.6 - This function is removed in Python 3.x. Use :func:`getitem` with a slice + This function is removed in Python 3.0. Use :func:`getitem` with a slice index. @@ -269,6 +269,9 @@ .. function:: repeat(a, b) __repeat__(a, b) + .. deprecated:: 2.6 + This function is removed in Python 3.0. Use :func:`__mul__` instead. + Return ``a * b`` where *a* is a sequence and *b* is an integer. @@ -292,7 +295,7 @@ Set the slice of *a* from index *b* to index *c-1* to the sequence *v*. .. deprecated:: 2.6 - This function is removed in Python 3.x. Use :func:`setitem` with a slice + This function is removed in Python 3.0. Use :func:`setitem` with a slice index. @@ -387,6 +390,9 @@ .. function:: irepeat(a, b) __irepeat__(a, b) + .. deprecated:: 2.6 + This function is removed in Python 3.0. Use :func:`__imul__` instead. + ``a = irepeat(a, b)`` is equivalent to ``a *= b`` where *a* is a sequence and *b* is an integer. @@ -427,33 +433,14 @@ The :mod:`operator` module also defines a few predicates to test the type of -objects. - -.. note:: - - Be careful not to misinterpret the results of these functions; only - :func:`isCallable` has any measure of reliability with instance objects. - For example: - - >>> class C: - ... pass - ... - >>> import operator - >>> obj = C() - >>> operator.isMappingType(obj) - True - -.. note:: - - Python 3 is expected to introduce abstract base classes for - collection types, so it should be possible to write, for example, - ``isinstance(obj, collections.Mapping)`` and ``isinstance(obj, - collections.Sequence)``. +objects; however, these are not all reliable. It is preferable to test +abstract base classes instead (see :mod:`collections` and +:mod:`numbers` for details). .. function:: isCallable(obj) .. deprecated:: 2.0 - Use the :func:`callable` built-in function instead. + Use ``isinstance(x, collections.Callable)`` instead. Returns true if the object *obj* can be called like a function, otherwise it returns false. True is returned for functions, bound and unbound methods, class @@ -462,6 +449,9 @@ .. function:: isMappingType(obj) + .. deprecated:: 2.6 + This function is removed in Python 3.0. Use ``isinstance(x, collections.Mapping)`` instead. + Returns true if the object *obj* supports the mapping interface. This is true for dictionaries and all instance objects defining :meth:`__getitem__`. @@ -474,6 +464,9 @@ .. function:: isNumberType(obj) + .. deprecated:: 2.6 + This function is removed in Python 3.0. Use ``isinstance(x, numbers.Number)`` instead. + Returns true if the object *obj* represents a number. This is true for all numeric types implemented in C. @@ -486,6 +479,9 @@ .. function:: isSequenceType(obj) + .. deprecated:: 2.6 + This function is removed in Python 3.0. Use ``isinstance(x, collections.Sequence)`` instead. + Returns true if the object *obj* supports the sequence protocol. This returns true for all objects which define sequence methods in C, and for all instance objects defining :meth:`__getitem__`. From python-checkins at python.org Tue Feb 3 04:37:03 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 3 Feb 2009 04:37:03 +0100 (CET) Subject: [Python-checkins] r69242 - in python/trunk/Lib: decimal.py test/test_decimal.py Message-ID: <20090203033703.8D6B61E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 3 04:37:03 2009 New Revision: 69242 Log: Register decimals as numbers.Number Modified: python/trunk/Lib/decimal.py python/trunk/Lib/test/test_decimal.py Modified: python/trunk/Lib/decimal.py ============================================================================== --- python/trunk/Lib/decimal.py (original) +++ python/trunk/Lib/decimal.py Tue Feb 3 04:37:03 2009 @@ -136,6 +136,7 @@ import copy as _copy import math as _math +import numbers as _numbers try: from collections import namedtuple as _namedtuple @@ -3608,6 +3609,12 @@ return self +# Register Decimal as a kind of Number (an abstract base class). +# However, do not register it as Real (because Decimals are not +# interoperable with floats). +_numbers.Number.register(Decimal) + + ##### Context class ####################################################### Modified: python/trunk/Lib/test/test_decimal.py ============================================================================== --- python/trunk/Lib/test/test_decimal.py (original) +++ python/trunk/Lib/test/test_decimal.py Tue Feb 3 04:37:03 2009 @@ -30,6 +30,7 @@ import pickle, copy import unittest from decimal import * +import numbers from test.test_support import (TestSkipped, run_unittest, run_doctest, is_resource_enabled) import random @@ -1334,6 +1335,12 @@ class DecimalPythonAPItests(unittest.TestCase): + def test_abc(self): + self.assert_(issubclass(Decimal, numbers.Number)) + self.assert_(not issubclass(Decimal, numbers.Real)) + self.assert_(isinstance(Decimal(0), numbers.Number)) + self.assert_(not isinstance(Decimal(0), numbers.Real)) + def test_pickle(self): d = Decimal('-3.141590000') p = pickle.dumps(d) From python-checkins at python.org Tue Feb 3 04:42:07 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 3 Feb 2009 04:42:07 +0100 (CET) Subject: [Python-checkins] r69243 - in python/branches/release26-maint: Lib/decimal.py Lib/test/test_decimal.py Misc/NEWS Message-ID: <20090203034207.8EC7B1E4015@bag.python.org> Author: raymond.hettinger Date: Tue Feb 3 04:42:07 2009 New Revision: 69243 Log: Register decimals as numbers.Number Modified: python/branches/release26-maint/Lib/decimal.py python/branches/release26-maint/Lib/test/test_decimal.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/decimal.py ============================================================================== --- python/branches/release26-maint/Lib/decimal.py (original) +++ python/branches/release26-maint/Lib/decimal.py Tue Feb 3 04:42:07 2009 @@ -135,6 +135,7 @@ ] import copy as _copy +import numbers as _numbers try: from collections import namedtuple as _namedtuple @@ -3567,6 +3568,12 @@ return self +# Register Decimal as a kind of Number (an abstract base class). +# However, do not register it as Real (because Decimals are not +# interoperable with floats). +_numbers.Number.register(Decimal) + + ##### Context class ####################################################### Modified: python/branches/release26-maint/Lib/test/test_decimal.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_decimal.py (original) +++ python/branches/release26-maint/Lib/test/test_decimal.py Tue Feb 3 04:42:07 2009 @@ -30,6 +30,7 @@ import pickle, copy import unittest from decimal import * +import numbers from test.test_support import (TestSkipped, run_unittest, run_doctest, is_resource_enabled) import random @@ -1334,6 +1335,12 @@ class DecimalPythonAPItests(unittest.TestCase): + def test_abc(self): + self.assert_(issubclass(Decimal, numbers.Number)) + self.assert_(not issubclass(Decimal, numbers.Real)) + self.assert_(isinstance(Decimal(0), numbers.Number)) + self.assert_(not isinstance(Decimal(0), numbers.Real)) + def test_pickle(self): d = Decimal('-3.141590000') p = pickle.dumps(d) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Tue Feb 3 04:42:07 2009 @@ -213,6 +213,8 @@ - Issue #1885: distutils. When running sdist with --formats=tar,gztar the tar file was overriden by the gztar one. +- Registered Decimal as a numbers.Number. + - Issue #1672332: fix unpickling of subnormal floats, which was producing a ValueError on some platforms. From python-checkins at python.org Tue Feb 3 04:44:39 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 3 Feb 2009 04:44:39 +0100 (CET) Subject: [Python-checkins] r69244 - python/branches/release26-maint/Misc/NEWS Message-ID: <20090203034439.48D6B1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 3 04:44:39 2009 New Revision: 69244 Log: More informative NEWS entry. 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 Tue Feb 3 04:44:39 2009 @@ -213,7 +213,7 @@ - Issue #1885: distutils. When running sdist with --formats=tar,gztar the tar file was overriden by the gztar one. -- Registered Decimal as a numbers.Number. +- Registered Decimal as a numbers.Number so that isinstance(d, Number) works. - Issue #1672332: fix unpickling of subnormal floats, which was producing a ValueError on some platforms. From python-checkins at python.org Tue Feb 3 04:50:40 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 3 Feb 2009 04:50:40 +0100 (CET) Subject: [Python-checkins] r69245 - in python/branches/release30-maint: Lib/decimal.py Lib/test/test_decimal.py Misc/NEWS Message-ID: <20090203035040.378CF1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 3 04:50:39 2009 New Revision: 69245 Log: Register decimals as numbers.Number Modified: python/branches/release30-maint/Lib/decimal.py python/branches/release30-maint/Lib/test/test_decimal.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/decimal.py ============================================================================== --- python/branches/release30-maint/Lib/decimal.py (original) +++ python/branches/release30-maint/Lib/decimal.py Tue Feb 3 04:50:39 2009 @@ -135,6 +135,7 @@ ] import copy as _copy +import numbers as _numbers try: from collections import namedtuple as _namedtuple @@ -3654,6 +3655,12 @@ return self +# Register Decimal as a kind of Number (an abstract base class). +# However, do not register it as Real (because Decimals are not +# interoperable with floats). +_numbers.Number.register(Decimal) + + ##### Context class ####################################################### Modified: python/branches/release30-maint/Lib/test/test_decimal.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_decimal.py (original) +++ python/branches/release30-maint/Lib/test/test_decimal.py Tue Feb 3 04:50:39 2009 @@ -30,6 +30,7 @@ import pickle, copy import unittest from decimal import * +import numbers from test.support import (TestSkipped, run_unittest, run_doctest, is_resource_enabled) import random @@ -1389,6 +1390,12 @@ class DecimalPythonAPItests(unittest.TestCase): + def test_abc(self): + self.assert_(issubclass(Decimal, numbers.Number)) + self.assert_(not issubclass(Decimal, numbers.Real)) + self.assert_(isinstance(Decimal(0), numbers.Number)) + self.assert_(not isinstance(Decimal(0), numbers.Real)) + def test_pickle(self): d = Decimal('-3.141590000') p = pickle.dumps(d) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Tue Feb 3 04:50:39 2009 @@ -152,7 +152,8 @@ rather than delaying the close by waiting for garbage collection to do it. - Issue #4998: Decimal no longer subclasses from or is registered to - numbers.Real. + numbers.Real. Instead, it is registered to numbers.Number so that + isinstance(d, Number) will work. - Issue #4867: Fixed a crash in ctypes when passing a string to a function without defining argtypes. From python-checkins at python.org Tue Feb 3 04:54:29 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 3 Feb 2009 04:54:29 +0100 (CET) Subject: [Python-checkins] r69246 - in python/branches/py3k/Lib: decimal.py test/test_decimal.py Message-ID: <20090203035429.15F821E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 3 04:54:28 2009 New Revision: 69246 Log: Register decimals as numbers.Number Modified: python/branches/py3k/Lib/decimal.py python/branches/py3k/Lib/test/test_decimal.py Modified: python/branches/py3k/Lib/decimal.py ============================================================================== --- python/branches/py3k/Lib/decimal.py (original) +++ python/branches/py3k/Lib/decimal.py Tue Feb 3 04:54:28 2009 @@ -136,6 +136,7 @@ import copy as _copy import math as _math +import numbers as _numbers try: from collections import namedtuple as _namedtuple @@ -3695,6 +3696,12 @@ return self +# Register Decimal as a kind of Number (an abstract base class). +# However, do not register it as Real (because Decimals are not +# interoperable with floats). +_numbers.Number.register(Decimal) + + ##### Context class ####################################################### Modified: python/branches/py3k/Lib/test/test_decimal.py ============================================================================== --- python/branches/py3k/Lib/test/test_decimal.py (original) +++ python/branches/py3k/Lib/test/test_decimal.py Tue Feb 3 04:54:28 2009 @@ -30,6 +30,7 @@ import pickle, copy import unittest from decimal import * +import numbers from test.support import (TestSkipped, run_unittest, run_doctest, is_resource_enabled) import random @@ -1388,6 +1389,12 @@ class DecimalPythonAPItests(unittest.TestCase): + def test_abc(self): + self.assert_(issubclass(Decimal, numbers.Number)) + self.assert_(not issubclass(Decimal, numbers.Real)) + self.assert_(isinstance(Decimal(0), numbers.Number)) + self.assert_(not isinstance(Decimal(0), numbers.Real)) + def test_pickle(self): d = Decimal('-3.141590000') p = pickle.dumps(d) From buildbot at python.org Tue Feb 3 05:04:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 03 Feb 2009 04:04:28 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090203040429.0F17C1E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/585 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Tue Feb 3 05:08:48 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 3 Feb 2009 05:08:48 +0100 (CET) Subject: [Python-checkins] r69247 - python/branches/py3k Message-ID: <20090203040848.AC8211E4002@bag.python.org> Author: benjamin.peterson Date: Tue Feb 3 05:08:48 2009 New Revision: 69247 Log: Blocked revisions 69242 via svnmerge ........ r69242 | raymond.hettinger | 2009-02-02 21:37:03 -0600 (Mon, 02 Feb 2009) | 1 line Register decimals as numbers.Number ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Tue Feb 3 05:14:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 03 Feb 2009 04:14:18 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 2.6 Message-ID: <20090203041418.B961E1E4002@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/92 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: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_urllib2 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Feb 3 05:15:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 03 Feb 2009 04:15:38 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090203041539.1AEA11E4002@bag.python.org> The Buildbot has detected a new failure of OS X x86 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/82 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Abort trap sincerely, -The Buildbot From python-checkins at python.org Tue Feb 3 05:16:34 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 3 Feb 2009 05:16:34 +0100 (CET) Subject: [Python-checkins] r69248 - in python/branches/release30-maint: Doc/library/shelve.rst Lib/shelve.py Misc/NEWS Message-ID: <20090203041634.8AB851E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 3 05:16:34 2009 New Revision: 69248 Log: The default shelve pickle protocol should have been 3. Modified: python/branches/release30-maint/Doc/library/shelve.rst python/branches/release30-maint/Lib/shelve.py python/branches/release30-maint/Misc/NEWS 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 Feb 3 05:16:34 2009 @@ -23,7 +23,7 @@ database file is opened for reading and writing. The optional *flag* parameter has the same interpretation as the *flag* parameter of :func:`dbm.open`. - By default, version 0 pickles are used to serialize values. The version of the + 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 Modified: python/branches/release30-maint/Lib/shelve.py ============================================================================== --- python/branches/release30-maint/Lib/shelve.py (original) +++ python/branches/release30-maint/Lib/shelve.py Tue Feb 3 05:16:34 2009 @@ -84,7 +84,7 @@ keyencoding="utf-8"): self.dict = dict if protocol is None: - protocol = 2 + protocol = 3 self._protocol = protocol self.writeback = writeback self.cache = {} Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Tue Feb 3 05:16:34 2009 @@ -113,6 +113,8 @@ - Issue #1581476: Always use the Tcl global namespace when calling into Tcl. +- The shelve module now defaults to pickle protocol 3. + - Issue #2047: shutil.move() could believe that its destination path was inside its source path if it began with the same letters (e.g. "src" vs. "src.new"). From python-checkins at python.org Tue Feb 3 05:19:10 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 3 Feb 2009 05:19:10 +0100 (CET) Subject: [Python-checkins] r69249 - in python/branches/py3k: Doc/library/shelve.rst Lib/shelve.py Misc/NEWS Message-ID: <20090203041910.49D571E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 3 05:19:10 2009 New Revision: 69249 Log: The default shelve pickle protocol should have been 3. Modified: python/branches/py3k/Doc/library/shelve.rst python/branches/py3k/Lib/shelve.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Doc/library/shelve.rst ============================================================================== --- python/branches/py3k/Doc/library/shelve.rst (original) +++ python/branches/py3k/Doc/library/shelve.rst Tue Feb 3 05:19:10 2009 @@ -23,7 +23,7 @@ database file is opened for reading and writing. The optional *flag* parameter has the same interpretation as the *flag* parameter of :func:`dbm.open`. - By default, version 2 pickles are used to serialize values. The version of the + 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 Modified: python/branches/py3k/Lib/shelve.py ============================================================================== --- python/branches/py3k/Lib/shelve.py (original) +++ python/branches/py3k/Lib/shelve.py Tue Feb 3 05:19:10 2009 @@ -84,7 +84,7 @@ keyencoding="utf-8"): self.dict = dict if protocol is None: - protocol = 2 + protocol = 3 self._protocol = protocol self.writeback = writeback self.cache = {} Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue Feb 3 05:19:10 2009 @@ -157,6 +157,8 @@ - Issue #1581476: Always use the Tcl global namespace when calling into Tcl. +- The shelve module now defaults to pickle protocol 3. + - Fix a bug in the trace module where a bytes object from co_lnotab had its items being passed through ord(). From buildbot at python.org Tue Feb 3 05:43:46 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 03 Feb 2009 04:43:46 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090203044346.8599E1E4002@bag.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/180 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: benjamin.peterson BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Tue Feb 3 05:44:33 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 3 Feb 2009 05:44:33 +0100 (CET) Subject: [Python-checkins] r69250 - sandbox/trunk/importlib Message-ID: <20090203044433.CA6B01E4002@bag.python.org> Author: brett.cannon Date: Tue Feb 3 05:44:33 2009 New Revision: 69250 Log: Directory to hold a copy of importlib from 2.x trunk to be packaged up and distributed on the Cheeseshop. Added: sandbox/trunk/importlib/ From python-checkins at python.org Tue Feb 3 05:57:49 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 3 Feb 2009 05:57:49 +0100 (CET) Subject: [Python-checkins] r69251 - python/branches/py3k/Makefile.pre.in Message-ID: <20090203045749.042321E4002@bag.python.org> Author: brett.cannon Date: Tue Feb 3 05:57:48 2009 New Revision: 69251 Log: Add importlib to the Makefile. 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 Tue Feb 3 05:57:48 2009 @@ -831,6 +831,9 @@ lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \ ctypes ctypes/test ctypes/macholib idlelib idlelib/Icons \ distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \ + importlib importlib/test importlib/test/builtin \ + importlib/test/extension importlib/test/frozen \ + importlib/test/import_ importlib/test/source \ setuptools setuptools/command setuptools/tests setuptools.egg-info \ multiprocessing multiprocessing/dummy \ curses $(MACHDEPS) From python-checkins at python.org Tue Feb 3 05:58:29 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 3 Feb 2009 05:58:29 +0100 (CET) Subject: [Python-checkins] r69252 - in python/trunk: Lib/importlib Lib/importlib.py Lib/importlib/__init__.py Makefile.pre.in Message-ID: <20090203045829.BD6761E4002@bag.python.org> Author: brett.cannon Date: Tue Feb 3 05:58:29 2009 New Revision: 69252 Log: Make importlib a package. This allows using svn:externals in the sandbox to package up the code for separate distribution. Added: python/trunk/Lib/importlib/ python/trunk/Lib/importlib/__init__.py - copied unchanged from r69250, /python/trunk/Lib/importlib.py Removed: python/trunk/Lib/importlib.py Modified: python/trunk/Makefile.pre.in Deleted: python/trunk/Lib/importlib.py ============================================================================== --- python/trunk/Lib/importlib.py Tue Feb 3 05:58:29 2009 +++ (empty file) @@ -1,38 +0,0 @@ -"""Backport of importlib.import_module from 3.x.""" -import sys - -def _resolve_name(name, package, level): - """Return the absolute name of the module to be imported.""" - level -= 1 - try: - if package.count('.') < level: - raise ValueError("attempted relative import beyond top-level " - "package") - except AttributeError: - raise ValueError("__package__ not set to a string") - base = package.rsplit('.', level)[0] - if name: - return "{0}.{1}".format(base, name) - else: - return base - - -def import_module(name, package=None): - """Import a module. - - The 'package' argument is required when performing a relative import. It - specifies the package to use as the anchor point from which to resolve the - relative import to an absolute import. - - """ - if name.startswith('.'): - if not package: - raise TypeError("relative imports require the 'package' argument") - level = 0 - for character in name: - if character != '.': - break - level += 1 - name = _resolve_name(name[level:], package, level) - __import__(name) - return sys.modules[name] Modified: python/trunk/Makefile.pre.in ============================================================================== --- python/trunk/Makefile.pre.in (original) +++ python/trunk/Makefile.pre.in Tue Feb 3 05:58:29 2009 @@ -822,7 +822,7 @@ email email/mime email/test email/test/data \ json json/tests \ sqlite3 sqlite3/test \ - logging bsddb bsddb/test csv wsgiref \ + logging bsddb bsddb/test csv importlib wsgiref \ lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \ ctypes ctypes/test ctypes/macholib idlelib idlelib/Icons \ distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \ From buildbot at python.org Tue Feb 3 05:58:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 03 Feb 2009 04:58:53 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090203045854.01F6C1E4002@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/89 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: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Tue Feb 3 05:59:58 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 3 Feb 2009 05:59:58 +0100 (CET) Subject: [Python-checkins] r69253 - python/trunk/Lib/importlib Message-ID: <20090203045958.473231E4002@bag.python.org> Author: brett.cannon Date: Tue Feb 3 05:59:58 2009 New Revision: 69253 Log: Ignore bytecode files in importlib. Modified: python/trunk/Lib/importlib/ (props changed) From python-checkins at python.org Tue Feb 3 06:00:53 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 3 Feb 2009 06:00:53 +0100 (CET) Subject: [Python-checkins] r69254 - python/branches/py3k Message-ID: <20090203050053.94A371E4002@bag.python.org> Author: brett.cannon Date: Tue Feb 3 06:00:53 2009 New Revision: 69254 Log: Blocked revisions 69252 via svnmerge ........ r69252 | brett.cannon | 2009-02-02 20:58:29 -0800 (Mon, 02 Feb 2009) | 3 lines Make importlib a package. This allows using svn:externals in the sandbox to package up the code for separate distribution. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Tue Feb 3 06:01:06 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 3 Feb 2009 06:01:06 +0100 (CET) Subject: [Python-checkins] r69255 - python/branches/release26-maint Message-ID: <20090203050106.E9B511E4002@bag.python.org> Author: brett.cannon Date: Tue Feb 3 06:01:06 2009 New Revision: 69255 Log: Blocked revisions 69252-69253 via svnmerge ........ r69252 | brett.cannon | 2009-02-02 20:58:29 -0800 (Mon, 02 Feb 2009) | 3 lines Make importlib a package. This allows using svn:externals in the sandbox to package up the code for separate distribution. ........ r69253 | brett.cannon | 2009-02-02 20:59:58 -0800 (Mon, 02 Feb 2009) | 1 line Ignore bytecode files in importlib. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Tue Feb 3 06:03:03 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 3 Feb 2009 06:03:03 +0100 (CET) Subject: [Python-checkins] r69256 - sandbox/trunk/importlib Message-ID: <20090203050303.DEF981E4002@bag.python.org> Author: brett.cannon Date: Tue Feb 3 06:03:03 2009 New Revision: 69256 Log: Grab importlib from trunk using svn:externals. Modified: sandbox/trunk/importlib/ (props changed) From python-checkins at python.org Tue Feb 3 06:08:22 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 3 Feb 2009 06:08:22 +0100 (CET) Subject: [Python-checkins] r69257 - python/trunk/Lib/importlib/__init__.py Message-ID: <20090203050822.B7FF71E4002@bag.python.org> Author: brett.cannon Date: Tue Feb 3 06:08:22 2009 New Revision: 69257 Log: Backport importlib to at least Python 2.5 by getting rid of use of str.format. Modified: python/trunk/Lib/importlib/__init__.py Modified: python/trunk/Lib/importlib/__init__.py ============================================================================== --- python/trunk/Lib/importlib/__init__.py (original) +++ python/trunk/Lib/importlib/__init__.py Tue Feb 3 06:08:22 2009 @@ -12,7 +12,7 @@ raise ValueError("__package__ not set to a string") base = package.rsplit('.', level)[0] if name: - return "{0}.{1}".format(base, name) + return "%s.%s" % (base, name) else: return base From buildbot at python.org Tue Feb 3 06:46:04 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 03 Feb 2009 05:46:04 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20090203054604.301941E4060@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%203.0/builds/107 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_email test_mailbox test_urllib2net make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Feb 3 06:47:41 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 3 Feb 2009 06:47:41 +0100 (CET) Subject: [Python-checkins] r69258 - in sandbox/trunk/importlib: README setup.py Message-ID: <20090203054741.CCAE31E4002@bag.python.org> Author: brett.cannon Date: Tue Feb 3 06:47:41 2009 New Revision: 69258 Log: Create setup.py and README for distribution along with svn:ignore for the typical distutils stuff. Added: sandbox/trunk/importlib/README sandbox/trunk/importlib/setup.py Modified: sandbox/trunk/importlib/ (props changed) Added: sandbox/trunk/importlib/README ============================================================================== --- (empty file) +++ sandbox/trunk/importlib/README Tue Feb 3 06:47:41 2009 @@ -0,0 +1,11 @@ +Purpose +======== + +This package contains the code from importlib as found in Python 2.7. It is +provided so that people who wish to use importlib.import_module() with a +version of Python prior to 2.7 or in 3.0 have the function readily available. +The code in no way deviates from what can be found in the 2.7 trunk. + +For documentaition, see the `importlib docs`_ for Python 2.7. + +.. _importlib docs: http://docs.python.org/dev/library/importlib.html Added: sandbox/trunk/importlib/setup.py ============================================================================== --- (empty file) +++ sandbox/trunk/importlib/setup.py Tue Feb 3 06:47:41 2009 @@ -0,0 +1,36 @@ +from distutils.core import setup +import sys + + +if sys.version_info[0] == 2 and sys.version_info[1] >= 7: + raise Exception("importlib is included in Python 2.7 and newer for 2.x") +elif sys.version_info[0] == 3 and sys.version_info[1] >= 1: + raise Exception("importlib is included in Python 3.1 and newer for 3.x") + + +version_classifiers = ['Programming Language :: Python :: %s' % version + for version in [ '2.5', '2.6', '3.0']] +other_classifiers = [ + 'Development Status :: 5 - Production/Stable', + 'License :: OSI Approved :: Python Software Foundation License', + ] + +readme_file = open('README', 'r') +try: + detailed_description = readme_file.read() +finally: + readme_file.close() + + +setup( + name='importlib', + version='1.0', + description='Backport of importlib.import_module() from Python 2.7', + long_description=detailed_description, + author='Brett Cannon', + author_email='brett at python.org', + url='http://svn.python.org/view/sandbox/trunk/importlib/', + packages=['importlib'], + data_files=['README'], + classifiers=version_classifiers + other_classifiers, + ) From buildbot at python.org Tue Feb 3 06:52:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 03 Feb 2009 05:52:34 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090203055234.7114C1E4002@bag.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/1796 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: brett.cannon BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Tue Feb 3 07:48:21 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 03 Feb 2009 06:48:21 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090203064821.774971E4012@bag.python.org> The Buildbot has detected a new failure of OS X x86 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/84 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_popen2 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Feb 3 08:43:55 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 03 Feb 2009 07:43:55 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090203074355.91AB01E4002@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/124 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: 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.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 Tue Feb 3 09:26:43 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 03 Feb 2009 08:26:43 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090203082644.0AC021E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/587 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Tue Feb 3 11:57:52 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Tue, 3 Feb 2009 11:57:52 +0100 (CET) Subject: [Python-checkins] r69259 - python/branches/py3k/Lib/test/test_urllib2net.py Message-ID: <20090203105752.A14061E4002@bag.python.org> Author: kristjan.jonsson Date: Tue Feb 3 11:57:52 2009 New Revision: 69259 Log: r69209 caused the fp of HTTPResponse objects to be a io.BufferedReader instead of a socket.SocketIO. This moves the underlying socket.socket object from r.fp._sock to r.fp.raw._sock. Since _sock is an internal object, this should be ok. The change is for the testsuite only, to assert socket state. Modified: python/branches/py3k/Lib/test/test_urllib2net.py Modified: python/branches/py3k/Lib/test/test_urllib2net.py ============================================================================== --- python/branches/py3k/Lib/test/test_urllib2net.py (original) +++ python/branches/py3k/Lib/test/test_urllib2net.py Tue Feb 3 11:57:52 2009 @@ -195,7 +195,7 @@ def test_http_basic(self): self.assertTrue(socket.getdefaulttimeout() is None) u = _urlopen_with_retry("http://www.python.org") - self.assertTrue(u.fp._sock.gettimeout() is None) + self.assertTrue(u.fp.raw._sock.gettimeout() is None) def test_http_default_timeout(self): self.assertTrue(socket.getdefaulttimeout() is None) @@ -204,7 +204,7 @@ u = _urlopen_with_retry("http://www.python.org") finally: socket.setdefaulttimeout(None) - self.assertEqual(u.fp._sock.gettimeout(), 60) + self.assertEqual(u.fp.raw._sock.gettimeout(), 60) def test_http_no_timeout(self): self.assertTrue(socket.getdefaulttimeout() is None) @@ -213,11 +213,11 @@ u = _urlopen_with_retry("http://www.python.org", timeout=None) finally: socket.setdefaulttimeout(None) - self.assertTrue(u.fp._sock.gettimeout() is None) + self.assertTrue(u.fp.raw._sock.gettimeout() is None) def test_http_timeout(self): u = _urlopen_with_retry("http://www.python.org", timeout=120) - self.assertEqual(u.fp._sock.gettimeout(), 120) + self.assertEqual(u.fp.raw._sock.gettimeout(), 120) FTP_HOST = "ftp://ftp.mirror.nl/pub/mirror/gnu/" From buildbot at python.org Tue Feb 3 12:12:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 03 Feb 2009 11:12:26 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.6 Message-ID: <20090203111227.11EFB1E4002@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/78 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: brett.cannon 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() 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/183 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: kristjan.jonsson BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Tue Feb 3 13:57:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 03 Feb 2009 12:57:57 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian 3.x Message-ID: <20090203125757.F1F451E4002@bag.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/43 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,brett.cannon,guilherme.polo,kristjan.jonsson,mark.dickinson,martin.v.loewis,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_pipes test_urllib ====================================================================== ERROR: test_empty_socket (test.test_urllib.urlopen_HttpTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_urllib.py", line 194, in test_empty_socket self.assertRaises(IOError, urlopen, "http://something") File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/unittest.py", line 344, in failUnlessRaises callableObj(*args, **kwargs) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_urllib.py", line 33, in urlopen return opener.open(url) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/urllib/request.py", line 1444, in open return getattr(self, name)(url) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/urllib/request.py", line 1618, in open_http return self._open_generic_http(http.client.HTTPConnection, url, data) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/urllib/request.py", line 1601, in _open_generic_http response = http_conn.getresponse() File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/http/client.py", line 937, in getresponse method=self._method) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/http/client.py", line 275, in __init__ self.fp = sock.makefile("rb") TypeError: makefile() takes exactly 3 positional arguments (2 given) ====================================================================== ERROR: test_read (test.test_urllib.urlopen_HttpTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_urllib.py", line 168, in test_read fp = urlopen("http://python.org/") File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_urllib.py", line 33, in urlopen return opener.open(url) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/urllib/request.py", line 1444, in open return getattr(self, name)(url) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/urllib/request.py", line 1618, in open_http return self._open_generic_http(http.client.HTTPConnection, url, data) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/urllib/request.py", line 1601, in _open_generic_http response = http_conn.getresponse() File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/http/client.py", line 937, in getresponse method=self._method) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/http/client.py", line 275, in __init__ self.fp = sock.makefile("rb") TypeError: makefile() takes exactly 3 positional arguments (2 given) ====================================================================== ERROR: test_read_bogus (test.test_urllib.urlopen_HttpTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_urllib.py", line 185, in test_read_bogus self.assertRaises(IOError, urlopen, "http://python.org/") File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/unittest.py", line 344, in failUnlessRaises callableObj(*args, **kwargs) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_urllib.py", line 33, in urlopen return opener.open(url) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/urllib/request.py", line 1444, in open return getattr(self, name)(url) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/urllib/request.py", line 1618, in open_http return self._open_generic_http(http.client.HTTPConnection, url, data) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/urllib/request.py", line 1601, in _open_generic_http response = http_conn.getresponse() File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/http/client.py", line 937, in getresponse method=self._method) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/http/client.py", line 275, in __init__ self.fp = sock.makefile("rb") TypeError: makefile() takes exactly 3 positional arguments (2 given) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From solipsis at pitrou.net Tue Feb 3 16:04:20 2009 From: solipsis at pitrou.net (Antoine Pitrou) Date: Tue, 3 Feb 2009 15:04:20 +0000 (UTC) Subject: [Python-checkins] =?utf-8?q?r69235_-_sandbox/trunk/dbm=5Fsqlite/a?= =?utf-8?q?lt/dbsqlite=2Epy?= References: <20090203021451.811411E4002@bag.python.org> Message-ID: writes: > > + GET_LEN = 'SELECT MAX(ROWID) FROM shelf' # returns None if count is zero Does this approach work on tables which have had some rows deleted? Something like "SELECT COUNT(key)" looks safer. From python-checkins at python.org Tue Feb 3 18:07:40 2009 From: python-checkins at python.org (thomas.heller) Date: Tue, 3 Feb 2009 18:07:40 +0100 (CET) Subject: [Python-checkins] r69260 - in python/trunk/Modules/_ctypes/libffi_msvc: ffi.c win32.S win32.c Message-ID: <20090203170740.77B071E4002@bag.python.org> Author: thomas.heller Date: Tue Feb 3 18:07:40 2009 New Revision: 69260 Log: This refactoring should make it easier to add new calling conventions. Replace ffi_call_STDCALL and ffi_call_SYSV by a ffi_call_x86 function that cleans up the stack when FFI_SYSV is used, and does nothing for FFI_STDCALL. Remove libffi_msvc\win32.S, which is out of date and also unused; it was only used for building ctypes with the MingW compiler. Removed: python/trunk/Modules/_ctypes/libffi_msvc/win32.S Modified: python/trunk/Modules/_ctypes/libffi_msvc/ffi.c python/trunk/Modules/_ctypes/libffi_msvc/win32.c Modified: python/trunk/Modules/_ctypes/libffi_msvc/ffi.c ============================================================================== --- python/trunk/Modules/_ctypes/libffi_msvc/ffi.c (original) +++ python/trunk/Modules/_ctypes/libffi_msvc/ffi.c Tue Feb 3 18:07:40 2009 @@ -148,27 +148,12 @@ } #ifdef _WIN32 -/*@-declundef@*/ -/*@-exportheader@*/ -extern int -ffi_call_SYSV(void (*)(char *, extended_cif *), - /*@out@*/ extended_cif *, - unsigned, unsigned, - /*@out@*/ unsigned *, - void (*fn)()); -/*@=declundef@*/ -/*@=exportheader@*/ - -/*@-declundef@*/ -/*@-exportheader@*/ extern int -ffi_call_STDCALL(void (*)(char *, extended_cif *), - /*@out@*/ extended_cif *, - unsigned, unsigned, - /*@out@*/ unsigned *, - void (*fn)()); -/*@=declundef@*/ -/*@=exportheader@*/ +ffi_call_x86(void (*)(char *, extended_cif *), + /*@out@*/ extended_cif *, + unsigned, unsigned, + /*@out@*/ unsigned *, + void (*fn)()); #endif #ifdef _WIN64 @@ -209,17 +194,9 @@ { #if !defined(_WIN64) case FFI_SYSV: - /*@-usedef@*/ - return ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, - cif->flags, ecif.rvalue, fn); - /*@=usedef@*/ - break; - case FFI_STDCALL: - /*@-usedef@*/ - return ffi_call_STDCALL(ffi_prep_args, &ecif, cif->bytes, - cif->flags, ecif.rvalue, fn); - /*@=usedef@*/ + return ffi_call_x86(ffi_prep_args, &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn); break; #else case FFI_SYSV: Deleted: python/trunk/Modules/_ctypes/libffi_msvc/win32.S ============================================================================== --- python/trunk/Modules/_ctypes/libffi_msvc/win32.S Tue Feb 3 18:07:40 2009 +++ (empty file) @@ -1,243 +0,0 @@ -/* ----------------------------------------------------------------------- - win32.S - Copyright (c) 1996, 1998, 2001, 2002 Red Hat, Inc. - Copyright (c) 2001 John Beniton - Copyright (c) 2002 Ranjit Mathew - - - X86 Foreign Function Interface - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - ``Software''), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR - OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - -.text - -.globl ffi_prep_args - - # This assumes we are using gas. - .balign 16 -.globl _ffi_call_SYSV - -_ffi_call_SYSV: - pushl %ebp - movl %esp,%ebp - - #THe: save previous %esi, and store the current stack pointer in %esi - pushl %esi - movl %esp,%esi - - # Make room for all of the new args. - movl 16(%ebp),%ecx - subl %ecx,%esp - - movl %esp,%eax - - # Place all of the ffi_prep_args in position - pushl 12(%ebp) - pushl %eax - call *8(%ebp) - - # Return stack to previous state and call the function - addl $8,%esp - - # FIXME: Align the stack to a 128-bit boundary to avoid - # potential performance hits. - - call *28(%ebp) - - # Remove the space we pushed for the args - movl 16(%ebp),%ecx - addl %ecx,%esp - - sub %esp,%esi # calculate stack pointer difference - - # Load %ecx with the return type code - movl 20(%ebp),%ecx - - # If the return value pointer is NULL, assume no return value. - cmpl $0,24(%ebp) - jne retint - - # Even if there is no space for the return value, we are - # obliged to handle floating-point values. - cmpl $FFI_TYPE_FLOAT,%ecx - jne noretval - fstp %st(0) - - jmp epilogue - -retint: - cmpl $FFI_TYPE_INT,%ecx - jne retfloat - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - movl %eax,0(%ecx) - jmp epilogue - -retfloat: - cmpl $FFI_TYPE_FLOAT,%ecx - jne retdouble - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - fstps (%ecx) - jmp epilogue - -retdouble: - cmpl $FFI_TYPE_DOUBLE,%ecx - jne retlongdouble - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - fstpl (%ecx) - jmp epilogue - -retlongdouble: - cmpl $FFI_TYPE_LONGDOUBLE,%ecx - jne retint64 - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - fstpt (%ecx) - jmp epilogue - -retint64: - cmpl $FFI_TYPE_SINT64,%ecx - jne retstruct - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - movl %eax,0(%ecx) - movl %edx,4(%ecx) - -retstruct: - # Nothing to do! - -noretval: -epilogue: - movl %esi,%eax # return the stack pointer detlta in %eax - popl %esi # restore previous %esi - movl %ebp,%esp - popl %ebp - ret - -.ffi_call_SYSV_end: - - # This assumes we are using gas. - .balign 16 -.globl _ffi_call_STDCALL - -_ffi_call_STDCALL: - pushl %ebp - movl %esp,%ebp - - #THe: save previous %esi, and store the current stack pointer in %esi - pushl %esi - movl %esp,%esi - - # Make room for all of the new args. - movl 16(%ebp),%ecx - subl %ecx,%esp - - movl %esp,%eax - - # Place all of the ffi_prep_args in position - pushl 12(%ebp) - pushl %eax - call *8(%ebp) - - # Return stack to previous state and call the function - addl $8,%esp - - # FIXME: Align the stack to a 128-bit boundary to avoid - # potential performance hits. - - call *28(%ebp) - - sub %esp,%esi # difference in stack - - # stdcall functions pop arguments off the stack themselves - - # Load %ecx with the return type code - movl 20(%ebp),%ecx - - # If the return value pointer is NULL, assume no return value. - cmpl $0,24(%ebp) - jne sc_retint - - # Even if there is no space for the return value, we are - # obliged to handle floating-point values. - cmpl $FFI_TYPE_FLOAT,%ecx - jne sc_noretval - fstp %st(0) - - jmp sc_epilogue - -sc_retint: - cmpl $FFI_TYPE_INT,%ecx - jne sc_retfloat - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - movl %eax,0(%ecx) - jmp sc_epilogue - -sc_retfloat: - cmpl $FFI_TYPE_FLOAT,%ecx - jne sc_retdouble - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - fstps (%ecx) - jmp sc_epilogue - -sc_retdouble: - cmpl $FFI_TYPE_DOUBLE,%ecx - jne sc_retlongdouble - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - fstpl (%ecx) - jmp sc_epilogue - -sc_retlongdouble: - cmpl $FFI_TYPE_LONGDOUBLE,%ecx - jne sc_retint64 - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - fstpt (%ecx) - jmp sc_epilogue - -sc_retint64: - cmpl $FFI_TYPE_SINT64,%ecx - jne sc_retstruct - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - movl %eax,0(%ecx) - movl %edx,4(%ecx) - -sc_retstruct: - # Nothing to do! - -sc_noretval: -sc_epilogue: - movl %esi,%eax # return the stack difference - popl %esi # restore previous %esi value - movl %ebp,%esp - popl %ebp - ret - -.ffi_call_STDCALL_end: Modified: python/trunk/Modules/_ctypes/libffi_msvc/win32.c ============================================================================== --- python/trunk/Modules/_ctypes/libffi_msvc/win32.c (original) +++ python/trunk/Modules/_ctypes/libffi_msvc/win32.c Tue Feb 3 18:07:40 2009 @@ -29,21 +29,21 @@ /* theller: almost verbatim translation from gas syntax to MSVC inline assembler code. */ -/* theller: ffi_call_SYSV and ffi_call_STDCALL now return an integer - the - difference of the stack pointer before and after the function call. If - everything is ok, zero is returned. If stdcall functions are passed the - wrong number of arguments, the difference will be nonzero. */ +/* theller: ffi_call_x86 now returns an integer - the difference of the stack + pointer before and after the function call. If everything is ok, zero is + returned. If stdcall functions are passed the wrong number of arguments, + the difference will be nonzero. */ #include #include __declspec(naked) int -ffi_call_SYSV(void (* prepfunc)(char *, extended_cif *), /* 8 */ - extended_cif *ecif, /* 12 */ - unsigned bytes, /* 16 */ - unsigned flags, /* 20 */ - unsigned *rvalue, /* 24 */ - void (*fn)()) /* 28 */ +ffi_call_x86(void (* prepfunc)(char *, extended_cif *), /* 8 */ + extended_cif *ecif, /* 12 */ + unsigned bytes, /* 16 */ + unsigned flags, /* 20 */ + unsigned *rvalue, /* 24 */ + void (*fn)()) /* 28 */ { _asm { push ebp @@ -69,125 +69,20 @@ // FIXME: Align the stack to a 128-bit boundary to avoid // potential performance hits. call [ebp + 28] -// Remove the space we pushed for the args - mov ecx, [ebp + 16] - add esp, ecx - -// XXX ASSERT THAT ESP IS THE SAME NOW THAN BEFORE! - sub esi, esp - -// Load %ecx with the return type code - mov ecx, [ebp + 20] - -// If the return value pointer is NULL, assume no return value. -/* - Intel asm is weird. We have to explicitely specify 'DWORD PTR' in the nexr instruction, - otherwise only one BYTE will be compared (instead of a DWORD)! - */ - cmp DWORD PTR [ebp + 24], 0 - jne sc_retint - -// Even if there is no space for the return value, we are -// obliged to handle floating-point values. - cmp ecx, FFI_TYPE_FLOAT - jne sc_noretval -// fstp %st(0) - fstp st(0) - - jmp sc_epilogue - -sc_retint: - cmp ecx, FFI_TYPE_INT - jne sc_retfloat -// # Load %ecx with the pointer to storage for the return value - mov ecx, [ebp + 24] - mov [ecx + 0], eax - jmp sc_epilogue - -sc_retfloat: - cmp ecx, FFI_TYPE_FLOAT - jne sc_retdouble -// Load %ecx with the pointer to storage for the return value - mov ecx, [ebp+24] -// fstps (%ecx) - fstp DWORD PTR [ecx] - jmp sc_epilogue -sc_retdouble: - cmp ecx, FFI_TYPE_DOUBLE - jne sc_retlongdouble -// movl 24(%ebp),%ecx - mov ecx, [ebp+24] - fstp QWORD PTR [ecx] - jmp sc_epilogue - - jmp sc_retlongdouble // avoid warning about unused label -sc_retlongdouble: - cmp ecx, FFI_TYPE_LONGDOUBLE - jne sc_retint64 -// Load %ecx with the pointer to storage for the return value - mov ecx, [ebp+24] -// fstpt (%ecx) - fstp QWORD PTR [ecx] /* XXX ??? */ - jmp sc_epilogue - -sc_retint64: - cmp ecx, FFI_TYPE_SINT64 - jne sc_retstruct -// Load %ecx with the pointer to storage for the return value - mov ecx, [ebp+24] - mov [ecx+0], eax - mov [ecx+4], edx - -sc_retstruct: -// Nothing to do! - -sc_noretval: -sc_epilogue: - mov eax, esi - pop esi // NEW restore: must be preserved across function calls - mov esp, ebp - pop ebp - ret - } -} - -__declspec(naked) int -ffi_call_STDCALL(void (* prepfunc)(char *, extended_cif *), /* 8 */ - extended_cif *ecif, /* 12 */ - unsigned bytes, /* 16 */ - unsigned flags, /* 20 */ - unsigned *rvalue, /* 24 */ - void (*fn)()) /* 28 */ -{ - _asm { - push ebp - mov ebp, esp - - push esi // NEW: this register must be preserved across function calls - -// XXX SAVE ESP NOW! - mov esi, esp - -// Make room for all of the new args. - mov ecx, [ebp+16] - sub esp, ecx +// Load ecif->cif->abi + mov ecx, [ebp + 12] + mov ecx, [ecx]ecif.cif + mov ecx, [ecx]ecif.cif.abi - mov eax, esp - -// Place all of the ffi_prep_args in position - push [ebp + 12] // ecif - push eax - call [ebp + 8] // prepfunc - -// Return stack to previous state and call the function - add esp, 8 -// FIXME: Align the stack to a 128-bit boundary to avoid -// potential performance hits. - call [ebp + 28] -// stdcall functions pop arguments off the stack themselves - -// XXX IS ESP NOW THE SAME AS BEFORE? + cmp ecx, FFI_STDCALL + je noclean +// STDCALL: Remove the space we pushed for the args + mov ecx, [ebp + 16] + add esp, ecx +// CDECL: Caller has already cleaned the stack +noclean: +// Check that esp has the same value as before! sub esi, esp // Load %ecx with the return type code From buildbot at python.org Tue Feb 3 19:12:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 03 Feb 2009 18:12:25 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090203181225.717C61E4010@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/100 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: thomas.heller BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Tue Feb 3 20:03:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 03 Feb 2009 19:03:35 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 trunk Message-ID: <20090203190335.D47AB1E400C@bag.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/1843 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: thomas.heller 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\trunk.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\trunk.bolen-windows\build\lib\bsddb\dbshelve.py", line 106, in open d.open(filename, dbname, filetype, flags, mode) File "E:\cygwin\home\db3l\buildarea\trunk.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\trunk.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\trunk.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\trunk.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\trunk.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\trunk.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\trunk.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\trunk.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') sincerely, -The Buildbot From python-checkins at python.org Tue Feb 3 20:34:18 2009 From: python-checkins at python.org (thomas.heller) Date: Tue, 3 Feb 2009 20:34:18 +0100 (CET) Subject: [Python-checkins] r69261 - in python/branches/py3k: Modules/_ctypes/libffi_msvc/ffi.c Modules/_ctypes/libffi_msvc/win32.S Modules/_ctypes/libffi_msvc/win32.c Message-ID: <20090203193418.9AAB11E4002@bag.python.org> Author: thomas.heller Date: Tue Feb 3 20:34:18 2009 New Revision: 69261 Log: Merged revisions 69260 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69260 | thomas.heller | 2009-02-03 18:07:40 +0100 (Di, 03 Feb 2009) | 9 lines This refactoring should make it easier to add new calling conventions. Replace ffi_call_STDCALL and ffi_call_SYSV by a ffi_call_x86 function that cleans up the stack when FFI_SYSV is used, and does nothing for FFI_STDCALL. Remove libffi_msvc\win32.S, which is out of date and also unused; it was only used for building ctypes with the MingW compiler. ........ Removed: python/branches/py3k/Modules/_ctypes/libffi_msvc/win32.S Modified: python/branches/py3k/ (props changed) python/branches/py3k/Modules/_ctypes/libffi_msvc/ffi.c python/branches/py3k/Modules/_ctypes/libffi_msvc/win32.c Modified: python/branches/py3k/Modules/_ctypes/libffi_msvc/ffi.c ============================================================================== --- python/branches/py3k/Modules/_ctypes/libffi_msvc/ffi.c (original) +++ python/branches/py3k/Modules/_ctypes/libffi_msvc/ffi.c Tue Feb 3 20:34:18 2009 @@ -148,27 +148,12 @@ } #ifdef _WIN32 -/*@-declundef@*/ -/*@-exportheader@*/ -extern int -ffi_call_SYSV(void (*)(char *, extended_cif *), - /*@out@*/ extended_cif *, - unsigned, unsigned, - /*@out@*/ unsigned *, - void (*fn)()); -/*@=declundef@*/ -/*@=exportheader@*/ - -/*@-declundef@*/ -/*@-exportheader@*/ extern int -ffi_call_STDCALL(void (*)(char *, extended_cif *), - /*@out@*/ extended_cif *, - unsigned, unsigned, - /*@out@*/ unsigned *, - void (*fn)()); -/*@=declundef@*/ -/*@=exportheader@*/ +ffi_call_x86(void (*)(char *, extended_cif *), + /*@out@*/ extended_cif *, + unsigned, unsigned, + /*@out@*/ unsigned *, + void (*fn)()); #endif #ifdef _WIN64 @@ -209,17 +194,9 @@ { #if !defined(_WIN64) case FFI_SYSV: - /*@-usedef@*/ - return ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, - cif->flags, ecif.rvalue, fn); - /*@=usedef@*/ - break; - case FFI_STDCALL: - /*@-usedef@*/ - return ffi_call_STDCALL(ffi_prep_args, &ecif, cif->bytes, - cif->flags, ecif.rvalue, fn); - /*@=usedef@*/ + return ffi_call_x86(ffi_prep_args, &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn); break; #else case FFI_SYSV: Deleted: python/branches/py3k/Modules/_ctypes/libffi_msvc/win32.S ============================================================================== --- python/branches/py3k/Modules/_ctypes/libffi_msvc/win32.S Tue Feb 3 20:34:18 2009 +++ (empty file) @@ -1,243 +0,0 @@ -/* ----------------------------------------------------------------------- - win32.S - Copyright (c) 1996, 1998, 2001, 2002 Red Hat, Inc. - Copyright (c) 2001 John Beniton - Copyright (c) 2002 Ranjit Mathew - - - X86 Foreign Function Interface - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - ``Software''), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR - OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - -.text - -.globl ffi_prep_args - - # This assumes we are using gas. - .balign 16 -.globl _ffi_call_SYSV - -_ffi_call_SYSV: - pushl %ebp - movl %esp,%ebp - - #THe: save previous %esi, and store the current stack pointer in %esi - pushl %esi - movl %esp,%esi - - # Make room for all of the new args. - movl 16(%ebp),%ecx - subl %ecx,%esp - - movl %esp,%eax - - # Place all of the ffi_prep_args in position - pushl 12(%ebp) - pushl %eax - call *8(%ebp) - - # Return stack to previous state and call the function - addl $8,%esp - - # FIXME: Align the stack to a 128-bit boundary to avoid - # potential performance hits. - - call *28(%ebp) - - # Remove the space we pushed for the args - movl 16(%ebp),%ecx - addl %ecx,%esp - - sub %esp,%esi # calculate stack pointer difference - - # Load %ecx with the return type code - movl 20(%ebp),%ecx - - # If the return value pointer is NULL, assume no return value. - cmpl $0,24(%ebp) - jne retint - - # Even if there is no space for the return value, we are - # obliged to handle floating-point values. - cmpl $FFI_TYPE_FLOAT,%ecx - jne noretval - fstp %st(0) - - jmp epilogue - -retint: - cmpl $FFI_TYPE_INT,%ecx - jne retfloat - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - movl %eax,0(%ecx) - jmp epilogue - -retfloat: - cmpl $FFI_TYPE_FLOAT,%ecx - jne retdouble - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - fstps (%ecx) - jmp epilogue - -retdouble: - cmpl $FFI_TYPE_DOUBLE,%ecx - jne retlongdouble - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - fstpl (%ecx) - jmp epilogue - -retlongdouble: - cmpl $FFI_TYPE_LONGDOUBLE,%ecx - jne retint64 - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - fstpt (%ecx) - jmp epilogue - -retint64: - cmpl $FFI_TYPE_SINT64,%ecx - jne retstruct - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - movl %eax,0(%ecx) - movl %edx,4(%ecx) - -retstruct: - # Nothing to do! - -noretval: -epilogue: - movl %esi,%eax # return the stack pointer detlta in %eax - popl %esi # restore previous %esi - movl %ebp,%esp - popl %ebp - ret - -.ffi_call_SYSV_end: - - # This assumes we are using gas. - .balign 16 -.globl _ffi_call_STDCALL - -_ffi_call_STDCALL: - pushl %ebp - movl %esp,%ebp - - #THe: save previous %esi, and store the current stack pointer in %esi - pushl %esi - movl %esp,%esi - - # Make room for all of the new args. - movl 16(%ebp),%ecx - subl %ecx,%esp - - movl %esp,%eax - - # Place all of the ffi_prep_args in position - pushl 12(%ebp) - pushl %eax - call *8(%ebp) - - # Return stack to previous state and call the function - addl $8,%esp - - # FIXME: Align the stack to a 128-bit boundary to avoid - # potential performance hits. - - call *28(%ebp) - - sub %esp,%esi # difference in stack - - # stdcall functions pop arguments off the stack themselves - - # Load %ecx with the return type code - movl 20(%ebp),%ecx - - # If the return value pointer is NULL, assume no return value. - cmpl $0,24(%ebp) - jne sc_retint - - # Even if there is no space for the return value, we are - # obliged to handle floating-point values. - cmpl $FFI_TYPE_FLOAT,%ecx - jne sc_noretval - fstp %st(0) - - jmp sc_epilogue - -sc_retint: - cmpl $FFI_TYPE_INT,%ecx - jne sc_retfloat - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - movl %eax,0(%ecx) - jmp sc_epilogue - -sc_retfloat: - cmpl $FFI_TYPE_FLOAT,%ecx - jne sc_retdouble - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - fstps (%ecx) - jmp sc_epilogue - -sc_retdouble: - cmpl $FFI_TYPE_DOUBLE,%ecx - jne sc_retlongdouble - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - fstpl (%ecx) - jmp sc_epilogue - -sc_retlongdouble: - cmpl $FFI_TYPE_LONGDOUBLE,%ecx - jne sc_retint64 - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - fstpt (%ecx) - jmp sc_epilogue - -sc_retint64: - cmpl $FFI_TYPE_SINT64,%ecx - jne sc_retstruct - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - movl %eax,0(%ecx) - movl %edx,4(%ecx) - -sc_retstruct: - # Nothing to do! - -sc_noretval: -sc_epilogue: - movl %esi,%eax # return the stack difference - popl %esi # restore previous %esi value - movl %ebp,%esp - popl %ebp - ret - -.ffi_call_STDCALL_end: Modified: python/branches/py3k/Modules/_ctypes/libffi_msvc/win32.c ============================================================================== --- python/branches/py3k/Modules/_ctypes/libffi_msvc/win32.c (original) +++ python/branches/py3k/Modules/_ctypes/libffi_msvc/win32.c Tue Feb 3 20:34:18 2009 @@ -29,21 +29,21 @@ /* theller: almost verbatim translation from gas syntax to MSVC inline assembler code. */ -/* theller: ffi_call_SYSV and ffi_call_STDCALL now return an integer - the - difference of the stack pointer before and after the function call. If - everything is ok, zero is returned. If stdcall functions are passed the - wrong number of arguments, the difference will be nonzero. */ +/* theller: ffi_call_x86 now returns an integer - the difference of the stack + pointer before and after the function call. If everything is ok, zero is + returned. If stdcall functions are passed the wrong number of arguments, + the difference will be nonzero. */ #include #include __declspec(naked) int -ffi_call_SYSV(void (* prepfunc)(char *, extended_cif *), /* 8 */ - extended_cif *ecif, /* 12 */ - unsigned bytes, /* 16 */ - unsigned flags, /* 20 */ - unsigned *rvalue, /* 24 */ - void (*fn)()) /* 28 */ +ffi_call_x86(void (* prepfunc)(char *, extended_cif *), /* 8 */ + extended_cif *ecif, /* 12 */ + unsigned bytes, /* 16 */ + unsigned flags, /* 20 */ + unsigned *rvalue, /* 24 */ + void (*fn)()) /* 28 */ { _asm { push ebp @@ -69,125 +69,20 @@ // FIXME: Align the stack to a 128-bit boundary to avoid // potential performance hits. call [ebp + 28] -// Remove the space we pushed for the args - mov ecx, [ebp + 16] - add esp, ecx - -// XXX ASSERT THAT ESP IS THE SAME NOW THAN BEFORE! - sub esi, esp - -// Load %ecx with the return type code - mov ecx, [ebp + 20] - -// If the return value pointer is NULL, assume no return value. -/* - Intel asm is weird. We have to explicitely specify 'DWORD PTR' in the nexr instruction, - otherwise only one BYTE will be compared (instead of a DWORD)! - */ - cmp DWORD PTR [ebp + 24], 0 - jne sc_retint - -// Even if there is no space for the return value, we are -// obliged to handle floating-point values. - cmp ecx, FFI_TYPE_FLOAT - jne sc_noretval -// fstp %st(0) - fstp st(0) - - jmp sc_epilogue - -sc_retint: - cmp ecx, FFI_TYPE_INT - jne sc_retfloat -// # Load %ecx with the pointer to storage for the return value - mov ecx, [ebp + 24] - mov [ecx + 0], eax - jmp sc_epilogue - -sc_retfloat: - cmp ecx, FFI_TYPE_FLOAT - jne sc_retdouble -// Load %ecx with the pointer to storage for the return value - mov ecx, [ebp+24] -// fstps (%ecx) - fstp DWORD PTR [ecx] - jmp sc_epilogue -sc_retdouble: - cmp ecx, FFI_TYPE_DOUBLE - jne sc_retlongdouble -// movl 24(%ebp),%ecx - mov ecx, [ebp+24] - fstp QWORD PTR [ecx] - jmp sc_epilogue - - jmp sc_retlongdouble // avoid warning about unused label -sc_retlongdouble: - cmp ecx, FFI_TYPE_LONGDOUBLE - jne sc_retint64 -// Load %ecx with the pointer to storage for the return value - mov ecx, [ebp+24] -// fstpt (%ecx) - fstp QWORD PTR [ecx] /* XXX ??? */ - jmp sc_epilogue - -sc_retint64: - cmp ecx, FFI_TYPE_SINT64 - jne sc_retstruct -// Load %ecx with the pointer to storage for the return value - mov ecx, [ebp+24] - mov [ecx+0], eax - mov [ecx+4], edx - -sc_retstruct: -// Nothing to do! - -sc_noretval: -sc_epilogue: - mov eax, esi - pop esi // NEW restore: must be preserved across function calls - mov esp, ebp - pop ebp - ret - } -} - -__declspec(naked) int -ffi_call_STDCALL(void (* prepfunc)(char *, extended_cif *), /* 8 */ - extended_cif *ecif, /* 12 */ - unsigned bytes, /* 16 */ - unsigned flags, /* 20 */ - unsigned *rvalue, /* 24 */ - void (*fn)()) /* 28 */ -{ - _asm { - push ebp - mov ebp, esp - - push esi // NEW: this register must be preserved across function calls - -// XXX SAVE ESP NOW! - mov esi, esp - -// Make room for all of the new args. - mov ecx, [ebp+16] - sub esp, ecx +// Load ecif->cif->abi + mov ecx, [ebp + 12] + mov ecx, [ecx]ecif.cif + mov ecx, [ecx]ecif.cif.abi - mov eax, esp - -// Place all of the ffi_prep_args in position - push [ebp + 12] // ecif - push eax - call [ebp + 8] // prepfunc - -// Return stack to previous state and call the function - add esp, 8 -// FIXME: Align the stack to a 128-bit boundary to avoid -// potential performance hits. - call [ebp + 28] -// stdcall functions pop arguments off the stack themselves - -// XXX IS ESP NOW THE SAME AS BEFORE? + cmp ecx, FFI_STDCALL + je noclean +// STDCALL: Remove the space we pushed for the args + mov ecx, [ebp + 16] + add esp, ecx +// CDECL: Caller has already cleaned the stack +noclean: +// Check that esp has the same value as before! sub esi, esp // Load %ecx with the return type code From python-checkins at python.org Tue Feb 3 22:13:18 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 3 Feb 2009 22:13:18 +0100 (CET) Subject: [Python-checkins] r69262 - python/trunk/Lib/importlib/__init__.py Message-ID: <20090203211318.A0D4A1E4002@bag.python.org> Author: brett.cannon Date: Tue Feb 3 22:13:05 2009 New Revision: 69262 Log: Make importlib backwards-compatible to Python 2.2 (but this is not promised to last; just doing it to be nice). Also fix a message for an exception. Modified: python/trunk/Lib/importlib/__init__.py Modified: python/trunk/Lib/importlib/__init__.py ============================================================================== --- python/trunk/Lib/importlib/__init__.py (original) +++ python/trunk/Lib/importlib/__init__.py Tue Feb 3 22:13:05 2009 @@ -1,4 +1,6 @@ """Backport of importlib.import_module from 3.x.""" +# While not critical (and in no way guaranteed!), it would be nice to keep this +# code compatible with Python 2.3. import sys def _resolve_name(name, package, level): @@ -9,8 +11,14 @@ raise ValueError("attempted relative import beyond top-level " "package") except AttributeError: - raise ValueError("__package__ not set to a string") - base = package.rsplit('.', level)[0] + raise ValueError("'package' not set to a string") + try: + # rpartition is more "correct" and rfind is just as easy to use, but + # neither are in Python 2.3. + dot_rindex = package.rindex('.', level)[0] + base = package[:dot_rindex] + except ValueError: + base = package if name: return "%s.%s" % (base, name) else: @@ -34,5 +42,10 @@ break level += 1 name = _resolve_name(name[level:], package, level) - __import__(name) + # Try to import specifying the level to be as accurate as possible, but + # realize that keyword arguments are not found in Python 2.3. + try: + __import__(name, level=0) + except TypeError: + __import__(name) return sys.modules[name] From buildbot at python.org Tue Feb 3 23:06:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 03 Feb 2009 22:06:17 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090203220633.A4A581E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/589 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_poplib.py", line 131, in run asyncore.loop(timeout=0.1, count=1) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 204, in loop poll_fun(timeout, map) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 141, in poll read(obj) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 78, in read obj.handle_error() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 74, in read obj.handle_read_event() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 413, in handle_read_event self.handle_read() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_ssl.py", line 408, in handle_read self.send(data.lower()) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 519, in send self.initiate_send() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 506, in initiate_send num_sent = dispatcher.send(self, self.out_buffer[:512]) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 349, in send result = self.socket.send(data) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/socket.py", line 165, in _dummy raise error(EBADF, 'Bad file descriptor') error: [Errno 9] Bad file descriptor sincerely, -The Buildbot From python-checkins at python.org Tue Feb 3 23:30:59 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 3 Feb 2009 23:30:59 +0100 (CET) Subject: [Python-checkins] r69263 - sandbox/trunk/dbm_sqlite/alt/dbsqlite.py Message-ID: <20090203223059.4CEF91E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 3 23:30:59 2009 New Revision: 69263 Log: Add a sync() method to be called by the shelve module. Modified: sandbox/trunk/dbm_sqlite/alt/dbsqlite.py Modified: sandbox/trunk/dbm_sqlite/alt/dbsqlite.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbsqlite.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbsqlite.py Tue Feb 3 23:30:59 2009 @@ -8,9 +8,10 @@ Issues: # ??? how to coordinate with whichdb - # ??? Size of text fields fixed or varchar (do we need blobs) + # ??? Any difference between blobs and text # ??? does default encoding affect str-->bytes or PySqlite3 always use UTF-8 - # ??? if pure python overhead and pysqlite overhead is too high, rewrite in C + # ??? what is the correct isolation mode + ''' __all__ = ['error', 'open'] @@ -89,6 +90,10 @@ self.conn.executescript(CLEAR_ALL) self.conn.commit() + def sync(self): + if self.conn is not None: + self.conn.commit() + def close(self): if self.conn is not None: self.conn.commit() From python-checkins at python.org Wed Feb 4 00:11:15 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 4 Feb 2009 00:11:15 +0100 (CET) Subject: [Python-checkins] r69264 - sandbox/trunk/dbm_sqlite/alt/dbsqlite.py Message-ID: <20090203231115.677C71E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 4 00:11:15 2009 New Revision: 69264 Log: Fixup broken __len__(). Modified: sandbox/trunk/dbm_sqlite/alt/dbsqlite.py Modified: sandbox/trunk/dbm_sqlite/alt/dbsqlite.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbsqlite.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbsqlite.py Wed Feb 4 00:11:15 2009 @@ -38,8 +38,12 @@ self.conn.commit() def __len__(self): - GET_LEN = 'SELECT MAX(ROWID) FROM shelf' # returns None if count is zero - return self.conn.execute(GET_LEN).fetchone()[0] or 0 + GET_LEN = 'SELECT COUNT(*) FROM shelf' + return self.conn.execute(GET_LEN).fetchone()[0] + + def __bool__(self): + GET_BOOL = 'SELECT MAX(ROWID) FROM shelf' # returns None if count is zero + return self.conn.execute(GET_BOOL).fetchone()[0] is not None def keys(self): return SQLhashKeysView(self) @@ -163,7 +167,9 @@ raise Exception('drat!') print(list(d)) + print(bool(d), True) d.clear() + print(bool(d), False) print(list(d)) d.update(p='x', q='y', r='z') print(list(d)) From python-checkins at python.org Wed Feb 4 00:26:55 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 4 Feb 2009 00:26:55 +0100 (CET) Subject: [Python-checkins] r69265 - sandbox/trunk/dbm_sqlite/alt/dbsqlite.py Message-ID: <20090203232655.0C2A01E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 4 00:26:54 2009 New Revision: 69265 Log: Clean-ups. Modified: sandbox/trunk/dbm_sqlite/alt/dbsqlite.py Modified: sandbox/trunk/dbm_sqlite/alt/dbsqlite.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbsqlite.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbsqlite.py Wed Feb 4 00:26:54 2009 @@ -42,7 +42,7 @@ return self.conn.execute(GET_LEN).fetchone()[0] def __bool__(self): - GET_BOOL = 'SELECT MAX(ROWID) FROM shelf' # returns None if count is zero + GET_BOOL = 'SELECT MAX(ROWID) FROM shelf' return self.conn.execute(GET_BOOL).fetchone()[0] is not None def keys(self): @@ -68,17 +68,15 @@ raise KeyError(key) return item[0] - def __setitem__(self, key, value): + def __setitem__(self, key, value): ADD_ITEM = 'REPLACE INTO shelf (key, value) VALUES (?,?)' self.conn.execute(ADD_ITEM, (key, value)) - #self.conn.commit() def __delitem__(self, key): if key not in self: raise KeyError(key) - DEL_ITEM = 'DELETE FROM shelf WHERE key = ?' + DEL_ITEM = 'DELETE FROM shelf WHERE key = ?' self.conn.execute(DEL_ITEM, (key,)) - #self.conn.commit() def update(self, items=(), **kwds): if isinstance(items, collections.Mapping): @@ -89,13 +87,13 @@ if kwds: self.update(kwds) - def clear(self): - CLEAR_ALL = 'DELETE FROM shelf; VACUUM;' + def clear(self): + CLEAR_ALL = 'DELETE FROM shelf; VACUUM;' self.conn.executescript(CLEAR_ALL) self.conn.commit() def sync(self): - if self.conn is not None: + if self.conn is not None: self.conn.commit() def close(self): @@ -105,27 +103,27 @@ self.conn = None def __del__(self): - self.close() + self.close() class ListRepr: def __repr__(self): - return repr(list(self)) + return repr(list(self)) class SQLhashKeysView(collections.KeysView, ListRepr): - + def __iter__(self): GET_KEYS = 'SELECT key FROM shelf ORDER BY ROWID' return map(itemgetter(0), self._mapping.conn.cursor().execute(GET_KEYS)) class SQLhashValuesView(collections.ValuesView, ListRepr): - + def __iter__(self): GET_VALUES = 'SELECT value FROM shelf ORDER BY ROWID' return map(itemgetter(0), self._mapping.conn.cursor().execute(GET_VALUES)) class SQLhashItemsView(collections.ValuesView, ListRepr): - + def __iter__(self): GET_ITEMS = 'SELECT key, value FROM shelf ORDER BY ROWID' return iter(self._mapping.conn.cursor().execute(GET_ITEMS)) @@ -136,12 +134,14 @@ return SQLhash() + + if __name__ in '__main___': for d in SQLhash(), SQLhash('example'): list(d) print(list(d), "start") d['abc'] = 'lmno' - print(d['abc']) + print(d['abc']) d['abc'] = 'rsvp' d['xyz'] = 'pdq' print(d.items()) @@ -150,7 +150,7 @@ print(list(d), 'list') d.update(p='x', q='y', r='z') print(d.items()) - + del d['abc'] try: print(d['abc']) @@ -158,7 +158,7 @@ pass else: raise Exception('oh noooo!') - + try: del d['abc'] except KeyError: @@ -167,7 +167,7 @@ raise Exception('drat!') print(list(d)) - print(bool(d), True) + print(bool(d), True) d.clear() print(bool(d), False) print(list(d)) From python-checkins at python.org Wed Feb 4 09:28:45 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 4 Feb 2009 09:28:45 +0100 (CET) Subject: [Python-checkins] r69266 - sandbox/trunk/dbm_sqlite/alt/dbdict.py Message-ID: <20090204082845.17CC41E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 4 09:28:44 2009 New Revision: 69266 Log: Add dbdict, a dbm based on a dict subclass. On open, loads full file into memory. On close, writes full dict to disk. Supported file formats: JSON, pickle, or csv Added: sandbox/trunk/dbm_sqlite/alt/dbdict.py (contents, props changed) Added: sandbox/trunk/dbm_sqlite/alt/dbdict.py ============================================================================== --- (empty file) +++ sandbox/trunk/dbm_sqlite/alt/dbdict.py Wed Feb 4 09:28:44 2009 @@ -0,0 +1,78 @@ +'''Alternate DB based on a dict subclass + +Runs like gdbm's fast mode (all writes all delayed until close). +While open, the whole dict is kept in memory. Start-up and +close time's are potentially long because the whole dict must be +read or written to disk. + +File format is selectable between pickle, json, and csv. +All three are backed by fast C implementations. + +''' + +import os, pickle, json, csv + +class DictDB(dict): + + def __init__(self, filename, flag='c', mode=None, *args, **kwds): + # r=readonly c=read_write_create_if_needed n=new_overwrite_previous + self.flag = flag + self.mode = mode + self.filename = filename + if flag != 'n' and os.access(filename, os.R_OK): + file = __builtins__.open(filename, 'rb') + try: + self.update(load(file)) + finally: + file.close() + self.update(*args, **kwds) + + def sync(self): + if self.flag != 'r': + file = __builtins__.open(self.filename, 'wb') + try: + dump(self, file) + finally: + file.close() + if self.mode: + os.chmod(self.filename, self.mode) + + def close(self): + self.sync() + +def myopen(filename, flag='c', mode=0o666): + return DictDB(filename, flag, mode) + +def set_csv(): + global load, dump + def load(f): + ans = list(csv.reader(f)) + return ans + def dump(self, f): + csv.writer(f).writerows(self.items()) + +def set_json(): + global load, dump + load = json.load + def dump(self, f): + json.dump(self, f, separators=(',',':')) + +def set_pickle(): + global load, dump + load = pickle.load + def dump(self, f): + pickle.dump(self, f, -1) + +set_csv() + +if __name__ == '__main__': + os.chdir('/dbm_sqlite/alt') + print(os.getcwd()) + s = myopen('tmp.shl', 'c') + print(s, 'start') + s['xyz'] = 'pdq' + s['abc'] = '123' + s.close() + f = __builtins__.open('tmp.shl', 'rb') + print (f.read()) + f.close() From python-checkins at python.org Wed Feb 4 09:56:31 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 4 Feb 2009 09:56:31 +0100 (CET) Subject: [Python-checkins] r69267 - sandbox/trunk/dbm_sqlite/alt/dbdict.py Message-ID: <20090204085631.B545C1E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 4 09:56:31 2009 New Revision: 69267 Log: Move dump/load inside the class definition. Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbdict.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbdict.py Wed Feb 4 09:56:31 2009 @@ -14,15 +14,16 @@ class DictDB(dict): - def __init__(self, filename, flag='c', mode=None, *args, **kwds): + def __init__(self, filename, flag='c', mode=None, format='csv', *args, **kwds): # r=readonly c=read_write_create_if_needed n=new_overwrite_previous self.flag = flag self.mode = mode - self.filename = filename + self.format = format + self.filename = filename if flag != 'n' and os.access(filename, os.R_OK): file = __builtins__.open(filename, 'rb') try: - self.update(load(file)) + self.update(self.load(file)) finally: file.close() self.update(*args, **kwds) @@ -31,7 +32,7 @@ if self.flag != 'r': file = __builtins__.open(self.filename, 'wb') try: - dump(self, file) + self.dump(file) finally: file.close() if self.mode: @@ -40,35 +41,36 @@ def close(self): self.sync() -def myopen(filename, flag='c', mode=0o666): - return DictDB(filename, flag, mode) - -def set_csv(): - global load, dump - def load(f): - ans = list(csv.reader(f)) - return ans def dump(self, f): - csv.writer(f).writerows(self.items()) + if self.format == 'csv': + csv.writer(f).writerows(self.iteritems()) + elif self.format == 'json': + json.dump(self, f, separators=(',',':')) + elif self.format == 'pickle': + pickle.dump(self.items(), f, -1) + else: + raise NotImplementedError('Unknown format: %r' % self.format) + + def load(self, f): + if self.format == 'csv': + return csv.reader(f) + elif self.format == 'json': + return json.load(f) + elif self.format == 'pickle': + return pickle.load(f) + else: + raise NotImplementedError('Unknown format: %r' % self.format) + + +def myopen(filename, flag='c', mode=0o666, format='csv'): + return DictDB(filename, flag, mode, format) -def set_json(): - global load, dump - load = json.load - def dump(self, f): - json.dump(self, f, separators=(',',':')) -def set_pickle(): - global load, dump - load = pickle.load - def dump(self, f): - pickle.dump(self, f, -1) - -set_csv() if __name__ == '__main__': os.chdir('/dbm_sqlite/alt') print(os.getcwd()) - s = myopen('tmp.shl', 'c') + s = myopen('tmp.shl', 'c', format='json') print(s, 'start') s['xyz'] = 'pdq' s['abc'] = '123' From python-checkins at python.org Wed Feb 4 11:05:25 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Wed, 4 Feb 2009 11:05:25 +0100 (CET) Subject: [Python-checkins] r69268 - in python/trunk: Lib/test/test_file.py Modules/timemodule.c Objects/fileobject.c Message-ID: <20090204100525.E739C1E404C@bag.python.org> Author: kristjan.jonsson Date: Wed Feb 4 11:05:25 2009 New Revision: 69268 Log: issue 4804: Provide checks for the format string of strftime, and for the "mode" string of fopen on Windows. These strings are user provided from python and so we can avoid invoking the C runtime invalid parameter handler by first checking that they are valid. Modified: python/trunk/Lib/test/test_file.py python/trunk/Modules/timemodule.c python/trunk/Objects/fileobject.c Modified: python/trunk/Lib/test/test_file.py ============================================================================== --- python/trunk/Lib/test/test_file.py (original) +++ python/trunk/Lib/test/test_file.py Wed Feb 4 11:05:25 2009 @@ -154,7 +154,7 @@ for name in (TESTFN, unicode(TESTFN), unicode(TESTFN + '\t')): try: f = open(name, "rr") - except IOError: + except (IOError, ValueError): pass else: f.close() Modified: python/trunk/Modules/timemodule.c ============================================================================== --- python/trunk/Modules/timemodule.c (original) +++ python/trunk/Modules/timemodule.c Wed Feb 4 11:05:25 2009 @@ -470,6 +470,23 @@ return NULL; } +#ifdef MS_WINDOWS + /* check that the format string contains only valid directives */ + for(outbuf = strchr(fmt, '%'); + outbuf != NULL; + outbuf = strchr(outbuf+2, '%')) + { + if (outbuf[1]=='#') + ++outbuf; /* not documented by python, */ + if (outbuf[1]=='\0' || + !strchr("aAbBcdfHIjmMpSUwWxXyYzZ%", outbuf[1])) + { + PyErr_SetString(PyExc_ValueError, "Invalid format string"); + return 0; + } + } +#endif + fmtlen = strlen(fmt); /* I hate these functions that presume you know how big the output Modified: python/trunk/Objects/fileobject.c ============================================================================== --- python/trunk/Objects/fileobject.c (original) +++ python/trunk/Objects/fileobject.c Wed Feb 4 11:05:25 2009 @@ -181,6 +181,87 @@ return (PyObject *) f; } +#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__) +#define Py_VERIFY_WINNT +/* The CRT on windows compiled with Visual Studio 2005 and higher may + * assert if given invalid mode strings. This is all fine and well + * in static languages like C where the mode string is typcially hard + * coded. But in Python, were we pass in the mode string from the user, + * we need to verify it first manually + */ +static int _PyVerify_Mode_WINNT(const char *mode) +{ + /* See if mode string is valid on Windows to avoid hard assertions */ + /* remove leading spacese */ + int singles = 0; + int pairs = 0; + int encoding = 0; + const char *s, *c; + + while(*mode == ' ') /* strip initial spaces */ + ++mode; + if (!strchr("rwa", *mode)) /* must start with one of these */ + return 0; + while (*++mode) { + if (*mode == ' ' || *mode == 'N') /* ignore spaces and N */ + continue; + s = "+TD"; /* each of this can appear only once */ + c = strchr(s, *mode); + if (c) { + ptrdiff_t idx = s-c; + if (singles & (1< Author: raymond.hettinger Date: Wed Feb 4 11:06:10 2009 New Revision: 69269 Log: Add eval format. Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbdict.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbdict.py Wed Feb 4 11:06:10 2009 @@ -5,7 +5,7 @@ close time's are potentially long because the whole dict must be read or written to disk. -File format is selectable between pickle, json, and csv. +File format is selectable between pickle, json, eval, and csv. All three are backed by fast C implementations. ''' @@ -48,16 +48,21 @@ json.dump(self, f, separators=(',',':')) elif self.format == 'pickle': pickle.dump(self.items(), f, -1) + elif self.format == 'eval': + f.write(repr(self)) else: raise NotImplementedError('Unknown format: %r' % self.format) def load(self, f): + # Use csv or json for untrusted data. Use pickle or eval for trusted. if self.format == 'csv': return csv.reader(f) elif self.format == 'json': return json.load(f) elif self.format == 'pickle': return pickle.load(f) + elif self.format == 'eval': + return eval(f.read()) else: raise NotImplementedError('Unknown format: %r' % self.format) From python-checkins at python.org Wed Feb 4 11:40:36 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 4 Feb 2009 11:40:36 +0100 (CET) Subject: [Python-checkins] r69270 - sandbox/trunk/dbm_sqlite/alt/dbdict.py Message-ID: <20090204104036.151E11E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 4 11:40:35 2009 New Revision: 69270 Log: Expand comments Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbdict.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbdict.py Wed Feb 4 11:40:35 2009 @@ -54,7 +54,8 @@ raise NotImplementedError('Unknown format: %r' % self.format) def load(self, f): - # Use csv or json for untrusted data. Use pickle or eval for trusted. + # Use csv or json for untrusted data. Handles only basic types. + # Use pickle or eval only for trusted. Handles many object types. if self.format == 'csv': return csv.reader(f) elif self.format == 'json': From buildbot at python.org Wed Feb 4 11:43:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 04 Feb 2009 10:43:07 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090204104307.23E621E4002@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/4580 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: kristjan.jonsson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Wed Feb 4 11:52:32 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 4 Feb 2009 11:52:32 +0100 (CET) Subject: [Python-checkins] r69271 - in python/trunk: Doc/library/collections.rst Doc/library/itertools.rst Lib/test/test_itertools.py Message-ID: <20090204105232.B9FA61E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 4 11:52:32 2009 New Revision: 69271 Log: Minor doc fixups. Modified: python/trunk/Doc/library/collections.rst python/trunk/Doc/library/itertools.rst python/trunk/Lib/test/test_itertools.py Modified: python/trunk/Doc/library/collections.rst ============================================================================== --- python/trunk/Doc/library/collections.rst (original) +++ python/trunk/Doc/library/collections.rst Wed Feb 4 11:52:32 2009 @@ -218,7 +218,7 @@ .. method:: most_common([n]) Return a list of the *n* most common elements and their counts from the - most common to the least. If *n* not specified, :func:`most_common` + 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:: Modified: python/trunk/Doc/library/itertools.rst ============================================================================== --- python/trunk/Doc/library/itertools.rst (original) +++ python/trunk/Doc/library/itertools.rst Wed Feb 4 11:52:32 2009 @@ -282,7 +282,7 @@ class groupby(object): # [k for k, g in groupby('AAAABBBCCDAABBB')] --> A B C D A B - # [(list(g)) for k, g in groupby('AAAABBBCCD')] --> AAAA BBB CC D + # [list(g) for k, g in groupby('AAAABBBCCD')] --> AAAA BBB CC D def __init__(self, iterable, key=None): if key is None: key = lambda x: x @@ -675,8 +675,8 @@ return imap(function, count(start)) def nth(iterable, n): - "Returns the nth item or empty list" - return list(islice(iterable, n, n+1)) + "Returns the nth item or None" + return next(islice(iterable, n, None), None) def quantify(iterable, pred=bool): "Count how many times the predicate is true" Modified: python/trunk/Lib/test/test_itertools.py ============================================================================== --- python/trunk/Lib/test/test_itertools.py (original) +++ python/trunk/Lib/test/test_itertools.py Wed Feb 4 11:52:32 2009 @@ -1352,8 +1352,8 @@ ... return imap(function, count(start)) >>> def nth(iterable, n): -... "Returns the nth item or empty list" -... return list(islice(iterable, n, n+1)) +... "Returns the nth item or None" +... return next(islice(iterable, n, None), None) >>> def quantify(iterable, pred=bool): ... "Count how many times the predicate is true" @@ -1448,7 +1448,10 @@ [0, 2, 4, 6] >>> nth('abcde', 3) -['d'] +'d' + +>>> nth('abcde', 9) is None +True >>> quantify(xrange(99), lambda x: x%2==0) 50 From python-checkins at python.org Wed Feb 4 12:14:18 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 4 Feb 2009 12:14:18 +0100 (CET) Subject: [Python-checkins] r69272 - python/trunk/Doc/library/operator.rst Message-ID: <20090204111418.DE9381E4010@bag.python.org> Author: raymond.hettinger Date: Wed Feb 4 12:14:18 2009 New Revision: 69272 Log: Doc fixes. Remove overbroad, redundant warnings. Fixup example code. Modified: python/trunk/Doc/library/operator.rst Modified: python/trunk/Doc/library/operator.rst ============================================================================== --- python/trunk/Doc/library/operator.rst (original) +++ python/trunk/Doc/library/operator.rst Wed Feb 4 12:14:18 2009 @@ -298,6 +298,15 @@ This function is removed in Python 3.x. Use :func:`setitem` with a slice index. +Example use of operator functions:: + + >>> # Elementwise multiplication + >>> map(mul, [0, 1, 2, 3], [10, 20, 30, 40]) + [0, 20, 60, 120] + + >>> # Dot product + >>> sum(map(mul, [0, 1, 2, 3], [10, 20, 30, 40])) + 200 Many operations have an "in-place" version. The following functions provide a more primitive access to in-place operators than the usual syntax does; for @@ -455,12 +464,6 @@ Returns true if the object *obj* supports the mapping interface. This is true for dictionaries and all instance objects defining :meth:`__getitem__`. - .. warning:: - - There is no reliable way to test if an instance supports the complete mapping - protocol since the interface itself is ill-defined. This makes this test less - useful than it otherwise might be. - .. function:: isNumberType(obj) @@ -470,12 +473,6 @@ Returns true if the object *obj* represents a number. This is true for all numeric types implemented in C. - .. warning:: - - There is no reliable way to test if an instance supports the complete numeric - interface since the interface itself is ill-defined. This makes this test less - useful than it otherwise might be. - .. function:: isSequenceType(obj) @@ -486,21 +483,6 @@ for all objects which define sequence methods in C, and for all instance objects defining :meth:`__getitem__`. - .. warning:: - - There is no reliable way to test if an instance supports the complete sequence - interface since the interface itself is ill-defined. This makes this test less - useful than it otherwise might be. - -Example: Build a dictionary that maps the ordinals from ``0`` to ``255`` to -their character equivalents. - - >>> d = {} - >>> keys = range(256) - >>> vals = map(chr, keys) - >>> map(operator.setitem, [d]*len(keys), keys, vals) # doctest: +SKIP - -.. XXX: find a better, readable, example The :mod:`operator` module also defines tools for generalized attribute and item lookups. These are useful for making fast field extractors as arguments for From python-checkins at python.org Wed Feb 4 12:31:30 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 4 Feb 2009 12:31:30 +0100 (CET) Subject: [Python-checkins] r69273 - python/trunk/Doc/library/collections.rst Message-ID: <20090204113130.9C5881E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 4 12:31:30 2009 New Revision: 69273 Log: Tweak the docs for Counter() objects. 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 Wed Feb 4 12:31:30 2009 @@ -156,14 +156,14 @@ A counter tool is provided to support convenient and rapid tallies. For example:: - # Tally occurrences of words in a list + >>> # Tally occurrences of words in a list >>> cnt = Counter() >>> for word in ['red', 'blue', 'red', 'green', 'blue', 'blue']: ... cnt[word] += 1 >>> cnt Counter({'blue': 3, 'red': 2, 'green': 1}) - # Find the ten most common words in Hamlet + >>> # Find the ten most common words in Hamlet >>> import re >>> words = re.findall('\w+', open('hamlet.txt').read().lower()) >>> Counter(words).most_common(10) @@ -256,8 +256,8 @@ contain repeated elements (with counts of one or more). Addition and subtraction combine counters by adding or subtracting the counts of corresponding elements. Intersection and union return the minimum and maximum -of corresponding counts. All four multiset operations exclude results with -counts less than one:: +of corresponding counts. Each operation can accept inputs with signed counts, +but the output excludes results with counts less than one. >>> c = Counter(a=3, b=1) >>> d = Counter(a=1, b=2) From python-checkins at python.org Wed Feb 4 12:41:45 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 4 Feb 2009 12:41:45 +0100 (CET) Subject: [Python-checkins] r69274 - python/branches/py3k/Doc/library/collections.rst Message-ID: <20090204114145.BD86A1E4042@bag.python.org> Author: raymond.hettinger Date: Wed Feb 4 12:41:45 2009 New Revision: 69274 Log: Tweak the docs for Counter() objects. 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 Wed Feb 4 12:41:45 2009 @@ -144,14 +144,14 @@ A counter tool is provided to support convenient and rapid tallies. For example:: - # Tally occurrences of words in a list + >>> # Tally occurrences of words in a list >>> cnt = Counter() >>> for word in ['red', 'blue', 'red', 'green', 'blue', 'blue']: ... cnt[word] += 1 >>> cnt Counter({'blue': 3, 'red': 2, 'green': 1}) - # Find the ten most common words in Hamlet + >>> # Find the ten most common words in Hamlet >>> import re >>> words = re.findall('\w+', open('hamlet.txt').read().lower()) >>> Counter(words).most_common(10) @@ -244,8 +244,8 @@ contain repeated elements (with counts of one or more). Addition and subtraction combine counters by adding or subtracting the counts of corresponding elements. Intersection and union return the minimum and maximum -of corresponding counts. All four multiset operations exclude results with -counts less than one:: +of corresponding counts. Each operation can accept inputs with signed counts, +but the output excludes results with counts less than one. >>> c = Counter(a=3, b=1) >>> d = Counter(a=1, b=2) From python-checkins at python.org Wed Feb 4 12:59:49 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 4 Feb 2009 12:59:49 +0100 (CET) Subject: [Python-checkins] r69275 - python/branches/release26-maint/Doc/library/operator.rst Message-ID: <20090204115949.A22F01E400C@bag.python.org> Author: raymond.hettinger Date: Wed Feb 4 12:59:49 2009 New Revision: 69275 Log: Doc fixes. Remove overbroad, redundant warnings. Fixup example code. Modified: python/branches/release26-maint/Doc/library/operator.rst Modified: python/branches/release26-maint/Doc/library/operator.rst ============================================================================== --- python/branches/release26-maint/Doc/library/operator.rst (original) +++ python/branches/release26-maint/Doc/library/operator.rst Wed Feb 4 12:59:49 2009 @@ -298,6 +298,15 @@ This function is removed in Python 3.0. Use :func:`setitem` with a slice index. +Example use of operator functions:: + + >>> # Elementwise multiplication + >>> map(mul, [0, 1, 2, 3], [10, 20, 30, 40]) + [0, 20, 60, 120] + + >>> # Dot product + >>> sum(map(mul, [0, 1, 2, 3], [10, 20, 30, 40])) + 200 Many operations have an "in-place" version. The following functions provide a more primitive access to in-place operators than the usual syntax does; for @@ -455,12 +464,6 @@ Returns true if the object *obj* supports the mapping interface. This is true for dictionaries and all instance objects defining :meth:`__getitem__`. - .. warning:: - - There is no reliable way to test if an instance supports the complete mapping - protocol since the interface itself is ill-defined. This makes this test less - useful than it otherwise might be. - .. function:: isNumberType(obj) @@ -470,12 +473,6 @@ Returns true if the object *obj* represents a number. This is true for all numeric types implemented in C. - .. warning:: - - There is no reliable way to test if an instance supports the complete numeric - interface since the interface itself is ill-defined. This makes this test less - useful than it otherwise might be. - .. function:: isSequenceType(obj) @@ -486,21 +483,6 @@ for all objects which define sequence methods in C, and for all instance objects defining :meth:`__getitem__`. - .. warning:: - - There is no reliable way to test if an instance supports the complete sequence - interface since the interface itself is ill-defined. This makes this test less - useful than it otherwise might be. - -Example: Build a dictionary that maps the ordinals from ``0`` to ``255`` to -their character equivalents. - - >>> d = {} - >>> keys = range(256) - >>> vals = map(chr, keys) - >>> map(operator.setitem, [d]*len(keys), keys, vals) # doctest: +SKIP - -.. XXX: find a better, readable, example The :mod:`operator` module also defines tools for generalized attribute and item lookups. These are useful for making fast field extractors as arguments for From buildbot at python.org Wed Feb 4 13:07:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 04 Feb 2009 12:07:18 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090204120718.95A091E4023@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/103 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: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Wed Feb 4 20:25:17 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 4 Feb 2009 20:25:17 +0100 (CET) Subject: [Python-checkins] r69276 - python/trunk/Doc/glossary.rst Message-ID: <20090204192517.CA0B21E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 4 20:25:17 2009 New Revision: 69276 Log: Clarify that named tuples do not have to subclass tuple. Modified: python/trunk/Doc/glossary.rst Modified: python/trunk/Doc/glossary.rst ============================================================================== --- python/trunk/Doc/glossary.rst (original) +++ python/trunk/Doc/glossary.rst Wed Feb 4 20:25:17 2009 @@ -396,7 +396,7 @@ also :term:`immutable`. named tuple - Any tuple subclass whose indexable elements are also accessible using + Any tuple-like class whose indexable elements are also accessible using named attributes (for example, :func:`time.localtime` returns a tuple-like object where the *year* is accessible either with an index such as ``t[0]`` or with a named attribute like ``t.tm_year``). From python-checkins at python.org Wed Feb 4 20:34:31 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 4 Feb 2009 20:34:31 +0100 (CET) Subject: [Python-checkins] r69277 - in python/branches/release26-maint: Doc/glossary.rst Doc/library/itertools.rst Lib/test/test_itertools.py Message-ID: <20090204193431.C26251E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 4 20:34:31 2009 New Revision: 69277 Log: Minor doc fixes. Modified: python/branches/release26-maint/Doc/glossary.rst python/branches/release26-maint/Doc/library/itertools.rst python/branches/release26-maint/Lib/test/test_itertools.py Modified: python/branches/release26-maint/Doc/glossary.rst ============================================================================== --- python/branches/release26-maint/Doc/glossary.rst (original) +++ python/branches/release26-maint/Doc/glossary.rst Wed Feb 4 20:34:31 2009 @@ -396,7 +396,7 @@ also :term:`immutable`. named tuple - Any tuple subclass whose indexable elements are also accessible using + Any tuple-like class whose indexable elements are also accessible using named attributes (for example, :func:`time.localtime` returns a tuple-like object where the *year* is accessible either with an index such as ``t[0]`` or with a named attribute like ``t.tm_year``). Modified: python/branches/release26-maint/Doc/library/itertools.rst ============================================================================== --- python/branches/release26-maint/Doc/library/itertools.rst (original) +++ python/branches/release26-maint/Doc/library/itertools.rst Wed Feb 4 20:34:31 2009 @@ -221,7 +221,7 @@ class groupby(object): # [k for k, g in groupby('AAAABBBCCDAABBB')] --> A B C D A B - # [(list(g)) for k, g in groupby('AAAABBBCCD')] --> AAAA BBB CC D + # [list(g) for k, g in groupby('AAAABBBCCD')] --> AAAA BBB CC D def __init__(self, iterable, key=None): if key is None: key = lambda x: x @@ -614,8 +614,8 @@ return imap(function, count(start)) def nth(iterable, n): - "Returns the nth item or empty list" - return list(islice(iterable, n, n+1)) + "Returns the nth item or None" + return next(islice(iterable, n, None), None) def quantify(iterable, pred=bool): "Count how many times the predicate is true" Modified: python/branches/release26-maint/Lib/test/test_itertools.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_itertools.py (original) +++ python/branches/release26-maint/Lib/test/test_itertools.py Wed Feb 4 20:34:31 2009 @@ -1201,8 +1201,8 @@ ... return imap(function, count(start)) >>> def nth(iterable, n): -... "Returns the nth item or empty list" -... return list(islice(iterable, n, n+1)) +... "Returns the nth item or None" +... return next(islice(iterable, n, None), None) >>> def quantify(iterable, pred=bool): ... "Count how many times the predicate is true" @@ -1318,7 +1318,10 @@ [0, 2, 4, 6] >>> nth('abcde', 3) -['d'] +'d' + +>>> nth('abcde', 9) is None +True >>> quantify(xrange(99), lambda x: x%2==0) 50 From python-checkins at python.org Wed Feb 4 20:42:15 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 4 Feb 2009 20:42:15 +0100 (CET) Subject: [Python-checkins] r69278 - in python/branches/release30-maint: Doc/glossary.rst Doc/library/itertools.rst Lib/test/test_itertools.py Message-ID: <20090204194215.8F7AF1E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 4 20:42:15 2009 New Revision: 69278 Log: Minor doc fixes. Modified: python/branches/release30-maint/Doc/glossary.rst python/branches/release30-maint/Doc/library/itertools.rst python/branches/release30-maint/Lib/test/test_itertools.py Modified: python/branches/release30-maint/Doc/glossary.rst ============================================================================== --- python/branches/release30-maint/Doc/glossary.rst (original) +++ python/branches/release30-maint/Doc/glossary.rst Wed Feb 4 20:42:15 2009 @@ -379,7 +379,7 @@ also :term:`immutable`. named tuple - Any tuple subclass whose indexable elements are also accessible using + Any tuple-like class whose indexable elements are also accessible using named attributes (for example, :func:`time.localtime` returns a tuple-like object where the *year* is accessible either with an index such as ``t[0]`` or with a named attribute like ``t.tm_year``). 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 Wed Feb 4 20:42:15 2009 @@ -229,7 +229,7 @@ class groupby(object): # [k for k, g in groupby('AAAABBBCCDAABBB')] --> A B C D A B - # [(list(g)) for k, g in groupby('AAAABBBCCD')] --> AAAA BBB CC D + # [list(g) for k, g in groupby('AAAABBBCCD')] --> AAAA BBB CC D def __init__(self, iterable, key=None): if key is None: key = lambda x: x @@ -530,8 +530,8 @@ return map(function, count(start)) def nth(iterable, n): - "Returns the nth item or empty list" - return list(islice(iterable, n, n+1)) + "Returns the nth item or None" + return next(islice(iterable, n, None), None) def quantify(iterable, pred=bool): "Count how many times the predicate is true" Modified: python/branches/release30-maint/Lib/test/test_itertools.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_itertools.py (original) +++ python/branches/release30-maint/Lib/test/test_itertools.py Wed Feb 4 20:42:15 2009 @@ -1220,8 +1220,8 @@ ... return map(function, count(start)) >>> def nth(iterable, n): -... "Returns the nth item or empty list" -... return list(islice(iterable, n, n+1)) +... "Returns the nth item or None" +... return next(islice(iterable, n, None), None) >>> def quantify(iterable, pred=bool): ... "Count how many times the predicate is true" @@ -1337,7 +1337,10 @@ [0, 2, 4, 6] >>> nth('abcde', 3) -['d'] +'d' + +>>> nth('abcde', 9) is None +True >>> quantify(range(99), lambda x: x%2==0) 50 From python-checkins at python.org Wed Feb 4 20:45:13 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 4 Feb 2009 20:45:13 +0100 (CET) Subject: [Python-checkins] r69279 - in python/branches/py3k: Doc/glossary.rst Doc/library/collections.rst Doc/library/itertools.rst Lib/test/test_itertools.py Message-ID: <20090204194513.F14E51E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 4 20:45:13 2009 New Revision: 69279 Log: Minor doc fixes. Modified: python/branches/py3k/Doc/glossary.rst python/branches/py3k/Doc/library/collections.rst python/branches/py3k/Doc/library/itertools.rst python/branches/py3k/Lib/test/test_itertools.py Modified: python/branches/py3k/Doc/glossary.rst ============================================================================== --- python/branches/py3k/Doc/glossary.rst (original) +++ python/branches/py3k/Doc/glossary.rst Wed Feb 4 20:45:13 2009 @@ -393,7 +393,7 @@ also :term:`immutable`. named tuple - Any tuple subclass whose indexable elements are also accessible using + Any tuple-like class whose indexable elements are also accessible using named attributes (for example, :func:`time.localtime` returns a tuple-like object where the *year* is accessible either with an index such as ``t[0]`` or with a named attribute like ``t.tm_year``). Modified: python/branches/py3k/Doc/library/collections.rst ============================================================================== --- python/branches/py3k/Doc/library/collections.rst (original) +++ python/branches/py3k/Doc/library/collections.rst Wed Feb 4 20:45:13 2009 @@ -206,7 +206,7 @@ .. method:: most_common([n]) Return a list of the *n* most common elements and their counts from the - most common to the least. If *n* not specified, :func:`most_common` + 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:: Modified: python/branches/py3k/Doc/library/itertools.rst ============================================================================== --- python/branches/py3k/Doc/library/itertools.rst (original) +++ python/branches/py3k/Doc/library/itertools.rst Wed Feb 4 20:45:13 2009 @@ -290,7 +290,7 @@ class groupby(object): # [k for k, g in groupby('AAAABBBCCDAABBB')] --> A B C D A B - # [(list(g)) for k, g in groupby('AAAABBBCCD')] --> AAAA BBB CC D + # [list(g) for k, g in groupby('AAAABBBCCD')] --> AAAA BBB CC D def __init__(self, iterable, key=None): if key is None: key = lambda x: x @@ -591,8 +591,8 @@ return map(function, count(start)) def nth(iterable, n): - "Returns the nth item or empty list" - return list(islice(iterable, n, n+1)) + "Returns the nth item or None" + return next(islice(iterable, n, None), None) def quantify(iterable, pred=bool): "Count how many times the predicate is true" Modified: python/branches/py3k/Lib/test/test_itertools.py ============================================================================== --- python/branches/py3k/Lib/test/test_itertools.py (original) +++ python/branches/py3k/Lib/test/test_itertools.py Wed Feb 4 20:45:13 2009 @@ -1371,8 +1371,8 @@ ... return map(function, count(start)) >>> def nth(iterable, n): -... "Returns the nth item or empty list" -... return list(islice(iterable, n, n+1)) +... "Returns the nth item or None" +... return next(islice(iterable, n, None), None) >>> def quantify(iterable, pred=bool): ... "Count how many times the predicate is true" @@ -1469,7 +1469,10 @@ [0, 2, 4, 6] >>> nth('abcde', 3) -['d'] +'d' + +>>> nth('abcde', 9) is None +True >>> quantify(range(99), lambda x: x%2==0) 50 From buildbot at python.org Wed Feb 4 21:17:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 04 Feb 2009 20:17:13 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090204201713.C22571E4002@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/92 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: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Wed Feb 4 21:24:55 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 04 Feb 2009 20:24:55 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090204202455.6AA3A1E4002@bag.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/83 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 python-checkins at python.org Thu Feb 5 01:05:45 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 5 Feb 2009 01:05:45 +0100 (CET) Subject: [Python-checkins] r69280 - python/branches/py3k Message-ID: <20090205000545.C1F241E4002@bag.python.org> Author: benjamin.peterson Date: Thu Feb 5 01:05:45 2009 New Revision: 69280 Log: Blocked revisions 69276 via svnmerge ........ r69276 | raymond.hettinger | 2009-02-04 13:25:17 -0600 (Wed, 04 Feb 2009) | 1 line Clarify that named tuples do not have to subclass tuple. ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Thu Feb 5 01:24:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 05 Feb 2009 00:24:40 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 3.x Message-ID: <20090205002440.87F911E4002@bag.python.org> The Buildbot has detected a new failure of OS X x86 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%203.x/builds/141 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 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_cmd_line test_urllib ====================================================================== FAIL: test_run_code (test.test_cmd_line.CmdLineTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_cmd_line.py", line 143, in test_run_code 0) AssertionError: 1 != 0 ====================================================================== ERROR: test_empty_socket (test.test_urllib.urlopen_HttpTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib.py", line 194, in test_empty_socket self.assertRaises(IOError, urlopen, "http://something") File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/unittest.py", line 344, in failUnlessRaises callableObj(*args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib.py", line 33, in urlopen return opener.open(url) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1444, in open return getattr(self, name)(url) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1618, in open_http return self._open_generic_http(http.client.HTTPConnection, url, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1601, in _open_generic_http response = http_conn.getresponse() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 937, in getresponse method=self._method) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 275, in __init__ self.fp = sock.makefile("rb") TypeError: makefile() takes exactly 3 positional arguments (2 given) ====================================================================== ERROR: test_read (test.test_urllib.urlopen_HttpTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib.py", line 168, in test_read fp = urlopen("http://python.org/") File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib.py", line 33, in urlopen return opener.open(url) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1444, in open return getattr(self, name)(url) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1618, in open_http return self._open_generic_http(http.client.HTTPConnection, url, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1601, in _open_generic_http response = http_conn.getresponse() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 937, in getresponse method=self._method) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 275, in __init__ self.fp = sock.makefile("rb") TypeError: makefile() takes exactly 3 positional arguments (2 given) ====================================================================== ERROR: test_read_bogus (test.test_urllib.urlopen_HttpTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib.py", line 185, in test_read_bogus self.assertRaises(IOError, urlopen, "http://python.org/") File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/unittest.py", line 344, in failUnlessRaises callableObj(*args, **kwargs) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/test/test_urllib.py", line 33, in urlopen return opener.open(url) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1444, in open return getattr(self, name)(url) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1618, in open_http return self._open_generic_http(http.client.HTTPConnection, url, data) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/urllib/request.py", line 1601, in _open_generic_http response = http_conn.getresponse() File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 937, in getresponse method=self._method) File "/Users/buildbot/buildarea/3.x.noller-osx86/build/Lib/http/client.py", line 275, in __init__ self.fp = sock.makefile("rb") TypeError: makefile() takes exactly 3 positional arguments (2 given) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Feb 5 03:52:18 2009 From: python-checkins at python.org (brett.cannon) Date: Thu, 5 Feb 2009 03:52:18 +0100 (CET) Subject: [Python-checkins] r69281 - python/branches/py3k/Lib/importlib/_bootstrap.py Message-ID: <20090205025218.6A16A1E4002@bag.python.org> Author: brett.cannon Date: Thu Feb 5 03:52:18 2009 New Revision: 69281 Log: Rename importlib._bootstrap.SysPathFinder to PathFinder and expose off of importlib.machinery. Also make the methods either class or staticmethods. Modified: python/branches/py3k/Lib/importlib/_bootstrap.py Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Thu Feb 5 03:52:18 2009 @@ -589,33 +589,29 @@ super(PyFileImporter, self).__init__(path_entry) -class SysPathFinder: +class PathFinder: """Meta path finder for sys.(path|path_hooks|path_importer_cache).""" - def _default_hook(self, path): - """Use the default hook on 'path'. - - If the path will not work for the default hook then raise ImportError. - - """ - # TODO(brett.cannon) Implement - raise ImportError + _default_hook = staticmethod(chaining_fs_path_hook(ExtensionFileImporter, + PyFileImporter)) # The list of implicit hooks cannot be a class attribute because of # bootstrapping issues for accessing imp. - def _implicit_hooks(self, path): + @classmethod + def _implicit_hooks(cls): """Return a list of the implicit path hooks.""" return [self._default_hook, imp.NullImporter] - def _path_hooks(self, path): + @classmethod + def _path_hooks(cls, path): """Search sys.path_hooks for a finder for 'path'. Guaranteed to return a finder for the path as NullImporter is the default importer for any path that does not have an explicit finder. """ - for hook in sys.path_hooks + self._implicit_hooks(): + for hook in sys.path_hooks + cls._implicit_hooks(): try: return hook(path) except ImportError: @@ -625,7 +621,8 @@ raise SystemError("no hook could find an importer for " "{0}".format(path)) - def _path_importer_cache(self, path): + @classmethod + def _path_importer_cache(cls, path): """Get the finder for the path from sys.path_importer_cache. If the path is not in the cache, find the appropriate finder and cache @@ -638,24 +635,25 @@ """ try: - finder = sys.path_importer_cache(path); + finder = sys.path_importer_cache[path] except KeyError: - finder = self._path_hooks(path) + finder = cls._path_hooks(path) sys.path_importer_cache[path] = finder else: if finder is None: # Raises ImportError on failure. - finder = self._default_hook(path) + finder = cls._default_hook(path) sys.path_importer_cache[path] = finder return finder - def find_module(self, fullname, path=None): + @classmethod + def find_module(cls, fullname, path=None): """Find the module on sys.path or 'path'.""" if not path: path = sys.path for entry in path: try: - finder = self._path_importer_cache(entry) + finder = cls._path_importer_cache(entry) except ImportError: continue loader = finder.find_module(fullname) From python-checkins at python.org Thu Feb 5 03:52:57 2009 From: python-checkins at python.org (brett.cannon) Date: Thu, 5 Feb 2009 03:52:57 +0100 (CET) Subject: [Python-checkins] r69282 - python/branches/py3k/Lib/importlib/machinery.py Message-ID: <20090205025257.63E551E4002@bag.python.org> Author: brett.cannon Date: Thu Feb 5 03:52:57 2009 New Revision: 69282 Log: Check in the fact that importlib.machinery.PathFinder now exists. Modified: python/branches/py3k/Lib/importlib/machinery.py Modified: python/branches/py3k/Lib/importlib/machinery.py ============================================================================== --- python/branches/py3k/Lib/importlib/machinery.py (original) +++ python/branches/py3k/Lib/importlib/machinery.py Thu Feb 5 03:52:57 2009 @@ -2,3 +2,4 @@ from ._bootstrap import BuiltinImporter from ._bootstrap import FrozenImporter +from ._bootstrap import PathFinder From python-checkins at python.org Thu Feb 5 03:53:23 2009 From: python-checkins at python.org (brett.cannon) Date: Thu, 5 Feb 2009 03:53:23 +0100 (CET) Subject: [Python-checkins] r69283 - python/branches/py3k/Lib/importlib/test/import_/test_path.py Message-ID: <20090205025323.E6E5E1E4002@bag.python.org> Author: brett.cannon Date: Thu Feb 5 03:53:23 2009 New Revision: 69283 Log: Begin writing tests for importlib.machinery.PathFinder. Modified: python/branches/py3k/Lib/importlib/test/import_/test_path.py Modified: python/branches/py3k/Lib/importlib/test/import_/test_path.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_path.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_path.py Thu Feb 5 03:53:23 2009 @@ -1,3 +1,4 @@ +from importlib import machinery from .. import util from . import util as import_util from contextlib import nested @@ -149,9 +150,64 @@ self.path_argument_test(name) +class FinderTests(unittest.TestCase): + + """Tests for SysPathImporter.""" + + def test_failure(self): + # Test None returned upon not finding a suitable finder. + def mock_implicit_hooks(): + return [] + # XXX Not blackbox. + original_hooks = machinery.PathFinder._implicit_hooks + machinery.PathFinder._implicit_hooks = staticmethod(mock_implicit_hooks) + try: + with util.import_state(): + self.assert_(machinery.PathFinder.find_module('XXX') is None) + finally: + machinery.PathFinder._implicit_hooks = original_hooks + + def test_sys_path(self): + # Test that sys.path is used when 'path' is None. + # Implicitly tests that sys.path_importer_cache is used. + module = '' + path = '' + importer = util.mock_modules(module) + with util.import_state(path_importer_cache={path: importer}, + path=[path]): + loader = machinery.PathFinder.find_module(module) + self.assert_(loader is importer) + + def test_path(self): + # Test that 'path' is used when set. + # Implicitly tests that sys.path_importer_cache is used. + module = '' + path = '' + importer = util.mock_modules(module) + with util.import_state(path_importer_cache={path: importer}): + loader = machinery.PathFinder.find_module(module, [path]) + self.assert_(loader is importer) + + def test_path_importer_cache_has_None(self): + # Test that the default hook is used when sys.path_importer_cache + # contains None for a path. + # TODO(brett.cannon) implement + pass + + def test_path_hooks(self): + # Test that sys.path_hooks is used. + # TODO(brett.cannon) implement + pass + + def test_implicit_hooks(self): + # Test that the implicit path hooks are used. + # TODO(brett.cannon) implement + pass + + def test_main(): from test.support import run_unittest - run_unittest(PathTests, __path__Tests) + run_unittest(PathTests, __path__Tests, FinderTests) if __name__ == '__main__': test_main() From python-checkins at python.org Thu Feb 5 03:53:47 2009 From: python-checkins at python.org (brett.cannon) Date: Thu, 5 Feb 2009 03:53:47 +0100 (CET) Subject: [Python-checkins] r69284 - python/branches/py3k/Lib/importlib/NOTES Message-ID: <20090205025347.830041E4002@bag.python.org> Author: brett.cannon Date: Thu Feb 5 03:53:47 2009 New Revision: 69284 Log: Update NOTES for importlib about PathFinder. Modified: python/branches/py3k/Lib/importlib/NOTES Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Thu Feb 5 03:53:47 2009 @@ -10,7 +10,9 @@ * Create meta_path importer for sys.path. + Create hook. + + Write tests. + Rewrite Import to use the hook. + + Document. * Implement PEP 302 protocol for loaders (should just be a matter of testing). From python-checkins at python.org Thu Feb 5 10:06:23 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 5 Feb 2009 10:06:23 +0100 (CET) Subject: [Python-checkins] r69285 - python/trunk/Lib/distutils/__init__.py Message-ID: <20090205090623.A13AC1E4039@bag.python.org> Author: tarek.ziade Date: Thu Feb 5 10:06:23 2009 New Revision: 69285 Log: Fix comment for #1835 Modified: python/trunk/Lib/distutils/__init__.py Modified: python/trunk/Lib/distutils/__init__.py ============================================================================== --- python/trunk/Lib/distutils/__init__.py (original) +++ python/trunk/Lib/distutils/__init__.py Thu Feb 5 10:06:23 2009 @@ -12,13 +12,8 @@ # Distutils version # -# Please coordinate with Marc-Andre Lemburg when adding -# new features to distutils that would warrant bumping the version number. +# Updated automatically by the Python release process. # -# In general, major and minor version should loosely follow the Python -# version number the distutils code was shipped with. -# - #--start constants-- __version__ = "2.6" #--end constants-- From python-checkins at python.org Thu Feb 5 10:07:29 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 5 Feb 2009 10:07:29 +0100 (CET) Subject: [Python-checkins] r69286 - python/branches/release26-maint Message-ID: <20090205090729.208AC1E4002@bag.python.org> Author: tarek.ziade Date: Thu Feb 5 10:07:28 2009 New Revision: 69286 Log: Blocked revisions 69285 via svnmerge ........ r69285 | tarek.ziade | 2009-02-05 10:06:23 +0100 (Thu, 05 Feb 2009) | 1 line Fix comment for #1835 ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Thu Feb 5 10:08:59 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 5 Feb 2009 10:08:59 +0100 (CET) Subject: [Python-checkins] r69287 - in python/branches/py3k: Lib/distutils/__init__.py Message-ID: <20090205090859.6CD5A1E4002@bag.python.org> Author: tarek.ziade Date: Thu Feb 5 10:08:59 2009 New Revision: 69287 Log: Merged revisions 69285 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69285 | tarek.ziade | 2009-02-05 10:06:23 +0100 (Thu, 05 Feb 2009) | 1 line Fix comment for #1835 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/__init__.py Modified: python/branches/py3k/Lib/distutils/__init__.py ============================================================================== --- python/branches/py3k/Lib/distutils/__init__.py (original) +++ python/branches/py3k/Lib/distutils/__init__.py Thu Feb 5 10:08:59 2009 @@ -12,13 +12,8 @@ # Distutils version # -# Please coordinate with Marc-Andre Lemburg when adding -# new features to distutils that would warrant bumping the version number. +# Updated automatically by the Python release process. # -# In general, major and minor version should loosely follow the Python -# version number the distutils code was shipped with. -# - #--start constants-- __version__ = "3.1a0" #--end constants-- From buildbot at python.org Thu Feb 5 10:37:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 05 Feb 2009 09:37:28 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090205093728.363C01E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/592 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_threadedtempfile make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Feb 5 11:29:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 05 Feb 2009 10:29:45 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian trunk Message-ID: <20090205102945.D8CAA1E4002@bag.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/104 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: kristjan.jonsson,raymond.hettinger,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pipes make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Feb 5 11:30:57 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 5 Feb 2009 11:30:57 +0100 (CET) Subject: [Python-checkins] r69288 - python/trunk/Doc/library/optparse.rst Message-ID: <20090205103057.6EC401E404E@bag.python.org> Author: georg.brandl Date: Thu Feb 5 11:30:57 2009 New Revision: 69288 Log: #5153: fix typo in example. 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 Thu Feb 5 11:30:57 2009 @@ -1651,7 +1651,7 @@ value.append(arg) del parser.rargs[:len(value)] - setattr(parser.values, option.dest, value)) + setattr(parser.values, option.dest, value) [...] parser.add_option("-c", "--callback", dest="vararg_attr", From python-checkins at python.org Thu Feb 5 11:37:07 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 5 Feb 2009 11:37:07 +0100 (CET) Subject: [Python-checkins] r69289 - python/trunk/Doc/c-api/init.rst Message-ID: <20090205103707.CC1301E4002@bag.python.org> Author: georg.brandl Date: Thu Feb 5 11:37:07 2009 New Revision: 69289 Log: #5144: document that PySys_SetArgv prepends the script directory (or the empty string) to sys.path. Modified: python/trunk/Doc/c-api/init.rst Modified: python/trunk/Doc/c-api/init.rst ============================================================================== --- python/trunk/Doc/c-api/init.rst (original) +++ python/trunk/Doc/c-api/init.rst Thu Feb 5 11:37:07 2009 @@ -353,13 +353,17 @@ single: Py_FatalError() single: argv (in module sys) - Set ``sys.argv`` based on *argc* and *argv*. These parameters are similar to - those passed to the program's :cfunc:`main` function with the difference that - the first entry should refer to the script file to be executed rather than the - executable hosting the Python interpreter. If there isn't a script that will be - run, the first entry in *argv* can be an empty string. If this function fails - to initialize ``sys.argv``, a fatal condition is signalled using - :cfunc:`Py_FatalError`. + Set :data:`sys.argv` based on *argc* and *argv*. These parameters are + similar to those passed to the program's :cfunc:`main` function with the + difference that the first entry should refer to the script file to be + executed rather than the executable hosting the Python interpreter. If there + isn't a script that will be run, the first entry in *argv* can be an empty + string. If this function fails to initialize :data:`sys.argv`, a fatal + condition is signalled using :cfunc:`Py_FatalError`. + + This function also prepends the executed script's path to :data:`sys.path`. + If no script is executed (in the case of calling ``python -c`` or just the + interactive interpreter), the empty string is used instead. .. XXX impl. doesn't seem consistent in allowing 0/NULL for the params; check w/ Guido. From python-checkins at python.org Thu Feb 5 11:40:48 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 5 Feb 2009 11:40:48 +0100 (CET) Subject: [Python-checkins] r69290 - python/branches/py3k/Doc/glossary.rst Message-ID: <20090205104048.353601E4002@bag.python.org> Author: georg.brandl Date: Thu Feb 5 11:40:48 2009 New Revision: 69290 Log: #5130: replace "unicode" by "bytes" in examples for sequence types. Modified: python/branches/py3k/Doc/glossary.rst Modified: python/branches/py3k/Doc/glossary.rst ============================================================================== --- python/branches/py3k/Doc/glossary.rst (original) +++ python/branches/py3k/Doc/glossary.rst Thu Feb 5 11:40:48 2009 @@ -484,7 +484,7 @@ indices via the :meth:`__getitem__` special method and defines a :meth:`len` method that returns the length of the sequence. Some built-in sequence types are :class:`list`, :class:`str`, - :class:`tuple`, and :class:`unicode`. Note that :class:`dict` also + :class:`tuple`, and :class:`bytes`. Note that :class:`dict` also supports :meth:`__getitem__` and :meth:`__len__`, but is considered a mapping rather than a sequence because the lookups use arbitrary :term:`immutable` keys rather than integers. From python-checkins at python.org Thu Feb 5 11:47:16 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 5 Feb 2009 11:47:16 +0100 (CET) Subject: [Python-checkins] r69291 - python/branches/py3k/Doc/library/functions.rst Message-ID: <20090205104716.474C61E4002@bag.python.org> Author: georg.brandl Date: Thu Feb 5 11:47:16 2009 New Revision: 69291 Log: #5107: document that default encoding is the same as locale.getpreferredencoding(). Modified: python/branches/py3k/Doc/library/functions.rst Modified: python/branches/py3k/Doc/library/functions.rst ============================================================================== --- python/branches/py3k/Doc/library/functions.rst (original) +++ python/branches/py3k/Doc/library/functions.rst Thu Feb 5 11:47:16 2009 @@ -666,9 +666,14 @@ Other common values are ``'w'`` for writing (truncating the file if it already exists), and ``'a'`` for appending (which on *some* Unix systems, means that *all* writes append to the end of the file regardless of the - current seek position). In text mode, if *encoding* is not specified the - encoding used is platform dependent. (For reading and writing raw bytes use - binary mode and leave *encoding* unspecified.) The available modes are: + current seek position). + + In text mode, if *encoding* is not specified the encoding used is the same as + returned by :func:`locale.getpreferredencoding`, if the :mod:`locale` module + is available, else ASCII. For reading and writing raw bytes, use binary mode + and leave *encoding* unspecified. + + The available modes are: ========= =============================================================== Character Meaning From python-checkins at python.org Thu Feb 5 11:56:37 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 5 Feb 2009 11:56:37 +0100 (CET) Subject: [Python-checkins] r69292 - python/branches/py3k/Doc/c-api/exceptions.rst Message-ID: <20090205105637.955751E4002@bag.python.org> Author: georg.brandl Date: Thu Feb 5 11:56:37 2009 New Revision: 69292 Log: #5096: document PyErr_PrintEx(). Modified: python/branches/py3k/Doc/c-api/exceptions.rst Modified: python/branches/py3k/Doc/c-api/exceptions.rst ============================================================================== --- python/branches/py3k/Doc/c-api/exceptions.rst (original) +++ python/branches/py3k/Doc/c-api/exceptions.rst Thu Feb 5 11:56:37 2009 @@ -35,12 +35,21 @@ Either alphabetical or some kind of structure. -.. cfunction:: void PyErr_Print() +.. cfunction:: void PyErr_PrintEx(int set_sys_last_vars) Print a standard traceback to ``sys.stderr`` and clear the error indicator. Call this function only when the error indicator is set. (Otherwise it will cause a fatal error!) + If *set_sys_last_vars* is nonzero, the variables :data:`sys.last_type`, + :data:`sys.last_value` and :data:`sys.last_traceback` will be set to the + type, value and traceback of the printed exception, respectively. + + +.. cfunction:: void PyErr_Print() + + Alias for ``PyErr_PrintEx(1)``. + .. cfunction:: PyObject* PyErr_Occurred() From python-checkins at python.org Thu Feb 5 11:59:28 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 5 Feb 2009 11:59:28 +0100 (CET) Subject: [Python-checkins] r69293 - python/trunk/Doc/library/cookielib.rst Message-ID: <20090205105928.8C0761E4054@bag.python.org> Author: georg.brandl Date: Thu Feb 5 11:59:28 2009 New Revision: 69293 Log: #5059: fix example. Modified: python/trunk/Doc/library/cookielib.rst Modified: python/trunk/Doc/library/cookielib.rst ============================================================================== --- python/trunk/Doc/library/cookielib.rst (original) +++ python/trunk/Doc/library/cookielib.rst Thu Feb 5 11:59:28 2009 @@ -769,7 +769,7 @@ import urllib2 from cookielib import CookieJar, DefaultCookiePolicy policy = DefaultCookiePolicy( - rfc2965=True, strict_ns_domain=Policy.DomainStrict, + rfc2965=True, strict_ns_domain=DefaultCookiePolicy.DomainStrict, blocked_domains=["ads.net", ".ads.net"]) cj = CookieJar(policy) opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) From python-checkins at python.org Thu Feb 5 12:01:54 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 5 Feb 2009 12:01:54 +0100 (CET) Subject: [Python-checkins] r69294 - python/branches/py3k/Doc/reference/simple_stmts.rst Message-ID: <20090205110154.3D5181E4002@bag.python.org> Author: georg.brandl Date: Thu Feb 5 12:01:54 2009 New Revision: 69294 Log: #4992: next() method -> next() function. Modified: python/branches/py3k/Doc/reference/simple_stmts.rst Modified: python/branches/py3k/Doc/reference/simple_stmts.rst ============================================================================== --- python/branches/py3k/Doc/reference/simple_stmts.rst (original) +++ python/branches/py3k/Doc/reference/simple_stmts.rst Thu Feb 5 12:01:54 2009 @@ -441,14 +441,14 @@ create a generator function instead of a normal function. When a generator function is called, it returns an iterator known as a generator iterator, or more commonly, a generator. The body of the generator function is -executed by calling the generator's :meth:`next` method repeatedly until it -raises an exception. +executed by calling the :func:`next` function on the generator repeatedly until +it raises an exception. When a :keyword:`yield` statement is executed, the state of the generator is frozen and the value of :token:`expression_list` is returned to :meth:`next`'s caller. By "frozen" we mean that all local state is retained, including the current bindings of local variables, the instruction pointer, and the internal -evaluation stack: enough information is saved so that the next time :meth:`next` +evaluation stack: enough information is saved so that the next time :func:`next` is invoked, the function can proceed exactly as if the :keyword:`yield` statement were just another external call. From python-checkins at python.org Thu Feb 5 12:23:47 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 5 Feb 2009 12:23:47 +0100 (CET) Subject: [Python-checkins] r69295 - python/trunk/Doc/c-api/exceptions.rst Message-ID: <20090205112347.F24391E4002@bag.python.org> Author: georg.brandl Date: Thu Feb 5 12:23:47 2009 New Revision: 69295 Log: PyErr_PrintEx is also in 2.x... Modified: python/trunk/Doc/c-api/exceptions.rst Modified: python/trunk/Doc/c-api/exceptions.rst ============================================================================== --- python/trunk/Doc/c-api/exceptions.rst (original) +++ python/trunk/Doc/c-api/exceptions.rst Thu Feb 5 12:23:47 2009 @@ -41,12 +41,21 @@ Either alphabetical or some kind of structure. -.. cfunction:: void PyErr_Print() +.. cfunction:: void PyErr_PrintEx(int set_sys_last_vars) Print a standard traceback to ``sys.stderr`` and clear the error indicator. Call this function only when the error indicator is set. (Otherwise it will cause a fatal error!) + If *set_sys_last_vars* is nonzero, the variables :data:`sys.last_type`, + :data:`sys.last_value` and :data:`sys.last_traceback` will be set to the + type, value and traceback of the printed exception, respectively. + + +.. cfunction:: void PyErr_Print() + + Alias for ``PyErr_PrintEx(1)``. + .. cfunction:: PyObject* PyErr_Occurred() From python-checkins at python.org Thu Feb 5 12:24:04 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 5 Feb 2009 12:24:04 +0100 (CET) Subject: [Python-checkins] r69296 - python/branches/py3k Message-ID: <20090205112404.AF3401E4002@bag.python.org> Author: georg.brandl Date: Thu Feb 5 12:24:04 2009 New Revision: 69296 Log: Blocked revisions 69295 via svnmerge ........ r69295 | georg.brandl | 2009-02-05 12:23:47 +0100 (Do, 05 Feb 2009) | 1 line PyErr_PrintEx is also in 2.x... ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Thu Feb 5 12:32:19 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 5 Feb 2009 12:32:19 +0100 (CET) Subject: [Python-checkins] r69297 - python/trunk/Doc/c-api/init.rst Message-ID: <20090205113219.BF9FC1E4002@bag.python.org> Author: georg.brandl Date: Thu Feb 5 12:32:18 2009 New Revision: 69297 Log: #5015: document PythonHome API functions. Modified: python/trunk/Doc/c-api/init.rst Modified: python/trunk/Doc/c-api/init.rst ============================================================================== --- python/trunk/Doc/c-api/init.rst (original) +++ python/trunk/Doc/c-api/init.rst Thu Feb 5 12:32:18 2009 @@ -369,6 +369,20 @@ check w/ Guido. +.. cfunction:: void Py_SetPythonHome(char *home) + + Set the default "home" directory, that is, the location of the standard + Python libraries. The libraries are searched in + :file:`{home}/lib/python{version}` and :file:`{home}/lib/python{version}`. + + +.. cfunction:: char* Py_GetPythonHome() + + Return the default "home", that is, the value set by a previous call to + :cfunc:`Py_SetPythonHome`, or the value of the :envvar:`PYTHONHOME` + environment variable if it is set. + + .. _threads: Thread State and the Global Interpreter Lock From python-checkins at python.org Thu Feb 5 12:33:22 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 5 Feb 2009 12:33:22 +0100 (CET) Subject: [Python-checkins] r69298 - python/trunk/Doc/library/optparse.rst Message-ID: <20090205113322.0ED801E4002@bag.python.org> Author: georg.brandl Date: Thu Feb 5 12:33:21 2009 New Revision: 69298 Log: #4827: fix callback example. 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 Thu Feb 5 12:33:21 2009 @@ -1511,7 +1511,7 @@ records that the option was seen:: def record_foo_seen(option, opt_str, value, parser): - parser.saw_foo = True + parser.values.saw_foo = True parser.add_option("--foo", action="callback", callback=record_foo_seen) From python-checkins at python.org Thu Feb 5 12:35:29 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 5 Feb 2009 12:35:29 +0100 (CET) Subject: [Python-checkins] r69299 - python/trunk/Doc/library/ctypes.rst Message-ID: <20090205113529.2693B1E4002@bag.python.org> Author: georg.brandl Date: Thu Feb 5 12:35:28 2009 New Revision: 69299 Log: #4820: use correct module for ctypes.util. 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 Thu Feb 5 12:35:28 2009 @@ -1274,6 +1274,7 @@ .. data:: find_library(name) + :module: ctypes.util :noindex: Try to find a library and return a pathname. *name* is the library name without From python-checkins at python.org Thu Feb 5 12:38:23 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 5 Feb 2009 12:38:23 +0100 (CET) Subject: [Python-checkins] r69300 - python/trunk/Doc/tools/sphinxext/pyspecific.py Message-ID: <20090205113823.B3A781E4002@bag.python.org> Author: georg.brandl Date: Thu Feb 5 12:38:23 2009 New Revision: 69300 Log: #4563: disable alpha and roman lists, fixes wrong formatting of contributor list. Modified: python/trunk/Doc/tools/sphinxext/pyspecific.py Modified: python/trunk/Doc/tools/sphinxext/pyspecific.py ============================================================================== --- python/trunk/Doc/tools/sphinxext/pyspecific.py (original) +++ python/trunk/Doc/tools/sphinxext/pyspecific.py Thu Feb 5 12:38:23 2009 @@ -13,6 +13,14 @@ from docutils import nodes, utils +# monkey-patch reST parser to disable alphabetic and roman enumerated lists +from docutils.parsers.rst.states import Body +Body.enum.converters['loweralpha'] = \ + Body.enum.converters['upperalpha'] = \ + Body.enum.converters['lowerroman'] = \ + Body.enum.converters['upperroman'] = lambda x: None + + def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): issue = utils.unescape(text) text = 'issue ' + issue From python-checkins at python.org Thu Feb 5 12:40:36 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 5 Feb 2009 12:40:36 +0100 (CET) Subject: [Python-checkins] r69301 - python/trunk/Doc/library/threading.rst Message-ID: <20090205114036.23FEB1E404A@bag.python.org> Author: georg.brandl Date: Thu Feb 5 12:40:35 2009 New Revision: 69301 Log: #5031: fix Thread.daemon property docs. Modified: python/trunk/Doc/library/threading.rst Modified: python/trunk/Doc/library/threading.rst ============================================================================== --- python/trunk/Doc/library/threading.rst (original) +++ python/trunk/Doc/library/threading.rst Thu Feb 5 12:40:35 2009 @@ -210,7 +210,7 @@ A thread can be flagged as a "daemon thread". The significance of this flag is that the entire Python program exits when only daemon threads are left. The initial value is inherited from the creating thread. The flag can be set -through the :attr:`daemon` attribute. +through the :attr:`daemon` property. There is a "main thread" object; this corresponds to the initial thread of control in the Python program. It is not a daemon thread. @@ -332,10 +332,11 @@ .. attribute:: Thread.daemon - The thread's daemon flag. This must be set before :meth:`start` is called, - otherwise :exc:`RuntimeError` is raised. - - The initial value is inherited from the creating thread. + A boolean value indicating whether this thread is a daemon thread (True) or + not (False). This must be set before :meth:`start` is called, otherwise + :exc:`RuntimeError` is raised. Its initial value is inherited from the + creating thread; the main thread is not a daemon thread and therefore all + threads created in the main thread default to :attr:`daemon` = ``False``. The entire Python program exits when no alive non-daemon threads are left. From buildbot at python.org Thu Feb 5 12:48:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 05 Feb 2009 11:48:48 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090205114849.133671E4002@bag.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/189 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 failed slave lost sincerely, -The Buildbot From python-checkins at python.org Thu Feb 5 17:14:40 2009 From: python-checkins at python.org (neil.schemenauer) Date: Thu, 5 Feb 2009 17:14:40 +0100 (CET) Subject: [Python-checkins] r69302 - python/trunk/Lib/distutils/sysconfig.py Message-ID: <20090205161440.245101E4026@bag.python.org> Author: neil.schemenauer Date: Thu Feb 5 17:14:39 2009 New Revision: 69302 Log: Fix get_python_inc() to work when building in a directory separate from the source. Also, define 'srcdir' on non-posix platforms. Modified: python/trunk/Lib/distutils/sysconfig.py Modified: python/trunk/Lib/distutils/sysconfig.py ============================================================================== --- python/trunk/Lib/distutils/sysconfig.py (original) +++ python/trunk/Lib/distutils/sysconfig.py Thu Feb 5 17:14:39 2009 @@ -73,14 +73,17 @@ prefix = plat_specific and EXEC_PREFIX or PREFIX if os.name == "posix": if python_build: + # Assume the executable is in the build directory. The + # pyconfig.h file should be in the same directory. Since + # the build directory may not be the source directory, we + # must use "srcdir" from the makefile to find the "Include" + # directory. base = os.path.dirname(os.path.abspath(sys.executable)) if plat_specific: - inc_dir = base + return base else: - inc_dir = os.path.join(base, "Include") - if not os.path.exists(inc_dir): - inc_dir = os.path.join(os.path.dirname(base), "Include") - return inc_dir + incdir = os.path.join(get_config_var('srcdir'), 'Include') + return os.path.normpath(incdir) return os.path.join(prefix, "include", "python" + get_python_version()) elif os.name == "nt": return os.path.join(prefix, "include") @@ -521,6 +524,9 @@ _config_vars['prefix'] = PREFIX _config_vars['exec_prefix'] = EXEC_PREFIX + if 'srcdir' not in _config_vars: + _config_vars['srcdir'] = project_base + if sys.platform == 'darwin': kernel_version = os.uname()[2] # Kernel version (8.4.3) major_version = int(kernel_version.split('.')[0]) From python-checkins at python.org Thu Feb 5 17:19:05 2009 From: python-checkins at python.org (neil.schemenauer) Date: Thu, 5 Feb 2009 17:19:05 +0100 (CET) Subject: [Python-checkins] r69303 - python/trunk/Lib/distutils/tests/test_sysconfig.py Message-ID: <20090205161905.F212B1E400C@bag.python.org> Author: neil.schemenauer Date: Thu Feb 5 17:19:05 2009 New Revision: 69303 Log: Since sysconfig.get_python_inc() now works when building in a directory other than the source directory, simplify the test code in test_sysconfig.py. 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 Thu Feb 5 17:19:05 2009 @@ -19,27 +19,10 @@ # test for pythonxx.lib? def test_get_python_inc(self): - # The check for srcdir is copied from Python's setup.py, - # and is necessary to make this test pass when building - # Python in a directory other than the source directory. - (srcdir,) = sysconfig.get_config_vars('srcdir') - if not srcdir: - inc_dir = sysconfig.get_python_inc() - else: - # This test is not really a proper test: when building - # Python from source, even in the same directory, - # we won't be testing the same thing as when running - # distutils' tests on an installed Python. Nevertheless, - # let's try to do our best: if we are running Python's - # unittests from a build directory that is not the source - # directory, the normal inc_dir will exist, it will just not - # contain anything of interest. - inc_dir = sysconfig.get_python_inc() - self.assert_(os.path.isdir(inc_dir)) - # Now test the source location, to make sure Python.h does - # exist. - inc_dir = os.path.join(os.getcwd(), srcdir, 'Include') - inc_dir = os.path.normpath(inc_dir) + inc_dir = sysconfig.get_python_inc() + # This is not much of a test. We make sure Python.h exists + # in the directory returned by get_python_inc() but we don't know + # it is the correct file. self.assert_(os.path.isdir(inc_dir), inc_dir) python_h = os.path.join(inc_dir, "Python.h") self.assert_(os.path.isfile(python_h), python_h) From python-checkins at python.org Thu Feb 5 17:25:16 2009 From: python-checkins at python.org (neil.schemenauer) Date: Thu, 5 Feb 2009 17:25:16 +0100 (CET) Subject: [Python-checkins] r69304 - python/trunk/Lib/distutils/tests/test_build_ext.py Message-ID: <20090205162516.B3F421E4018@bag.python.org> Author: neil.schemenauer Date: Thu Feb 5 17:25:16 2009 New Revision: 69304 Log: Fix test_build_ext.py to work when building in a separate directory. Since "srcdir" should now be defined on all platforms, use it to find the module source. 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 Feb 5 17:25:16 2009 @@ -11,6 +11,10 @@ import unittest from test import test_support +def _get_source_filename(): + srcdir = sysconfig.get_config_var('srcdir') + return os.path.join(srcdir, 'Modules', 'xxmodule.c') + class BuildExtTestCase(unittest.TestCase): def setUp(self): # Create a simple test environment @@ -18,9 +22,7 @@ self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_") self.sys_path = sys.path[:] sys.path.append(self.tmp_dir) - - xx_c = os.path.join(sysconfig.project_base, 'Modules', 'xxmodule.c') - shutil.copy(xx_c, self.tmp_dir) + shutil.copy(_get_source_filename(), self.tmp_dir) def test_build_ext(self): xx_c = os.path.join(self.tmp_dir, 'xxmodule.c') @@ -66,9 +68,11 @@ shutil.rmtree(self.tmp_dir, os.name == 'nt' or sys.platform == 'cygwin') def test_suite(): - if not sysconfig.python_build: + src = _get_source_filename() + if not os.path.exists(src): if test_support.verbose: - print 'test_build_ext: The test must be run in a python build dir' + print ('test_build_ext: Cannot find source code (test' + ' must run in python build dir)') return unittest.TestSuite() else: return unittest.makeSuite(BuildExtTestCase) From python-checkins at python.org Thu Feb 5 17:32:29 2009 From: python-checkins at python.org (neil.schemenauer) Date: Thu, 5 Feb 2009 17:32:29 +0100 (CET) Subject: [Python-checkins] r69305 - python/trunk/setup.py Message-ID: <20090205163229.443CA1E4002@bag.python.org> Author: neil.schemenauer Date: Thu Feb 5 17:32:29 2009 New Revision: 69305 Log: Make setup.py work when building in a directory other than the source directory. Mainly use 'srcdir' rather than os.getcwd() or '.'. Modified: python/trunk/setup.py Modified: python/trunk/setup.py ============================================================================== --- python/trunk/setup.py (original) +++ python/trunk/setup.py Thu Feb 5 17:32:29 2009 @@ -118,52 +118,36 @@ if not srcdir: # Maybe running on Windows but not using CYGWIN? raise ValueError("No source directory; cannot proceed.") - - # Figure out the location of the source code for extension modules - # (This logic is copied in distutils.test.test_sysconfig, - # so building in a separate directory does not break test_distutils.) - moddir = os.path.join(os.getcwd(), srcdir, 'Modules') - moddir = os.path.normpath(moddir) - srcdir, tail = os.path.split(moddir) srcdir = os.path.normpath(srcdir) - moddir = os.path.normpath(moddir) - - moddirlist = [moddir] - incdirlist = ['./Include'] + moddirlist = [os.path.join(srcdir, 'Modules')] # Platform-dependent module source and include directories platform = self.get_platform() if platform in ('darwin', 'mac') and ("--disable-toolbox-glue" not in sysconfig.get_config_var("CONFIG_ARGS")): # Mac OS X also includes some mac-specific modules - macmoddir = os.path.join(os.getcwd(), srcdir, 'Mac/Modules') + macmoddir = os.path.join(srcdir, 'Mac/Modules') moddirlist.append(macmoddir) incdirlist.append('./Mac/Include') - alldirlist = moddirlist + incdirlist - # Fix up the paths for scripts, too self.distribution.scripts = [os.path.join(srcdir, filename) for filename in self.distribution.scripts] # Python header files - headers = glob("Include/*.h") + ["pyconfig.h"] - + headers = [sysconfig.get_config_h_filename()] + headers += glob(os.path.join(sysconfig.get_python_inc(), "*.h")) for ext in self.extensions[:]: ext.sources = [ find_module_file(filename, moddirlist) for filename in ext.sources ] if ext.depends is not None: - ext.depends = [find_module_file(filename, alldirlist) + ext.depends = [find_module_file(filename, moddirlist) for filename in ext.depends] else: ext.depends = [] # re-compile extensions if a header file has been changed ext.depends.extend(headers) - ext.include_dirs.append( '.' ) # to get config.h - for incdir in incdirlist: - ext.include_dirs.append( os.path.join(srcdir, incdir) ) - # If a module has already been built statically, # don't build it here if ext.name in sys.builtin_module_names: @@ -374,7 +358,7 @@ config_h_vars = sysconfig.parse_config_h(open(config_h)) platform = self.get_platform() - (srcdir,) = sysconfig.get_config_vars('srcdir') + srcdir = sysconfig.get_config_var('srcdir') # Check for AtheOS which has libraries in non-standard locations if platform == 'atheos': @@ -1640,7 +1624,7 @@ def configure_ctypes_darwin(self, ext): # Darwin (OS X) uses preconfigured files, in # the Modules/_ctypes/libffi_osx directory. - (srcdir,) = sysconfig.get_config_vars('srcdir') + srcdir = sysconfig.get_config_var('srcdir') ffi_srcdir = os.path.abspath(os.path.join(srcdir, 'Modules', '_ctypes', 'libffi_osx')) sources = [os.path.join(ffi_srcdir, p) @@ -1669,7 +1653,7 @@ if sys.platform == 'darwin': return self.configure_ctypes_darwin(ext) - (srcdir,) = sysconfig.get_config_vars('srcdir') + srcdir = sysconfig.get_config_var('srcdir') ffi_builddir = os.path.join(self.build_temp, 'libffi') ffi_srcdir = os.path.abspath(os.path.join(srcdir, 'Modules', '_ctypes', 'libffi')) From python-checkins at python.org Thu Feb 5 17:33:41 2009 From: python-checkins at python.org (neil.schemenauer) Date: Thu, 5 Feb 2009 17:33:41 +0100 (CET) Subject: [Python-checkins] r69306 - python/branches/py3k/Lib/distutils/sysconfig.py Message-ID: <20090205163341.C82DF1E4002@bag.python.org> Author: neil.schemenauer Date: Thu Feb 5 17:33:41 2009 New Revision: 69306 Log: Fix get_python_inc() to work when building in a directory separate from the source. Also, define 'srcdir' on non-posix platforms. Modified: python/branches/py3k/Lib/distutils/sysconfig.py Modified: python/branches/py3k/Lib/distutils/sysconfig.py ============================================================================== --- python/branches/py3k/Lib/distutils/sysconfig.py (original) +++ python/branches/py3k/Lib/distutils/sysconfig.py Thu Feb 5 17:33:41 2009 @@ -72,14 +72,17 @@ prefix = plat_specific and EXEC_PREFIX or PREFIX if os.name == "posix": if python_build: + # Assume the executable is in the build directory. The + # pyconfig.h file should be in the same directory. Since + # the build directory may not be the source directory, we + # must use "srcdir" from the makefile to find the "Include" + # directory. base = os.path.dirname(os.path.abspath(sys.executable)) if plat_specific: - inc_dir = base + return base else: - inc_dir = os.path.join(base, "Include") - if not os.path.exists(inc_dir): - inc_dir = os.path.join(os.path.dirname(base), "Include") - return inc_dir + incdir = os.path.join(get_config_var('srcdir'), 'Include') + return os.path.normpath(incdir) return os.path.join(prefix, "include", "python" + get_python_version()) elif os.name == "nt": return os.path.join(prefix, "include") From python-checkins at python.org Thu Feb 5 17:35:05 2009 From: python-checkins at python.org (neil.schemenauer) Date: Thu, 5 Feb 2009 17:35:05 +0100 (CET) Subject: [Python-checkins] r69307 - python/branches/py3k/Lib/distutils/tests/test_sysconfig.py Message-ID: <20090205163505.098E91E4002@bag.python.org> Author: neil.schemenauer Date: Thu Feb 5 17:35:04 2009 New Revision: 69307 Log: Since sysconfig.get_python_inc() now works when building in a directory other than the source directory, simplify the test code in test_sysconfig.py. Modified: 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 Thu Feb 5 17:35:04 2009 @@ -19,27 +19,10 @@ # test for pythonxx.lib? def test_get_python_inc(self): - # The check for srcdir is copied from Python's setup.py, - # and is necessary to make this test pass when building - # Python in a directory other than the source directory. - (srcdir,) = sysconfig.get_config_vars('srcdir') - if not srcdir: - inc_dir = sysconfig.get_python_inc() - else: - # This test is not really a proper test: when building - # Python from source, even in the same directory, - # we won't be testing the same thing as when running - # distutils' tests on an installed Python. Nevertheless, - # let's try to do our best: if we are running Python's - # unittests from a build directory that is not the source - # directory, the normal inc_dir will exist, it will just not - # contain anything of interest. - inc_dir = sysconfig.get_python_inc() - self.assert_(os.path.isdir(inc_dir)) - # Now test the source location, to make sure Python.h does - # exist. - inc_dir = os.path.join(os.getcwd(), srcdir, 'Include') - inc_dir = os.path.normpath(inc_dir) + inc_dir = sysconfig.get_python_inc() + # This is not much of a test. We make sure Python.h exists + # in the directory returned by get_python_inc() but we don't know + # it is the correct file. self.assert_(os.path.isdir(inc_dir), inc_dir) python_h = os.path.join(inc_dir, "Python.h") self.assert_(os.path.isfile(python_h), python_h) From python-checkins at python.org Thu Feb 5 17:35:45 2009 From: python-checkins at python.org (neil.schemenauer) Date: Thu, 5 Feb 2009 17:35:45 +0100 (CET) Subject: [Python-checkins] r69308 - python/branches/py3k/setup.py Message-ID: <20090205163545.C03D51E402C@bag.python.org> Author: neil.schemenauer Date: Thu Feb 5 17:35:45 2009 New Revision: 69308 Log: Make setup.py work when building in a directory other than the source directory. Mainly, use 'srcdir' rather than os.getcwd() or '.'. Modified: python/branches/py3k/setup.py Modified: python/branches/py3k/setup.py ============================================================================== --- python/branches/py3k/setup.py (original) +++ python/branches/py3k/setup.py Thu Feb 5 17:35:45 2009 @@ -112,51 +112,36 @@ self.extensions = extensions # Fix up the autodetected modules, prefixing all the source files - # with Modules/ and adding Python's include directory to the path. - (srcdir,) = sysconfig.get_config_vars('srcdir') + # with Modules/. + srcdir = sysconfig.get_config_var('srcdir') if not srcdir: # Maybe running on Windows but not using CYGWIN? raise ValueError("No source directory; cannot proceed.") - - # Figure out the location of the source code for extension modules - # (This logic is copied in distutils.test.test_sysconfig, - # so building in a separate directory does not break test_distutils.) - moddir = os.path.join(os.getcwd(), srcdir, 'Modules') - moddir = os.path.normpath(moddir) - srcdir, tail = os.path.split(moddir) srcdir = os.path.normpath(srcdir) - moddir = os.path.normpath(moddir) - - moddirlist = [moddir] - incdirlist = ['./Include'] + moddirlist = [os.path.join(srcdir, 'Modules')] # Platform-dependent module source and include directories platform = self.get_platform() - alldirlist = moddirlist + incdirlist - # Fix up the paths for scripts, too self.distribution.scripts = [os.path.join(srcdir, filename) for filename in self.distribution.scripts] # Python header files - headers = glob("Include/*.h") + ["pyconfig.h"] + headers = [sysconfig.get_config_h_filename()] + headers += glob(os.path.join(sysconfig.get_python_inc(), "*.h")) for ext in self.extensions[:]: ext.sources = [ find_module_file(filename, moddirlist) for filename in ext.sources ] if ext.depends is not None: - ext.depends = [find_module_file(filename, alldirlist) + ext.depends = [find_module_file(filename, moddirlist) for filename in ext.depends] else: ext.depends = [] # re-compile extensions if a header file has been changed ext.depends.extend(headers) - ext.include_dirs.append( '.' ) # to get config.h - for incdir in incdirlist: - ext.include_dirs.append( os.path.join(srcdir, incdir) ) - # If a module has already been built statically, # don't build it here if ext.name in sys.builtin_module_names: @@ -368,7 +353,7 @@ config_h_vars = sysconfig.parse_config_h(open(config_h)) platform = self.get_platform() - (srcdir,) = sysconfig.get_config_vars('srcdir') + srcdir = sysconfig.get_config_var('srcdir') # Check for AtheOS which has libraries in non-standard locations if platform == 'atheos': @@ -1285,7 +1270,7 @@ def configure_ctypes_darwin(self, ext): # Darwin (OS X) uses preconfigured files, in # the Modules/_ctypes/libffi_osx directory. - (srcdir,) = sysconfig.get_config_vars('srcdir') + srcdir = sysconfig.get_config_var('srcdir') ffi_srcdir = os.path.abspath(os.path.join(srcdir, 'Modules', '_ctypes', 'libffi_osx')) sources = [os.path.join(ffi_srcdir, p) @@ -1314,7 +1299,7 @@ if sys.platform == 'darwin': return self.configure_ctypes_darwin(ext) - (srcdir,) = sysconfig.get_config_vars('srcdir') + srcdir = sysconfig.get_config_var('srcdir') ffi_builddir = os.path.join(self.build_temp, 'libffi') ffi_srcdir = os.path.abspath(os.path.join(srcdir, 'Modules', '_ctypes', 'libffi')) From buildbot at python.org Thu Feb 5 17:40:58 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 05 Feb 2009 16:40:58 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090205164058.4ACDA1E4002@bag.python.org> The Buildbot has detected a new failure of OS X x86 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/90 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl,neil.schemenauer BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_ftplib.py", line 203, in run asyncore.loop(timeout=0.1, count=1) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asyncore.py", line 204, in loop poll_fun(timeout, map) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asyncore.py", line 141, in poll read(obj) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asyncore.py", line 78, in read obj.handle_error() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asyncore.py", line 74, in read obj.handle_read_event() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asyncore.py", line 413, in handle_read_event self.handle_read() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asynchat.py", line 112, in handle_read self.handle_error() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asynchat.py", line 110, in handle_read data = self.recv (self.ac_in_buffer_size) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asyncore.py", line 362, in recv data = self.socket.recv(buffer_size) error: [Errno 9] Bad file descriptor Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_ftplib.py", line 203, in run asyncore.loop(timeout=0.1, count=1) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asyncore.py", line 204, in loop poll_fun(timeout, map) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asyncore.py", line 130, in poll r, w, e = select.select(r, w, e, timeout) error: (9, 'Bad file descriptor') make: *** [buildbottest] Abort trap sincerely, -The Buildbot From python-checkins at python.org Thu Feb 5 18:07:33 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 5 Feb 2009 18:07:33 +0100 (CET) Subject: [Python-checkins] r69309 - sandbox/trunk/dbm_sqlite/alt/dbdict.py Message-ID: <20090205170733.D6B521E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 5 18:07:33 2009 New Revision: 69309 Log: Don't overwrite db until we know that serialization is successful. Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbdict.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbdict.py Thu Feb 5 18:07:33 2009 @@ -10,7 +10,9 @@ ''' -import os, pickle, json, csv +import pickle, json, csv +import os, shutil, warnings +warnings.filterwarnings("ignore", message='tempnam') class DictDB(dict): @@ -29,12 +31,17 @@ self.update(*args, **kwds) def sync(self): + tempname = os.tempnam() if self.flag != 'r': - file = __builtins__.open(self.filename, 'wb') + file = __builtins__.open(tempname, 'wb') + success = False try: self.dump(file) + success = True finally: file.close() + if success: + shutil.move(tempname, self.filename) if self.mode: os.chmod(self.filename, self.mode) @@ -68,18 +75,19 @@ raise NotImplementedError('Unknown format: %r' % self.format) -def myopen(filename, flag='c', mode=0o666, format='csv'): +def dbopen(filename, flag='c', mode=0o666, format='csv'): return DictDB(filename, flag, mode, format) if __name__ == '__main__': + import random os.chdir('/dbm_sqlite/alt') print(os.getcwd()) - s = myopen('tmp.shl', 'c', format='json') + s = dbopen('tmp.shl', 'c', format='json') print(s, 'start') - s['xyz'] = 'pdq' s['abc'] = '123' + s['rand'] = random.randrange(10000) s.close() f = __builtins__.open('tmp.shl', 'rb') print (f.read()) From buildbot at python.org Thu Feb 5 18:11:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 05 Feb 2009 17:11:37 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090205171137.F3FA11E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/594 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neil.schemenauer BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Thu Feb 5 18:25:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 05 Feb 2009 17:25:25 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090205172526.341731E401E@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/814 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: neil.schemenauer 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 Thu Feb 5 18:39:27 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 5 Feb 2009 18:39:27 +0100 (CET) Subject: [Python-checkins] r69310 - sandbox/trunk/dbm_sqlite/alt/dbdict.py Message-ID: <20090205173927.E320C1E400C@bag.python.org> Author: raymond.hettinger Date: Thu Feb 5 18:39:27 2009 New Revision: 69310 Log: Skip use of tempnam(). Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbdict.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbdict.py Thu Feb 5 18:39:27 2009 @@ -11,8 +11,7 @@ ''' import pickle, json, csv -import os, shutil, warnings -warnings.filterwarnings("ignore", message='tempnam') +import os, shutil class DictDB(dict): @@ -31,7 +30,8 @@ self.update(*args, **kwds) def sync(self): - tempname = os.tempnam() + filename = self.filename + tempname = filename + '.tmp' if self.flag != 'r': file = __builtins__.open(tempname, 'wb') success = False From python-checkins at python.org Thu Feb 5 19:14:51 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 5 Feb 2009 19:14:51 +0100 (CET) Subject: [Python-checkins] r69311 - sandbox/trunk/dbm_sqlite/alt/dbdict.py Message-ID: <20090205181451.3DDFE1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 5 19:14:50 2009 New Revision: 69311 Log: Simplify commit/rollback logic. Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbdict.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbdict.py Thu Feb 5 19:14:50 2009 @@ -34,14 +34,11 @@ tempname = filename + '.tmp' if self.flag != 'r': file = __builtins__.open(tempname, 'wb') - success = False try: self.dump(file) - success = True finally: file.close() - if success: - shutil.move(tempname, self.filename) + shutil.move(tempname, self.filename) # atomic commit if self.mode: os.chmod(self.filename, self.mode) From python-checkins at python.org Thu Feb 5 19:23:09 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 5 Feb 2009 19:23:09 +0100 (CET) Subject: [Python-checkins] r69312 - sandbox/trunk/dbm_sqlite/alt/dbdict.py Message-ID: <20090205182309.344EA1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 5 19:23:08 2009 New Revision: 69312 Log: Use tempfile module. Delete tempfile on error. Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbdict.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbdict.py Thu Feb 5 19:23:08 2009 @@ -11,7 +11,7 @@ ''' import pickle, json, csv -import os, shutil +import os, shutil, tempfile class DictDB(dict): @@ -30,15 +30,15 @@ self.update(*args, **kwds) def sync(self): - filename = self.filename - tempname = filename + '.tmp' if self.flag != 'r': - file = __builtins__.open(tempname, 'wb') + file = tempfile.NamedTemporaryFile('w+b', delete=False) try: self.dump(file) + except Exception: + file.delete = True finally: file.close() - shutil.move(tempname, self.filename) # atomic commit + shutil.move(file.name, self.filename) # atomic commit if self.mode: os.chmod(self.filename, self.mode) From python-checkins at python.org Thu Feb 5 23:02:05 2009 From: python-checkins at python.org (brett.cannon) Date: Thu, 5 Feb 2009 23:02:05 +0100 (CET) Subject: [Python-checkins] r69313 - python/branches/py3k/Lib/importlib/test/import_/test_path.py Message-ID: <20090205220205.1C8C01E400C@bag.python.org> Author: brett.cannon Date: Thu Feb 5 23:02:03 2009 New Revision: 69313 Log: Implement test for sys.path_importer_cache having None for importlib.machinery.PathFinder. Modified: python/branches/py3k/Lib/importlib/test/import_/test_path.py Modified: python/branches/py3k/Lib/importlib/test/import_/test_path.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_path.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_path.py Thu Feb 5 23:02:03 2009 @@ -3,6 +3,7 @@ from . import util as import_util from contextlib import nested from imp import new_module +import os import sys from types import MethodType import unittest @@ -191,8 +192,19 @@ def test_path_importer_cache_has_None(self): # Test that the default hook is used when sys.path_importer_cache # contains None for a path. - # TODO(brett.cannon) implement - pass + module = '' + importer = util.mock_modules(module) + path = '' + # XXX Not blackbox. + original_hook = machinery.PathFinder._default_hook + mock_hook = import_util.mock_path_hook(path, importer=importer) + machinery.PathFinder._default_hook = staticmethod(mock_hook) + try: + with util.import_state(path_importer_cache={path: None}): + loader = machinery.PathFinder.find_module(module, path=[path]) + self.assert_(loader is importer) + finally: + machinery.PathFinder._default_hook = original_hook def test_path_hooks(self): # Test that sys.path_hooks is used. From python-checkins at python.org Thu Feb 5 23:04:00 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 5 Feb 2009 23:04:00 +0100 (CET) Subject: [Python-checkins] r69314 - sandbox/trunk/dbm_sqlite/alt/dbdict.py Message-ID: <20090205220400.943E71E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 5 23:04:00 2009 New Revision: 69314 Log: Can't get tempfile to reliably delete on error and persist otherwise. Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbdict.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbdict.py Thu Feb 5 23:04:00 2009 @@ -11,7 +11,7 @@ ''' import pickle, json, csv -import os, shutil, tempfile +import os, shutil class DictDB(dict): @@ -31,13 +31,16 @@ def sync(self): if self.flag != 'r': - file = tempfile.NamedTemporaryFile('w+b', delete=False) + filename = self.filename + tempname = filename + '.tmp' + file = __builtins__.open(tempname, 'wb') try: self.dump(file) except Exception: - file.delete = True - finally: file.close() + os.remove(tempname) + raise + file.close() shutil.move(file.name, self.filename) # atomic commit if self.mode: os.chmod(self.filename, self.mode) From python-checkins at python.org Thu Feb 5 23:14:04 2009 From: python-checkins at python.org (neil.schemenauer) Date: Thu, 5 Feb 2009 23:14:04 +0100 (CET) Subject: [Python-checkins] r69315 - python/trunk/setup.py Message-ID: <20090205221404.347351E4002@bag.python.org> Author: neil.schemenauer Date: Thu Feb 5 23:14:04 2009 New Revision: 69315 Log: Oops, Mac build needs the 'incdirlist' variable so restore it. Modified: python/trunk/setup.py Modified: python/trunk/setup.py ============================================================================== --- python/trunk/setup.py (original) +++ python/trunk/setup.py Thu Feb 5 23:14:04 2009 @@ -122,13 +122,14 @@ moddirlist = [os.path.join(srcdir, 'Modules')] # Platform-dependent module source and include directories + incdirlist = [] platform = self.get_platform() if platform in ('darwin', 'mac') and ("--disable-toolbox-glue" not in sysconfig.get_config_var("CONFIG_ARGS")): # Mac OS X also includes some mac-specific modules macmoddir = os.path.join(srcdir, 'Mac/Modules') moddirlist.append(macmoddir) - incdirlist.append('./Mac/Include') + incdirlist.append(os.path.join(srcdir, 'Mac/Include')) # Fix up the paths for scripts, too self.distribution.scripts = [os.path.join(srcdir, filename) @@ -148,6 +149,9 @@ # re-compile extensions if a header file has been changed ext.depends.extend(headers) + # platform specific include directories + ext.include_dirs.extend(incdirlist) + # If a module has already been built statically, # don't build it here if ext.name in sys.builtin_module_names: From nnorwitz at gmail.com Thu Feb 5 23:23:33 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 5 Feb 2009 17:23:33 -0500 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090205222333.GA28855@python.psfb.org> More important issues: ---------------------- test_distutils leaked [103, 103, 103] references, sum=309 Less important issues: ---------------------- test_asynchat leaked [0, 0, 125] references, sum=125 test_cmd_line leaked [25, -25, 25] references, sum=25 test_smtplib leaked [-73, 78, 10] references, sum=15 test_sys leaked [-21, 0, 0] references, sum=-21 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 test_xmlrpc leaked [-4, 89, -85] references, sum=0 From buildbot at python.org Thu Feb 5 23:30:12 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 05 Feb 2009 22:30:12 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090205223013.B62CB1E4029@bag.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/191 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: brett.cannon BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Thu Feb 5 23:52:52 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 5 Feb 2009 23:52:52 +0100 (CET) Subject: [Python-checkins] r69316 - in python/trunk: Lib/distutils/command/build_ext.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090205225252.531671E4002@bag.python.org> Author: tarek.ziade Date: Thu Feb 5 23:52:52 2009 New Revision: 69316 Log: Fixed #5132: enable extensions to link on Solaris 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 Thu Feb 5 23:52:52 2009 @@ -231,10 +231,12 @@ # building python standard extensions self.library_dirs.append('.') - # for extensions under Linux with a shared Python library, + # for extensions under Linux or Solaris with a shared Python library, # Python's library directory must be appended to library_dirs - if (sys.platform.startswith('linux') or sys.platform.startswith('gnu')) \ - and sysconfig.get_config_var('Py_ENABLE_SHARED'): + sysconfig.get_config_var('Py_ENABLE_SHARED') + if ((sys.platform.startswith('linux') or sys.platform.startswith('gnu') + or sys.platform.startswith('sunos')) + and sysconfig.get_config_var('Py_ENABLE_SHARED')): if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): # building third party extensions self.library_dirs.append(sysconfig.get_config_var('LIBDIR')) 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 Feb 5 23:52:52 2009 @@ -67,6 +67,27 @@ # 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') + def test_solaris_enable_shared(self): + dist = Distribution({'name': 'xx'}) + cmd = build_ext(dist) + old = sys.platform + + sys.platform = 'sunos' # fooling finalize_options + from distutils.sysconfig import _config_vars + old_var = _config_vars.get('Py_ENABLE_SHARED') + _config_vars['Py_ENABLE_SHARED'] = 1 + try: + cmd.ensure_finalized() + finally: + sys.platform = old + if old_var is None: + del _config_vars['Py_ENABLE_SHARED'] + else: + _config_vars['Py_ENABLE_SHARED'] = old_var + + # make sur we get some lobrary dirs under solaris + self.assert_(len(cmd.library_dirs) > 0) + 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 Thu Feb 5 23:52:52 2009 @@ -149,6 +149,9 @@ Library ------- +- Issue #5132: Fixed trouble building extensions under Solaris with + --enabled-shared activated. Initial patch by Dave Peterson. + - Issue #1581476: Always use the Tcl global namespace when calling into Tcl. - Issue #2047: shutil.move() could believe that its destination path was From python-checkins at python.org Thu Feb 5 23:55:01 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 5 Feb 2009 23:55:01 +0100 (CET) Subject: [Python-checkins] r69317 - in python/branches/release26-maint: Lib/distutils/command/build_ext.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090205225501.2F4B91E4002@bag.python.org> Author: tarek.ziade Date: Thu Feb 5 23:55:00 2009 New Revision: 69317 Log: Merged revisions 69316 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69316 | tarek.ziade | 2009-02-05 23:52:52 +0100 (Thu, 05 Feb 2009) | 1 line Fixed #5132: enable extensions to link on Solaris ........ 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 Thu Feb 5 23:55:00 2009 @@ -233,10 +233,12 @@ # building python standard extensions self.library_dirs.append('.') - # for extensions under Linux with a shared Python library, + # for extensions under Linux or Solaris with a shared Python library, # Python's library directory must be appended to library_dirs - if (sys.platform.startswith('linux') or sys.platform.startswith('gnu')) \ - and sysconfig.get_config_var('Py_ENABLE_SHARED'): + sysconfig.get_config_var('Py_ENABLE_SHARED') + if ((sys.platform.startswith('linux') or sys.platform.startswith('gnu') + or sys.platform.startswith('sunos')) + and sysconfig.get_config_var('Py_ENABLE_SHARED')): if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): # building third party extensions self.library_dirs.append(sysconfig.get_config_var('LIBDIR')) 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 Feb 5 23:55:00 2009 @@ -65,6 +65,27 @@ # 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') + def test_solaris_enable_shared(self): + dist = Distribution({'name': 'xx'}) + cmd = build_ext(dist) + old = sys.platform + + sys.platform = 'sunos' # fooling finalize_options + from distutils.sysconfig import _config_vars + old_var = _config_vars.get('Py_ENABLE_SHARED') + _config_vars['Py_ENABLE_SHARED'] = 1 + try: + cmd.ensure_finalized() + finally: + sys.platform = old + if old_var is None: + del _config_vars['Py_ENABLE_SHARED'] + else: + _config_vars['Py_ENABLE_SHARED'] = old_var + + # make sur we get some lobrary dirs under solaris + self.assert_(len(cmd.library_dirs) > 0) + 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 Thu Feb 5 23:55:00 2009 @@ -80,6 +80,9 @@ Library ------- +- Issue #5132: Fixed trouble building extensions under Solaris with + --enabled-shared activated. Initial patch by Dave Peterson. + - Issue #1581476: Always use the Tcl global namespace when calling into Tcl. - Issue #2047: shutil.move() could believe that its destination path was From python-checkins at python.org Thu Feb 5 23:56:15 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 5 Feb 2009 23:56:15 +0100 (CET) Subject: [Python-checkins] r69318 - in python/branches/py3k: Lib/distutils/command/build_ext.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090205225615.3B73B1E4002@bag.python.org> Author: tarek.ziade Date: Thu Feb 5 23:56:14 2009 New Revision: 69318 Log: Merged revisions 69316 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69316 | tarek.ziade | 2009-02-05 23:52:52 +0100 (Thu, 05 Feb 2009) | 1 line Fixed #5132: enable extensions to link on Solaris ........ 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 Thu Feb 5 23:56:14 2009 @@ -229,10 +229,12 @@ # building python standard extensions self.library_dirs.append('.') - # for extensions under Linux with a shared Python library, + # for extensions under Linux or Solaris with a shared Python library, # Python's library directory must be appended to library_dirs - if (sys.platform.startswith('linux') or sys.platform.startswith('gnu')) \ - and sysconfig.get_config_var('Py_ENABLE_SHARED'): + sysconfig.get_config_var('Py_ENABLE_SHARED') + if ((sys.platform.startswith('linux') or sys.platform.startswith('gnu') + or sys.platform.startswith('sunos')) + and sysconfig.get_config_var('Py_ENABLE_SHARED')): if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): # building third party extensions self.library_dirs.append(sysconfig.get_config_var('LIBDIR')) 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 Feb 5 23:56:14 2009 @@ -75,6 +75,27 @@ # 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') + def test_solaris_enable_shared(self): + dist = Distribution({'name': 'xx'}) + cmd = build_ext(dist) + old = sys.platform + + sys.platform = 'sunos' # fooling finalize_options + from distutils.sysconfig import _config_vars + old_var = _config_vars.get('Py_ENABLE_SHARED') + _config_vars['Py_ENABLE_SHARED'] = 1 + try: + cmd.ensure_finalized() + finally: + sys.platform = old + if old_var is None: + del _config_vars['Py_ENABLE_SHARED'] + else: + _config_vars['Py_ENABLE_SHARED'] = old_var + + # make sur we get some lobrary dirs under solaris + self.assert_(len(cmd.library_dirs) > 0) + def test_suite(): if not sysconfig.python_build: if support.verbose: Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu Feb 5 23:56:14 2009 @@ -155,6 +155,9 @@ Library ------- +- Issue #5132: Fixed trouble building extensions under Solaris with + --enabled-shared activated. Initial patch by Dave Peterson. + - Issue #1581476: Always use the Tcl global namespace when calling into Tcl. - The shelve module now defaults to pickle protocol 3. From python-checkins at python.org Thu Feb 5 23:58:42 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 5 Feb 2009 23:58:42 +0100 (CET) Subject: [Python-checkins] r69319 - in python/branches/release30-maint: Lib/distutils/command/build_ext.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090205225842.013831E4002@bag.python.org> Author: tarek.ziade Date: Thu Feb 5 23:58:41 2009 New Revision: 69319 Log: Merged revisions 69318 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69318 | tarek.ziade | 2009-02-05 23:56:14 +0100 (Thu, 05 Feb 2009) | 9 lines Merged revisions 69316 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69316 | tarek.ziade | 2009-02-05 23:52:52 +0100 (Thu, 05 Feb 2009) | 1 line Fixed #5132: enable extensions to link on Solaris ........ ................ 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 Thu Feb 5 23:58:41 2009 @@ -229,10 +229,12 @@ # building python standard extensions self.library_dirs.append('.') - # for extensions under Linux with a shared Python library, + # for extensions under Linux or Solaris with a shared Python library, # Python's library directory must be appended to library_dirs - if (sys.platform.startswith('linux') or sys.platform.startswith('gnu')) \ - and sysconfig.get_config_var('Py_ENABLE_SHARED'): + sysconfig.get_config_var('Py_ENABLE_SHARED') + if ((sys.platform.startswith('linux') or sys.platform.startswith('gnu') + or sys.platform.startswith('sunos')) + and sysconfig.get_config_var('Py_ENABLE_SHARED')): if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): # building third party extensions self.library_dirs.append(sysconfig.get_config_var('LIBDIR')) 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 Feb 5 23:58:41 2009 @@ -75,6 +75,27 @@ # 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') + def test_solaris_enable_shared(self): + dist = Distribution({'name': 'xx'}) + cmd = build_ext(dist) + old = sys.platform + + sys.platform = 'sunos' # fooling finalize_options + from distutils.sysconfig import _config_vars + old_var = _config_vars.get('Py_ENABLE_SHARED') + _config_vars['Py_ENABLE_SHARED'] = 1 + try: + cmd.ensure_finalized() + finally: + sys.platform = old + if old_var is None: + del _config_vars['Py_ENABLE_SHARED'] + else: + _config_vars['Py_ENABLE_SHARED'] = old_var + + # make sur we get some lobrary dirs under solaris + self.assert_(len(cmd.library_dirs) > 0) + 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 Thu Feb 5 23:58:41 2009 @@ -111,6 +111,9 @@ Library ------- +- Issue #5132: Fixed trouble building extensions under Solaris with + --enabled-shared activated. Initial patch by Dave Peterson. + - Issue #1581476: Always use the Tcl global namespace when calling into Tcl. - The shelve module now defaults to pickle protocol 3. From python-checkins at python.org Fri Feb 6 00:36:02 2009 From: python-checkins at python.org (brett.cannon) Date: Fri, 6 Feb 2009 00:36:02 +0100 (CET) Subject: [Python-checkins] r69320 - in python/branches/py3k/Lib/importlib: _bootstrap.py test/import_/test_path.py Message-ID: <20090205233602.D0EF81E4002@bag.python.org> Author: brett.cannon Date: Fri Feb 6 00:36:02 2009 New Revision: 69320 Log: Add tests for using sys.path_hooks by importlib.machinery.PathFinder. Modified: python/branches/py3k/Lib/importlib/_bootstrap.py python/branches/py3k/Lib/importlib/test/import_/test_path.py Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Fri Feb 6 00:36:02 2009 @@ -601,7 +601,7 @@ @classmethod def _implicit_hooks(cls): """Return a list of the implicit path hooks.""" - return [self._default_hook, imp.NullImporter] + return [cls._default_hook, imp.NullImporter] @classmethod def _path_hooks(cls, path): Modified: python/branches/py3k/Lib/importlib/test/import_/test_path.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_path.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_path.py Fri Feb 6 00:36:02 2009 @@ -208,8 +208,16 @@ def test_path_hooks(self): # Test that sys.path_hooks is used. - # TODO(brett.cannon) implement - pass + # Test that sys.path_importer_cache is set. + module = '' + path = '' + importer = util.mock_modules(module) + hook = import_util.mock_path_hook(path, importer=importer) + with util.import_state(path_hooks=[hook]): + loader = machinery.PathFinder.find_module(module, [path]) + self.assert_(loader is importer) + self.assert_(path in sys.path_importer_cache) + self.assert_(sys.path_importer_cache[path] is importer) def test_implicit_hooks(self): # Test that the implicit path hooks are used. From buildbot at python.org Fri Feb 6 00:39:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 05 Feb 2009 23:39:00 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090205233901.1EA401E401F@bag.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/1805 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Fri Feb 6 01:01:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 00:01:41 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.0 Message-ID: <20090206000141.C4E3A1E4002@bag.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/135 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 test Excerpt from the test logfile: 1 test failed: test_doctest make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Feb 6 01:07:50 2009 From: python-checkins at python.org (brett.cannon) Date: Fri, 6 Feb 2009 01:07:50 +0100 (CET) Subject: [Python-checkins] r69321 - in python/branches/py3k/Lib/importlib: NOTES test/import_/test_path.py Message-ID: <20090206000750.118261E4030@bag.python.org> Author: brett.cannon Date: Fri Feb 6 01:07:49 2009 New Revision: 69321 Log: Finish implementing tests for importlib.machinery.PathFinder by testing that implicit hooks are handled properly. Modified: python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/test/import_/test_path.py Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Fri Feb 6 01:07:49 2009 @@ -9,11 +9,15 @@ * Create meta_path importer for sys.path. - + Create hook. - + Write tests. - + Rewrite Import to use the hook. + Document. +* Refactor __import__. + + + Create a greatest common denominator function for __import__/import_module + that takes in an absolute module name and performs the import. + + Use GCD import for __import__. + + Use GCD import for import_module. + * Implement PEP 302 protocol for loaders (should just be a matter of testing). + Built-in. @@ -21,7 +25,7 @@ + Extension. + Source/bytecode. -* Public API to expose (w/ docs!) +* Public API left to expose (w/ docs!) + abc @@ -33,6 +37,8 @@ * load_module + - (?) Importer(Finder, Loader) + - ResourceLoader(Loader) * get_data @@ -58,8 +64,6 @@ + machinery - (?) Chained path hook/finder - - BuiltinImporter - - FrozenImporter - (?) FileFinder - Extensions importers @@ -75,10 +79,8 @@ * OPTIMIZE! - + Fast path common cases. - - - Absolute name from sys.path. - - Relative name from sys.path. + + Fast path absolute name. + + Fast path pulling from sys.modules. * Bootstrap importlib as implementation of builtins.__import__ Modified: python/branches/py3k/Lib/importlib/test/import_/test_path.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_path.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_path.py Fri Feb 6 01:07:49 2009 @@ -2,9 +2,10 @@ from .. import util from . import util as import_util from contextlib import nested -from imp import new_module +import imp import os import sys +from test import support from types import MethodType import unittest @@ -143,7 +144,7 @@ self.run_test(self.hooks_order_test, location, [location]) def test_path_argument(self): - module = new_module('pkg') + module = imp.new_module('pkg') module.__path__ = ['random __path__'] name = 'pkg.whatever' sys.modules['pkg'] = module @@ -221,8 +222,22 @@ def test_implicit_hooks(self): # Test that the implicit path hooks are used. - # TODO(brett.cannon) implement - pass + existing_path = os.path.dirname(support.TESTFN) + bad_path = '' + module = '' + assert not os.path.exists(bad_path) + with util.import_state(): + nothing = machinery.PathFinder.find_module(module, + path=[existing_path]) + self.assert_(nothing is None) + self.assert_(existing_path in sys.path_importer_cache) + self.assert_(not isinstance(sys.path_importer_cache[existing_path], + imp.NullImporter)) + nothing = machinery.PathFinder.find_module(module, path=[bad_path]) + self.assert_(nothing is None) + self.assert_(bad_path in sys.path_importer_cache) + self.assert_(isinstance(sys.path_importer_cache[bad_path], + imp.NullImporter)) def test_main(): From buildbot at python.org Fri Feb 6 01:08:24 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 00:08:24 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090206000825.306A71E4002@bag.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/193 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: brett.cannon BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Fri Feb 6 01:21:56 2009 From: python-checkins at python.org (neil.schemenauer) Date: Fri, 6 Feb 2009 01:21:56 +0100 (CET) Subject: [Python-checkins] r69322 - python/trunk/setup.py Message-ID: <20090206002156.0F5481E4002@bag.python.org> Author: neil.schemenauer Date: Fri Feb 6 01:21:55 2009 New Revision: 69322 Log: Distutils apparently requires an absolute path so provide one. Modified: python/trunk/setup.py Modified: python/trunk/setup.py ============================================================================== --- python/trunk/setup.py (original) +++ python/trunk/setup.py Fri Feb 6 01:21:55 2009 @@ -118,7 +118,7 @@ if not srcdir: # Maybe running on Windows but not using CYGWIN? raise ValueError("No source directory; cannot proceed.") - srcdir = os.path.normpath(srcdir) + srcdir = os.path.abspath(srcdir) moddirlist = [os.path.join(srcdir, 'Modules')] # Platform-dependent module source and include directories From python-checkins at python.org Fri Feb 6 01:27:50 2009 From: python-checkins at python.org (neil.schemenauer) Date: Fri, 6 Feb 2009 01:27:50 +0100 (CET) Subject: [Python-checkins] r69323 - python/branches/py3k/setup.py Message-ID: <20090206002750.57BF91E4002@bag.python.org> Author: neil.schemenauer Date: Fri Feb 6 01:27:50 2009 New Revision: 69323 Log: Distutils apparently requires an absolute path so provide one. Modified: python/branches/py3k/setup.py Modified: python/branches/py3k/setup.py ============================================================================== --- python/branches/py3k/setup.py (original) +++ python/branches/py3k/setup.py Fri Feb 6 01:27:50 2009 @@ -117,7 +117,7 @@ if not srcdir: # Maybe running on Windows but not using CYGWIN? raise ValueError("No source directory; cannot proceed.") - srcdir = os.path.normpath(srcdir) + srcdir = os.path.abspath(srcdir) moddirlist = [os.path.join(srcdir, 'Modules')] # Platform-dependent module source and include directories From python-checkins at python.org Fri Feb 6 01:31:59 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 01:31:59 +0100 (CET) Subject: [Python-checkins] r69324 - in python/trunk: Lib/distutils/dir_util.py Lib/distutils/file_util.py Lib/distutils/tests/test_dir_util.py Lib/distutils/tests/test_file_util.py Misc/NEWS Message-ID: <20090206003159.58FF31E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 01:31:59 2009 New Revision: 69324 Log: Fixed #1276768: verbose option was not used in the code. Added: python/trunk/Lib/distutils/tests/test_dir_util.py (contents, props changed) python/trunk/Lib/distutils/tests/test_file_util.py (contents, props changed) Modified: python/trunk/Lib/distutils/dir_util.py python/trunk/Lib/distutils/file_util.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/dir_util.py ============================================================================== --- python/trunk/Lib/distutils/dir_util.py (original) +++ python/trunk/Lib/distutils/dir_util.py Fri Feb 6 01:31:59 2009 @@ -16,7 +16,7 @@ # 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=0, dry_run=0): +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 @@ -49,13 +49,9 @@ tails = [tail] # stack of lone dirs to create while head and tail and not os.path.isdir(head): - #print "splitting '%s': " % head, (head, tail) = os.path.split(head) - #print "to ('%s','%s')" % (head, tail) tails.insert(0, tail) # push next higher dir onto stack - #print "stack of tails:", tails - # now 'head' contains the deepest directory that already exists # (that is, the child of 'head' in 'name' is the highest directory # that does *not* exist) @@ -67,7 +63,8 @@ if _path_created.get(abs_head): continue - log.info("creating %s", head) + if verbose == 1: + log.info("creating %s", head) if not dry_run: try: @@ -83,7 +80,7 @@ # mkpath () -def create_tree (base_dir, files, mode=0777, verbose=0, dry_run=0): +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 @@ -102,7 +99,7 @@ # Now create them for dir in need_dirs: - mkpath(dir, mode, dry_run=dry_run) + mkpath(dir, mode, verbose=verbose, dry_run=dry_run) # create_tree () @@ -112,7 +109,7 @@ preserve_times=1, preserve_symlinks=0, update=0, - verbose=0, + verbose=1, dry_run=0): """Copy an entire directory tree 'src' to a new location 'dst'. Both @@ -148,7 +145,7 @@ "error listing files in '%s': %s" % (src, errstr) if not dry_run: - mkpath(dst) + mkpath(dst, verbose=verbose) outputs = [] @@ -158,7 +155,8 @@ if preserve_symlinks and os.path.islink(src_name): link_dest = os.readlink(src_name) - log.info("linking %s -> %s", dst_name, link_dest) + if verbose == 1: + log.info("linking %s -> %s", dst_name, link_dest) if not dry_run: os.symlink(link_dest, dst_name) outputs.append(dst_name) @@ -167,10 +165,11 @@ outputs.extend( copy_tree(src_name, dst_name, preserve_mode, preserve_times, preserve_symlinks, update, - dry_run=dry_run)) + verbose=verbose, dry_run=dry_run)) else: copy_file(src_name, dst_name, preserve_mode, - preserve_times, update, dry_run=dry_run) + preserve_times, update, verbose=verbose, + dry_run=dry_run) outputs.append(dst_name) return outputs @@ -188,14 +187,15 @@ cmdtuples.append((os.rmdir, path)) -def remove_tree (directory, verbose=0, dry_run=0): +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). """ from distutils.util import grok_environment_error global _path_created - log.info("removing '%s' (and everything under it)", directory) + if verbose == 1: + log.info("removing '%s' (and everything under it)", directory) if dry_run: return cmdtuples = [] Modified: python/trunk/Lib/distutils/file_util.py ============================================================================== --- python/trunk/Lib/distutils/file_util.py (original) +++ python/trunk/Lib/distutils/file_util.py Fri Feb 6 01:31:59 2009 @@ -76,7 +76,7 @@ preserve_times=1, update=0, link=None, - verbose=0, + verbose=1, dry_run=0): """Copy a file 'src' to 'dst'. If 'dst' is a directory, then 'src' is @@ -123,7 +123,8 @@ dir = os.path.dirname(dst) if update and not newer(src, dst): - log.debug("not copying %s (output up-to-date)", src) + if verbose == 1: + log.debug("not copying %s (output up-to-date)", src) return dst, 0 try: @@ -131,10 +132,12 @@ except KeyError: raise ValueError, \ "invalid value '%s' for 'link' argument" % link - if os.path.basename(dst) == os.path.basename(src): - log.info("%s %s -> %s", action, src, dir) - else: - log.info("%s %s -> %s", action, src, dst) + + if verbose == 1: + if os.path.basename(dst) == os.path.basename(src): + log.info("%s %s -> %s", action, src, dir) + else: + log.info("%s %s -> %s", action, src, dst) if dry_run: return (dst, 1) @@ -178,7 +181,7 @@ # XXX I suspect this is Unix-specific -- need porting help! def move_file (src, dst, - verbose=0, + verbose=1, dry_run=0): """Move a file 'src' to 'dst'. If 'dst' is a directory, the file will @@ -191,7 +194,8 @@ from os.path import exists, isfile, isdir, basename, dirname import errno - log.info("moving %s -> %s", src, dst) + if verbose == 1: + log.info("moving %s -> %s", src, dst) if dry_run: return dst @@ -223,7 +227,7 @@ "couldn't move '%s' to '%s': %s" % (src, dst, msg) if copy_it: - copy_file(src, dst) + copy_file(src, dst, verbose=verbose) try: os.unlink(src) except os.error, (num, msg): Added: python/trunk/Lib/distutils/tests/test_dir_util.py ============================================================================== --- (empty file) +++ python/trunk/Lib/distutils/tests/test_dir_util.py Fri Feb 6 01:31:59 2009 @@ -0,0 +1,91 @@ +"""Tests for distutils.dir_util.""" +import unittest +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 import log + +class DirUtilTestCase(unittest.TestCase): + + def _log(self, msg, *args): + if len(args) > 0: + self._logs.append(msg % args) + else: + self._logs.append(msg) + + def setUp(self): + self._logs = [] + self.root_target = os.path.join(os.path.dirname(__file__), 'deep') + self.target = os.path.join(self.root_target, 'here') + self.target2 = os.path.join(os.path.dirname(__file__), 'deep2') + self.old_log = log.info + log.info = self._log + + def tearDown(self): + for target in (self.target, self.target2): + if os.path.exists(target): + shutil.rmtree(target) + log.info = self.old_log + + def test_mkpath_remove_tree_verbosity(self): + + mkpath(self.target, verbose=0) + wanted = [] + self.assertEquals(self._logs, wanted) + remove_tree(self.root_target, verbose=0) + + mkpath(self.target, verbose=1) + wanted = ['creating %s' % self.root_target, + 'creating %s' % self.target] + self.assertEquals(self._logs, wanted) + self._logs = [] + + remove_tree(self.root_target, verbose=1) + wanted = ["removing '%s' (and everything under it)" % self.root_target] + self.assertEquals(self._logs, wanted) + + def test_create_tree_verbosity(self): + + create_tree(self.root_target, ['one', 'two', 'three'], verbose=0) + self.assertEquals(self._logs, []) + remove_tree(self.root_target, verbose=0) + + wanted = ['creating %s' % self.root_target] + create_tree(self.root_target, ['one', 'two', 'three'], verbose=1) + self.assertEquals(self._logs, wanted) + + remove_tree(self.root_target, verbose=0) + + + def test_copy_tree_verbosity(self): + + mkpath(self.target, verbose=0) + + copy_tree(self.target, self.target2, verbose=0) + self.assertEquals(self._logs, []) + + remove_tree(self.root_target, verbose=0) + + mkpath(self.target, verbose=0) + a_file = os.path.join(self.target, 'ok.txt') + f = open(a_file, 'w') + f.write('some content') + f.close() + + wanted = ['copying %s -> %s' % (a_file, self.target2)] + copy_tree(self.target, self.target2, verbose=1) + self.assertEquals(self._logs, wanted) + + remove_tree(self.root_target, verbose=0) + remove_tree(self.target2, verbose=0) + +def test_suite(): + return unittest.makeSuite(DirUtilTestCase) + +if __name__ == "__main__": + unittest.main(defaultTest="test_suite") Added: python/trunk/Lib/distutils/tests/test_file_util.py ============================================================================== --- (empty file) +++ python/trunk/Lib/distutils/tests/test_file_util.py Fri Feb 6 01:31:59 2009 @@ -0,0 +1,66 @@ +"""Tests for distutils.file_util.""" +import unittest +import os +import shutil + +from distutils.file_util import move_file +from distutils import log + +class FileUtilTestCase(unittest.TestCase): + + def _log(self, msg, *args): + if len(args) > 0: + self._logs.append(msg % args) + else: + self._logs.append(msg) + + def setUp(self): + self._logs = [] + self.old_log = log.info + log.info = self._log + self.source = os.path.join(os.path.dirname(__file__), 'f1') + self.target = os.path.join(os.path.dirname(__file__), 'f2') + self.target_dir = os.path.join(os.path.dirname(__file__), 'd1') + + def tearDown(self): + log.info = self.old_log + for f in (self.source, self.target, self.target_dir): + if os.path.exists(f): + if os.path.isfile(f): + os.remove(f) + else: + shutil.rmtree(f) + + def test_move_file_verbosity(self): + + f = open(self.source, 'w') + f.write('some content') + f.close() + + move_file(self.source, self.target, verbose=0) + wanted = [] + self.assertEquals(self._logs, wanted) + + # back to original state + move_file(self.target, self.source, verbose=0) + + move_file(self.source, self.target, verbose=1) + wanted = ['moving %s -> %s' % (self.source, self.target)] + self.assertEquals(self._logs, wanted) + + # back to original state + move_file(self.target, self.source, verbose=0) + + self._logs = [] + # now the target is a dir + os.mkdir(self.target_dir) + move_file(self.source, self.target_dir, verbose=1) + wanted = ['moving %s -> %s' % (self.source, self.target_dir)] + self.assertEquals(self._logs, wanted) + + +def test_suite(): + return unittest.makeSuite(FileUtilTestCase) + +if __name__ == "__main__": + unittest.main(defaultTest="test_suite") Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Feb 6 01:31:59 2009 @@ -149,6 +149,9 @@ Library ------- +- Issue #1276768: The verbose option was not used in the code of + distutils.file_util and distutils.dir_util. + - Issue #5132: Fixed trouble building extensions under Solaris with --enabled-shared activated. Initial patch by Dave Peterson. From python-checkins at python.org Fri Feb 6 01:33:27 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 01:33:27 +0100 (CET) Subject: [Python-checkins] r69325 - python/branches/release26-maint Message-ID: <20090206003327.30D4F1E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 01:33:27 2009 New Revision: 69325 Log: Blocked revisions 69324 via svnmerge ........ r69324 | tarek.ziade | 2009-02-06 01:31:59 +0100 (Fri, 06 Feb 2009) | 1 line Fixed #1276768: verbose option was not used in the code. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri Feb 6 01:38:35 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 01:38:35 +0100 (CET) Subject: [Python-checkins] r69326 - in python/branches/py3k: Lib/distutils/dir_util.py Lib/distutils/file_util.py Lib/distutils/tests/test_dir_util.py Lib/distutils/tests/test_file_util.py Misc/NEWS Message-ID: <20090206003835.A45591E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 01:38:35 2009 New Revision: 69326 Log: Merged revisions 69324 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69324 | tarek.ziade | 2009-02-06 01:31:59 +0100 (Fri, 06 Feb 2009) | 1 line Fixed #1276768: verbose option was not used in the code. ........ Added: python/branches/py3k/Lib/distutils/tests/test_dir_util.py - copied unchanged from r69324, /python/trunk/Lib/distutils/tests/test_dir_util.py python/branches/py3k/Lib/distutils/tests/test_file_util.py - copied unchanged from r69324, /python/trunk/Lib/distutils/tests/test_file_util.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/dir_util.py python/branches/py3k/Lib/distutils/file_util.py python/branches/py3k/Misc/NEWS 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 Fri Feb 6 01:38:35 2009 @@ -15,7 +15,7 @@ # 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=0, dry_run=0): +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 @@ -48,13 +48,9 @@ tails = [tail] # stack of lone dirs to create while head and tail and not os.path.isdir(head): - #print "splitting '%s': " % head, (head, tail) = os.path.split(head) - #print "to ('%s','%s')" % (head, tail) tails.insert(0, tail) # push next higher dir onto stack - #print "stack of tails:", tails - # now 'head' contains the deepest directory that already exists # (that is, the child of 'head' in 'name' is the highest directory # that does *not* exist) @@ -66,7 +62,8 @@ if _path_created.get(abs_head): continue - log.info("creating %s", head) + if verbose == 1: + log.info("creating %s", head) if not dry_run: try: @@ -82,7 +79,7 @@ # mkpath () -def create_tree (base_dir, files, mode=0o777, verbose=0, dry_run=0): +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 @@ -99,7 +96,7 @@ # Now create them for dir in sorted(need_dir): - mkpath(dir, mode, dry_run=dry_run) + mkpath(dir, mode, verbose=verbose, dry_run=dry_run) # create_tree () @@ -109,7 +106,7 @@ preserve_times=1, preserve_symlinks=0, update=0, - verbose=0, + verbose=1, dry_run=0): """Copy an entire directory tree 'src' to a new location 'dst'. Both @@ -146,7 +143,7 @@ "error listing files in '%s': %s" % (src, errstr)) if not dry_run: - mkpath(dst) + mkpath(dst, verbose=verbose) outputs = [] @@ -156,7 +153,8 @@ if preserve_symlinks and os.path.islink(src_name): link_dest = os.readlink(src_name) - log.info("linking %s -> %s", dst_name, link_dest) + if verbose == 1: + log.info("linking %s -> %s", dst_name, link_dest) if not dry_run: os.symlink(link_dest, dst_name) outputs.append(dst_name) @@ -165,10 +163,11 @@ outputs.extend( copy_tree(src_name, dst_name, preserve_mode, preserve_times, preserve_symlinks, update, - dry_run=dry_run)) + verbose=verbose, dry_run=dry_run)) else: copy_file(src_name, dst_name, preserve_mode, - preserve_times, update, dry_run=dry_run) + preserve_times, update, verbose=verbose, + dry_run=dry_run) outputs.append(dst_name) return outputs @@ -184,14 +183,15 @@ cmdtuples.append((os.rmdir, path)) -def remove_tree (directory, verbose=0, dry_run=0): +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). """ from distutils.util import grok_environment_error global _path_created - log.info("removing '%s' (and everything under it)", directory) + if verbose == 1: + log.info("removing '%s' (and everything under it)", directory) if dry_run: return cmdtuples = [] Modified: python/branches/py3k/Lib/distutils/file_util.py ============================================================================== --- python/branches/py3k/Lib/distutils/file_util.py (original) +++ python/branches/py3k/Lib/distutils/file_util.py Fri Feb 6 01:38:35 2009 @@ -67,7 +67,7 @@ fsrc.close() def copy_file(src, dst, preserve_mode=1, preserve_times=1, update=0, - link=None, verbose=0, dry_run=0): + link=None, verbose=1, dry_run=0): """Copy a file 'src' to 'dst'. If 'dst' is a directory, then 'src' is copied there with the same name; otherwise, it must be a filename. (If the file exists, it will be ruthlessly clobbered.) If 'preserve_mode' @@ -112,17 +112,20 @@ dir = os.path.dirname(dst) if update and not newer(src, dst): - log.debug("not copying %s (output up-to-date)", src) + if verbose == 1: + log.debug("not copying %s (output up-to-date)", src) return (dst, 0) try: action = _copy_action[link] except KeyError: raise ValueError("invalid value '%s' for 'link' argument" % link) - if os.path.basename(dst) == os.path.basename(src): - log.info("%s %s -> %s", action, src, dir) - else: - log.info("%s %s -> %s", action, src, dst) + + if verbose == 1: + if os.path.basename(dst) == os.path.basename(src): + log.info("%s %s -> %s", action, src, dir) + else: + log.info("%s %s -> %s", action, src, dst) if dry_run: return (dst, 1) @@ -164,7 +167,7 @@ # XXX I suspect this is Unix-specific -- need porting help! def move_file (src, dst, - verbose=0, + verbose=1, dry_run=0): """Move a file 'src' to 'dst'. If 'dst' is a directory, the file will @@ -177,7 +180,8 @@ from os.path import exists, isfile, isdir, basename, dirname import errno - log.info("moving %s -> %s", src, dst) + if verbose == 1: + log.info("moving %s -> %s", src, dst) if dry_run: return dst @@ -209,7 +213,7 @@ "couldn't move '%s' to '%s': %s" % (src, dst, msg)) if copy_it: - copy_file(src, dst) + copy_file(src, dst, verbose=verbose) try: os.unlink(src) except os.error as e: Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri Feb 6 01:38:35 2009 @@ -155,6 +155,9 @@ Library ------- +- Issue #1276768: The verbose option was not used in the code of + distutils.file_util and distutils.dir_util. + - Issue #5132: Fixed trouble building extensions under Solaris with --enabled-shared activated. Initial patch by Dave Peterson. From python-checkins at python.org Fri Feb 6 01:38:48 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 6 Feb 2009 01:38:48 +0100 (CET) Subject: [Python-checkins] r69327 - sandbox/trunk/dbm_sqlite/alt/dbdict.py Message-ID: <20090206003848.C75031E4002@bag.python.org> Author: raymond.hettinger Date: Fri Feb 6 01:38:48 2009 New Revision: 69327 Log: Auto search input file formats. Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbdict.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbdict.py Fri Feb 6 01:38:48 2009 @@ -5,7 +5,8 @@ close time's are potentially long because the whole dict must be read or written to disk. -File format is selectable between pickle, json, eval, and csv. +Input file format is automatically discovered. +Output file format is selectable between pickle, json, and csv. All three are backed by fast C implementations. ''' @@ -15,16 +16,18 @@ class DictDB(dict): - def __init__(self, filename, flag='c', mode=None, format='csv', *args, **kwds): - # r=readonly c=read_write_create_if_needed n=new_overwrite_previous + def __init__(self, filename, flag='c', mode=None, format=None, *args, **kwds): + # flags: r=readonly c=create n=new_overwrite_previous + # mode: None or a triple like 0x666 + # format: csv, json, or pickle (default is csv) self.flag = flag self.mode = mode - self.format = format + self.format = format or 'csv' self.filename = filename if flag != 'n' and os.access(filename, os.R_OK): file = __builtins__.open(filename, 'rb') try: - self.update(self.load(file)) + self.load(file) finally: file.close() self.update(*args, **kwds) @@ -42,40 +45,34 @@ raise file.close() shutil.move(file.name, self.filename) # atomic commit - if self.mode: + if self.mode is not None: os.chmod(self.filename, self.mode) def close(self): self.sync() - def dump(self, f): + def dump(self, file): if self.format == 'csv': - csv.writer(f).writerows(self.iteritems()) + csv.writer(file).writerows(self.iteritems()) elif self.format == 'json': - json.dump(self, f, separators=(',',':')) + json.dump(self, file, separators=(',',':')) elif self.format == 'pickle': - pickle.dump(self.items(), f, -1) - elif self.format == 'eval': - f.write(repr(self)) + pickle.dump(self.items(), file, -1) else: raise NotImplementedError('Unknown format: %r' % self.format) - def load(self, f): - # Use csv or json for untrusted data. Handles only basic types. - # Use pickle or eval only for trusted. Handles many object types. - if self.format == 'csv': - return csv.reader(f) - elif self.format == 'json': - return json.load(f) - elif self.format == 'pickle': - return pickle.load(f) - elif self.format == 'eval': - return eval(f.read()) - else: - raise NotImplementedError('Unknown format: %r' % self.format) + def load(self, file): + # try formats from most restrictive to least restrictive + for loader in (pickle.load, json.load, csv.reader): + file.seek(0) + try: + return self.update(loader(file)) + except Exception: + pass + raise NotImplementedError('Unknown format: %r' % self.format) -def dbopen(filename, flag='c', mode=0o666, format='csv'): +def dbopen(filename, flag='c', mode=None, format=None): return DictDB(filename, flag, mode, format) From python-checkins at python.org Fri Feb 6 01:40:15 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 01:40:15 +0100 (CET) Subject: [Python-checkins] r69328 - python/branches/release30-maint Message-ID: <20090206004015.A810B1E402D@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 01:40:15 2009 New Revision: 69328 Log: Blocked revisions 69326 via svnmerge ................ r69326 | tarek.ziade | 2009-02-06 01:38:35 +0100 (Fri, 06 Feb 2009) | 9 lines Merged revisions 69324 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69324 | tarek.ziade | 2009-02-06 01:31:59 +0100 (Fri, 06 Feb 2009) | 1 line Fixed #1276768: verbose option was not used in the code. ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Fri Feb 6 01:40:46 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 6 Feb 2009 01:40:46 +0100 (CET) Subject: [Python-checkins] r69329 - sandbox/trunk/dbm_sqlite/alt/dbdict.py Message-ID: <20090206004046.215CE1E4049@bag.python.org> Author: raymond.hettinger Date: Fri Feb 6 01:40:45 2009 New Revision: 69329 Log: Clarify cause of load exception. Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbdict.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbdict.py Fri Feb 6 01:40:45 2009 @@ -69,7 +69,7 @@ return self.update(loader(file)) except Exception: pass - raise NotImplementedError('Unknown format: %r' % self.format) + raise ValueError('File not in recognized format') def dbopen(filename, flag='c', mode=None, format=None): From mal at egenix.com Fri Feb 6 01:41:16 2009 From: mal at egenix.com (M.-A. Lemburg) Date: Fri, 06 Feb 2009 01:41:16 +0100 Subject: [Python-checkins] r69324 - in python/trunk: Lib/distutils/dir_util.py Lib/distutils/file_util.py Lib/distutils/tests/test_dir_util.py Lib/distutils/tests/test_file_util.py Misc/NEWS In-Reply-To: <20090206003159.58FF31E4002@bag.python.org> References: <20090206003159.58FF31E4002@bag.python.org> Message-ID: <498B872C.3000802@egenix.com> Hi Tarek, On 2009-02-06 01:31, tarek.ziade wrote: > Author: tarek.ziade > Date: Fri Feb 6 01:31:59 2009 > New Revision: 69324 > > Log: > Fixed #1276768: verbose option was not used in the code. > > Modified: python/trunk/Lib/distutils/dir_util.py > ============================================================================== > --- python/trunk/Lib/distutils/dir_util.py (original) > +++ python/trunk/Lib/distutils/dir_util.py Fri Feb 6 01:31:59 2009 > - log.info("creating %s", head) > + if verbose == 1: > + log.info("creating %s", head) You may want to use "if verbose >= 1:" for these. Setting verbose to 2 would otherwise not cause the message to be written. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 06 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/ ________________________________________________________________________ ::: 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 ziade.tarek at gmail.com Fri Feb 6 01:45:59 2009 From: ziade.tarek at gmail.com (=?ISO-8859-1?Q?Tarek_Ziad=E9?=) Date: Fri, 6 Feb 2009 01:45:59 +0100 Subject: [Python-checkins] r69324 - in python/trunk: Lib/distutils/dir_util.py Lib/distutils/file_util.py Lib/distutils/tests/test_dir_util.py Lib/distutils/tests/test_file_util.py Misc/NEWS In-Reply-To: <498B872C.3000802@egenix.com> References: <20090206003159.58FF31E4002@bag.python.org> <498B872C.3000802@egenix.com> Message-ID: <94bdd2610902051645uf1ee9f2ife744772397b6cab@mail.gmail.com> Hi Marc-Andr?, I'll change it accordingly Cheers Tarek On Fri, Feb 6, 2009 at 1:41 AM, M.-A. Lemburg wrote: > Hi Tarek, > > On 2009-02-06 01:31, tarek.ziade wrote: >> Author: tarek.ziade >> Date: Fri Feb 6 01:31:59 2009 >> New Revision: 69324 >> >> Log: >> Fixed #1276768: verbose option was not used in the code. >> >> Modified: python/trunk/Lib/distutils/dir_util.py >> ============================================================================== >> --- python/trunk/Lib/distutils/dir_util.py (original) >> +++ python/trunk/Lib/distutils/dir_util.py Fri Feb 6 01:31:59 2009 >> - log.info("creating %s", head) >> + if verbose == 1: >> + log.info("creating %s", head) > > You may want to use "if verbose >= 1:" for these. Setting verbose > to 2 would otherwise not cause the message to be written. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 06 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/ > ________________________________________________________________________ > > ::: 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/ > _______________________________________________ > Python-checkins mailing list > Python-checkins at python.org > http://mail.python.org/mailman/listinfo/python-checkins > -- Tarek Ziad? | Association AfPy | www.afpy.org Blog FR | http://programmation-python.org Blog EN | http://tarekziade.wordpress.com/ From python-checkins at python.org Fri Feb 6 01:46:58 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 01:46:58 +0100 (CET) Subject: [Python-checkins] r69330 - python/trunk/Lib/distutils/README Message-ID: <20090206004658.078D11E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 01:46:57 2009 New Revision: 69330 Log: README now reflects the current state Modified: python/trunk/Lib/distutils/README Modified: python/trunk/Lib/distutils/README ============================================================================== --- python/trunk/Lib/distutils/README (original) +++ python/trunk/Lib/distutils/README Fri Feb 6 01:46:57 2009 @@ -1,22 +1,11 @@ -This directory contains only a subset of the Distutils, specifically -the Python modules in the 'distutils' and 'distutils.command' -packages. This is all you need to distribute and install Python -modules using the Distutils. There is also a separately packaged -standalone version of the Distutils available for people who want to -upgrade the Distutils without upgrading Python, available from the -Distutils web page: +This directory contains the Distutils package. - http://www.python.org/sigs/distutils-sig/ +There's a full documentation available at: -The standalone version includes all of the code in this directory, -plus documentation, test scripts, examples, etc. + http://docs.python.org/distutils/ -The Distutils documentation is divided into two documents, "Installing -Python Modules", which explains how to install Python packages, and -"Distributing Python Modules", which explains how to write setup.py -files. Both documents are part of the standard Python documentation -set, and are available from http://www.python.org/doc/current/ . +The Distutils-SIG web page is also a good starting point: - Greg Ward (gward at python.net) + http://www.python.org/sigs/distutils-sig/ $Id$ From python-checkins at python.org Fri Feb 6 01:48:26 2009 From: python-checkins at python.org (eric.smith) Date: Fri, 6 Feb 2009 01:48:26 +0100 (CET) Subject: [Python-checkins] r69331 - in python/trunk: Doc/library/sys.rst Lib/test/test_sys.py Misc/NEWS Python/sysmodule.c Message-ID: <20090206004826.45EEB1E4002@bag.python.org> Author: eric.smith Date: Fri Feb 6 01:48:26 2009 New Revision: 69331 Log: Implement issue #4285, convert sys.version_info to a named tuple. Patch by Ross Light. Modified: python/trunk/Doc/library/sys.rst python/trunk/Lib/test/test_sys.py python/trunk/Misc/NEWS python/trunk/Python/sysmodule.c Modified: python/trunk/Doc/library/sys.rst ============================================================================== --- python/trunk/Doc/library/sys.rst (original) +++ python/trunk/Doc/library/sys.rst Fri Feb 6 01:48:26 2009 @@ -853,9 +853,13 @@ *micro*, *releaselevel*, and *serial*. All values except *releaselevel* are integers; the release level is ``'alpha'``, ``'beta'``, ``'candidate'``, or ``'final'``. The ``version_info`` value corresponding to the Python version 2.0 - is ``(2, 0, 0, 'final', 0)``. + is ``(2, 0, 0, 'final', 0)``. The components can also be accessed by name, + so ``sys.version_info[0]`` is equivalent to ``sys.version_info.major`` + and so on. .. versionadded:: 2.0 + .. versionchanged:: 2.7 + Added named component attributes .. data:: warnoptions Modified: python/trunk/Lib/test/test_sys.py ============================================================================== --- python/trunk/Lib/test/test_sys.py (original) +++ python/trunk/Lib/test/test_sys.py Fri Feb 6 01:48:26 2009 @@ -340,13 +340,25 @@ self.assert_(isinstance(sys.prefix, basestring)) self.assert_(isinstance(sys.version, basestring)) vi = sys.version_info - self.assert_(isinstance(vi, tuple)) + self.assert_(isinstance(vi[:], tuple)) self.assertEqual(len(vi), 5) self.assert_(isinstance(vi[0], int)) self.assert_(isinstance(vi[1], int)) self.assert_(isinstance(vi[2], int)) self.assert_(vi[3] in ("alpha", "beta", "candidate", "final")) self.assert_(isinstance(vi[4], int)) + self.assert_(isinstance(vi.major, int)) + self.assert_(isinstance(vi.minor, int)) + self.assert_(isinstance(vi.micro, int)) + self.assert_(vi.releaselevel in + ("alpha", "beta", "candidate", "final")) + self.assert_(isinstance(vi.serial, int)) + self.assertEqual(vi[0], vi.major) + self.assertEqual(vi[1], vi.minor) + self.assertEqual(vi[2], vi.micro) + self.assertEqual(vi[3], vi.releaselevel) + self.assertEqual(vi[4], vi.serial) + self.assert_(vi > (1,0,0)) def test_43581(self): # Can't use sys.stdout, as this is a cStringIO object when Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Feb 6 01:48:26 2009 @@ -149,6 +149,9 @@ Library ------- +- Issue #4285: Change sys.version_info to be a named tuple. Patch by + Ross Light. + - Issue #1276768: The verbose option was not used in the code of distutils.file_util and distutils.dir_util. Modified: python/trunk/Python/sysmodule.c ============================================================================== --- python/trunk/Python/sysmodule.c (original) +++ python/trunk/Python/sysmodule.c Fri Feb 6 01:48:26 2009 @@ -1048,7 +1048,7 @@ maxunicode -- the largest supported character\n\ builtin_module_names -- tuple of module names built into this interpreter\n\ version -- the version of this interpreter as a string\n\ -version_info -- version information as a tuple\n\ +version_info -- version information as a named tuple\n\ hexversion -- version information encoded as a single integer\n\ copyright -- copyright notice pertaining to this interpreter\n\ platform -- platform identifier\n\ @@ -1279,6 +1279,75 @@ return seq; } +PyDoc_STRVAR(version_info__doc__, +"sys.version_info\n\ +\n\ +Version information as a named tuple."); + +static PyTypeObject VersionInfoType = {0, 0, 0, 0, 0, 0}; + +static PyStructSequence_Field version_info_fields[] = { + {"major", "Major release number"}, + {"minor", "Minor release number"}, + {"micro", "Patch release number"}, + {"releaselevel", "'alpha', 'beta', 'candidate', or 'release'"}, + {"serial", "Serial release number"}, + {0} +}; + +static PyStructSequence_Desc version_info_desc = { + "sys.version_info", /* name */ + version_info__doc__, /* doc */ + version_info_fields, /* fields */ + 5 +}; + +static PyObject * +make_version_info(void) +{ + PyObject *version_info; + char *s; + int pos = 0; + + version_info = PyStructSequence_New(&VersionInfoType); + if (version_info == NULL) { + return NULL; + } + + /* + * These release level checks are mutually exclusive and cover + * the field, so don't get too fancy with the pre-processor! + */ +#if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_ALPHA + s = "alpha"; +#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_BETA + s = "beta"; +#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_GAMMA + s = "candidate"; +#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_FINAL + s = "final"; +#endif + +#define SetIntItem(flag) \ + PyStructSequence_SET_ITEM(version_info, pos++, PyInt_FromLong(flag)) +#define SetStrItem(flag) \ + PyStructSequence_SET_ITEM(version_info, pos++, PyString_FromString(flag)) + + SetIntItem(PY_MAJOR_VERSION); + SetIntItem(PY_MINOR_VERSION); + SetIntItem(PY_MICRO_VERSION); + SetStrItem(s); + SetIntItem(PY_RELEASE_SERIAL); +#undef SetIntItem +#undef SetStrItem + + if (PyErr_Occurred()) { + Py_CLEAR(version_info); + return NULL; + } + return version_info; +} + PyObject * _PySys_Init(void) { @@ -1354,25 +1423,6 @@ svn_revision)); SET_SYS_FROM_STRING("dont_write_bytecode", PyBool_FromLong(Py_DontWriteBytecodeFlag)); - /* - * These release level checks are mutually exclusive and cover - * the field, so don't get too fancy with the pre-processor! - */ -#if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_ALPHA - s = "alpha"; -#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_BETA - s = "beta"; -#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_GAMMA - s = "candidate"; -#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_FINAL - s = "final"; -#endif - - SET_SYS_FROM_STRING("version_info", - Py_BuildValue("iiisi", PY_MAJOR_VERSION, - PY_MINOR_VERSION, - PY_MICRO_VERSION, s, - PY_RELEASE_SERIAL)); SET_SYS_FROM_STRING("api_version", PyInt_FromLong(PYTHON_API_VERSION)); SET_SYS_FROM_STRING("copyright", @@ -1429,6 +1479,15 @@ PyDict_SetItemString(sysdict, "warnoptions", warnoptions); } + /* version_info */ + if (VersionInfoType.tp_name == 0) + PyStructSequence_InitType(&VersionInfoType, &version_info_desc); + SET_SYS_FROM_STRING("version_info", make_version_info()); + /* prevent user from creating new instances */ + VersionInfoType.tp_init = NULL; + VersionInfoType.tp_new = NULL; + + /* flags */ if (FlagsType.tp_name == 0) PyStructSequence_InitType(&FlagsType, &flags_desc); SET_SYS_FROM_STRING("flags", make_flags()); From python-checkins at python.org Fri Feb 6 01:49:45 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 01:49:45 +0100 (CET) Subject: [Python-checkins] r69332 - in python/trunk/Lib/distutils: dir_util.py file_util.py Message-ID: <20090206004945.85E4C1E4016@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 01:49:45 2009 New Revision: 69332 Log: using >= so setting verbose to 2 will work as well Modified: python/trunk/Lib/distutils/dir_util.py python/trunk/Lib/distutils/file_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 Fri Feb 6 01:49:45 2009 @@ -63,7 +63,7 @@ if _path_created.get(abs_head): continue - if verbose == 1: + if verbose >= 1: log.info("creating %s", head) if not dry_run: @@ -155,7 +155,7 @@ if preserve_symlinks and os.path.islink(src_name): link_dest = os.readlink(src_name) - if verbose == 1: + if verbose >= 1: log.info("linking %s -> %s", dst_name, link_dest) if not dry_run: os.symlink(link_dest, dst_name) @@ -194,7 +194,7 @@ from distutils.util import grok_environment_error global _path_created - if verbose == 1: + if verbose >= 1: log.info("removing '%s' (and everything under it)", directory) if dry_run: return Modified: python/trunk/Lib/distutils/file_util.py ============================================================================== --- python/trunk/Lib/distutils/file_util.py (original) +++ python/trunk/Lib/distutils/file_util.py Fri Feb 6 01:49:45 2009 @@ -123,7 +123,7 @@ dir = os.path.dirname(dst) if update and not newer(src, dst): - if verbose == 1: + if verbose >= 1: log.debug("not copying %s (output up-to-date)", src) return dst, 0 @@ -133,7 +133,7 @@ raise ValueError, \ "invalid value '%s' for 'link' argument" % link - if verbose == 1: + if verbose >= 1: if os.path.basename(dst) == os.path.basename(src): log.info("%s %s -> %s", action, src, dir) else: @@ -194,7 +194,7 @@ from os.path import exists, isfile, isdir, basename, dirname import errno - if verbose == 1: + if verbose >= 1: log.info("moving %s -> %s", src, dst) if dry_run: From python-checkins at python.org Fri Feb 6 01:51:19 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 01:51:19 +0100 (CET) Subject: [Python-checkins] r69333 - python/branches/release26-maint Message-ID: <20090206005119.776C61E4049@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 01:51:19 2009 New Revision: 69333 Log: Blocked revisions 69330 via svnmerge ........ r69330 | tarek.ziade | 2009-02-06 01:46:57 +0100 (Fri, 06 Feb 2009) | 1 line README now reflects the current state ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri Feb 6 01:51:51 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 01:51:51 +0100 (CET) Subject: [Python-checkins] r69334 - python/branches/release26-maint Message-ID: <20090206005151.305961E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 01:51:51 2009 New Revision: 69334 Log: Blocked revisions 69332 via svnmerge ........ r69332 | tarek.ziade | 2009-02-06 01:49:45 +0100 (Fri, 06 Feb 2009) | 1 line using >= so setting verbose to 2 will work as well ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri Feb 6 01:52:52 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 01:52:52 +0100 (CET) Subject: [Python-checkins] r69335 - in python/branches/py3k: Lib/distutils/README Message-ID: <20090206005252.788F91E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 01:52:52 2009 New Revision: 69335 Log: Merged revisions 69330 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69330 | tarek.ziade | 2009-02-06 01:46:57 +0100 (Fri, 06 Feb 2009) | 1 line README now reflects the current state ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/README Modified: python/branches/py3k/Lib/distutils/README ============================================================================== --- python/branches/py3k/Lib/distutils/README (original) +++ python/branches/py3k/Lib/distutils/README Fri Feb 6 01:52:52 2009 @@ -1,22 +1,11 @@ -This directory contains only a subset of the Distutils, specifically -the Python modules in the 'distutils' and 'distutils.command' -packages. This is all you need to distribute and install Python -modules using the Distutils. There is also a separately packaged -standalone version of the Distutils available for people who want to -upgrade the Distutils without upgrading Python, available from the -Distutils web page: +This directory contains the Distutils package. - http://www.python.org/sigs/distutils-sig/ +There's a full documentation available at: -The standalone version includes all of the code in this directory, -plus documentation, test scripts, examples, etc. + http://docs.python.org/distutils/ -The Distutils documentation is divided into two documents, "Installing -Python Modules", which explains how to install Python packages, and -"Distributing Python Modules", which explains how to write setup.py -files. Both documents are part of the standard Python documentation -set, and are available from http://www.python.org/doc/current/ . +The Distutils-SIG web page is also a good starting point: - Greg Ward (gward at python.net) + http://www.python.org/sigs/distutils-sig/ $Id$ From python-checkins at python.org Fri Feb 6 01:53:43 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 01:53:43 +0100 (CET) Subject: [Python-checkins] r69336 - in python/branches/py3k: Lib/distutils/dir_util.py Lib/distutils/file_util.py Message-ID: <20090206005343.4BD821E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 01:53:43 2009 New Revision: 69336 Log: Merged revisions 69332 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69332 | tarek.ziade | 2009-02-06 01:49:45 +0100 (Fri, 06 Feb 2009) | 1 line using >= so setting verbose to 2 will work as well ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/dir_util.py python/branches/py3k/Lib/distutils/file_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 Fri Feb 6 01:53:43 2009 @@ -62,7 +62,7 @@ if _path_created.get(abs_head): continue - if verbose == 1: + if verbose >= 1: log.info("creating %s", head) if not dry_run: @@ -153,7 +153,7 @@ if preserve_symlinks and os.path.islink(src_name): link_dest = os.readlink(src_name) - if verbose == 1: + if verbose >= 1: log.info("linking %s -> %s", dst_name, link_dest) if not dry_run: os.symlink(link_dest, dst_name) @@ -190,7 +190,7 @@ from distutils.util import grok_environment_error global _path_created - if verbose == 1: + if verbose >= 1: log.info("removing '%s' (and everything under it)", directory) if dry_run: return Modified: python/branches/py3k/Lib/distutils/file_util.py ============================================================================== --- python/branches/py3k/Lib/distutils/file_util.py (original) +++ python/branches/py3k/Lib/distutils/file_util.py Fri Feb 6 01:53:43 2009 @@ -112,7 +112,7 @@ dir = os.path.dirname(dst) if update and not newer(src, dst): - if verbose == 1: + if verbose >= 1: log.debug("not copying %s (output up-to-date)", src) return (dst, 0) @@ -121,7 +121,7 @@ except KeyError: raise ValueError("invalid value '%s' for 'link' argument" % link) - if verbose == 1: + if verbose >= 1: if os.path.basename(dst) == os.path.basename(src): log.info("%s %s -> %s", action, src, dir) else: @@ -180,7 +180,7 @@ from os.path import exists, isfile, isdir, basename, dirname import errno - if verbose == 1: + if verbose >= 1: log.info("moving %s -> %s", src, dst) if dry_run: From python-checkins at python.org Fri Feb 6 01:53:43 2009 From: python-checkins at python.org (eric.smith) Date: Fri, 6 Feb 2009 01:53:43 +0100 (CET) Subject: [Python-checkins] r69337 - python/branches/release26-maint Message-ID: <20090206005343.68FA21E400C@bag.python.org> Author: eric.smith Date: Fri Feb 6 01:53:43 2009 New Revision: 69337 Log: Blocked revisions 69331 via svnmerge ........ r69331 | eric.smith | 2009-02-05 19:48:26 -0500 (Thu, 05 Feb 2009) | 2 lines Implement issue #4285, convert sys.version_info to a named tuple. Patch by Ross Light. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri Feb 6 01:54:46 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 01:54:46 +0100 (CET) Subject: [Python-checkins] r69338 - python/branches/release30-maint Message-ID: <20090206005446.8CDF31E4015@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 01:54:46 2009 New Revision: 69338 Log: Blocked revisions 69335 via svnmerge ................ r69335 | tarek.ziade | 2009-02-06 01:52:52 +0100 (Fri, 06 Feb 2009) | 9 lines Merged revisions 69330 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69330 | tarek.ziade | 2009-02-06 01:46:57 +0100 (Fri, 06 Feb 2009) | 1 line README now reflects the current state ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Fri Feb 6 01:55:05 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 01:55:05 +0100 (CET) Subject: [Python-checkins] r69339 - python/branches/release30-maint Message-ID: <20090206005505.9E2E11E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 01:55:05 2009 New Revision: 69339 Log: Blocked revisions 69336 via svnmerge ................ r69336 | tarek.ziade | 2009-02-06 01:53:43 +0100 (Fri, 06 Feb 2009) | 9 lines Merged revisions 69332 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69332 | tarek.ziade | 2009-02-06 01:49:45 +0100 (Fri, 06 Feb 2009) | 1 line using >= so setting verbose to 2 will work as well ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Fri Feb 6 02:02:20 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 6 Feb 2009 02:02:20 +0100 (CET) Subject: [Python-checkins] r69340 - sandbox/trunk/dbm_sqlite/alt/dbdict.py Message-ID: <20090206010220.824C81E4011@bag.python.org> Author: raymond.hettinger Date: Fri Feb 6 02:02:20 2009 New Revision: 69340 Log: More comments and better names. Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbdict.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbdict.py Fri Feb 6 02:02:20 2009 @@ -17,8 +17,8 @@ class DictDB(dict): def __init__(self, filename, flag='c', mode=None, format=None, *args, **kwds): - # flags: r=readonly c=create n=new_overwrite_previous - # mode: None or a triple like 0x666 + # flags: r=readonly c=create n=new + # mode: None or an octal triple like 0x666 # format: csv, json, or pickle (default is csv) self.flag = flag self.mode = mode @@ -44,7 +44,7 @@ os.remove(tempname) raise file.close() - shutil.move(file.name, self.filename) # atomic commit + shutil.move(tempname, self.filename) # atomic commit if self.mode is not None: os.chmod(self.filename, self.mode) From python-checkins at python.org Fri Feb 6 02:11:00 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 6 Feb 2009 02:11:00 +0100 (CET) Subject: [Python-checkins] r69341 - sandbox/trunk/dbm_sqlite/alt/dbdict.py Message-ID: <20090206011100.4370C1E4002@bag.python.org> Author: raymond.hettinger Date: Fri Feb 6 02:11:00 2009 New Revision: 69341 Log: Small cleanups. Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py Modified: sandbox/trunk/dbm_sqlite/alt/dbdict.py ============================================================================== --- sandbox/trunk/dbm_sqlite/alt/dbdict.py (original) +++ sandbox/trunk/dbm_sqlite/alt/dbdict.py Fri Feb 6 02:11:00 2009 @@ -16,13 +16,10 @@ class DictDB(dict): - def __init__(self, filename, flag='c', mode=None, format=None, *args, **kwds): - # flags: r=readonly c=create n=new - # mode: None or an octal triple like 0x666 - # format: csv, json, or pickle (default is csv) - self.flag = flag - self.mode = mode - self.format = format or 'csv' + def __init__(self, filename, flag=None, mode=None, format=None, *args, **kwds): + self.flag = flag or 'c' # r=readonly, c=create, or n=new + self.mode = mode # None or octal triple like 0x666 + self.format = format or 'csv' # csv, json, or pickle self.filename = filename if flag != 'n' and os.access(filename, os.R_OK): file = __builtins__.open(filename, 'rb') @@ -33,20 +30,21 @@ self.update(*args, **kwds) def sync(self): - if self.flag != 'r': - filename = self.filename - tempname = filename + '.tmp' - file = __builtins__.open(tempname, 'wb') - try: - self.dump(file) - except Exception: - file.close() - os.remove(tempname) - raise + if self.flag == 'r': + return + filename = self.filename + tempname = filename + '.tmp' + file = __builtins__.open(tempname, 'wb') + try: + self.dump(file) + except Exception: file.close() - shutil.move(tempname, self.filename) # atomic commit - if self.mode is not None: - os.chmod(self.filename, self.mode) + os.remove(tempname) + raise + file.close() + shutil.move(tempname, self.filename) # atomic commit + if self.mode is not None: + os.chmod(self.filename, self.mode) def close(self): self.sync() @@ -55,7 +53,7 @@ if self.format == 'csv': csv.writer(file).writerows(self.iteritems()) elif self.format == 'json': - json.dump(self, file, separators=(',',':')) + json.dump(self, file, separators=(',', ':')) elif self.format == 'pickle': pickle.dump(self.items(), file, -1) else: @@ -72,7 +70,7 @@ raise ValueError('File not in recognized format') -def dbopen(filename, flag='c', mode=None, format=None): +def dbopen(filename, flag=None, mode=None, format=None): return DictDB(filename, flag, mode, format) From python-checkins at python.org Fri Feb 6 02:15:51 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 02:15:51 +0100 (CET) Subject: [Python-checkins] r69342 - in python/trunk: Lib/distutils/sysconfig.py Lib/distutils/tests/test_sysconfig.py Misc/NEWS Message-ID: <20090206011552.02A2A1E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 02:15:51 2009 New Revision: 69342 Log: fixed #1520877: now distutils reads Read from the environment/Makefile Modified: python/trunk/Lib/distutils/sysconfig.py python/trunk/Lib/distutils/tests/test_sysconfig.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/sysconfig.py ============================================================================== --- python/trunk/Lib/distutils/sysconfig.py (original) +++ python/trunk/Lib/distutils/sysconfig.py Fri Feb 6 02:15:51 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) = \ + (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar) = \ get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', - 'CCSHARED', 'LDSHARED', 'SO') + 'CCSHARED', 'LDSHARED', 'SO', 'AR') if 'CC' in os.environ: cc = os.environ['CC'] @@ -188,6 +188,8 @@ cpp = cpp + ' ' + os.environ['CPPFLAGS'] cflags = cflags + ' ' + os.environ['CPPFLAGS'] ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] + if 'AR' in os.environ: + ar = os.environ['AR'] cc_cmd = cc + ' ' + cflags compiler.set_executables( @@ -196,7 +198,8 @@ compiler_so=cc_cmd + ' ' + ccshared, compiler_cxx=cxx, linker_so=ldshared, - linker_exe=cc) + linker_exe=cc, + archiver=ar) compiler.shared_lib_extension = so_ext 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 Feb 6 02:15:51 2009 @@ -8,6 +8,13 @@ class SysconfigTestCase(unittest.TestCase): + def setUp(self): + self.old_AR = os.environ.get('AR') + + def tearDown(self): + if self.old_AR is not None: + os.environ['AR'] = self.old_AR + def test_get_config_h_filename(self): config_h = sysconfig.get_config_h_filename() self.assert_(os.path.isfile(config_h), config_h) @@ -32,6 +39,21 @@ self.assert_(isinstance(cvars, dict)) self.assert_(cvars) + def test_customize_compiler(self): + + os.environ['AR'] = 'xxx' + + # make sure AR gets caught + class compiler: + compiler_type = 'unix' + + def set_executables(self, **kw): + self.exes = kw + + comp = compiler() + sysconfig.customize_compiler(comp) + self.assertEquals(comp.exes['archiver'], 'xxx') + def test_suite(): suite = unittest.TestSuite() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Feb 6 02:15:51 2009 @@ -149,6 +149,9 @@ Library ------- +- Issue #1520877: Now distutils.sysconfig reads $AR from the + environment/Makefile. Patch by Douglas Greiman. + - Issue #4285: Change sys.version_info to be a named tuple. Patch by Ross Light. From python-checkins at python.org Fri Feb 6 02:16:50 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 02:16:50 +0100 (CET) Subject: [Python-checkins] r69343 - python/branches/release26-maint Message-ID: <20090206011650.443041E4032@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 02:16:49 2009 New Revision: 69343 Log: Blocked revisions 69342 via svnmerge ........ r69342 | tarek.ziade | 2009-02-06 02:15:51 +0100 (Fri, 06 Feb 2009) | 1 line fixed #1520877: now distutils reads Read from the environment/Makefile ........ Modified: python/branches/release26-maint/ (props changed) From buildbot at python.org Fri Feb 6 02:17:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 01:17:13 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090206011713.6FAF41E4002@bag.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/1807 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Fri Feb 6 02:18:37 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 02:18:37 +0100 (CET) Subject: [Python-checkins] r69344 - in python/branches/py3k: Lib/distutils/sysconfig.py Lib/distutils/tests/test_sysconfig.py Misc/NEWS Message-ID: <20090206011837.A4B8F1E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 02:18:36 2009 New Revision: 69344 Log: Merged revisions 69342 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69342 | tarek.ziade | 2009-02-06 02:15:51 +0100 (Fri, 06 Feb 2009) | 1 line fixed #1520877: now distutils reads Read from the environment/Makefile ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/sysconfig.py python/branches/py3k/Lib/distutils/tests/test_sysconfig.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/distutils/sysconfig.py ============================================================================== --- python/branches/py3k/Lib/distutils/sysconfig.py (original) +++ python/branches/py3k/Lib/distutils/sysconfig.py Fri Feb 6 02:18:36 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) = \ + (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar) = \ get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', - 'CCSHARED', 'LDSHARED', 'SO') + 'CCSHARED', 'LDSHARED', 'SO', 'AR') if 'CC' in os.environ: cc = os.environ['CC'] @@ -183,6 +183,8 @@ cpp = cpp + ' ' + os.environ['CPPFLAGS'] cflags = cflags + ' ' + os.environ['CPPFLAGS'] ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] + if 'AR' in os.environ: + ar = os.environ['AR'] cc_cmd = cc + ' ' + cflags compiler.set_executables( @@ -191,7 +193,8 @@ compiler_so=cc_cmd + ' ' + ccshared, compiler_cxx=cxx, linker_so=ldshared, - linker_exe=cc) + linker_exe=cc, + archiver=ar) compiler.shared_lib_extension = so_ext 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 Feb 6 02:18:36 2009 @@ -8,6 +8,13 @@ class SysconfigTestCase(unittest.TestCase): + def setUp(self): + self.old_AR = os.environ.get('AR') + + def tearDown(self): + if self.old_AR is not None: + os.environ['AR'] = self.old_AR + def test_get_config_h_filename(self): config_h = sysconfig.get_config_h_filename() self.assert_(os.path.isfile(config_h), config_h) @@ -32,6 +39,21 @@ self.assert_(isinstance(cvars, dict)) self.assert_(cvars) + def test_customize_compiler(self): + + os.environ['AR'] = 'xxx' + + # make sure AR gets caught + class compiler: + compiler_type = 'unix' + + def set_executables(self, **kw): + self.exes = kw + + comp = compiler() + sysconfig.customize_compiler(comp) + self.assertEquals(comp.exes['archiver'], 'xxx') + def test_suite(): suite = unittest.TestSuite() Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri Feb 6 02:18:36 2009 @@ -155,6 +155,9 @@ Library ------- +- Issue #1520877: Now distutils.sysconfig reads $AR from the + environment/Makefile. Patch by Douglas Greiman. + - Issue #1276768: The verbose option was not used in the code of distutils.file_util and distutils.dir_util. From python-checkins at python.org Fri Feb 6 02:19:22 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 02:19:22 +0100 (CET) Subject: [Python-checkins] r69345 - python/branches/release30-maint Message-ID: <20090206011922.8D1851E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 02:19:22 2009 New Revision: 69345 Log: Blocked revisions 69344 via svnmerge ................ r69344 | tarek.ziade | 2009-02-06 02:18:36 +0100 (Fri, 06 Feb 2009) | 9 lines Merged revisions 69342 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69342 | tarek.ziade | 2009-02-06 02:15:51 +0100 (Fri, 06 Feb 2009) | 1 line fixed #1520877: now distutils reads Read from the environment/Makefile ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Fri Feb 6 02:32:43 2009 From: python-checkins at python.org (eric.smith) Date: Fri, 6 Feb 2009 02:32:43 +0100 (CET) Subject: [Python-checkins] r69346 - in python/branches/py3k: Doc/library/sys.rst Lib/test/test_sys.py Misc/NEWS Python/sysmodule.c Message-ID: <20090206013243.454B11E4002@bag.python.org> Author: eric.smith Date: Fri Feb 6 02:32:42 2009 New Revision: 69346 Log: Merged revisions 69331 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69331 | eric.smith | 2009-02-05 19:48:26 -0500 (Thu, 05 Feb 2009) | 2 lines Implement issue #4285, convert sys.version_info to a named tuple. Patch by Ross Light. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/sys.rst python/branches/py3k/Lib/test/test_sys.py python/branches/py3k/Misc/NEWS python/branches/py3k/Python/sysmodule.c Modified: python/branches/py3k/Doc/library/sys.rst ============================================================================== --- python/branches/py3k/Doc/library/sys.rst (original) +++ python/branches/py3k/Doc/library/sys.rst Fri Feb 6 02:32:42 2009 @@ -769,8 +769,12 @@ *micro*, *releaselevel*, and *serial*. All values except *releaselevel* are integers; the release level is ``'alpha'``, ``'beta'``, ``'candidate'``, or ``'final'``. The ``version_info`` value corresponding to the Python version 2.0 - is ``(2, 0, 0, 'final', 0)``. + is ``(2, 0, 0, 'final', 0)``. The components can also be accessed by name, + so ``sys.version_info[0]`` is equivalent to ``sys.version_info.major`` + and so on. + .. versionchanged:: 2.7 + Added named component attributes .. data:: warnoptions 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 Fri Feb 6 02:32:42 2009 @@ -298,13 +298,25 @@ self.assert_(isinstance(sys.prefix, str)) self.assert_(isinstance(sys.version, str)) vi = sys.version_info - self.assert_(isinstance(vi, tuple)) + self.assert_(isinstance(vi[:], tuple)) self.assertEqual(len(vi), 5) self.assert_(isinstance(vi[0], int)) self.assert_(isinstance(vi[1], int)) self.assert_(isinstance(vi[2], int)) self.assert_(vi[3] in ("alpha", "beta", "candidate", "final")) self.assert_(isinstance(vi[4], int)) + self.assert_(isinstance(vi.major, int)) + self.assert_(isinstance(vi.minor, int)) + self.assert_(isinstance(vi.micro, int)) + self.assert_(vi.releaselevel in + ("alpha", "beta", "candidate", "final")) + self.assert_(isinstance(vi.serial, int)) + self.assertEqual(vi[0], vi.major) + self.assertEqual(vi[1], vi.minor) + self.assertEqual(vi[2], vi.micro) + self.assertEqual(vi[3], vi.releaselevel) + self.assertEqual(vi[4], vi.serial) + self.assert_(vi > (1,0,0)) def test_43581(self): # Can't use sys.stdout, as this is a StringIO object when Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri Feb 6 02:32:42 2009 @@ -155,6 +155,9 @@ Library ------- +- Issue #4285: Change sys.version_info to be a named tuple. Patch by + Ross Light. + - Issue #1520877: Now distutils.sysconfig reads $AR from the environment/Makefile. Patch by Douglas Greiman. Modified: python/branches/py3k/Python/sysmodule.c ============================================================================== --- python/branches/py3k/Python/sysmodule.c (original) +++ python/branches/py3k/Python/sysmodule.c Fri Feb 6 02:32:42 2009 @@ -1017,7 +1017,7 @@ builtin_module_names -- tuple of module names built into this interpreter\n\ subversion -- subversion information of the build as tuple\n\ version -- the version of this interpreter as a string\n\ -version_info -- version information as a tuple\n\ +version_info -- version information as a named tuple\n\ hexversion -- version information encoded as a single integer\n\ copyright -- copyright notice pertaining to this interpreter\n\ platform -- platform identifier\n\ @@ -1227,6 +1227,75 @@ return seq; } +PyDoc_STRVAR(version_info__doc__, +"sys.version_info\n\ +\n\ +Version information as a named tuple."); + +static PyTypeObject VersionInfoType; + +static PyStructSequence_Field version_info_fields[] = { + {"major", "Major release number"}, + {"minor", "Minor release number"}, + {"micro", "Patch release number"}, + {"releaselevel", "'alpha', 'beta', 'candidate', or 'release'"}, + {"serial", "Serial release number"}, + {0} +}; + +static PyStructSequence_Desc version_info_desc = { + "sys.version_info", /* name */ + version_info__doc__, /* doc */ + version_info_fields, /* fields */ + 5 +}; + +static PyObject * +make_version_info(void) +{ + PyObject *version_info; + char *s; + int pos = 0; + + version_info = PyStructSequence_New(&VersionInfoType); + if (version_info == NULL) { + return NULL; + } + + /* + * These release level checks are mutually exclusive and cover + * the field, so don't get too fancy with the pre-processor! + */ +#if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_ALPHA + s = "alpha"; +#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_BETA + s = "beta"; +#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_GAMMA + s = "candidate"; +#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_FINAL + s = "final"; +#endif + +#define SetIntItem(flag) \ + PyStructSequence_SET_ITEM(version_info, pos++, PyLong_FromLong(flag)) +#define SetStrItem(flag) \ + PyStructSequence_SET_ITEM(version_info, pos++, PyUnicode_FromString(flag)) + + SetIntItem(PY_MAJOR_VERSION); + SetIntItem(PY_MINOR_VERSION); + SetIntItem(PY_MICRO_VERSION); + SetStrItem(s); + SetIntItem(PY_RELEASE_SERIAL); +#undef SetIntItem +#undef SetStrItem + + if (PyErr_Occurred()) { + Py_CLEAR(version_info); + return NULL; + } + return version_info; +} + static struct PyModuleDef sysmodule = { PyModuleDef_HEAD_INIT, "sys", @@ -1239,8 +1308,6 @@ NULL }; - - PyObject * _PySys_Init(void) { @@ -1291,25 +1358,6 @@ svn_revision)); SET_SYS_FROM_STRING("dont_write_bytecode", PyBool_FromLong(Py_DontWriteBytecodeFlag)); - /* - * These release level checks are mutually exclusive and cover - * the field, so don't get too fancy with the pre-processor! - */ -#if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_ALPHA - s = "alpha"; -#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_BETA - s = "beta"; -#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_GAMMA - s = "candidate"; -#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_FINAL - s = "final"; -#endif - - SET_SYS_FROM_STRING("version_info", - Py_BuildValue("iiiUi", PY_MAJOR_VERSION, - PY_MINOR_VERSION, - PY_MICRO_VERSION, s, - PY_RELEASE_SERIAL)); SET_SYS_FROM_STRING("api_version", PyLong_FromLong(PYTHON_API_VERSION)); SET_SYS_FROM_STRING("copyright", @@ -1361,6 +1409,15 @@ PyDict_SetItemString(sysdict, "warnoptions", warnoptions); } + /* version_info */ + if (VersionInfoType.tp_name == 0) + PyStructSequence_InitType(&VersionInfoType, &version_info_desc); + SET_SYS_FROM_STRING("version_info", make_version_info()); + /* prevent user from creating new instances */ + VersionInfoType.tp_init = NULL; + VersionInfoType.tp_new = NULL; + + /* flags */ if (FlagsType.tp_name == 0) PyStructSequence_InitType(&FlagsType, &flags_desc); SET_SYS_FROM_STRING("flags", make_flags()); From python-checkins at python.org Fri Feb 6 02:34:42 2009 From: python-checkins at python.org (eric.smith) Date: Fri, 6 Feb 2009 02:34:42 +0100 (CET) Subject: [Python-checkins] r69347 - python/branches/release30-maint Message-ID: <20090206013442.4663E1E4002@bag.python.org> Author: eric.smith Date: Fri Feb 6 02:34:42 2009 New Revision: 69347 Log: Blocked revisions 69346 via svnmerge ................ r69346 | eric.smith | 2009-02-05 20:32:42 -0500 (Thu, 05 Feb 2009) | 10 lines Merged revisions 69331 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69331 | eric.smith | 2009-02-05 19:48:26 -0500 (Thu, 05 Feb 2009) | 2 lines Implement issue #4285, convert sys.version_info to a named tuple. Patch by Ross Light. ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Fri Feb 6 02:45:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 01:45:38 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090206014538.D43FB1E4002@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/126 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 Fri Feb 6 02:47:31 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 6 Feb 2009 02:47:31 +0100 (CET) Subject: [Python-checkins] r69348 - python/trunk/Doc/tools/sphinxext/download.html Message-ID: <20090206014731.3C0921E4002@bag.python.org> Author: benjamin.peterson Date: Fri Feb 6 02:47:31 2009 New Revision: 69348 Log: fix download link Modified: python/trunk/Doc/tools/sphinxext/download.html Modified: python/trunk/Doc/tools/sphinxext/download.html ============================================================================== --- python/trunk/Doc/tools/sphinxext/download.html (original) +++ python/trunk/Doc/tools/sphinxext/download.html Fri Feb 6 02:47:31 2009 @@ -31,7 +31,7 @@ Download (ca. 4 MB) Plain Text - Download (ca. 2 MB) + Download (ca. 2 MB) Download (ca. 1.5 MB) From python-checkins at python.org Fri Feb 6 03:02:07 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 6 Feb 2009 03:02:07 +0100 (CET) Subject: [Python-checkins] r69349 - python/branches/py3k Message-ID: <20090206020207.72B701E4002@bag.python.org> Author: benjamin.peterson Date: Fri Feb 6 03:02:07 2009 New Revision: 69349 Log: Blocked revisions 69240,69242,69252-69253,69257,69262,69271-69273,69302-69305,69315,69322 via svnmerge ........ r69240 | raymond.hettinger | 2009-02-02 21:18:14 -0600 (Mon, 02 Feb 2009) | 1 line Record operator deprecations in docs. ........ r69242 | raymond.hettinger | 2009-02-02 21:37:03 -0600 (Mon, 02 Feb 2009) | 1 line Register decimals as numbers.Number ........ r69252 | brett.cannon | 2009-02-02 22:58:29 -0600 (Mon, 02 Feb 2009) | 3 lines Make importlib a package. This allows using svn:externals in the sandbox to package up the code for separate distribution. ........ r69253 | brett.cannon | 2009-02-02 22:59:58 -0600 (Mon, 02 Feb 2009) | 1 line Ignore bytecode files in importlib. ........ r69257 | brett.cannon | 2009-02-02 23:08:22 -0600 (Mon, 02 Feb 2009) | 1 line Backport importlib to at least Python 2.5 by getting rid of use of str.format. ........ r69262 | brett.cannon | 2009-02-03 15:13:05 -0600 (Tue, 03 Feb 2009) | 5 lines Make importlib backwards-compatible to Python 2.2 (but this is not promised to last; just doing it to be nice). Also fix a message for an exception. ........ r69271 | raymond.hettinger | 2009-02-04 04:52:32 -0600 (Wed, 04 Feb 2009) | 1 line Minor doc fixups. ........ r69272 | raymond.hettinger | 2009-02-04 05:14:18 -0600 (Wed, 04 Feb 2009) | 1 line Doc fixes. Remove overbroad, redundant warnings. Fixup example code. ........ r69273 | raymond.hettinger | 2009-02-04 05:31:30 -0600 (Wed, 04 Feb 2009) | 1 line Tweak the docs for Counter() objects. ........ r69302 | neil.schemenauer | 2009-02-05 10:14:39 -0600 (Thu, 05 Feb 2009) | 3 lines Fix get_python_inc() to work when building in a directory separate from the source. Also, define 'srcdir' on non-posix platforms. ........ r69303 | neil.schemenauer | 2009-02-05 10:19:05 -0600 (Thu, 05 Feb 2009) | 4 lines Since sysconfig.get_python_inc() now works when building in a directory other than the source directory, simplify the test code in test_sysconfig.py. ........ r69304 | neil.schemenauer | 2009-02-05 10:25:16 -0600 (Thu, 05 Feb 2009) | 4 lines Fix test_build_ext.py to work when building in a separate directory. Since "srcdir" should now be defined on all platforms, use it to find the module source. ........ r69305 | neil.schemenauer | 2009-02-05 10:32:29 -0600 (Thu, 05 Feb 2009) | 4 lines Make setup.py work when building in a directory other than the source directory. Mainly use 'srcdir' rather than os.getcwd() or '.'. ........ r69315 | neil.schemenauer | 2009-02-05 16:14:04 -0600 (Thu, 05 Feb 2009) | 2 lines Oops, Mac build needs the 'incdirlist' variable so restore it. ........ r69322 | neil.schemenauer | 2009-02-05 18:21:55 -0600 (Thu, 05 Feb 2009) | 2 lines Distutils apparently requires an absolute path so provide one. ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Fri Feb 6 03:11:04 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 02:11:04 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090206021104.B2CAC1E4002@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/95 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: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Fri Feb 6 03:33:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 02:33:29 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20090206023329.BB01E1E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%203.0/builds/111 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 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_email test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 6 03:35:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 02:35:25 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090206023525.39AD21E4013@bag.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/198 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: benjamin.peterson BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Fri Feb 6 03:37:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 02:37:06 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090206023706.E01CE1E4002@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/4589 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: eric.smith,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Killed sincerely, -The Buildbot From python-checkins at python.org Fri Feb 6 03:40:08 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 6 Feb 2009 03:40:08 +0100 (CET) Subject: [Python-checkins] r69350 - in python/branches/py3k: Doc/c-api/exceptions.rst Doc/c-api/init.rst Doc/library/ctypes.rst Doc/library/optparse.rst Doc/library/threading.rst Doc/tools/sphinxext/download.html Doc/tools/sphinxext/pyspecific.py Doc/tutorial/floatingpoint.rst Doc/whatsnew/2.7.rst Lib/heapq.py Lib/test/test_hash.py Lib/test/test_os.py Lib/test/test_socket.py Lib/test/test_tcl.py Misc/NEWS Modules/socketmodule.c Python/compile.c Message-ID: <20090206024008.427401E4002@bag.python.org> Author: benjamin.peterson Date: Fri Feb 6 03:40:07 2009 New Revision: 69350 Log: Merged revisions 69129-69131,69139-69140,69143,69154-69159,69169,69288-69289,69293,69297-69301,69348 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69129 | benjamin.peterson | 2009-01-30 19:42:55 -0600 (Fri, 30 Jan 2009) | 1 line check the errno in bad fd cases ........ r69130 | andrew.kuchling | 2009-01-30 20:50:09 -0600 (Fri, 30 Jan 2009) | 1 line Add a section ........ r69131 | andrew.kuchling | 2009-01-30 21:26:02 -0600 (Fri, 30 Jan 2009) | 1 line Text edits and markup fixes ........ r69139 | mark.dickinson | 2009-01-31 10:44:04 -0600 (Sat, 31 Jan 2009) | 2 lines Add an extra test for long <-> float hash equivalence. ........ r69140 | benjamin.peterson | 2009-01-31 10:52:03 -0600 (Sat, 31 Jan 2009) | 1 line PyErr_BadInternalCall() raises a SystemError, not TypeError #5112 ........ r69143 | benjamin.peterson | 2009-01-31 15:00:10 -0600 (Sat, 31 Jan 2009) | 1 line I believe the intention here was to avoid a global lookup ........ r69154 | benjamin.peterson | 2009-01-31 16:33:02 -0600 (Sat, 31 Jan 2009) | 1 line fix indentation in comment ........ r69155 | david.goodger | 2009-01-31 16:53:46 -0600 (Sat, 31 Jan 2009) | 1 line markup fix ........ r69156 | gregory.p.smith | 2009-01-31 16:57:30 -0600 (Sat, 31 Jan 2009) | 4 lines - Issue #5104: The socket module now raises OverflowError when 16-bit port and protocol numbers are supplied outside the allowed 0-65536 range on bind() and getservbyport(). ........ r69157 | benjamin.peterson | 2009-01-31 17:43:25 -0600 (Sat, 31 Jan 2009) | 1 line add explanatory comment ........ r69158 | benjamin.peterson | 2009-01-31 17:54:38 -0600 (Sat, 31 Jan 2009) | 1 line more flags which only work for function blocks ........ r69159 | gregory.p.smith | 2009-01-31 18:16:01 -0600 (Sat, 31 Jan 2009) | 2 lines Update doc wording as suggested in issue4903. ........ r69169 | guilherme.polo | 2009-01-31 20:56:16 -0600 (Sat, 31 Jan 2009) | 3 lines Restore Tkinter.Tk._loadtk so this test doesn't fail for problems related to ttk. ........ r69288 | georg.brandl | 2009-02-05 04:30:57 -0600 (Thu, 05 Feb 2009) | 1 line #5153: fix typo in example. ........ r69289 | georg.brandl | 2009-02-05 04:37:07 -0600 (Thu, 05 Feb 2009) | 1 line #5144: document that PySys_SetArgv prepends the script directory (or the empty string) to sys.path. ........ r69293 | georg.brandl | 2009-02-05 04:59:28 -0600 (Thu, 05 Feb 2009) | 1 line #5059: fix example. ........ r69297 | georg.brandl | 2009-02-05 05:32:18 -0600 (Thu, 05 Feb 2009) | 1 line #5015: document PythonHome API functions. ........ r69298 | georg.brandl | 2009-02-05 05:33:21 -0600 (Thu, 05 Feb 2009) | 1 line #4827: fix callback example. ........ r69299 | georg.brandl | 2009-02-05 05:35:28 -0600 (Thu, 05 Feb 2009) | 1 line #4820: use correct module for ctypes.util. ........ r69300 | georg.brandl | 2009-02-05 05:38:23 -0600 (Thu, 05 Feb 2009) | 1 line #4563: disable alpha and roman lists, fixes wrong formatting of contributor list. ........ r69301 | georg.brandl | 2009-02-05 05:40:35 -0600 (Thu, 05 Feb 2009) | 1 line #5031: fix Thread.daemon property docs. ........ r69348 | benjamin.peterson | 2009-02-05 19:47:31 -0600 (Thu, 05 Feb 2009) | 1 line fix download link ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/c-api/exceptions.rst python/branches/py3k/Doc/c-api/init.rst python/branches/py3k/Doc/library/ctypes.rst python/branches/py3k/Doc/library/optparse.rst python/branches/py3k/Doc/library/threading.rst python/branches/py3k/Doc/tools/sphinxext/download.html python/branches/py3k/Doc/tools/sphinxext/pyspecific.py python/branches/py3k/Doc/tutorial/floatingpoint.rst python/branches/py3k/Doc/whatsnew/2.7.rst python/branches/py3k/Lib/heapq.py python/branches/py3k/Lib/test/test_hash.py python/branches/py3k/Lib/test/test_os.py python/branches/py3k/Lib/test/test_socket.py python/branches/py3k/Lib/test/test_tcl.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/socketmodule.c python/branches/py3k/Python/compile.c Modified: python/branches/py3k/Doc/c-api/exceptions.rst ============================================================================== --- python/branches/py3k/Doc/c-api/exceptions.rst (original) +++ python/branches/py3k/Doc/c-api/exceptions.rst Fri Feb 6 03:40:07 2009 @@ -280,9 +280,10 @@ .. cfunction:: void PyErr_BadInternalCall() - This is a shorthand for ``PyErr_SetString(PyExc_TypeError, message)``, where - *message* indicates that an internal operation (e.g. a Python/C API function) - was invoked with an illegal argument. It is mostly for internal use. + This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, + where *message* indicates that an internal operation (e.g. a Python/C API + function) was invoked with an illegal argument. It is mostly for internal + use. .. cfunction:: int PyErr_WarnEx(PyObject *category, char *message, int stacklevel) 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 Feb 6 03:40:07 2009 @@ -350,18 +350,36 @@ single: Py_FatalError() single: argv (in module sys) - Set ``sys.argv`` based on *argc* and *argv*. These parameters are similar to - those passed to the program's :cfunc:`main` function with the difference that - the first entry should refer to the script file to be executed rather than the - executable hosting the Python interpreter. If there isn't a script that will be - run, the first entry in *argv* can be an empty string. If this function fails - to initialize ``sys.argv``, a fatal condition is signalled using - :cfunc:`Py_FatalError`. + Set :data:`sys.argv` based on *argc* and *argv*. These parameters are + similar to those passed to the program's :cfunc:`main` function with the + difference that the first entry should refer to the script file to be + executed rather than the executable hosting the Python interpreter. If there + isn't a script that will be run, the first entry in *argv* can be an empty + string. If this function fails to initialize :data:`sys.argv`, a fatal + condition is signalled using :cfunc:`Py_FatalError`. + + This function also prepends the executed script's path to :data:`sys.path`. + If no script is executed (in the case of calling ``python -c`` or just the + interactive interpreter), the empty string is used instead. .. XXX impl. doesn't seem consistent in allowing 0/NULL for the params; check w/ Guido. +.. cfunction:: void Py_SetPythonHome(char *home) + + Set the default "home" directory, that is, the location of the standard + Python libraries. The libraries are searched in + :file:`{home}/lib/python{version}` and :file:`{home}/lib/python{version}`. + + +.. cfunction:: char* Py_GetPythonHome() + + Return the default "home", that is, the value set by a previous call to + :cfunc:`Py_SetPythonHome`, or the value of the :envvar:`PYTHONHOME` + environment variable if it is set. + + .. _threads: Thread State and the Global Interpreter Lock Modified: python/branches/py3k/Doc/library/ctypes.rst ============================================================================== --- python/branches/py3k/Doc/library/ctypes.rst (original) +++ python/branches/py3k/Doc/library/ctypes.rst Fri Feb 6 03:40:07 2009 @@ -1272,6 +1272,7 @@ .. data:: find_library(name) + :module: ctypes.util :noindex: Try to find a library and return a pathname. *name* is the library name without Modified: python/branches/py3k/Doc/library/optparse.rst ============================================================================== --- python/branches/py3k/Doc/library/optparse.rst (original) +++ python/branches/py3k/Doc/library/optparse.rst Fri Feb 6 03:40:07 2009 @@ -1506,7 +1506,7 @@ records that the option was seen:: def record_foo_seen(option, opt_str, value, parser): - parser.saw_foo = True + parser.values.saw_foo = True parser.add_option("--foo", action="callback", callback=record_foo_seen) @@ -1646,7 +1646,7 @@ value.append(arg) del parser.rargs[:len(value)] - setattr(parser.values, option.dest, value)) + setattr(parser.values, option.dest, value) [...] parser.add_option("-c", "--callback", dest="vararg_attr", Modified: python/branches/py3k/Doc/library/threading.rst ============================================================================== --- python/branches/py3k/Doc/library/threading.rst (original) +++ python/branches/py3k/Doc/library/threading.rst Fri Feb 6 03:40:07 2009 @@ -198,7 +198,7 @@ A thread can be flagged as a "daemon thread". The significance of this flag is that the entire Python program exits when only daemon threads are left. The initial value is inherited from the creating thread. The flag can be set -through the :attr:`daemon` attribute. +through the :attr:`daemon` property. There is a "main thread" object; this corresponds to the initial thread of control in the Python program. It is not a daemon thread. @@ -312,10 +312,11 @@ .. attribute:: Thread.daemon - The thread's daemon flag. This must be set before :meth:`start` is called, - otherwise :exc:`RuntimeError` is raised. - - The initial value is inherited from the creating thread. + A boolean value indicating whether this thread is a daemon thread (True) or + not (False). This must be set before :meth:`start` is called, otherwise + :exc:`RuntimeError` is raised. Its initial value is inherited from the + creating thread; the main thread is not a daemon thread and therefore all + threads created in the main thread default to :attr:`daemon` = ``False``. The entire Python program exits when no alive non-daemon threads are left. Modified: python/branches/py3k/Doc/tools/sphinxext/download.html ============================================================================== --- python/branches/py3k/Doc/tools/sphinxext/download.html (original) +++ python/branches/py3k/Doc/tools/sphinxext/download.html Fri Feb 6 03:40:07 2009 @@ -31,7 +31,7 @@ Download (ca. 4 MB) Plain Text - Download (ca. 2 MB) + Download (ca. 2 MB) Download (ca. 1.5 MB) Modified: python/branches/py3k/Doc/tools/sphinxext/pyspecific.py ============================================================================== --- python/branches/py3k/Doc/tools/sphinxext/pyspecific.py (original) +++ python/branches/py3k/Doc/tools/sphinxext/pyspecific.py Fri Feb 6 03:40:07 2009 @@ -13,6 +13,14 @@ from docutils import nodes, utils +# monkey-patch reST parser to disable alphabetic and roman enumerated lists +from docutils.parsers.rst.states import Body +Body.enum.converters['loweralpha'] = \ + Body.enum.converters['upperalpha'] = \ + Body.enum.converters['lowerroman'] = \ + Body.enum.converters['upperroman'] = lambda x: None + + def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): issue = utils.unescape(text) text = 'issue ' + issue Modified: python/branches/py3k/Doc/tutorial/floatingpoint.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/floatingpoint.rst (original) +++ python/branches/py3k/Doc/tutorial/floatingpoint.rst Fri Feb 6 03:40:07 2009 @@ -200,7 +200,7 @@ machines today (November 2000) use IEEE-754 floating point arithmetic, and almost all platforms map Python floats to IEEE-754 "double precision". 754 doubles contain 53 bits of precision, so on input the computer strives to -convert 0.1 to the closest fraction it can of the form *J*/2\*\**N* where *J* is +convert 0.1 to the closest fraction it can of the form *J*/2**\ *N* where *J* is an integer containing exactly 53 bits. Rewriting :: 1 / 10 ~= J / (2**N) 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 Feb 6 03:40:07 2009 @@ -197,6 +197,23 @@ .. ====================================================================== .. whole new modules get described in subsections here +ttk: Themed Widgets for Tk +-------------------------- + +Tcl/Tk 8.5 includes a set of themed widgets that re-implement basic Tk +widgets but have a more customizable appearance and can therefore more +closely resemble the native platform's widgets. This widget +set was originally called Tile, but was renamed to Ttk (for "themed Tk") +on being added to Tcl/Tck release 8.5. + +XXX write a brief discussion and an example here. + +The :mod:`ttk` module was written by Guilherme Polo and added in +:issue:`2983`. An alternate version called ``Tile.py``, written by +Martin Franklin and maintained by Kevin Walzer, was proposed for +inclusion in :issue:`2618`, but the authors argued that Guilherme +Polo's work was more comprehensive. + .. ====================================================================== Modified: python/branches/py3k/Lib/heapq.py ============================================================================== --- python/branches/py3k/Lib/heapq.py (original) +++ python/branches/py3k/Lib/heapq.py Fri Feb 6 03:40:07 2009 @@ -195,7 +195,7 @@ heapify(result) _heappushpop = heappushpop for elem in it: - heappushpop(result, elem) + _heappushpop(result, elem) result.sort(reverse=True) return result Modified: python/branches/py3k/Lib/test/test_hash.py ============================================================================== --- python/branches/py3k/Lib/test/test_hash.py (original) +++ python/branches/py3k/Lib/test/test_hash.py Fri Feb 6 03:40:07 2009 @@ -33,6 +33,7 @@ # for 64-bit platforms self.same_hash(int(2**31), float(2**31)) self.same_hash(int(-2**63), float(-2**63)) + self.same_hash(long(2**63), float(2**63)) def test_coerced_floats(self): self.same_hash(int(1.23e300), float(1.23e300)) 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 Fri Feb 6 03:40:07 2009 @@ -3,6 +3,7 @@ # portable than they had been thought to be. import os +import errno import unittest import warnings import sys @@ -277,7 +278,6 @@ result = os.statvfs(self.fname) except OSError as e: # On AtheOS, glibc always returns ENOSYS - import errno if e.errno == errno.ENOSYS: return @@ -601,7 +601,13 @@ locals()["test_"+f] = get_single(f) def check(self, f, *args): - self.assertRaises(OSError, f, support.make_bad_fd(), *args) + try: + f(support.make_bad_fd(), *args) + except OSError as e: + self.assertEqual(e.errno, errno.EBADF) + else: + self.fail("%r didn't raise a OSError with a bad file descriptor" + % f) def test_isatty(self): if hasattr(os, "isatty"): Modified: python/branches/py3k/Lib/test/test_socket.py ============================================================================== --- python/branches/py3k/Lib/test/test_socket.py (original) +++ python/branches/py3k/Lib/test/test_socket.py Fri Feb 6 03:40:07 2009 @@ -366,6 +366,9 @@ eq(socket.getservbyport(port, 'tcp'), service) if udpport is not None: eq(socket.getservbyport(udpport, 'udp'), service) + # Make sure getservbyport does not accept out of range ports. + self.assertRaises(OverflowError, socket.getservbyport, -1) + self.assertRaises(OverflowError, socket.getservbyport, 65536) def testDefaultTimeout(self): # Testing default timeout @@ -466,15 +469,23 @@ # XXX The following don't test module-level functionality... - def testSockName(self): - # Testing getsockname(). Use a temporary socket to elicit an unused - # ephemeral port that we can use later in the test. + def _get_unused_port(self, bind_address='0.0.0.0'): + """Use a temporary socket to elicit an unused ephemeral port. + + Args: + bind_address: Hostname or IP address to search for a port on. + + Returns: A most likely to be unused port. + """ tempsock = socket.socket() - tempsock.bind(("0.0.0.0", 0)) - (host, port) = tempsock.getsockname() + tempsock.bind((bind_address, 0)) + host, port = tempsock.getsockname() tempsock.close() - del tempsock + return port + def testSockName(self): + # Testing getsockname() + port = self._get_unused_port() sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.bind(("0.0.0.0", port)) name = sock.getsockname() @@ -514,6 +525,19 @@ self.assertEqual(sock.proto, 0) sock.close() + def test_getsockaddrarg(self): + host = '0.0.0.0' + port = self._get_unused_port(bind_address=host) + big_port = port + 65536 + neg_port = port - 65536 + sock = socket.socket() + try: + self.assertRaises(OverflowError, sock.bind, (host, big_port)) + self.assertRaises(OverflowError, sock.bind, (host, neg_port)) + sock.bind((host, port)) + finally: + sock.close() + def test_sock_ioctl(self): if os.name != "nt": return 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 Feb 6 03:40:07 2009 @@ -4,9 +4,15 @@ import os import _tkinter from test import support -from tkinter import Tcl +from tkinter import Tk, Tcl from _tkinter import TclError +# Restore Tkinter.Tk._loadtk that may have been overridden by ttk. +# If this is not done then this test may fail for reasons related +# to ttk only (like failing to load the tile package). +from ttk import __loadtk__ +Tk._loadtk = __loadtk__ + class TkinterTest(unittest.TestCase): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri Feb 6 03:40:07 2009 @@ -382,6 +382,10 @@ - Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on biarch systems. Try to rely on ldconfig only, without using objdump and gcc. +- Issue #5104: The socket module now raises OverflowError when 16-bit port and + protocol numbers are supplied outside the allowed 0-65536 range on bind() + and getservbyport(). + Tools/Demos ----------- Modified: python/branches/py3k/Modules/socketmodule.c ============================================================================== --- python/branches/py3k/Modules/socketmodule.c (original) +++ python/branches/py3k/Modules/socketmodule.c Fri Feb 6 03:40:07 2009 @@ -1223,6 +1223,12 @@ PyMem_Free(host); if (result < 0) return 0; + if (port < 0 || port > 0xffff) { + PyErr_SetString( + PyExc_OverflowError, + "getsockaddrarg: port must be 0-65535."); + return 0; + } addr->sin_family = AF_INET; addr->sin_port = htons((short)port); *len_ret = sizeof *addr; @@ -1255,6 +1261,12 @@ PyMem_Free(host); if (result < 0) return 0; + if (port < 0 || port > 0xffff) { + PyErr_SetString( + PyExc_OverflowError, + "getsockaddrarg: port must be 0-65535."); + return 0; + } addr->sin6_family = s->sock_family; addr->sin6_port = htons((short)port); addr->sin6_flowinfo = flowinfo; @@ -1381,6 +1393,12 @@ "Hardware address must be 8 bytes or less"); return 0; } + if (protoNumber < 0 || protoNumber > 0xffff) { + PyErr_SetString( + PyExc_OverflowError, + "getsockaddrarg: protoNumber must be 0-65535."); + return 0; + } addr = (struct sockaddr_ll*)addr_ret; addr->sll_family = AF_PACKET; addr->sll_protocol = htons((short)protoNumber); @@ -3271,13 +3289,19 @@ static PyObject * socket_getservbyport(PyObject *self, PyObject *args) { - unsigned short port; + int port; char *proto=NULL; struct servent *sp; - if (!PyArg_ParseTuple(args, "H|s:getservbyport", &port, &proto)) + if (!PyArg_ParseTuple(args, "i|s:getservbyport", &port, &proto)) + return NULL; + if (port < 0 || port > 0xffff) { + PyErr_SetString( + PyExc_OverflowError, + "getservbyport: port must be 0-65535."); return NULL; + } Py_BEGIN_ALLOW_THREADS - sp = getservbyport(htons(port), proto); + sp = getservbyport(htons((short)port), proto); Py_END_ALLOW_THREADS if (sp == NULL) { PyErr_SetString(socket_error, "port/proto not found"); Modified: python/branches/py3k/Python/compile.c ============================================================================== --- python/branches/py3k/Python/compile.c (original) +++ python/branches/py3k/Python/compile.c Fri Feb 6 03:40:07 2009 @@ -4006,6 +4006,8 @@ return NULL; while (PyDict_Next(dict, &pos, &k, &v)) { i = PyLong_AS_LONG(v); + /* The keys of the dictionary are tuples. (see compiler_add_o) + The object we want is always first, though. */ k = PyTuple_GET_ITEM(k, 0); Py_INCREF(k); assert((i - offset) < size); @@ -4029,13 +4031,11 @@ flags |= CO_NESTED; if (ste->ste_generator) flags |= CO_GENERATOR; + if (ste->ste_varargs) + flags |= CO_VARARGS; + if (ste->ste_varkeywords) + flags |= CO_VARKEYWORDS; } - if (ste->ste_varargs) - flags |= CO_VARARGS; - if (ste->ste_varkeywords) - flags |= CO_VARKEYWORDS; - if (ste->ste_generator) - flags |= CO_GENERATOR; /* (Only) inherit compilerflags in PyCF_MASK */ flags |= (c->c_flags->cf_flags & PyCF_MASK); From python-checkins at python.org Fri Feb 6 03:42:50 2009 From: python-checkins at python.org (brett.cannon) Date: Fri, 6 Feb 2009 03:42:50 +0100 (CET) Subject: [Python-checkins] r69351 - peps/trunk/pep-0302.txt Message-ID: <20090206024250.CC8C21E402A@bag.python.org> Author: brett.cannon Date: Fri Feb 6 03:42:50 2009 New Revision: 69351 Log: Fix a typo and strip some whitespace. Modified: peps/trunk/pep-0302.txt Modified: peps/trunk/pep-0302.txt ============================================================================== --- peps/trunk/pep-0302.txt (original) +++ peps/trunk/pep-0302.txt Fri Feb 6 03:42:50 2009 @@ -223,11 +223,11 @@ loader.load_module(fullname) - This method returns the loaded module or raises and exception, + This method returns the loaded module or raises an exception, preferably ImportError if an existing exception is not being propagated. If load_module() is asked to load a module that it cannot, ImportError is to be raised. - + In many cases the importer and loader can be one and the same object: importer.find_module() would just return self. @@ -384,7 +384,7 @@ d = os.path.dirname(__file__) data = __loader__.get_data(os.path.join(d, "logo.gif")) - + The following set of methods may be implemented if support for (for example) Freeze-like tools is desirable. It consists of three additional methods which, to make it easier for the caller, each of @@ -514,7 +514,7 @@ a new module implementing a subset of ihooks as a new-style importer, or add a hookable built-in path importer object. - There is no specific support within this PEP for "stacking" hooks. + There is no specific support within this PEP for "stacking" hooks. For example, it is not obvious how to write a hook to load modules from ..tar.gz files by combining separate hooks to load modules from .tar and ..gz files. However, there is no support for such stacking From python-checkins at python.org Fri Feb 6 03:47:33 2009 From: python-checkins at python.org (brett.cannon) Date: Fri, 6 Feb 2009 03:47:33 +0100 (CET) Subject: [Python-checkins] r69352 - in python/branches/py3k/Lib/importlib: NOTES _bootstrap.py Message-ID: <20090206024733.D1F861E4002@bag.python.org> Author: brett.cannon Date: Fri Feb 6 03:47:33 2009 New Revision: 69352 Log: Initial, untested stab at writing a common denominator function for __import__ and import_module. Modified: python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/_bootstrap.py Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Fri Feb 6 03:47:33 2009 @@ -15,6 +15,19 @@ + Create a greatest common denominator function for __import__/import_module that takes in an absolute module name and performs the import. + + - Needs of __import__ + + * Figure out caller's package. + * Import module. + * Set __package__. + * Figure out what module to return. + + - Needs of import_module + + * Resolve name/level. + * Import module. + + Use GCD import for __import__. + Use GCD import for import_module. Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Fri Feb 6 03:47:33 2009 @@ -676,6 +676,48 @@ imp.release_lock() +def _gcd_import(name, package=None, level=0): + """Import and return the module based on its name, the package the call is + being made from, and the level adjustment. + + This function represents the greatest common denominator of functionality + between import_module and __import__. + """ + if package and package not in sys.modules: + msg = "Parent module {0!r} not loaded, cannot perform relative import" + raise SystemError(msg.format(package)) + dot = len(package) + if level > 0: + for x in range(level, 1, -1): + try: + dot = package.rindex('.', 0, dot) + except AttributeError: + raise ValueError("__package__ not set to a string") + except ValueError: + raise ValueError("attempted relative import beyond top-level " + "package") + name = "{0}.{1}".format(package[:dot], name) + with ImportLockContext(): + try: + return sys.modules[name] + except KeyError: + pass + parent = name.rpartition('.')[0] + path = None + if parent: + if parent not in sys.modules: + parent_module = _gcd_import(parent) + else: + parent_module = sys.modules[parent] + path = parent_module.__path__ + for finder in sys.meta_path + [PathFinder]: + loader = finder.find_module(name, path) + if loader: # XXX Worth checking for None explicitly? + return loader.load_module(name) + else: + raise ImportError("No module named {0}".format(name)) + + class Import(object): """Class that implements the __import__ interface. @@ -950,6 +992,7 @@ (e.g. has a value of 2 for ``from .. import foo``). """ + # TODO(brett.cannon) outdated check; just care that level >= 0 if not name and level < 1: raise ValueError("Empty module name") is_pkg = True if '__path__' in globals else False From python-checkins at python.org Fri Feb 6 03:50:20 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 6 Feb 2009 03:50:20 +0100 (CET) Subject: [Python-checkins] r69353 - in python/branches/release30-maint: Doc/c-api/exceptions.rst Doc/c-api/init.rst Doc/library/ctypes.rst Doc/library/optparse.rst Doc/library/threading.rst Doc/tools/sphinxext/download.html Doc/tools/sphinxext/pyspecific.py Doc/tutorial/floatingpoint.rst Doc/whatsnew/2.7.rst Lib/heapq.py Lib/test/test_hash.py Lib/test/test_os.py Lib/test/test_socket.py Lib/test/test_tcl.py Misc/NEWS Modules/socketmodule.c Python/compile.c Message-ID: <20090206025020.0F4631E4002@bag.python.org> Author: benjamin.peterson Date: Fri Feb 6 03:50:18 2009 New Revision: 69353 Log: Merged revisions 69350 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69350 | benjamin.peterson | 2009-02-05 20:40:07 -0600 (Thu, 05 Feb 2009) | 96 lines Merged revisions 69129-69131,69139-69140,69143,69154-69159,69169,69288-69289,69293,69297-69301,69348 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69129 | benjamin.peterson | 2009-01-30 19:42:55 -0600 (Fri, 30 Jan 2009) | 1 line check the errno in bad fd cases ........ r69130 | andrew.kuchling | 2009-01-30 20:50:09 -0600 (Fri, 30 Jan 2009) | 1 line Add a section ........ r69131 | andrew.kuchling | 2009-01-30 21:26:02 -0600 (Fri, 30 Jan 2009) | 1 line Text edits and markup fixes ........ r69139 | mark.dickinson | 2009-01-31 10:44:04 -0600 (Sat, 31 Jan 2009) | 2 lines Add an extra test for long <-> float hash equivalence. ........ r69140 | benjamin.peterson | 2009-01-31 10:52:03 -0600 (Sat, 31 Jan 2009) | 1 line PyErr_BadInternalCall() raises a SystemError, not TypeError #5112 ........ r69143 | benjamin.peterson | 2009-01-31 15:00:10 -0600 (Sat, 31 Jan 2009) | 1 line I believe the intention here was to avoid a global lookup ........ r69154 | benjamin.peterson | 2009-01-31 16:33:02 -0600 (Sat, 31 Jan 2009) | 1 line fix indentation in comment ........ r69155 | david.goodger | 2009-01-31 16:53:46 -0600 (Sat, 31 Jan 2009) | 1 line markup fix ........ r69156 | gregory.p.smith | 2009-01-31 16:57:30 -0600 (Sat, 31 Jan 2009) | 4 lines - Issue #5104: The socket module now raises OverflowError when 16-bit port and protocol numbers are supplied outside the allowed 0-65536 range on bind() and getservbyport(). ........ r69157 | benjamin.peterson | 2009-01-31 17:43:25 -0600 (Sat, 31 Jan 2009) | 1 line add explanatory comment ........ r69158 | benjamin.peterson | 2009-01-31 17:54:38 -0600 (Sat, 31 Jan 2009) | 1 line more flags which only work for function blocks ........ r69159 | gregory.p.smith | 2009-01-31 18:16:01 -0600 (Sat, 31 Jan 2009) | 2 lines Update doc wording as suggested in issue4903. ........ r69169 | guilherme.polo | 2009-01-31 20:56:16 -0600 (Sat, 31 Jan 2009) | 3 lines Restore Tkinter.Tk._loadtk so this test doesn't fail for problems related to ttk. ........ r69288 | georg.brandl | 2009-02-05 04:30:57 -0600 (Thu, 05 Feb 2009) | 1 line #5153: fix typo in example. ........ r69289 | georg.brandl | 2009-02-05 04:37:07 -0600 (Thu, 05 Feb 2009) | 1 line #5144: document that PySys_SetArgv prepends the script directory (or the empty string) to sys.path. ........ r69293 | georg.brandl | 2009-02-05 04:59:28 -0600 (Thu, 05 Feb 2009) | 1 line #5059: fix example. ........ r69297 | georg.brandl | 2009-02-05 05:32:18 -0600 (Thu, 05 Feb 2009) | 1 line #5015: document PythonHome API functions. ........ r69298 | georg.brandl | 2009-02-05 05:33:21 -0600 (Thu, 05 Feb 2009) | 1 line #4827: fix callback example. ........ r69299 | georg.brandl | 2009-02-05 05:35:28 -0600 (Thu, 05 Feb 2009) | 1 line #4820: use correct module for ctypes.util. ........ r69300 | georg.brandl | 2009-02-05 05:38:23 -0600 (Thu, 05 Feb 2009) | 1 line #4563: disable alpha and roman lists, fixes wrong formatting of contributor list. ........ r69301 | georg.brandl | 2009-02-05 05:40:35 -0600 (Thu, 05 Feb 2009) | 1 line #5031: fix Thread.daemon property docs. ........ r69348 | benjamin.peterson | 2009-02-05 19:47:31 -0600 (Thu, 05 Feb 2009) | 1 line fix download link ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/c-api/exceptions.rst python/branches/release30-maint/Doc/c-api/init.rst python/branches/release30-maint/Doc/library/ctypes.rst python/branches/release30-maint/Doc/library/optparse.rst python/branches/release30-maint/Doc/library/threading.rst python/branches/release30-maint/Doc/tools/sphinxext/download.html python/branches/release30-maint/Doc/tools/sphinxext/pyspecific.py python/branches/release30-maint/Doc/tutorial/floatingpoint.rst python/branches/release30-maint/Doc/whatsnew/2.7.rst python/branches/release30-maint/Lib/heapq.py python/branches/release30-maint/Lib/test/test_hash.py python/branches/release30-maint/Lib/test/test_os.py python/branches/release30-maint/Lib/test/test_socket.py python/branches/release30-maint/Lib/test/test_tcl.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/socketmodule.c python/branches/release30-maint/Python/compile.c Modified: python/branches/release30-maint/Doc/c-api/exceptions.rst ============================================================================== --- python/branches/release30-maint/Doc/c-api/exceptions.rst (original) +++ python/branches/release30-maint/Doc/c-api/exceptions.rst Fri Feb 6 03:50:18 2009 @@ -271,9 +271,10 @@ .. cfunction:: void PyErr_BadInternalCall() - This is a shorthand for ``PyErr_SetString(PyExc_TypeError, message)``, where - *message* indicates that an internal operation (e.g. a Python/C API function) - was invoked with an illegal argument. It is mostly for internal use. + This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, + where *message* indicates that an internal operation (e.g. a Python/C API + function) was invoked with an illegal argument. It is mostly for internal + use. .. cfunction:: int PyErr_WarnEx(PyObject *category, char *message, int stacklevel) Modified: python/branches/release30-maint/Doc/c-api/init.rst ============================================================================== --- python/branches/release30-maint/Doc/c-api/init.rst (original) +++ python/branches/release30-maint/Doc/c-api/init.rst Fri Feb 6 03:50:18 2009 @@ -350,18 +350,36 @@ single: Py_FatalError() single: argv (in module sys) - Set ``sys.argv`` based on *argc* and *argv*. These parameters are similar to - those passed to the program's :cfunc:`main` function with the difference that - the first entry should refer to the script file to be executed rather than the - executable hosting the Python interpreter. If there isn't a script that will be - run, the first entry in *argv* can be an empty string. If this function fails - to initialize ``sys.argv``, a fatal condition is signalled using - :cfunc:`Py_FatalError`. + Set :data:`sys.argv` based on *argc* and *argv*. These parameters are + similar to those passed to the program's :cfunc:`main` function with the + difference that the first entry should refer to the script file to be + executed rather than the executable hosting the Python interpreter. If there + isn't a script that will be run, the first entry in *argv* can be an empty + string. If this function fails to initialize :data:`sys.argv`, a fatal + condition is signalled using :cfunc:`Py_FatalError`. + + This function also prepends the executed script's path to :data:`sys.path`. + If no script is executed (in the case of calling ``python -c`` or just the + interactive interpreter), the empty string is used instead. .. XXX impl. doesn't seem consistent in allowing 0/NULL for the params; check w/ Guido. +.. cfunction:: void Py_SetPythonHome(char *home) + + Set the default "home" directory, that is, the location of the standard + Python libraries. The libraries are searched in + :file:`{home}/lib/python{version}` and :file:`{home}/lib/python{version}`. + + +.. cfunction:: char* Py_GetPythonHome() + + Return the default "home", that is, the value set by a previous call to + :cfunc:`Py_SetPythonHome`, or the value of the :envvar:`PYTHONHOME` + environment variable if it is set. + + .. _threads: Thread State and the Global Interpreter Lock Modified: python/branches/release30-maint/Doc/library/ctypes.rst ============================================================================== --- python/branches/release30-maint/Doc/library/ctypes.rst (original) +++ python/branches/release30-maint/Doc/library/ctypes.rst Fri Feb 6 03:50:18 2009 @@ -1272,6 +1272,7 @@ .. data:: find_library(name) + :module: ctypes.util :noindex: Try to find a library and return a pathname. *name* is the library name without Modified: python/branches/release30-maint/Doc/library/optparse.rst ============================================================================== --- python/branches/release30-maint/Doc/library/optparse.rst (original) +++ python/branches/release30-maint/Doc/library/optparse.rst Fri Feb 6 03:50:18 2009 @@ -1506,7 +1506,7 @@ records that the option was seen:: def record_foo_seen(option, opt_str, value, parser): - parser.saw_foo = True + parser.values.saw_foo = True parser.add_option("--foo", action="callback", callback=record_foo_seen) @@ -1646,7 +1646,7 @@ value.append(arg) del parser.rargs[:len(value)] - setattr(parser.values, option.dest, value)) + setattr(parser.values, option.dest, value) [...] parser.add_option("-c", "--callback", dest="vararg_attr", Modified: python/branches/release30-maint/Doc/library/threading.rst ============================================================================== --- python/branches/release30-maint/Doc/library/threading.rst (original) +++ python/branches/release30-maint/Doc/library/threading.rst Fri Feb 6 03:50:18 2009 @@ -198,7 +198,7 @@ A thread can be flagged as a "daemon thread". The significance of this flag is that the entire Python program exits when only daemon threads are left. The initial value is inherited from the creating thread. The flag can be set -through the :attr:`daemon` attribute. +through the :attr:`daemon` property. There is a "main thread" object; this corresponds to the initial thread of control in the Python program. It is not a daemon thread. @@ -312,10 +312,11 @@ .. attribute:: Thread.daemon - The thread's daemon flag. This must be set before :meth:`start` is called, - otherwise :exc:`RuntimeError` is raised. - - The initial value is inherited from the creating thread. + A boolean value indicating whether this thread is a daemon thread (True) or + not (False). This must be set before :meth:`start` is called, otherwise + :exc:`RuntimeError` is raised. Its initial value is inherited from the + creating thread; the main thread is not a daemon thread and therefore all + threads created in the main thread default to :attr:`daemon` = ``False``. The entire Python program exits when no alive non-daemon threads are left. Modified: python/branches/release30-maint/Doc/tools/sphinxext/download.html ============================================================================== --- python/branches/release30-maint/Doc/tools/sphinxext/download.html (original) +++ python/branches/release30-maint/Doc/tools/sphinxext/download.html Fri Feb 6 03:50:18 2009 @@ -31,7 +31,7 @@ Download (ca. 4 MB) Plain Text - Download (ca. 2 MB) + Download (ca. 2 MB) Download (ca. 1.5 MB) Modified: python/branches/release30-maint/Doc/tools/sphinxext/pyspecific.py ============================================================================== --- python/branches/release30-maint/Doc/tools/sphinxext/pyspecific.py (original) +++ python/branches/release30-maint/Doc/tools/sphinxext/pyspecific.py Fri Feb 6 03:50:18 2009 @@ -13,6 +13,14 @@ from docutils import nodes, utils +# monkey-patch reST parser to disable alphabetic and roman enumerated lists +from docutils.parsers.rst.states import Body +Body.enum.converters['loweralpha'] = \ + Body.enum.converters['upperalpha'] = \ + Body.enum.converters['lowerroman'] = \ + Body.enum.converters['upperroman'] = lambda x: None + + def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): issue = utils.unescape(text) text = 'issue ' + issue Modified: python/branches/release30-maint/Doc/tutorial/floatingpoint.rst ============================================================================== --- python/branches/release30-maint/Doc/tutorial/floatingpoint.rst (original) +++ python/branches/release30-maint/Doc/tutorial/floatingpoint.rst Fri Feb 6 03:50:18 2009 @@ -200,7 +200,7 @@ machines today (November 2000) use IEEE-754 floating point arithmetic, and almost all platforms map Python floats to IEEE-754 "double precision". 754 doubles contain 53 bits of precision, so on input the computer strives to -convert 0.1 to the closest fraction it can of the form *J*/2\*\**N* where *J* is +convert 0.1 to the closest fraction it can of the form *J*/2**\ *N* where *J* is an integer containing exactly 53 bits. Rewriting :: 1 / 10 ~= J / (2**N) Modified: python/branches/release30-maint/Doc/whatsnew/2.7.rst ============================================================================== --- python/branches/release30-maint/Doc/whatsnew/2.7.rst (original) +++ python/branches/release30-maint/Doc/whatsnew/2.7.rst Fri Feb 6 03:50:18 2009 @@ -108,6 +108,23 @@ .. ====================================================================== .. whole new modules get described in subsections here +ttk: Themed Widgets for Tk +-------------------------- + +Tcl/Tk 8.5 includes a set of themed widgets that re-implement basic Tk +widgets but have a more customizable appearance and can therefore more +closely resemble the native platform's widgets. This widget +set was originally called Tile, but was renamed to Ttk (for "themed Tk") +on being added to Tcl/Tck release 8.5. + +XXX write a brief discussion and an example here. + +The :mod:`ttk` module was written by Guilherme Polo and added in +:issue:`2983`. An alternate version called ``Tile.py``, written by +Martin Franklin and maintained by Kevin Walzer, was proposed for +inclusion in :issue:`2618`, but the authors argued that Guilherme +Polo's work was more comprehensive. + .. ====================================================================== Modified: python/branches/release30-maint/Lib/heapq.py ============================================================================== --- python/branches/release30-maint/Lib/heapq.py (original) +++ python/branches/release30-maint/Lib/heapq.py Fri Feb 6 03:50:18 2009 @@ -195,7 +195,7 @@ heapify(result) _heappushpop = heappushpop for elem in it: - heappushpop(result, elem) + _heappushpop(result, elem) result.sort(reverse=True) return result Modified: python/branches/release30-maint/Lib/test/test_hash.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_hash.py (original) +++ python/branches/release30-maint/Lib/test/test_hash.py Fri Feb 6 03:50:18 2009 @@ -33,6 +33,7 @@ # for 64-bit platforms self.same_hash(int(2**31), float(2**31)) self.same_hash(int(-2**63), float(-2**63)) + self.same_hash(long(2**63), float(2**63)) def test_coerced_floats(self): self.same_hash(int(1.23e300), float(1.23e300)) 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 Fri Feb 6 03:50:18 2009 @@ -3,6 +3,7 @@ # portable than they had been thought to be. import os +import errno import unittest import warnings import sys @@ -277,7 +278,6 @@ result = os.statvfs(self.fname) except OSError as e: # On AtheOS, glibc always returns ENOSYS - import errno if e.errno == errno.ENOSYS: return @@ -587,6 +587,71 @@ def test_chmod(self): self.assertRaises(WindowsError, os.utime, support.TESTFN, 0) + +class TestInvalidFD(unittest.TestCase): + singles = ["fchdir", "dup", "fdopen", "fdatasync", "fstat", + "fstatvfs", "fsync", "tcgetpgrp", "ttyname"] + #singles.append("close") + #We omit close because it doesn'r raise an exception on some platforms + def get_single(f): + def helper(self): + if hasattr(os, f): + self.check(getattr(os, f)) + return helper + for f in singles: + locals()["test_"+f] = get_single(f) + + def check(self, f, *args): + try: + f(support.make_bad_fd(), *args) + except OSError as e: + self.assertEqual(e.errno, errno.EBADF) + else: + self.fail("%r didn't raise a OSError with a bad file descriptor" + % f) + + def test_isatty(self): + if hasattr(os, "isatty"): + self.assertEqual(os.isatty(support.make_bad_fd()), False) + + def test_closerange(self): + if hasattr(os, "closerange"): + fd = support.make_bad_fd() + self.assertEqual(os.closerange(fd, fd + 10), None) + + def test_dup2(self): + if hasattr(os, "dup2"): + self.check(os.dup2, 20) + + def test_fchmod(self): + if hasattr(os, "fchmod"): + self.check(os.fchmod, 0) + + def test_fchown(self): + if hasattr(os, "fchown"): + self.check(os.fchown, -1, -1) + + def test_fpathconf(self): + if hasattr(os, "fpathconf"): + self.check(os.fpathconf, "PC_NAME_MAX") + + def test_lseek(self): + if hasattr(os, "lseek"): + self.check(os.lseek, 0, 0) + + def test_read(self): + if hasattr(os, "read"): + self.check(os.read, 1) + + def test_tcsetpgrpt(self): + if hasattr(os, "tcsetpgrp"): + self.check(os.tcsetpgrp, 0) + + def test_write(self): + if hasattr(os, "write"): + self.check(os.write, b" ") + + if sys.platform != 'win32': class Win32ErrorTests(unittest.TestCase): pass Modified: python/branches/release30-maint/Lib/test/test_socket.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_socket.py (original) +++ python/branches/release30-maint/Lib/test/test_socket.py Fri Feb 6 03:50:18 2009 @@ -366,6 +366,9 @@ eq(socket.getservbyport(port, 'tcp'), service) if udpport is not None: eq(socket.getservbyport(udpport, 'udp'), service) + # Make sure getservbyport does not accept out of range ports. + self.assertRaises(OverflowError, socket.getservbyport, -1) + self.assertRaises(OverflowError, socket.getservbyport, 65536) def testDefaultTimeout(self): # Testing default timeout @@ -466,15 +469,23 @@ # XXX The following don't test module-level functionality... - def testSockName(self): - # Testing getsockname(). Use a temporary socket to elicit an unused - # ephemeral port that we can use later in the test. + def _get_unused_port(self, bind_address='0.0.0.0'): + """Use a temporary socket to elicit an unused ephemeral port. + + Args: + bind_address: Hostname or IP address to search for a port on. + + Returns: A most likely to be unused port. + """ tempsock = socket.socket() - tempsock.bind(("0.0.0.0", 0)) - (host, port) = tempsock.getsockname() + tempsock.bind((bind_address, 0)) + host, port = tempsock.getsockname() tempsock.close() - del tempsock + return port + def testSockName(self): + # Testing getsockname() + port = self._get_unused_port() sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.bind(("0.0.0.0", port)) name = sock.getsockname() @@ -514,6 +525,19 @@ self.assertEqual(sock.proto, 0) sock.close() + def test_getsockaddrarg(self): + host = '0.0.0.0' + port = self._get_unused_port(bind_address=host) + big_port = port + 65536 + neg_port = port - 65536 + sock = socket.socket() + try: + self.assertRaises(OverflowError, sock.bind, (host, big_port)) + self.assertRaises(OverflowError, sock.bind, (host, neg_port)) + sock.bind((host, port)) + finally: + sock.close() + def test_sock_ioctl(self): if os.name != "nt": return Modified: python/branches/release30-maint/Lib/test/test_tcl.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_tcl.py (original) +++ python/branches/release30-maint/Lib/test/test_tcl.py Fri Feb 6 03:50:18 2009 @@ -4,9 +4,15 @@ import os import _tkinter from test import support -from tkinter import Tcl +from tkinter import Tk, Tcl from _tkinter import TclError +# Restore Tkinter.Tk._loadtk that may have been overridden by ttk. +# If this is not done then this test may fail for reasons related +# to ttk only (like failing to load the tile package). +from ttk import __loadtk__ +Tk._loadtk = __loadtk__ + class TkinterTest(unittest.TestCase): Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Fri Feb 6 03:50:18 2009 @@ -253,6 +253,10 @@ - Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on biarch systems. Try to rely on ldconfig only, without using objdump and gcc. +- Issue #5104: The socket module now raises OverflowError when 16-bit port and + protocol numbers are supplied outside the allowed 0-65536 range on bind() + and getservbyport(). + Tools/Demos ----------- Modified: python/branches/release30-maint/Modules/socketmodule.c ============================================================================== --- python/branches/release30-maint/Modules/socketmodule.c (original) +++ python/branches/release30-maint/Modules/socketmodule.c Fri Feb 6 03:50:18 2009 @@ -1223,6 +1223,12 @@ PyMem_Free(host); if (result < 0) return 0; + if (port < 0 || port > 0xffff) { + PyErr_SetString( + PyExc_OverflowError, + "getsockaddrarg: port must be 0-65535."); + return 0; + } addr->sin_family = AF_INET; addr->sin_port = htons((short)port); *len_ret = sizeof *addr; @@ -1255,6 +1261,12 @@ PyMem_Free(host); if (result < 0) return 0; + if (port < 0 || port > 0xffff) { + PyErr_SetString( + PyExc_OverflowError, + "getsockaddrarg: port must be 0-65535."); + return 0; + } addr->sin6_family = s->sock_family; addr->sin6_port = htons((short)port); addr->sin6_flowinfo = flowinfo; @@ -1381,6 +1393,12 @@ "Hardware address must be 8 bytes or less"); return 0; } + if (protoNumber < 0 || protoNumber > 0xffff) { + PyErr_SetString( + PyExc_OverflowError, + "getsockaddrarg: protoNumber must be 0-65535."); + return 0; + } addr = (struct sockaddr_ll*)addr_ret; addr->sll_family = AF_PACKET; addr->sll_protocol = htons((short)protoNumber); @@ -3271,13 +3289,19 @@ static PyObject * socket_getservbyport(PyObject *self, PyObject *args) { - unsigned short port; + int port; char *proto=NULL; struct servent *sp; - if (!PyArg_ParseTuple(args, "H|s:getservbyport", &port, &proto)) + if (!PyArg_ParseTuple(args, "i|s:getservbyport", &port, &proto)) + return NULL; + if (port < 0 || port > 0xffff) { + PyErr_SetString( + PyExc_OverflowError, + "getservbyport: port must be 0-65535."); return NULL; + } Py_BEGIN_ALLOW_THREADS - sp = getservbyport(htons(port), proto); + sp = getservbyport(htons((short)port), proto); Py_END_ALLOW_THREADS if (sp == NULL) { PyErr_SetString(socket_error, "port/proto not found"); Modified: python/branches/release30-maint/Python/compile.c ============================================================================== --- python/branches/release30-maint/Python/compile.c (original) +++ python/branches/release30-maint/Python/compile.c Fri Feb 6 03:50:18 2009 @@ -4016,6 +4016,8 @@ return NULL; while (PyDict_Next(dict, &pos, &k, &v)) { i = PyLong_AS_LONG(v); + /* The keys of the dictionary are tuples. (see compiler_add_o) + The object we want is always first, though. */ k = PyTuple_GET_ITEM(k, 0); Py_INCREF(k); assert((i - offset) < size); @@ -4039,13 +4041,11 @@ flags |= CO_NESTED; if (ste->ste_generator) flags |= CO_GENERATOR; + if (ste->ste_varargs) + flags |= CO_VARARGS; + if (ste->ste_varkeywords) + flags |= CO_VARKEYWORDS; } - if (ste->ste_varargs) - flags |= CO_VARARGS; - if (ste->ste_varkeywords) - flags |= CO_VARKEYWORDS; - if (ste->ste_generator) - flags |= CO_GENERATOR; /* (Only) inherit compilerflags in PyCF_MASK */ flags |= (c->c_flags->cf_flags & PyCF_MASK); From python-checkins at python.org Fri Feb 6 04:01:25 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 6 Feb 2009 04:01:25 +0100 (CET) Subject: [Python-checkins] r69354 - in python/branches/py3k: Doc/library/itertools.rst Lib/tkinter/test/runtktests.py Lib/tkinter/test/test_ttk/test_extensions.py Message-ID: <20090206030125.138621E4002@bag.python.org> Author: benjamin.peterson Date: Fri Feb 6 04:01:24 2009 New Revision: 69354 Log: Merged revisions 69141,69211-69212 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69141 | benjamin.peterson | 2009-01-31 14:01:48 -0600 (Sat, 31 Jan 2009) | 1 line fix indentation ........ r69211 | guilherme.polo | 2009-02-02 14:23:29 -0600 (Mon, 02 Feb 2009) | 1 line Restore the previous geometry before leaving the test ........ r69212 | guilherme.polo | 2009-02-02 14:28:59 -0600 (Mon, 02 Feb 2009) | 1 line Moving to importlib ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/itertools.rst python/branches/py3k/Lib/tkinter/test/runtktests.py python/branches/py3k/Lib/tkinter/test/test_ttk/test_extensions.py Modified: python/branches/py3k/Doc/library/itertools.rst ============================================================================== --- python/branches/py3k/Doc/library/itertools.rst (original) +++ python/branches/py3k/Doc/library/itertools.rst Fri Feb 6 04:01:24 2009 @@ -654,26 +654,26 @@ s = list(iterable) return chain.from_iterable(combinations(s, r) for r in range(len(s)+1)) - def unique_everseen(iterable, key=None): - "List unique elements, preserving order. Remember all elements ever seen." - # unique_everseen('AAAABBBCCDAABBB') --> A B C D - # unique_everseen('ABBCcAD', str.lower) --> A B C D - seen = set() - seen_add = seen.add - if key is None: - for element in iterable: - if element not in seen: - seen_add(element) - yield element - else: - for element in iterable: - k = key(element) - if k not in seen: - seen_add(k) - yield element + def unique_everseen(iterable, key=None): + "List unique elements, preserving order. Remember all elements ever seen." + # unique_everseen('AAAABBBCCDAABBB') --> A B C D + # unique_everseen('ABBCcAD', str.lower) --> A B C D + seen = set() + seen_add = seen.add + if key is None: + for element in iterable: + if element not in seen: + seen_add(element) + yield element + else: + for element in iterable: + k = key(element) + if k not in seen: + seen_add(k) + yield element - def unique_justseen(iterable, key=None): - "List unique elements, preserving order. Remember only the element just seen." - # unique_justseen('AAAABBBCCDAABBB') --> A B C D A B - # unique_justseen('ABBCcAD', str.lower) --> A B C A D - return map(next, map(itemgetter(1), groupby(iterable, key))) + def unique_justseen(iterable, key=None): + "List unique elements, preserving order. Remember only the element just seen." + # unique_justseen('AAAABBBCCDAABBB') --> A B C D A B + # unique_justseen('ABBCcAD', str.lower) --> A B C A D + return map(next, imap(itemgetter(1), groupby(iterable, key))) Modified: python/branches/py3k/Lib/tkinter/test/runtktests.py ============================================================================== --- python/branches/py3k/Lib/tkinter/test/runtktests.py (original) +++ python/branches/py3k/Lib/tkinter/test/runtktests.py Fri Feb 6 04:01:24 2009 @@ -9,6 +9,7 @@ import os import sys import unittest +import importlib import test.support this_dir_path = os.path.abspath(os.path.dirname(__file__)) @@ -44,13 +45,8 @@ for name in filenames: try: - yield __import__( - "%s.%s.%s" % ( - "tkinter.test", - pkg_name, - name[:-len(py_ext)]), - fromlist=[''] - ) + yield importlib.import_module( + ".%s" % name[:-len(py_ext)], pkg_name) except test.support.ResourceDenied: if gui: raise Modified: python/branches/py3k/Lib/tkinter/test/test_ttk/test_extensions.py ============================================================================== --- python/branches/py3k/Lib/tkinter/test/test_ttk/test_extensions.py (original) +++ python/branches/py3k/Lib/tkinter/test/test_ttk/test_extensions.py Fri Feb 6 04:01:24 2009 @@ -167,14 +167,15 @@ x.update() width, height = x.master.winfo_width(), x.master.winfo_height() - width, height = width * 2, height * 2 + width_new, height_new = width * 2, height * 2 x.value = 3 x.update() - x.master.wm_geometry("%dx%d" % (width, height)) + x.master.wm_geometry("%dx%d" % (width_new, height_new)) self.failUnlessEqual(int(x.label.place_info()['x']), x.scale.coords()[0]) + # Reset geometry x.master.wm_geometry("%dx%d" % (width, height)) x.destroy() From python-checkins at python.org Fri Feb 6 04:03:34 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 6 Feb 2009 04:03:34 +0100 (CET) Subject: [Python-checkins] r69355 - python/branches/release30-maint Message-ID: <20090206030334.5AE661E403C@bag.python.org> Author: benjamin.peterson Date: Fri Feb 6 04:03:34 2009 New Revision: 69355 Log: Blocked revisions 69354 via svnmerge ................ r69354 | benjamin.peterson | 2009-02-05 21:01:24 -0600 (Thu, 05 Feb 2009) | 17 lines Merged revisions 69141,69211-69212 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69141 | benjamin.peterson | 2009-01-31 14:01:48 -0600 (Sat, 31 Jan 2009) | 1 line fix indentation ........ r69211 | guilherme.polo | 2009-02-02 14:23:29 -0600 (Mon, 02 Feb 2009) | 1 line Restore the previous geometry before leaving the test ........ r69212 | guilherme.polo | 2009-02-02 14:28:59 -0600 (Mon, 02 Feb 2009) | 1 line Moving to importlib ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Fri Feb 6 04:20:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 03:20:47 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090206032048.127441E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/598 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: eric.smith,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_ftplib.py", line 203, in run asyncore.loop(timeout=0.1, count=1) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 204, in loop poll_fun(timeout, map) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 141, in poll read(obj) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 78, in read obj.handle_error() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 74, in read obj.handle_read_event() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 413, in handle_read_event self.handle_read() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_ssl.py", line 408, in handle_read self.send(data.lower()) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 519, in send self.initiate_send() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 506, in initiate_send num_sent = dispatcher.send(self, self.out_buffer[:512]) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 349, in send result = self.socket.send(data) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/socket.py", line 165, in _dummy raise error(EBADF, 'Bad file descriptor') error: [Errno 9] Bad file descriptor 1 test failed: test_ftplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 6 04:22:59 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 03:22:59 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090206032259.87BAF1E4002@bag.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/88 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: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_hash test_smtplib ====================================================================== ERROR: test_coerced_integers (test.test_hash.HashEqualityTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_hash.py", line 36, in test_coerced_integers self.same_hash(long(2**63), float(2**63)) NameError: global name 'long' is not defined make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 6 05:04:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 04:04:23 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.0 Message-ID: <20090206040424.2EC121E400C@bag.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/139 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: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_hash ====================================================================== ERROR: test_coerced_integers (test.test_hash.HashEqualityTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-ubuntu-i386/build/Lib/test/test_hash.py", line 36, in test_coerced_integers self.same_hash(long(2**63), float(2**63)) NameError: global name 'long' is not defined make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 6 06:05:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 05:05:00 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.0 Message-ID: <20090206050500.EEFAC1E4002@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/123 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: benjamin.peterson,eric.smith,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_hash ====================================================================== ERROR: test_coerced_integers (test.test_hash.HashEqualityTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_hash.py", line 36, in test_coerced_integers self.same_hash(long(2**63), float(2**63)) NameError: global name 'long' is not defined make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 6 07:23:49 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 06:23:49 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.0 Message-ID: <20090206062349.71B871E4002@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/127 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: benjamin.peterson,eric.smith,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_hash ====================================================================== ERROR: test_coerced_integers (test.test_hash.HashEqualityTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_hash.py", line 36, in test_coerced_integers self.same_hash(long(2**63), float(2**63)) NameError: global name 'long' is not defined make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 6 08:47:04 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 07:47:04 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090206074704.5C7691E4002@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/128 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_hash 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 43, 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_coerced_integers (test.test_hash.HashEqualityTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_hash.py", line 36, in test_coerced_integers self.same_hash(long(2**63), float(2**63)) NameError: global name 'long' is not defined ====================================================================== 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 Fri Feb 6 09:20:16 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 09:20:16 +0100 (CET) Subject: [Python-checkins] r69356 - python/trunk/Lib/distutils/core.py Message-ID: <20090206082016.E90641E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 09:20:15 2009 New Revision: 69356 Log: Fixed #3987 : removed unused import Modified: python/trunk/Lib/distutils/core.py Modified: python/trunk/Lib/distutils/core.py ============================================================================== --- python/trunk/Lib/distutils/core.py (original) +++ python/trunk/Lib/distutils/core.py Fri Feb 6 09:20:15 2009 @@ -9,7 +9,6 @@ __revision__ = "$Id$" import sys, os -from types import * from distutils.debug import DEBUG from distutils.errors import * From python-checkins at python.org Fri Feb 6 09:21:23 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 09:21:23 +0100 (CET) Subject: [Python-checkins] r69357 - python/branches/release26-maint Message-ID: <20090206082123.C2D3C1E400C@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 09:21:23 2009 New Revision: 69357 Log: Blocked revisions 69356 via svnmerge ........ r69356 | tarek.ziade | 2009-02-06 09:20:15 +0100 (Fri, 06 Feb 2009) | 1 line Fixed #3987 : removed unused import ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri Feb 6 09:22:21 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 09:22:21 +0100 (CET) Subject: [Python-checkins] r69358 - python/branches/py3k Message-ID: <20090206082221.77FFF1E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 09:22:21 2009 New Revision: 69358 Log: Merged revisions 69356 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69356 | tarek.ziade | 2009-02-06 09:20:15 +0100 (Fri, 06 Feb 2009) | 1 line Fixed #3987 : removed unused import ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Fri Feb 6 09:23:07 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 09:23:07 +0100 (CET) Subject: [Python-checkins] r69359 - python/branches/release30-maint Message-ID: <20090206082307.3E58B1E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 09:23:07 2009 New Revision: 69359 Log: Blocked revisions 69358 via svnmerge ................ r69358 | tarek.ziade | 2009-02-06 09:22:21 +0100 (Fri, 06 Feb 2009) | 9 lines Merged revisions 69356 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69356 | tarek.ziade | 2009-02-06 09:20:15 +0100 (Fri, 06 Feb 2009) | 1 line Fixed #3987 : removed unused import ........ ................ Modified: python/branches/release30-maint/ (props changed) From ncoghlan at gmail.com Fri Feb 6 09:50:31 2009 From: ncoghlan at gmail.com (Nick Coghlan) Date: Fri, 06 Feb 2009 18:50:31 +1000 Subject: [Python-checkins] r69314 - sandbox/trunk/dbm_sqlite/alt/dbdict.py In-Reply-To: <20090205220400.943E71E4002@bag.python.org> References: <20090205220400.943E71E4002@bag.python.org> Message-ID: <498BF9D7.1050908@gmail.com> raymond.hettinger wrote: > Author: raymond.hettinger > Date: Thu Feb 5 23:04:00 2009 > New Revision: 69314 > > Log: > Can't get tempfile to reliably delete on error and persist otherwise. You work on Windows, don't you Raymond? What you were trying (setting tf.delete after the file was already open but before it was closed) would actually work on non-Windows platforms, since the delete flag is only checked in the close() method. On Windows, however, the tempfile code uses the _os.O_TEMPORARY flag at creation time to tell *Windows* to delete the file when it gets closed. In that case, writing to the delete attribute has no effect (since the flag has already been set) Perhaps the windows special casing should be removed so that the delete flag on named temporary files can be effectively written to on all platforms? Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- From python-checkins at python.org Fri Feb 6 09:55:24 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 09:55:24 +0100 (CET) Subject: [Python-checkins] r69360 - in python/trunk/Lib/distutils: cmd.py tests/test_cmd.py Message-ID: <20090206085524.4DFE21E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 09:55:23 2009 New Revision: 69360 Log: removed types usage and added test coverage (work for #3986) Added: python/trunk/Lib/distutils/tests/test_cmd.py (contents, props changed) Modified: python/trunk/Lib/distutils/cmd.py Modified: python/trunk/Lib/distutils/cmd.py ============================================================================== --- python/trunk/Lib/distutils/cmd.py (original) +++ python/trunk/Lib/distutils/cmd.py Fri Feb 6 09:55:23 2009 @@ -7,8 +7,7 @@ __revision__ = "$Id$" import sys, os, string, re -from types import * -from distutils.errors import * +from distutils.errors import DistutilsOptionError from distutils import util, dir_util, file_util, archive_util, dep_util from distutils import log @@ -220,7 +219,7 @@ if val is None: setattr(self, option, default) return default - elif type(val) is not StringType: + elif not isinstance(val, str): raise DistutilsOptionError, \ "'%s' must be a %s (got `%s`)" % (option, what, val) return val @@ -240,19 +239,24 @@ val = getattr(self, option) if val is None: return - elif type(val) is StringType: + elif isinstance(val, str): setattr(self, option, re.split(r',\s*|\s+', val)) else: - if type(val) is ListType: - types = map(type, val) - ok = (types == [StringType] * len(val)) + if isinstance(val, list): + # checks if all elements are str + ok = 1 + for element in val: + if not isinstance(element, str): + ok = 0 + break else: ok = 0 if not ok: raise DistutilsOptionError, \ - "'%s' must be a list of strings (got %r)" % \ - (option, val) + "'%s' must be a list of strings (got %r)" % \ + (option, val) + def _ensure_tested_string (self, option, tester, what, error_fmt, default=None): Added: python/trunk/Lib/distutils/tests/test_cmd.py ============================================================================== --- (empty file) +++ python/trunk/Lib/distutils/tests/test_cmd.py Fri Feb 6 09:55:23 2009 @@ -0,0 +1,38 @@ +"""Tests for distutils.cmd.""" +import unittest + +from distutils.cmd import Command +from distutils.dist import Distribution +from distutils.errors import DistutilsOptionError + +class CommandTestCase(unittest.TestCase): + + def test_ensure_string_list(self): + + class MyCmd(Command): + + def initialize_options(self): + pass + + dist = Distribution() + cmd = MyCmd(dist) + + cmd.not_string_list = ['one', 2, 'three'] + cmd.yes_string_list = ['one', 'two', 'three'] + cmd.not_string_list2 = object() + cmd.yes_string_list2 = 'ok' + + cmd.ensure_string_list('yes_string_list') + cmd.ensure_string_list('yes_string_list2') + + self.assertRaises(DistutilsOptionError, + cmd.ensure_string_list, 'not_string_list') + + self.assertRaises(DistutilsOptionError, + cmd.ensure_string_list, 'not_string_list2') + +def test_suite(): + return unittest.makeSuite(CommandTestCase) + +if __name__ == '__main__': + test_support.run_unittest(test_suite()) From python-checkins at python.org Fri Feb 6 09:56:45 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 09:56:45 +0100 (CET) Subject: [Python-checkins] r69361 - python/branches/release26-maint Message-ID: <20090206085645.CDDA31E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 09:56:45 2009 New Revision: 69361 Log: Blocked revisions 69360 via svnmerge ........ r69360 | tarek.ziade | 2009-02-06 09:55:23 +0100 (Fri, 06 Feb 2009) | 1 line removed types usage and added test coverage (work for #3986) ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri Feb 6 10:03:10 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 10:03:10 +0100 (CET) Subject: [Python-checkins] r69362 - in python/branches/py3k: Lib/distutils/cmd.py Lib/distutils/tests/test_cmd.py Message-ID: <20090206090310.77EFF1E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 10:03:10 2009 New Revision: 69362 Log: Merged revisions 69360 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69360 | tarek.ziade | 2009-02-06 09:55:23 +0100 (Fri, 06 Feb 2009) | 1 line removed types usage and added test coverage (work for #3986) ........ Added: python/branches/py3k/Lib/distutils/tests/test_cmd.py - copied unchanged from r69360, /python/trunk/Lib/distutils/tests/test_cmd.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/cmd.py Modified: python/branches/py3k/Lib/distutils/cmd.py ============================================================================== --- python/branches/py3k/Lib/distutils/cmd.py (original) +++ python/branches/py3k/Lib/distutils/cmd.py Fri Feb 6 10:03:10 2009 @@ -7,7 +7,7 @@ __revision__ = "$Id$" import sys, os, re -from distutils.errors import * +from distutils.errors import DistutilsOptionError from distutils import util, dir_util, file_util, archive_util, dep_util from distutils import log From python-checkins at python.org Fri Feb 6 10:04:51 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 10:04:51 +0100 (CET) Subject: [Python-checkins] r69363 - python/branches/release30-maint Message-ID: <20090206090451.3E86F1E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 10:04:51 2009 New Revision: 69363 Log: Blocked revisions 69362 via svnmerge ................ r69362 | tarek.ziade | 2009-02-06 10:03:10 +0100 (Fri, 06 Feb 2009) | 9 lines Merged revisions 69360 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69360 | tarek.ziade | 2009-02-06 09:55:23 +0100 (Fri, 06 Feb 2009) | 1 line removed types usage and added test coverage (work for #3986) ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Fri Feb 6 11:17:34 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Fri, 6 Feb 2009 11:17:34 +0100 (CET) Subject: [Python-checkins] r69364 - python/trunk/Lib/test/test_os.py Message-ID: <20090206101734.B0D331E4002@bag.python.org> Author: kristjan.jonsson Date: Fri Feb 6 11:17:34 2009 New Revision: 69364 Log: Fix a number of Win32ErrorTests error cases. chmod wasn't being tested. 'access' never raises an error. 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 Fri Feb 6 11:17:34 2009 @@ -524,16 +524,18 @@ self.assertRaises(WindowsError, os.chdir, test_support.TESTFN) def test_mkdir(self): - self.assertRaises(WindowsError, os.chdir, test_support.TESTFN) + f = open(test_support.TESTFN, "w") + try: + self.assertRaises(WindowsError, os.mkdir, test_support.TESTFN) + finally: + f.close() + os.unlink(test_support.TESTFN) def test_utime(self): self.assertRaises(WindowsError, os.utime, test_support.TESTFN, None) - def test_access(self): - self.assertRaises(WindowsError, os.utime, test_support.TESTFN, 0) - def test_chmod(self): - self.assertRaises(WindowsError, os.utime, test_support.TESTFN, 0) + self.assertRaises(WindowsError, os.chmod, test_support.TESTFN, 0) class TestInvalidFD(unittest.TestCase): singles = ["fchdir", "fdopen", "dup", "fdatasync", "fstat", From buildbot at python.org Fri Feb 6 11:25:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 10:25:28 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 2.6 Message-ID: <20090206102529.66EC01E401A@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/101 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: 1 test failed: test_urllib2 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 6 11:26:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 10:26:52 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090206102652.B4B931E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/601 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_ftplib.py", line 203, in run asyncore.loop(timeout=0.1, count=1) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 204, in loop poll_fun(timeout, map) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 141, in poll read(obj) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 78, in read obj.handle_error() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 74, in read obj.handle_read_event() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 413, in handle_read_event self.handle_read() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_ssl.py", line 408, in handle_read self.send(data.lower()) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 519, in send self.initiate_send() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 506, in initiate_send num_sent = dispatcher.send(self, self.out_buffer[:512]) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 349, in send result = self.socket.send(data) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/socket.py", line 165, in _dummy raise error(EBADF, 'Bad file descriptor') error: [Errno 9] Bad file descriptor 1 test failed: test_ftplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Fri Feb 6 12:07:59 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 6 Feb 2009 06:07:59 -0500 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090206110759.GA25582@python.psfb.org> More important issues: ---------------------- test_distutils leaked [103, 103, 103] references, sum=309 Less important issues: ---------------------- test_asynchat leaked [0, 126, -126] references, sum=0 test_cmd_line leaked [0, 0, 25] references, sum=25 test_docxmlrpc leaked [0, 31, -31] references, sum=0 test_dumbdbm leaked [0, -92, 0] references, sum=-92 test_smtplib leaked [-116, 88, -1] references, sum=-29 test_sys leaked [0, 0, 42] references, sum=42 test_threadsignals leaked [-8, 0, 0] references, sum=-8 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 test_xmlrpc leaked [85, 0, 0] references, sum=85 From buildbot at python.org Fri Feb 6 12:12:08 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 11:12:08 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090206111208.8A9D31E4033@bag.python.org> The Buildbot has detected a new failure of OS X x86 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/99 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: kristjan.jonsson BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Abort trap sincerely, -The Buildbot From buildbot at python.org Fri Feb 6 12:22:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 11:22:29 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090206112230.258241E4002@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/111 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_bsddb3 Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/threading.py", line 522, 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') make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Feb 6 12:46:26 2009 From: python-checkins at python.org (armin.rigo) Date: Fri, 6 Feb 2009 12:46:26 +0100 (CET) Subject: [Python-checkins] r69365 - python/trunk/Lib/test/crashers/compiler_recursion.py Message-ID: <20090206114626.301CB1E4002@bag.python.org> Author: armin.rigo Date: Fri Feb 6 12:46:26 2009 New Revision: 69365 Log: Ivan on IRC in #twisted reported this crasher. Added: python/trunk/Lib/test/crashers/compiler_recursion.py (contents, props changed) Added: python/trunk/Lib/test/crashers/compiler_recursion.py ============================================================================== --- (empty file) +++ python/trunk/Lib/test/crashers/compiler_recursion.py Fri Feb 6 12:46:26 2009 @@ -0,0 +1,5 @@ +""" +The compiler (>= 2.5) recurses happily. +""" + +compile('()'*9**5, '?', 'exec') From python-checkins at python.org Fri Feb 6 14:27:38 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 14:27:38 +0100 (CET) Subject: [Python-checkins] r69366 - python/trunk/Lib/distutils/tests/test_sysconfig.py Message-ID: <20090206132738.EAF141E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 14:27:38 2009 New Revision: 69366 Log: Fixed #5167: test_customize_compiler does not apply under non unix compilers 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 Feb 6 14:27:38 2009 @@ -1,6 +1,8 @@ """Tests for distutils.dist.""" from distutils import sysconfig +from distutils.ccompiler import get_default_compiler + import os import unittest @@ -41,6 +43,10 @@ def test_customize_compiler(self): + # not testing if default compiler is not unix + if get_default_compiler() != 'unix': + return + os.environ['AR'] = 'xxx' # make sure AR gets caught From python-checkins at python.org Fri Feb 6 14:32:44 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 14:32:44 +0100 (CET) Subject: [Python-checkins] r69367 - python/branches/release26-maint Message-ID: <20090206133244.5F3E61E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 14:32:43 2009 New Revision: 69367 Log: Blocked revisions 69366 via svnmerge ........ r69366 | tarek.ziade | 2009-02-06 14:27:38 +0100 (Fri, 06 Feb 2009) | 1 line Fixed #5167: test_customize_compiler does not apply under non unix compilers ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri Feb 6 14:33:47 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 14:33:47 +0100 (CET) Subject: [Python-checkins] r69368 - in python/branches/py3k: Lib/distutils/tests/test_sysconfig.py Message-ID: <20090206133347.E69481E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 14:33:47 2009 New Revision: 69368 Log: Merged revisions 69366 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69366 | tarek.ziade | 2009-02-06 14:27:38 +0100 (Fri, 06 Feb 2009) | 1 line Fixed #5167: test_customize_compiler does not apply under non unix compilers ........ 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 Feb 6 14:33:47 2009 @@ -1,6 +1,8 @@ """Tests for distutils.dist.""" from distutils import sysconfig +from distutils.ccompiler import get_default_compiler + import os import unittest @@ -41,6 +43,10 @@ def test_customize_compiler(self): + # not testing if default compiler is not unix + if get_default_compiler() != 'unix': + return + os.environ['AR'] = 'xxx' # make sure AR gets caught From python-checkins at python.org Fri Feb 6 14:34:46 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 6 Feb 2009 14:34:46 +0100 (CET) Subject: [Python-checkins] r69369 - python/branches/release30-maint Message-ID: <20090206133446.E962A1E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 6 14:34:46 2009 New Revision: 69369 Log: Blocked revisions 69368 via svnmerge ................ r69368 | tarek.ziade | 2009-02-06 14:33:47 +0100 (Fri, 06 Feb 2009) | 9 lines Merged revisions 69366 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69366 | tarek.ziade | 2009-02-06 14:27:38 +0100 (Fri, 06 Feb 2009) | 1 line Fixed #5167: test_customize_compiler does not apply under non unix compilers ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Fri Feb 6 14:47:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 13:47:56 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090206134757.2493D1E4002@bag.python.org> The Buildbot has detected a new failure of OS X x86 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/101 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Abort trap sincerely, -The Buildbot From buildbot at python.org Fri Feb 6 15:08:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 14:08:18 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090206140818.D16D91E404D@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/4594 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 Fri Feb 6 15:11:43 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 14:11:43 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 2.6 Message-ID: <20090206141143.279731E4002@bag.python.org> The Buildbot has detected a new failure of OS X x86 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%202.6/builds/51 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 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 "/Users/buildbot/buildarea/2.6.noller-osx86/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/2.6.noller-osx86/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/Users/buildbot/buildarea/2.6.noller-osx86/build/Lib/bsddb/test/test_thread.py", line 306, in readerThread rec = dbutils.DeadlockWrap(c.next, max_retries=10) File "/Users/buildbot/buildarea/2.6.noller-osx86/build/Lib/bsddb/dbutils.py", line 68, in DeadlockWrap return function(*_args, **_kwargs) DBLockDeadlockError: (-30995, 'DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock') Traceback (most recent call last): File "/Users/buildbot/buildarea/2.6.noller-osx86/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/2.6.noller-osx86/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/Users/buildbot/buildarea/2.6.noller-osx86/build/Lib/bsddb/test/test_thread.py", line 306, in readerThread rec = dbutils.DeadlockWrap(c.next, max_retries=10) File "/Users/buildbot/buildarea/2.6.noller-osx86/build/Lib/bsddb/dbutils.py", line 68, in DeadlockWrap return function(*_args, **_kwargs) DBLockDeadlockError: (-30995, 'DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock') 1 test failed: test_urllib2net make: *** [buildbottest] Error 1 sincerely, -The Buildbot From benjamin at python.org Fri Feb 6 16:45:35 2009 From: benjamin at python.org (Benjamin Peterson) Date: Fri, 6 Feb 2009 09:45:35 -0600 Subject: [Python-checkins] r69365 - python/trunk/Lib/test/crashers/compiler_recursion.py In-Reply-To: <20090206114626.301CB1E4002@bag.python.org> References: <20090206114626.301CB1E4002@bag.python.org> Message-ID: <1afaf6160902060745m29d0db86n364c0f7b8bb8ba60@mail.gmail.com> On Fri, Feb 6, 2009 at 5:46 AM, armin. rigo wrote: > Author: armin.rigo > Date: Fri Feb 6 12:46:26 2009 > New Revision: 69365 > > Log: > Ivan on IRC in #twisted reported this crasher. Is there a bug report somewhere for this? -- Regards, Benjamin From python-checkins at python.org Fri Feb 6 17:39:11 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 6 Feb 2009 17:39:11 +0100 (CET) Subject: [Python-checkins] r69370 - python/branches/py3k/README Message-ID: <20090206163911.674AA1E4002@bag.python.org> Author: mark.dickinson Date: Fri Feb 6 17:39:11 2009 New Revision: 69370 Log: Replace references to python-3000 mailing list with python-dev in README. Modified: python/branches/py3k/README Modified: python/branches/py3k/README ============================================================================== --- python/branches/py3k/README (original) +++ python/branches/py3k/README Fri Feb 6 17:39:11 2009 @@ -130,11 +130,11 @@ If you're not sure whether you're dealing with a bug or a feature, use the mailing list: - python-3000 at python.org + python-dev at python.org To subscribe to the list, use the mailman form: - http://mail.python.org/mailman/listinfo/python-3000/ + http://mail.python.org/mailman/listinfo/python-dev/ Build Instructions From python-checkins at python.org Fri Feb 6 17:41:20 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 6 Feb 2009 17:41:20 +0100 (CET) Subject: [Python-checkins] r69371 - in python/branches/release30-maint: README Message-ID: <20090206164120.4BD801E4002@bag.python.org> Author: mark.dickinson Date: Fri Feb 6 17:41:19 2009 New Revision: 69371 Log: Merged revisions 69370 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69370 | mark.dickinson | 2009-02-06 16:39:11 +0000 (Fri, 06 Feb 2009) | 3 lines Replace references to python-3000 mailing list with python-dev in README. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/README Modified: python/branches/release30-maint/README ============================================================================== --- python/branches/release30-maint/README (original) +++ python/branches/release30-maint/README Fri Feb 6 17:41:19 2009 @@ -114,11 +114,11 @@ If you're not sure whether you're dealing with a bug or a feature, use the mailing list: - python-3000 at python.org + python-dev at python.org To subscribe to the list, use the Mailman form: - http://mail.python.org/mailman/listinfo/python-3000/ + http://mail.python.org/mailman/listinfo/python-dev/ Build Instructions From buildbot at python.org Fri Feb 6 18:03:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 17:03:22 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090206170323.4B5DA1E4002@bag.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/205 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 BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_hash test_urllib ====================================================================== ERROR: test_coerced_integers (test.test_hash.HashEqualityTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_hash.py", line 36, in test_coerced_integers self.same_hash(long(2**63), float(2**63)) NameError: global name 'long' is not defined ====================================================================== ERROR: test_empty_socket (test.test_urllib.urlopen_HttpTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_urllib.py", line 194, in test_empty_socket self.assertRaises(IOError, urlopen, "http://something") File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/unittest.py", line 344, in failUnlessRaises callableObj(*args, **kwargs) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_urllib.py", line 33, in urlopen return opener.open(url) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/urllib/request.py", line 1444, in open return getattr(self, name)(url) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/urllib/request.py", line 1618, in open_http return self._open_generic_http(http.client.HTTPConnection, url, data) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/urllib/request.py", line 1601, in _open_generic_http response = http_conn.getresponse() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/http/client.py", line 937, in getresponse method=self._method) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/http/client.py", line 275, in __init__ self.fp = sock.makefile("rb") TypeError: makefile() takes exactly 3 positional arguments (2 given) ====================================================================== ERROR: test_read (test.test_urllib.urlopen_HttpTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_urllib.py", line 168, in test_read fp = urlopen("http://python.org/") File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_urllib.py", line 33, in urlopen return opener.open(url) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/urllib/request.py", line 1444, in open return getattr(self, name)(url) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/urllib/request.py", line 1618, in open_http return self._open_generic_http(http.client.HTTPConnection, url, data) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/urllib/request.py", line 1601, in _open_generic_http response = http_conn.getresponse() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/http/client.py", line 937, in getresponse method=self._method) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/http/client.py", line 275, in __init__ self.fp = sock.makefile("rb") TypeError: makefile() takes exactly 3 positional arguments (2 given) ====================================================================== ERROR: test_read_bogus (test.test_urllib.urlopen_HttpTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_urllib.py", line 185, in test_read_bogus self.assertRaises(IOError, urlopen, "http://python.org/") File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/unittest.py", line 344, in failUnlessRaises callableObj(*args, **kwargs) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_urllib.py", line 33, in urlopen return opener.open(url) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/urllib/request.py", line 1444, in open return getattr(self, name)(url) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/urllib/request.py", line 1618, in open_http return self._open_generic_http(http.client.HTTPConnection, url, data) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/urllib/request.py", line 1601, in _open_generic_http response = http_conn.getresponse() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/http/client.py", line 937, in getresponse method=self._method) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/http/client.py", line 275, in __init__ self.fp = sock.makefile("rb") TypeError: makefile() takes exactly 3 positional arguments (2 given) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 6 18:23:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 17:23:26 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090206172326.4DF8C1E4002@bag.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/93 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_hash ====================================================================== ERROR: test_coerced_integers (test.test_hash.HashEqualityTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_hash.py", line 36, in test_coerced_integers self.same_hash(long(2**63), float(2**63)) NameError: global name 'long' is not defined make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Feb 6 19:11:01 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 6 Feb 2009 19:11:01 +0100 (CET) Subject: [Python-checkins] r69372 - python/branches/py3k/Doc/whatsnew/3.0.rst Message-ID: <20090206181101.3EC371E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 6 19:11:01 2009 New Revision: 69372 Log: #5173: StandardError wasn't removed in 2.6. Modified: python/branches/py3k/Doc/whatsnew/3.0.rst Modified: python/branches/py3k/Doc/whatsnew/3.0.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/3.0.rst (original) +++ python/branches/py3k/Doc/whatsnew/3.0.rst Fri Feb 6 19:11:01 2009 @@ -691,7 +691,7 @@ idiom for handling all exceptions except for this latter category is to use :keyword:`except` :exc:`Exception`. -* :exc:`StandardError` was removed (in 2.6 already). +* :exc:`StandardError` was removed. * Exceptions no longer behave as sequences. Use the :attr:`args` attribute instead. From python-checkins at python.org Fri Feb 6 22:08:52 2009 From: python-checkins at python.org (neil.schemenauer) Date: Fri, 6 Feb 2009 22:08:52 +0100 (CET) Subject: [Python-checkins] r69373 - in python/trunk/Lib/compiler: pyassem.py pycodegen.py Message-ID: <20090206210852.DDC3D1E4002@bag.python.org> Author: neil.schemenauer Date: Fri Feb 6 22:08:52 2009 New Revision: 69373 Log: Overhaul Lib/compiler block ordering. The previous code was filled with hacks. The new code is based on issue #2472 posted by Antoine Pitrou. I did some further cleanups of the pyassem code and optimized the block ordering pass. Modified: python/trunk/Lib/compiler/pyassem.py python/trunk/Lib/compiler/pycodegen.py Modified: python/trunk/Lib/compiler/pyassem.py ============================================================================== --- python/trunk/Lib/compiler/pyassem.py (original) +++ python/trunk/Lib/compiler/pyassem.py Fri Feb 6 22:08:52 2009 @@ -21,6 +21,7 @@ if self.current: print "end", repr(self.current) print " next", self.current.next + print " prev", self.current.prev print " ", self.current.get_children() print repr(block) self.current = block @@ -40,13 +41,12 @@ if block is None: block = self.newBlock() - # Note: If the current block ends with an unconditional - # control transfer, then it is incorrect to add an implicit - # transfer to the block graph. The current code requires - # these edges to get the blocks emitted in the right order, - # however. :-( If a client needs to remove these edges, call - # pruneEdges(). - + # Note: If the current block ends with an unconditional control + # transfer, then it is techically incorrect to add an implicit + # transfer to the block graph. Doing so results in code generation + # for unreachable blocks. That doesn't appear to be very common + # with Python code and since the built-in compiler doesn't optimize + # it out we don't either. self.current.addNext(block) self.startBlock(block) @@ -69,8 +69,6 @@ def emit(self, *inst): if self._debug: print "\t", inst - if inst[0] in ['RETURN_VALUE', 'YIELD_VALUE']: - self.current.addOutEdge(self.exit) if len(inst) == 2 and isinstance(inst[1], Block): self.current.addOutEdge(inst[1]) self.current.emit(inst) @@ -80,118 +78,9 @@ i.e. each node appears before all of its successors """ - # XXX make sure every node that doesn't have an explicit next - # is set so that next points to exit - for b in self.blocks.elements(): - if b is self.exit: - continue - if not b.next: - b.addNext(self.exit) - order = dfs_postorder(self.entry, {}) - order.reverse() - self.fixupOrder(order, self.exit) - # hack alert - if not self.exit in order: - order.append(self.exit) - + order = order_blocks(self.entry, self.exit) return order - def fixupOrder(self, blocks, default_next): - """Fixup bad order introduced by DFS.""" - - # XXX This is a total mess. There must be a better way to get - # the code blocks in the right order. - - self.fixupOrderHonorNext(blocks, default_next) - self.fixupOrderForward(blocks, default_next) - - def fixupOrderHonorNext(self, blocks, default_next): - """Fix one problem with DFS. - - The DFS uses child block, but doesn't know about the special - "next" block. As a result, the DFS can order blocks so that a - block isn't next to the right block for implicit control - transfers. - """ - index = {} - for i in range(len(blocks)): - index[blocks[i]] = i - - for i in range(0, len(blocks) - 1): - b = blocks[i] - n = blocks[i + 1] - if not b.next or b.next[0] == default_next or b.next[0] == n: - continue - # The blocks are in the wrong order. Find the chain of - # blocks to insert where they belong. - cur = b - chain = [] - elt = cur - while elt.next and elt.next[0] != default_next: - chain.append(elt.next[0]) - elt = elt.next[0] - # Now remove the blocks in the chain from the current - # block list, so that they can be re-inserted. - l = [] - for b in chain: - assert index[b] > i - l.append((index[b], b)) - l.sort() - l.reverse() - for j, b in l: - del blocks[index[b]] - # Insert the chain in the proper location - blocks[i:i + 1] = [cur] + chain - # Finally, re-compute the block indexes - for i in range(len(blocks)): - index[blocks[i]] = i - - def fixupOrderForward(self, blocks, default_next): - """Make sure all JUMP_FORWARDs jump forward""" - index = {} - chains = [] - cur = [] - for b in blocks: - index[b] = len(chains) - cur.append(b) - if b.next and b.next[0] == default_next: - chains.append(cur) - cur = [] - chains.append(cur) - - while 1: - constraints = [] - - for i in range(len(chains)): - l = chains[i] - for b in l: - for c in b.get_children(): - if index[c] < i: - forward_p = 0 - for inst in b.insts: - if inst[0] == 'JUMP_FORWARD': - if inst[1] == c: - forward_p = 1 - if not forward_p: - continue - constraints.append((index[c], i)) - - if not constraints: - break - - # XXX just do one for now - # do swaps to get things in the right order - goes_before, a_chain = constraints[0] - assert a_chain > goes_before - c = chains[a_chain] - chains.remove(c) - chains.insert(goes_before, c) - - del blocks[:] - for c in chains: - for b in c: - blocks.append(b) - def getBlocks(self): return self.blocks.elements() @@ -205,27 +94,81 @@ l.extend(b.getContainedGraphs()) return l -def dfs_postorder(b, seen): - """Depth-first search of tree rooted at b, return in postorder""" + +def order_blocks(start_block, exit_block): + """Order blocks so that they are emitted in the right order""" + # Rules: + # - when a block has a next block, the next block must be emitted just after + # - when a block has followers (relative jumps), it must be emitted before + # them + # - all reachable blocks must be emitted order = [] - seen[b] = b - for c in b.get_children(): - if c in seen: + + # Find all the blocks to be emitted. + remaining = set() + todo = [start_block] + while todo: + b = todo.pop() + if b in remaining: continue - order = order + dfs_postorder(c, seen) - order.append(b) + remaining.add(b) + for c in b.get_children(): + if c not in remaining: + todo.append(c) + + # A block is dominated by another block if that block must be emitted + # before it. + dominators = {} + for b in remaining: + if __debug__ and b.next: + assert b is b.next[0].prev[0], (b, b.next) + # preceeding blocks dominate following blocks + for c in b.get_followers(): + while 1: + dominators.setdefault(c, set()).add(b) + # Any block that has a next pointer leading to c is also + # dominated because the whole chain will be emitted at once. + # Walk backwards and add them all. + if c.prev and c.prev[0] is not b: + c = c.prev[0] + else: + break + + def find_next(): + # Find a block that can be emitted next. + for b in remaining: + for c in dominators[b]: + if c in remaining: + break # can't emit yet, dominated by a remaining block + else: + return b + assert 0, 'circular dependency, cannot find next block' + + b = start_block + while 1: + order.append(b) + remaining.discard(b) + if b.next: + b = b.next[0] + continue + elif b is not exit_block and not b.has_unconditional_transfer(): + order.append(exit_block) + if not remaining: + break + b = find_next() return order + class Block: _count = 0 def __init__(self, label=''): self.insts = [] - self.inEdges = misc.Set() - self.outEdges = misc.Set() + self.outEdges = set() self.label = label self.bid = Block._count self.next = [] + self.prev = [] Block._count = Block._count + 1 def __repr__(self): @@ -241,51 +184,46 @@ def emit(self, inst): op = inst[0] - if op[:4] == 'JUMP': - self.outEdges.add(inst[1]) self.insts.append(inst) def getInstructions(self): return self.insts - def addInEdge(self, block): - self.inEdges.add(block) - def addOutEdge(self, block): self.outEdges.add(block) def addNext(self, block): self.next.append(block) assert len(self.next) == 1, map(str, self.next) + block.prev.append(self) + assert len(block.prev) == 1, map(str, block.prev) - _uncond_transfer = ('RETURN_VALUE', 'RAISE_VARARGS', 'YIELD_VALUE', - 'JUMP_ABSOLUTE', 'JUMP_FORWARD', 'CONTINUE_LOOP') - - def pruneNext(self): - """Remove bogus edge for unconditional transfers - - Each block has a next edge that accounts for implicit control - transfers, e.g. from a JUMP_IF_FALSE to the block that will be - executed if the test is true. - - These edges must remain for the current assembler code to - work. If they are removed, the dfs_postorder gets things in - weird orders. However, they shouldn't be there for other - purposes, e.g. conversion to SSA form. This method will - remove the next edge when it follows an unconditional control - transfer. - """ + _uncond_transfer = ('RETURN_VALUE', 'RAISE_VARARGS', + 'JUMP_ABSOLUTE', 'JUMP_FORWARD', 'CONTINUE_LOOP', + ) + + def has_unconditional_transfer(self): + """Returns True if there is an unconditional transfer to an other block + at the end of this block. This means there is no risk for the bytecode + executer to go past this block's bytecode.""" try: op, arg = self.insts[-1] except (IndexError, ValueError): return - if op in self._uncond_transfer: - self.next = [] + return op in self._uncond_transfer def get_children(self): - if self.next and self.next[0] in self.outEdges: - self.outEdges.remove(self.next[0]) - return self.outEdges.elements() + self.next + return list(self.outEdges) + self.next + + def get_followers(self): + """Get the whole list of followers, including the next block.""" + followers = set(self.next) + # Blocks that must be emitted *after* this one, because of + # bytecode offsets (e.g. relative jumps) pointing to them. + for inst in self.insts: + if inst[0] in PyFlowGraph.hasjrel: + followers.add(inst[1]) + return followers def getContainedGraphs(self): """Return all graphs contained within this block. @@ -446,18 +384,18 @@ elif inst[0] != "SET_LINENO": pc = pc + 3 opname = inst[0] - if self.hasjrel.has_elt(opname): + if opname in self.hasjrel: oparg = inst[1] offset = begin[oparg] - pc insts[i] = opname, offset - elif self.hasjabs.has_elt(opname): + elif opname in self.hasjabs: insts[i] = opname, begin[inst[1]] self.stage = FLAT - hasjrel = misc.Set() + hasjrel = set() for i in dis.hasjrel: hasjrel.add(dis.opname[i]) - hasjabs = misc.Set() + hasjabs = set() for i in dis.hasjabs: hasjabs.add(dis.opname[i]) Modified: python/trunk/Lib/compiler/pycodegen.py ============================================================================== --- python/trunk/Lib/compiler/pycodegen.py (original) +++ python/trunk/Lib/compiler/pycodegen.py Fri Feb 6 22:08:52 2009 @@ -671,7 +671,7 @@ self.startBlock(anchor) self.emit('POP_BLOCK') self.setups.pop() - self.startBlock(end) + self.nextBlock(end) self.emit('LOAD_CONST', None) From python-checkins at python.org Fri Feb 6 22:33:45 2009 From: python-checkins at python.org (neil.schemenauer) Date: Fri, 6 Feb 2009 22:33:45 +0100 (CET) Subject: [Python-checkins] r69374 - python/trunk/Lib/distutils/sysconfig.py Message-ID: <20090206213345.5D08D1E4002@bag.python.org> Author: neil.schemenauer Date: Fri Feb 6 22:33:45 2009 New Revision: 69374 Log: Convert "srcdir" into an absolute path if that seems prudent. Currrently the only user of this is Lib/distutils/tests/test_build_ext.py (in order to find the source for xxmodule.c). I'm not sure if other platforms need similar tweaks, I'm not brave enough to attempt it without being able to test. Modified: python/trunk/Lib/distutils/sysconfig.py Modified: python/trunk/Lib/distutils/sysconfig.py ============================================================================== --- python/trunk/Lib/distutils/sysconfig.py (original) +++ python/trunk/Lib/distutils/sysconfig.py Fri Feb 6 22:33:45 2009 @@ -530,6 +530,20 @@ if 'srcdir' not in _config_vars: _config_vars['srcdir'] = project_base + # Convert srcdir into an absolute path if it appears necessary. + # Normally it is relative to the build directory. However, during + # testing, for example, we might be running a non-installed python + # from a different directory. + if python_build and os.name == "posix": + base = os.path.dirname(os.path.abspath(sys.executable)) + if (not os.path.isabs(_config_vars['srcdir']) and + base != os.getcwd()): + # srcdir is relative and we are not in the same directory + # as the executable. Assume executable is in the build + # directory and make srcdir absolute. + srcdir = os.path.join(base, _config_vars['srcdir']) + _config_vars['srcdir'] = os.path.normpath(srcdir) + if sys.platform == 'darwin': kernel_version = os.uname()[2] # Kernel version (8.4.3) major_version = int(kernel_version.split('.')[0]) From buildbot at python.org Fri Feb 6 22:34:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 21:34:19 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090206213419.85D671E4002@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/825 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: neil.schemenauer BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_urllib2 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Feb 6 22:42:05 2009 From: python-checkins at python.org (neil.schemenauer) Date: Fri, 6 Feb 2009 22:42:05 +0100 (CET) Subject: [Python-checkins] r69375 - in python/branches/py3k/Lib/distutils: sysconfig.py tests/test_build_ext.py Message-ID: <20090206214206.0001F1E4002@bag.python.org> Author: neil.schemenauer Date: Fri Feb 6 22:42:05 2009 New Revision: 69375 Log: Make test_build_ext.py use sysconfig "srcdir" to find the source for xxmodule.c. Have sysconfig make the srcdir path absolute if that seems necessary (running non-installed Python outside the build directory). Modified: python/branches/py3k/Lib/distutils/sysconfig.py python/branches/py3k/Lib/distutils/tests/test_build_ext.py Modified: python/branches/py3k/Lib/distutils/sysconfig.py ============================================================================== --- python/branches/py3k/Lib/distutils/sysconfig.py (original) +++ python/branches/py3k/Lib/distutils/sysconfig.py Fri Feb 6 22:42:05 2009 @@ -504,6 +504,20 @@ _config_vars['prefix'] = PREFIX _config_vars['exec_prefix'] = EXEC_PREFIX + # Convert srcdir into an absolute path if it appears necessary. + # Normally it is relative to the build directory. However, during + # testing, for example, we might be running a non-installed python + # from a different directory. + if python_build and os.name == "posix": + base = os.path.dirname(os.path.abspath(sys.executable)) + if (not os.path.isabs(_config_vars['srcdir']) and + base != os.getcwd()): + # srcdir is relative and we are not in the same directory + # as the executable. Assume executable is in the build + # directory and make srcdir absolute. + srcdir = os.path.join(base, _config_vars['srcdir']) + _config_vars['srcdir'] = os.path.normpath(srcdir) + if sys.platform == 'darwin': kernel_version = os.uname()[2] # Kernel version (8.4.3) major_version = int(kernel_version.split('.')[0]) 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 Fri Feb 6 22:42:05 2009 @@ -15,6 +15,10 @@ # Don't load the xx module more than once. ALREADY_TESTED = False +def _get_source_filename(): + srcdir = sysconfig.get_config_var('srcdir') + return os.path.join(srcdir, 'Modules', 'xxmodule.c') + class BuildExtTestCase(unittest.TestCase): def setUp(self): # Create a simple test environment @@ -22,9 +26,7 @@ self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_") self.sys_path = sys.path[:] sys.path.append(self.tmp_dir) - - xx_c = os.path.join(sysconfig.project_base, 'Modules', 'xxmodule.c') - shutil.copy(xx_c, self.tmp_dir) + shutil.copy(_get_source_filename(), self.tmp_dir) def test_build_ext(self): global ALREADY_TESTED @@ -97,9 +99,11 @@ self.assert_(len(cmd.library_dirs) > 0) def test_suite(): - if not sysconfig.python_build: + src = _get_source_filename() + if not os.path.exists(src): if support.verbose: - print('test_build_ext: The test must be run in a python build dir') + print('test_build_ext: Cannot find source code (test' + ' must run in python build dir)') return unittest.TestSuite() else: return unittest.makeSuite(BuildExtTestCase) From python-checkins at python.org Fri Feb 6 23:26:23 2009 From: python-checkins at python.org (guilherme.polo) Date: Fri, 6 Feb 2009 23:26:23 +0100 (CET) Subject: [Python-checkins] r69376 - in python/trunk: Misc/NEWS Modules/_tkinter.c Message-ID: <20090206222623.1C79A1E4002@bag.python.org> Author: guilherme.polo Date: Fri Feb 6 23:26:22 2009 New Revision: 69376 Log: Partial fix to issue #1731706: memory leak in Tkapp_Call when calling from a thread different than the one that created the Tcl interpreter. Modified: python/trunk/Misc/NEWS python/trunk/Modules/_tkinter.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Feb 6 23:26:22 2009 @@ -149,6 +149,10 @@ Library ------- +- Partial fix to issue #1731706: memory leak in Tkapp_Call when calling + from a thread different than the one that created the Tcl interpreter. + Patch by Robert Hancock. + - Issue #1520877: Now distutils.sysconfig reads $AR from the environment/Makefile. Patch by Douglas Greiman. Modified: python/trunk/Modules/_tkinter.c ============================================================================== --- python/trunk/Modules/_tkinter.c (original) +++ python/trunk/Modules/_tkinter.c Fri Feb 6 23:26:22 2009 @@ -1256,7 +1256,9 @@ *(e->res) = Tkapp_CallResult(e->self); } LEAVE_PYTHON - done: + + Tkapp_CallDeallocArgs(objv, objStore, objc); +done: /* Wake up calling thread. */ Tcl_MutexLock(&call_mutex); Tcl_ConditionNotify(&e->done); From python-checkins at python.org Fri Feb 6 23:48:08 2009 From: python-checkins at python.org (guilherme.polo) Date: Fri, 6 Feb 2009 23:48:08 +0100 (CET) Subject: [Python-checkins] r69377 - in python/trunk: Misc/NEWS Modules/_tkinter.c Message-ID: <20090206224808.187E61E4002@bag.python.org> Author: guilherme.polo Date: Fri Feb 6 23:48:07 2009 New Revision: 69377 Log: Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will not be used again (this requires Tcl/Tk 8.3.1), also fix a memory leak in Tkapp_Call when calling from a thread different than the one that created the Tcl interpreter. Modified: python/trunk/Misc/NEWS python/trunk/Modules/_tkinter.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Feb 6 23:48:07 2009 @@ -149,9 +149,10 @@ Library ------- -- Partial fix to issue #1731706: memory leak in Tkapp_Call when calling - from a thread different than the one that created the Tcl interpreter. - Patch by Robert Hancock. +- Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will + not be used again (this requires Tcl/Tk 8.3.1), also fix a memory leak in + Tkapp_Call when calling from a thread different than the one that created + the Tcl interpreter. Patch by Robert Hancock. - Issue #1520877: Now distutils.sysconfig reads $AR from the environment/Makefile. Patch by Douglas Greiman. Modified: python/trunk/Modules/_tkinter.c ============================================================================== --- python/trunk/Modules/_tkinter.c (original) +++ python/trunk/Modules/_tkinter.c Fri Feb 6 23:48:07 2009 @@ -9,9 +9,9 @@ /* TCL/TK VERSION INFO: - Only Tcl/Tk 8.2 and later are supported. Older versions are not - supported. (Use Python 2.2 if you cannot upgrade your Tcl/Tk - libraries.) + Only Tcl/Tk 8.3.1 and later are supported. Older versions are not + supported. Use Python 2.6 or older if you cannot upgrade your + Tcl/Tk libraries. */ /* XXX Further speed-up ideas, involving Tcl 8.0 features: @@ -1110,7 +1110,7 @@ int flags; PyObject **res; PyObject **exc_type, **exc_value, **exc_tb; - Tcl_Condition done; + Tcl_Condition *done; } Tkapp_CallEvent; void @@ -1261,7 +1261,7 @@ done: /* Wake up calling thread. */ Tcl_MutexLock(&call_mutex); - Tcl_ConditionNotify(&e->done); + Tcl_ConditionNotify(e->done); Tcl_MutexUnlock(&call_mutex); return 1; } @@ -1299,6 +1299,7 @@ /* We cannot call the command directly. Instead, we must marshal the parameters to the interpreter thread. */ Tkapp_CallEvent *ev; + Tcl_Condition cond = NULL; PyObject *exc_type, *exc_value, *exc_tb; if (!WaitForMainloop(self)) return NULL; @@ -1310,9 +1311,9 @@ ev->exc_type = &exc_type; ev->exc_value = &exc_value; ev->exc_tb = &exc_tb; - ev->done = (Tcl_Condition)0; + ev->done = &cond; - Tkapp_ThreadSend(self, (Tcl_Event*)ev, &ev->done, &call_mutex); + Tkapp_ThreadSend(self, (Tcl_Event*)ev, &cond, &call_mutex); if (res == NULL) { if (exc_type) @@ -1320,6 +1321,7 @@ else PyErr_SetObject(Tkinter_TclError, exc_value); } + Tcl_ConditionFinalize(&cond); } else #endif @@ -1505,7 +1507,7 @@ PyObject **res; PyObject **exc_type; PyObject **exc_val; - Tcl_Condition cond; + Tcl_Condition *cond; } VarEvent; static int @@ -1545,7 +1547,7 @@ ENTER_PYTHON var_perform(ev); Tcl_MutexLock(&var_mutex); - Tcl_ConditionNotify(&ev->cond); + Tcl_ConditionNotify(ev->cond); Tcl_MutexUnlock(&var_mutex); LEAVE_PYTHON return 1; @@ -1560,6 +1562,7 @@ TkappObject *self = (TkappObject*)selfptr; VarEvent *ev; PyObject *res, *exc_type, *exc_val; + Tcl_Condition cond = NULL; /* The current thread is not the interpreter thread. Marshal the call to the interpreter thread, then wait for @@ -1576,9 +1579,10 @@ ev->res = &res; ev->exc_type = &exc_type; ev->exc_val = &exc_val; - ev->cond = NULL; + ev->cond = &cond; ev->ev.proc = (Tcl_EventProc*)var_proc; - Tkapp_ThreadSend(self, (Tcl_Event*)ev, &ev->cond, &var_mutex); + Tkapp_ThreadSend(self, (Tcl_Event*)ev, &cond, &var_mutex); + Tcl_ConditionFinalize(&cond); if (!res) { PyErr_SetObject(exc_type, exc_val); Py_DECREF(exc_type); @@ -2065,7 +2069,7 @@ int create; int *status; ClientData *data; - Tcl_Condition done; + Tcl_Condition *done; } CommandEvent; static int @@ -2078,7 +2082,7 @@ else *ev->status = Tcl_DeleteCommand(ev->interp, ev->name); Tcl_MutexLock(&command_mutex); - Tcl_ConditionNotify(&ev->done); + Tcl_ConditionNotify(ev->done); Tcl_MutexUnlock(&command_mutex); return 1; } @@ -2114,6 +2118,7 @@ data->func = func; if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) { + Tcl_Condition cond = NULL; CommandEvent *ev = (CommandEvent*)ckalloc(sizeof(CommandEvent)); ev->ev.proc = (Tcl_EventProc*)Tkapp_CommandProc; ev->interp = self->interp; @@ -2121,8 +2126,9 @@ ev->name = cmdName; ev->data = (ClientData)data; ev->status = &err; - ev->done = NULL; - Tkapp_ThreadSend(self, (Tcl_Event*)ev, &ev->done, &command_mutex); + ev->done = &cond; + Tkapp_ThreadSend(self, (Tcl_Event*)ev, &cond, &command_mutex); + Tcl_ConditionFinalize(&cond); } else { ENTER_TCL @@ -2153,6 +2159,7 @@ if (!PyArg_ParseTuple(args, "s:deletecommand", &cmdName)) return NULL; if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) { + Tcl_Condition cond = NULL; CommandEvent *ev; ev = (CommandEvent*)ckalloc(sizeof(CommandEvent)); ev->ev.proc = (Tcl_EventProc*)Tkapp_CommandProc; @@ -2160,9 +2167,10 @@ ev->create = 0; ev->name = cmdName; ev->status = &err; - ev->done = NULL; - Tkapp_ThreadSend(self, (Tcl_Event*)ev, &ev->done, + ev->done = &cond; + Tkapp_ThreadSend(self, (Tcl_Event*)ev, &cond, &command_mutex); + Tcl_ConditionFinalize(&cond); } else { ENTER_TCL From python-checkins at python.org Fri Feb 6 23:52:31 2009 From: python-checkins at python.org (guilherme.polo) Date: Fri, 6 Feb 2009 23:52:31 +0100 (CET) Subject: [Python-checkins] r69378 - in python/branches/release26-maint: Misc/NEWS Modules/_tkinter.c Message-ID: <20090206225231.CA3941E4002@bag.python.org> Author: guilherme.polo Date: Fri Feb 6 23:52:31 2009 New Revision: 69378 Log: Merged revisions 69376 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69376 | guilherme.polo | 2009-02-06 20:26:22 -0200 (Fri, 06 Feb 2009) | 3 lines Partial fix to issue #1731706: memory leak in Tkapp_Call when calling from a thread different than the one that created the Tcl interpreter. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/_tkinter.c Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Fri Feb 6 23:52:31 2009 @@ -80,6 +80,10 @@ Library ------- +- Partial fix to issue #1731706: memory leak in Tkapp_Call when calling + from a thread different than the one that created the Tcl interpreter. + Patch by Robert Hancock. + - Issue #5132: Fixed trouble building extensions under Solaris with --enabled-shared activated. Initial patch by Dave Peterson. Modified: python/branches/release26-maint/Modules/_tkinter.c ============================================================================== --- python/branches/release26-maint/Modules/_tkinter.c (original) +++ python/branches/release26-maint/Modules/_tkinter.c Fri Feb 6 23:52:31 2009 @@ -1256,7 +1256,9 @@ *(e->res) = Tkapp_CallResult(e->self); } LEAVE_PYTHON - done: + + Tkapp_CallDeallocArgs(objv, objStore, objc); +done: /* Wake up calling thread. */ Tcl_MutexLock(&call_mutex); Tcl_ConditionNotify(&e->done); From python-checkins at python.org Sat Feb 7 00:04:49 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 7 Feb 2009 00:04:49 +0100 (CET) Subject: [Python-checkins] r69379 - in python/branches/py3k/Lib: test/test_tcl.py tkinter/test/runtktests.py Message-ID: <20090206230449.1BF221E4002@bag.python.org> Author: guilherme.polo Date: Sat Feb 7 00:04:44 2009 New Revision: 69379 Log: Fixing changes from the last merge. Modified: python/branches/py3k/Lib/test/test_tcl.py python/branches/py3k/Lib/tkinter/test/runtktests.py 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 Sat Feb 7 00:04:44 2009 @@ -10,7 +10,7 @@ # Restore Tkinter.Tk._loadtk that may have been overridden by ttk. # If this is not done then this test may fail for reasons related # to ttk only (like failing to load the tile package). -from ttk import __loadtk__ +from tkinter.ttk import __loadtk__ Tk._loadtk = __loadtk__ Modified: python/branches/py3k/Lib/tkinter/test/runtktests.py ============================================================================== --- python/branches/py3k/Lib/tkinter/test/runtktests.py (original) +++ python/branches/py3k/Lib/tkinter/test/runtktests.py Sat Feb 7 00:04:44 2009 @@ -46,7 +46,8 @@ for name in filenames: try: yield importlib.import_module( - ".%s" % name[:-len(py_ext)], pkg_name) + ".%s.%s" % (pkg_name, name[:-len(py_ext)]), + "tkinter.test") except test.support.ResourceDenied: if gui: raise From buildbot at python.org Sat Feb 7 00:10:55 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 23:10:55 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090206231055.D5EB81E4002@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/827 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: guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sat Feb 7 00:16:11 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 7 Feb 2009 00:16:11 +0100 (CET) Subject: [Python-checkins] r69380 - in python/branches/py3k: Misc/NEWS Modules/_tkinter.c Message-ID: <20090206231611.9A1E71E4002@bag.python.org> Author: guilherme.polo Date: Sat Feb 7 00:16:11 2009 New Revision: 69380 Log: Merged revisions 69376-69377 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69376 | guilherme.polo | 2009-02-06 20:26:22 -0200 (Fri, 06 Feb 2009) | 3 lines Partial fix to issue #1731706: memory leak in Tkapp_Call when calling from a thread different than the one that created the Tcl interpreter. ........ r69377 | guilherme.polo | 2009-02-06 20:48:07 -0200 (Fri, 06 Feb 2009) | 5 lines Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will not be used again (this requires Tcl/Tk 8.3.1), also fix a memory leak in Tkapp_Call when calling from a thread different than the one that created the Tcl interpreter. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_tkinter.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Feb 7 00:16:11 2009 @@ -155,6 +155,11 @@ Library ------- +- Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will + not be used again (this requires Tcl/Tk 8.3.1), also fix a memory leak in + Tkapp_Call when calling from a thread different than the one that created + the Tcl interpreter. Patch by Robert Hancock. + - Issue #4285: Change sys.version_info to be a named tuple. Patch by Ross Light. Modified: python/branches/py3k/Modules/_tkinter.c ============================================================================== --- python/branches/py3k/Modules/_tkinter.c (original) +++ python/branches/py3k/Modules/_tkinter.c Sat Feb 7 00:16:11 2009 @@ -9,9 +9,9 @@ /* TCL/TK VERSION INFO: - Only Tcl/Tk 8.2 and later are supported. Older versions are not - supported. (Use Python 2.2 if you cannot upgrade your Tcl/Tk - libraries.) + Only Tcl/Tk 8.3.1 and later are supported. Older versions are not + supported. Use Python 2.6 or older if you cannot upgrade your + Tcl/Tk libraries. */ /* XXX Further speed-up ideas, involving Tcl 8.0 features: @@ -1085,7 +1085,7 @@ int flags; PyObject **res; PyObject **exc_type, **exc_value, **exc_tb; - Tcl_Condition done; + Tcl_Condition *done; } Tkapp_CallEvent; void @@ -1208,10 +1208,12 @@ *(e->res) = Tkapp_CallResult(e->self); } LEAVE_PYTHON - done: + + Tkapp_CallDeallocArgs(objv, objStore, objc); +done: /* Wake up calling thread. */ Tcl_MutexLock(&call_mutex); - Tcl_ConditionNotify(&e->done); + Tcl_ConditionNotify(e->done); Tcl_MutexUnlock(&call_mutex); return 1; } @@ -1249,6 +1251,7 @@ /* We cannot call the command directly. Instead, we must marshal the parameters to the interpreter thread. */ Tkapp_CallEvent *ev; + Tcl_Condition cond = NULL; PyObject *exc_type, *exc_value, *exc_tb; if (!WaitForMainloop(self)) return NULL; @@ -1260,9 +1263,9 @@ ev->exc_type = &exc_type; ev->exc_value = &exc_value; ev->exc_tb = &exc_tb; - ev->done = (Tcl_Condition)0; + ev->done = &cond; - Tkapp_ThreadSend(self, (Tcl_Event*)ev, &ev->done, &call_mutex); + Tkapp_ThreadSend(self, (Tcl_Event*)ev, &cond, &call_mutex); if (res == NULL) { if (exc_type) @@ -1270,6 +1273,7 @@ else PyErr_SetObject(Tkinter_TclError, exc_value); } + Tcl_ConditionFinalize(&cond); } else #endif @@ -1455,7 +1459,7 @@ PyObject **res; PyObject **exc_type; PyObject **exc_val; - Tcl_Condition cond; + Tcl_Condition *cond; } VarEvent; static int @@ -1499,7 +1503,7 @@ ENTER_PYTHON var_perform(ev); Tcl_MutexLock(&var_mutex); - Tcl_ConditionNotify(&ev->cond); + Tcl_ConditionNotify(ev->cond); Tcl_MutexUnlock(&var_mutex); LEAVE_PYTHON return 1; @@ -1514,6 +1518,7 @@ TkappObject *self = (TkappObject*)selfptr; VarEvent *ev; PyObject *res, *exc_type, *exc_val; + Tcl_Condition cond = NULL; /* The current thread is not the interpreter thread. Marshal the call to the interpreter thread, then wait for @@ -1530,9 +1535,10 @@ ev->res = &res; ev->exc_type = &exc_type; ev->exc_val = &exc_val; - ev->cond = NULL; + ev->cond = &cond; ev->ev.proc = (Tcl_EventProc*)var_proc; - Tkapp_ThreadSend(self, (Tcl_Event*)ev, &ev->cond, &var_mutex); + Tkapp_ThreadSend(self, (Tcl_Event*)ev, &cond, &var_mutex); + Tcl_ConditionFinalize(&cond); if (!res) { PyErr_SetObject(exc_type, exc_val); Py_DECREF(exc_type); @@ -2019,7 +2025,7 @@ int create; int *status; ClientData *data; - Tcl_Condition done; + Tcl_Condition *done; } CommandEvent; static int @@ -2032,7 +2038,7 @@ else *ev->status = Tcl_DeleteCommand(ev->interp, ev->name); Tcl_MutexLock(&command_mutex); - Tcl_ConditionNotify(&ev->done); + Tcl_ConditionNotify(ev->done); Tcl_MutexUnlock(&command_mutex); return 1; } @@ -2068,6 +2074,7 @@ data->func = func; if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) { + Tcl_Condition cond = NULL; CommandEvent *ev = (CommandEvent*)ckalloc(sizeof(CommandEvent)); ev->ev.proc = (Tcl_EventProc*)Tkapp_CommandProc; ev->interp = self->interp; @@ -2075,8 +2082,9 @@ ev->name = cmdName; ev->data = (ClientData)data; ev->status = &err; - ev->done = NULL; - Tkapp_ThreadSend(self, (Tcl_Event*)ev, &ev->done, &command_mutex); + ev->done = &cond; + Tkapp_ThreadSend(self, (Tcl_Event*)ev, &cond, &command_mutex); + Tcl_ConditionFinalize(&cond); } else { ENTER_TCL @@ -2107,6 +2115,7 @@ if (!PyArg_ParseTuple(args, "s:deletecommand", &cmdName)) return NULL; if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) { + Tcl_Condition cond = NULL; CommandEvent *ev; ev = (CommandEvent*)ckalloc(sizeof(CommandEvent)); ev->ev.proc = (Tcl_EventProc*)Tkapp_CommandProc; @@ -2114,9 +2123,10 @@ ev->create = 0; ev->name = cmdName; ev->status = &err; - ev->done = NULL; - Tkapp_ThreadSend(self, (Tcl_Event*)ev, &ev->done, + ev->done = &cond; + Tkapp_ThreadSend(self, (Tcl_Event*)ev, &cond, &command_mutex); + Tcl_ConditionFinalize(&cond); } else { ENTER_TCL From python-checkins at python.org Sat Feb 7 00:30:11 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 7 Feb 2009 00:30:11 +0100 (CET) Subject: [Python-checkins] r69381 - in python/branches/release30-maint: Misc/NEWS Modules/_tkinter.c Message-ID: <20090206233011.CE0E61E4026@bag.python.org> Author: guilherme.polo Date: Sat Feb 7 00:30:11 2009 New Revision: 69381 Log: Hand-merged revision 69376 from svn+ssh://pythondev/python/trunk ........ r69376 | guilherme.polo | 2009-02-06 20:26:22 -0200 Partial fix to issue #1731706: memory leak in Tkapp_Call when calling from a thread different than the one that created the Tcl interpreter. Modified: python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/_tkinter.c Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat Feb 7 00:30:11 2009 @@ -111,6 +111,10 @@ Library ------- +- Partial fix to issue #1731706: memory leak in Tkapp_Call when calling + from a thread different than the one that created the Tcl interpreter. + Patch by Robert Hancock. + - Issue #5132: Fixed trouble building extensions under Solaris with --enabled-shared activated. Initial patch by Dave Peterson. Modified: python/branches/release30-maint/Modules/_tkinter.c ============================================================================== --- python/branches/release30-maint/Modules/_tkinter.c (original) +++ python/branches/release30-maint/Modules/_tkinter.c Sat Feb 7 00:30:11 2009 @@ -1208,7 +1208,9 @@ *(e->res) = Tkapp_CallResult(e->self); } LEAVE_PYTHON - done: + + Tkapp_CallDeallocArgs(objv, objStore, objc); +done: /* Wake up calling thread. */ Tcl_MutexLock(&call_mutex); Tcl_ConditionNotify(&e->done); From python-checkins at python.org Sat Feb 7 00:31:12 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 7 Feb 2009 00:31:12 +0100 (CET) Subject: [Python-checkins] r69382 - python/branches/release30-maint Message-ID: <20090206233112.A24631E402A@bag.python.org> Author: guilherme.polo Date: Sat Feb 7 00:31:12 2009 New Revision: 69382 Log: Blocked revisions 69380 via svnmerge ................ r69380 | guilherme.polo | 2009-02-06 21:16:11 -0200 (Fri, 06 Feb 2009) | 17 lines Merged revisions 69376-69377 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69376 | guilherme.polo | 2009-02-06 20:26:22 -0200 (Fri, 06 Feb 2009) | 3 lines Partial fix to issue #1731706: memory leak in Tkapp_Call when calling from a thread different than the one that created the Tcl interpreter. ........ r69377 | guilherme.polo | 2009-02-06 20:48:07 -0200 (Fri, 06 Feb 2009) | 5 lines Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will not be used again (this requires Tcl/Tk 8.3.1), also fix a memory leak in Tkapp_Call when calling from a thread different than the one that created the Tcl interpreter. ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sat Feb 7 00:39:18 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 7 Feb 2009 00:39:18 +0100 (CET) Subject: [Python-checkins] r69383 - python/branches/release30-maint/Lib/test/test_tcl.py Message-ID: <20090206233918.D5DFE1E4019@bag.python.org> Author: guilherme.polo Date: Sat Feb 7 00:39:18 2009 New Revision: 69383 Log: Revert unwanted merge Modified: python/branches/release30-maint/Lib/test/test_tcl.py Modified: python/branches/release30-maint/Lib/test/test_tcl.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_tcl.py (original) +++ python/branches/release30-maint/Lib/test/test_tcl.py Sat Feb 7 00:39:18 2009 @@ -4,15 +4,9 @@ import os import _tkinter from test import support -from tkinter import Tk, Tcl +from tkinter import Tcl from _tkinter import TclError -# Restore Tkinter.Tk._loadtk that may have been overridden by ttk. -# If this is not done then this test may fail for reasons related -# to ttk only (like failing to load the tile package). -from ttk import __loadtk__ -Tk._loadtk = __loadtk__ - class TkinterTest(unittest.TestCase): From buildbot at python.org Sat Feb 7 00:42:59 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 23:42:59 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 2.6 Message-ID: <20090206234300.20FEF1E4002@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/102 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: guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sat Feb 7 00:43:59 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 06 Feb 2009 23:43:59 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian 3.0 Message-ID: <20090206234359.5CEAD1E4002@bag.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/46 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: benjamin.peterson,eric.smith,mark.dickinson,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_hash ====================================================================== ERROR: test_coerced_integers (test.test_hash.HashEqualityTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/3.0.klose-debian-alpha/build/Lib/test/test_hash.py", line 36, in test_coerced_integers self.same_hash(long(2**63), float(2**63)) NameError: global name 'long' is not defined make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Feb 7 00:48:15 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 7 Feb 2009 00:48:15 +0100 (CET) Subject: [Python-checkins] r69384 - python/branches/release26-maint Message-ID: <20090206234815.218C51E4002@bag.python.org> Author: guilherme.polo Date: Sat Feb 7 00:48:14 2009 New Revision: 69384 Log: Blocked revisions 69050,69060-69061,69169,69195,69211-69212 via svnmerge ........ r69050 | guilherme.polo | 2009-01-28 11:09:03 -0200 (Wed, 28 Jan 2009) | 2 lines Added the ttk module. See issue #2983: Ttk support for Tkinter. ........ r69060 | guilherme.polo | 2009-01-28 17:23:28 -0200 (Wed, 28 Jan 2009) | 2 lines Added support for collecting tests only from specific packages. ........ r69061 | guilherme.polo | 2009-01-28 17:28:04 -0200 (Wed, 28 Jan 2009) | 4 lines * Renaming test_tk_* to test_ttk_* since that is what they are testing. * Added ttk tests to the expected skips mapping just like where test_tcl was expected to be skipped too. ........ r69169 | guilherme.polo | 2009-02-01 00:56:16 -0200 (Sun, 01 Feb 2009) | 3 lines Restore Tkinter.Tk._loadtk so this test doesn't fail for problems related to ttk. ........ r69195 | guilherme.polo | 2009-02-01 22:38:54 -0200 (Sun, 01 Feb 2009) | 3 lines Use a single Tcl interpreter through all these tests, this may help some failing buildbots. ........ r69211 | guilherme.polo | 2009-02-02 18:23:29 -0200 (Mon, 02 Feb 2009) | 1 line Restore the previous geometry before leaving the test ........ r69212 | guilherme.polo | 2009-02-02 18:28:59 -0200 (Mon, 02 Feb 2009) | 1 line Moving to importlib ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sat Feb 7 01:05:39 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 7 Feb 2009 01:05:39 +0100 (CET) Subject: [Python-checkins] r69385 - in python/trunk/Lib/distutils: cmd.py tests/test_cmd.py Message-ID: <20090207000539.71A931E4002@bag.python.org> Author: tarek.ziade Date: Sat Feb 7 01:05:39 2009 New Revision: 69385 Log: #3986 replacing string and types call (like in the Py3k branch), and put exec_msg call at the right place Modified: python/trunk/Lib/distutils/cmd.py python/trunk/Lib/distutils/tests/test_cmd.py Modified: python/trunk/Lib/distutils/cmd.py ============================================================================== --- python/trunk/Lib/distutils/cmd.py (original) +++ python/trunk/Lib/distutils/cmd.py Sat Feb 7 01:05:39 2009 @@ -6,7 +6,7 @@ __revision__ = "$Id$" -import sys, os, string, re +import sys, os, re from distutils.errors import DistutilsOptionError from distutils import util, dir_util, file_util, archive_util, dep_util from distutils import log @@ -156,19 +156,19 @@ "abstract method -- subclass %s must override" % self.__class__ - def dump_options (self, header=None, indent=""): + def dump_options(self, header=None, indent=""): from distutils.fancy_getopt import longopt_xlate if header is None: header = "command options for '%s':" % self.get_command_name() - print indent + header + self.announce(indent + header, level=log.INFO) indent = indent + " " for (option, _, _) in self.user_options: - option = string.translate(option, longopt_xlate) + option = option.translate(longopt_xlate) if option[-1] == "=": option = option[:-1] value = getattr(self, option) - print indent + "%s = %s" % (option, value) - + self.announce(indent + "%s = %s" % (option, value), + level=log.INFO) def run (self): """A command's raison d'etre: carry out the action it exists to @@ -405,8 +405,8 @@ base_name, format, root_dir, base_dir, dry_run=self.dry_run) - def make_file (self, infiles, outfile, func, args, - exec_msg=None, skip_msg=None, level=1): + def make_file(self, infiles, outfile, func, args, + exec_msg=None, skip_msg=None, level=1): """Special case of 'execute()' for operations that process one or more input files and generate one output file. Works just like 'execute()', except the operation is skipped and a different @@ -415,24 +415,24 @@ and it is true, then the command is unconditionally run -- does no timestamp checks. """ - if exec_msg is None: - exec_msg = "generating %s from %s" % \ - (outfile, string.join(infiles, ', ')) if skip_msg is None: skip_msg = "skipping %s (inputs unchanged)" % outfile - # Allow 'infiles' to be a single string - if type(infiles) is StringType: + if isinstance(infiles, str): infiles = (infiles,) - elif type(infiles) not in (ListType, TupleType): + elif not isinstance(infiles, (list, tuple)): raise TypeError, \ "'infiles' must be a string, or a list or tuple of strings" + if exec_msg is None: + exec_msg = "generating %s from %s" % \ + (outfile, ', '.join(infiles)) + # If 'outfile' must be regenerated (either because it doesn't # exist, is out-of-date, or the 'force' flag is true) then # perform the action that presumably regenerates it - if self.force or dep_util.newer_group (infiles, outfile): + if self.force or dep_util.newer_group(infiles, outfile): self.execute(func, args, exec_msg, level) # Otherwise, print the "skip" message Modified: python/trunk/Lib/distutils/tests/test_cmd.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_cmd.py (original) +++ python/trunk/Lib/distutils/tests/test_cmd.py Sat Feb 7 01:05:39 2009 @@ -5,23 +5,23 @@ from distutils.dist import Distribution from distutils.errors import DistutilsOptionError -class CommandTestCase(unittest.TestCase): - - def test_ensure_string_list(self): +class MyCmd(Command): + def initialize_options(self): + pass - class MyCmd(Command): - - def initialize_options(self): - pass +class CommandTestCase(unittest.TestCase): + def setUp(self): dist = Distribution() - cmd = MyCmd(dist) + self.cmd = MyCmd(dist) + def test_ensure_string_list(self): + + cmd = self.cmd cmd.not_string_list = ['one', 2, 'three'] cmd.yes_string_list = ['one', 'two', 'three'] cmd.not_string_list2 = object() cmd.yes_string_list2 = 'ok' - cmd.ensure_string_list('yes_string_list') cmd.ensure_string_list('yes_string_list2') @@ -31,6 +31,37 @@ self.assertRaises(DistutilsOptionError, cmd.ensure_string_list, 'not_string_list2') + def test_make_file(self): + + cmd = self.cmd + + # making sure it raises when infiles is not a string or a list/tuple + self.assertRaises(TypeError, cmd.make_file, + infiles=1, outfile='', func='func', args=()) + + # making sure execute gets called properly + def _execute(func, args, exec_msg, level): + self.assertEquals(exec_msg, 'generating out from in') + cmd.force = True + cmd.execute = _execute + cmd.make_file(infiles='in', outfile='out', func='func', args=()) + + def test_dump_options(self): + + msgs = [] + def _announce(msg, level): + msgs.append(msg) + cmd = self.cmd + cmd.announce = _announce + cmd.option1 = 1 + cmd.option2 = 1 + cmd.user_options = [('option1', '', ''), ('option2', '', '')] + cmd.dump_options() + + wanted = ["command options for 'MyCmd':", ' option1 = 1', + ' option2 = 1'] + self.assertEquals(msgs, wanted) + def test_suite(): return unittest.makeSuite(CommandTestCase) From buildbot at python.org Sat Feb 7 01:06:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 07 Feb 2009 00:06:25 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090207000626.1C5BC1E4002@bag.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/208 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: guilherme.polo BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Sat Feb 7 01:07:10 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 7 Feb 2009 01:07:10 +0100 (CET) Subject: [Python-checkins] r69386 - python/branches/release26-maint Message-ID: <20090207000710.1764F1E4002@bag.python.org> Author: tarek.ziade Date: Sat Feb 7 01:07:09 2009 New Revision: 69386 Log: Blocked revisions 69385 via svnmerge ........ r69385 | tarek.ziade | 2009-02-07 01:05:39 +0100 (Sat, 07 Feb 2009) | 1 line #3986 replacing string and types call (like in the Py3k branch), and put exec_msg call at the right place ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sat Feb 7 01:10:49 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 7 Feb 2009 01:10:49 +0100 (CET) Subject: [Python-checkins] r69387 - in python/branches/py3k: Lib/distutils/cmd.py Lib/distutils/tests/test_cmd.py Message-ID: <20090207001049.09C721E4002@bag.python.org> Author: tarek.ziade Date: Sat Feb 7 01:10:48 2009 New Revision: 69387 Log: Merged revisions 69385 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69385 | tarek.ziade | 2009-02-07 01:05:39 +0100 (Sat, 07 Feb 2009) | 1 line #3986 replacing string and types call (like in the Py3k branch), and put exec_msg call at the right place ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/cmd.py python/branches/py3k/Lib/distutils/tests/test_cmd.py Modified: python/branches/py3k/Lib/distutils/cmd.py ============================================================================== --- python/branches/py3k/Lib/distutils/cmd.py (original) +++ python/branches/py3k/Lib/distutils/cmd.py Sat Feb 7 01:10:48 2009 @@ -155,15 +155,15 @@ from distutils.fancy_getopt import longopt_xlate if header is None: header = "command options for '%s':" % self.get_command_name() - print(indent + header) + self.announce(indent + header, level=log.INFO) indent = indent + " " for (option, _, _) in self.user_options: option = longopt_xlate(option) if option[-1] == "=": option = option[:-1] value = getattr(self, option) - print(indent + "%s = %s" % (option, value)) - + self.announce(indent + "%s = %s" % (option, value), + level=log.INFO) def run(self): """A command's raison d'etre: carry out the action it exists to @@ -383,12 +383,9 @@ and it is true, then the command is unconditionally run -- does no timestamp checks. """ - if exec_msg is None: - exec_msg = "generating %s from %s" % (outfile, ', '.join(infiles)) if skip_msg is None: skip_msg = "skipping %s (inputs unchanged)" % outfile - # Allow 'infiles' to be a single string if isinstance(infiles, str): infiles = (infiles,) @@ -396,10 +393,13 @@ raise TypeError( "'infiles' must be a string, or a list or tuple of strings") + if exec_msg is None: + exec_msg = "generating %s from %s" % (outfile, ', '.join(infiles)) + # If 'outfile' must be regenerated (either because it doesn't # exist, is out-of-date, or the 'force' flag is true) then # perform the action that presumably regenerates it - if self.force or dep_util.newer_group (infiles, outfile): + if self.force or dep_util.newer_group(infiles, outfile): self.execute(func, args, exec_msg, level) # Otherwise, print the "skip" message else: Modified: python/branches/py3k/Lib/distutils/tests/test_cmd.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_cmd.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_cmd.py Sat Feb 7 01:10:48 2009 @@ -5,23 +5,23 @@ from distutils.dist import Distribution from distutils.errors import DistutilsOptionError -class CommandTestCase(unittest.TestCase): - - def test_ensure_string_list(self): +class MyCmd(Command): + def initialize_options(self): + pass - class MyCmd(Command): - - def initialize_options(self): - pass +class CommandTestCase(unittest.TestCase): + def setUp(self): dist = Distribution() - cmd = MyCmd(dist) + self.cmd = MyCmd(dist) + def test_ensure_string_list(self): + + cmd = self.cmd cmd.not_string_list = ['one', 2, 'three'] cmd.yes_string_list = ['one', 'two', 'three'] cmd.not_string_list2 = object() cmd.yes_string_list2 = 'ok' - cmd.ensure_string_list('yes_string_list') cmd.ensure_string_list('yes_string_list2') @@ -31,6 +31,37 @@ self.assertRaises(DistutilsOptionError, cmd.ensure_string_list, 'not_string_list2') + def test_make_file(self): + + cmd = self.cmd + + # making sure it raises when infiles is not a string or a list/tuple + self.assertRaises(TypeError, cmd.make_file, + infiles=1, outfile='', func='func', args=()) + + # making sure execute gets called properly + def _execute(func, args, exec_msg, level): + self.assertEquals(exec_msg, 'generating out from in') + cmd.force = True + cmd.execute = _execute + cmd.make_file(infiles='in', outfile='out', func='func', args=()) + + def test_dump_options(self): + + msgs = [] + def _announce(msg, level): + msgs.append(msg) + cmd = self.cmd + cmd.announce = _announce + cmd.option1 = 1 + cmd.option2 = 1 + cmd.user_options = [('option1', '', ''), ('option2', '', '')] + cmd.dump_options() + + wanted = ["command options for 'MyCmd':", ' option1 = 1', + ' option2 = 1'] + self.assertEquals(msgs, wanted) + def test_suite(): return unittest.makeSuite(CommandTestCase) From python-checkins at python.org Sat Feb 7 01:11:51 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 7 Feb 2009 01:11:51 +0100 (CET) Subject: [Python-checkins] r69388 - python/branches/release30-maint Message-ID: <20090207001151.060CC1E4002@bag.python.org> Author: tarek.ziade Date: Sat Feb 7 01:11:50 2009 New Revision: 69388 Log: Blocked revisions 69387 via svnmerge ................ r69387 | tarek.ziade | 2009-02-07 01:10:48 +0100 (Sat, 07 Feb 2009) | 9 lines Merged revisions 69385 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69385 | tarek.ziade | 2009-02-07 01:05:39 +0100 (Sat, 07 Feb 2009) | 1 line #3986 replacing string and types call (like in the Py3k branch), and put exec_msg call at the right place ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sat Feb 7 01:13:39 2009 From: python-checkins at python.org (neil.schemenauer) Date: Sat, 7 Feb 2009 01:13:39 +0100 (CET) Subject: [Python-checkins] r69389 - python/trunk/Lib/compiler/pycodegen.py Message-ID: <20090207001339.CDC331E4002@bag.python.org> Author: neil.schemenauer Date: Sat Feb 7 01:13:39 2009 New Revision: 69389 Log: Make names generated for 'with' variables match the built-in compiler. Modified: python/trunk/Lib/compiler/pycodegen.py Modified: python/trunk/Lib/compiler/pycodegen.py ============================================================================== --- python/trunk/Lib/compiler/pycodegen.py (original) +++ python/trunk/Lib/compiler/pycodegen.py Sat Feb 7 01:13:39 2009 @@ -814,8 +814,8 @@ def visitWith(self, node): body = self.newBlock() final = self.newBlock() - valuevar = "$value%d" % self.__with_count self.__with_count += 1 + valuevar = "_[%d]" % self.__with_count self.set_lineno(node) self.visit(node.expr) self.emit('DUP_TOP') From python-checkins at python.org Sat Feb 7 01:14:28 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 7 Feb 2009 01:14:28 +0100 (CET) Subject: [Python-checkins] r69390 - python/branches/release26-maint Message-ID: <20090207001428.98E001E4002@bag.python.org> Author: guilherme.polo Date: Sat Feb 7 01:14:28 2009 New Revision: 69390 Log: Blocked revisions 69377 via svnmerge ........ r69377 | guilherme.polo | 2009-02-06 20:48:07 -0200 (Fri, 06 Feb 2009) | 5 lines Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will not be used again (this requires Tcl/Tk 8.3.1), also fix a memory leak in Tkapp_Call when calling from a thread different than the one that created the Tcl interpreter. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sat Feb 7 01:17:05 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 7 Feb 2009 01:17:05 +0100 (CET) Subject: [Python-checkins] r69391 - python/branches/release30-maint Message-ID: <20090207001705.64F4C1E4002@bag.python.org> Author: guilherme.polo Date: Sat Feb 7 01:17:05 2009 New Revision: 69391 Log: Blocked revisions 69197,69379 via svnmerge ................ r69197 | guilherme.polo | 2009-02-01 23:02:20 -0200 (Sun, 01 Feb 2009) | 10 lines Recorded merge of revisions 69195 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69195 | guilherme.polo | 2009-02-01 22:38:54 -0200 (Sun, 01 Feb 2009) | 3 lines Use a single Tcl interpreter through all these tests, this may help some failing buildbots. ........ ................ r69379 | guilherme.polo | 2009-02-06 21:04:44 -0200 (Fri, 06 Feb 2009) | 2 lines Fixing changes from the last merge. ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Sat Feb 7 01:26:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 07 Feb 2009 00:26:40 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090207002640.9F1FE1E4002@bag.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/95 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: guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_hash ====================================================================== ERROR: test_coerced_integers (test.test_hash.HashEqualityTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_hash.py", line 36, in test_coerced_integers self.same_hash(long(2**63), float(2**63)) NameError: global name 'long' is not defined make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Feb 7 01:45:10 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 7 Feb 2009 01:45:10 +0100 (CET) Subject: [Python-checkins] r69392 - python/branches/py3k/Lib/test/test_hash.py Message-ID: <20090207004510.B11561E4018@bag.python.org> Author: guilherme.polo Date: Sat Feb 7 01:45:10 2009 New Revision: 69392 Log: long -> int Modified: python/branches/py3k/Lib/test/test_hash.py Modified: python/branches/py3k/Lib/test/test_hash.py ============================================================================== --- python/branches/py3k/Lib/test/test_hash.py (original) +++ python/branches/py3k/Lib/test/test_hash.py Sat Feb 7 01:45:10 2009 @@ -33,7 +33,7 @@ # for 64-bit platforms self.same_hash(int(2**31), float(2**31)) self.same_hash(int(-2**63), float(-2**63)) - self.same_hash(long(2**63), float(2**63)) + self.same_hash(int(2**63), float(2**63)) def test_coerced_floats(self): self.same_hash(int(1.23e300), float(1.23e300)) From python-checkins at python.org Sat Feb 7 01:46:52 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 7 Feb 2009 01:46:52 +0100 (CET) Subject: [Python-checkins] r69393 - in python/branches/release30-maint: Lib/test/test_hash.py Message-ID: <20090207004652.DEAE91E4002@bag.python.org> Author: guilherme.polo Date: Sat Feb 7 01:46:52 2009 New Revision: 69393 Log: Merged revisions 69392 via svnmerge from svn+ssh://pythondev/python/branches/py3k ........ r69392 | guilherme.polo | 2009-02-06 22:45:10 -0200 (Fri, 06 Feb 2009) | 1 line long -> int ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_hash.py Modified: python/branches/release30-maint/Lib/test/test_hash.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_hash.py (original) +++ python/branches/release30-maint/Lib/test/test_hash.py Sat Feb 7 01:46:52 2009 @@ -33,7 +33,7 @@ # for 64-bit platforms self.same_hash(int(2**31), float(2**31)) self.same_hash(int(-2**63), float(-2**63)) - self.same_hash(long(2**63), float(2**63)) + self.same_hash(int(2**63), float(2**63)) def test_coerced_floats(self): self.same_hash(int(1.23e300), float(1.23e300)) From buildbot at python.org Sat Feb 7 01:53:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 07 Feb 2009 00:53:45 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090207005345.AE57E1E4002@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/101 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: guilherme.polo 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 Feb 7 01:54:42 2009 From: python-checkins at python.org (neil.schemenauer) Date: Sat, 7 Feb 2009 01:54:42 +0100 (CET) Subject: [Python-checkins] r69394 - in python/trunk: Lib/compiler/consts.py Lib/compiler/pycodegen.py Lib/compiler/symbols.py Misc/NEWS Message-ID: <20090207005442.2B44A1E4002@bag.python.org> Author: neil.schemenauer Date: Sat Feb 7 01:54:41 2009 New Revision: 69394 Log: Issue #999042: The Python compiler now handles explict global statements correctly (should be assigned using STORE_GLOBAL opcode). This was done by having the system table differentiate between explict and implicit globals. Modified: python/trunk/Lib/compiler/consts.py python/trunk/Lib/compiler/pycodegen.py python/trunk/Lib/compiler/symbols.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/compiler/consts.py ============================================================================== --- python/trunk/Lib/compiler/consts.py (original) +++ python/trunk/Lib/compiler/consts.py Sat Feb 7 01:54:41 2009 @@ -4,10 +4,11 @@ OP_APPLY = 'OP_APPLY' SC_LOCAL = 1 -SC_GLOBAL = 2 -SC_FREE = 3 -SC_CELL = 4 -SC_UNKNOWN = 5 +SC_GLOBAL_IMPLICIT = 2 +SC_GLOBAL_EXPLICT = 3 +SC_FREE = 4 +SC_CELL = 5 +SC_UNKNOWN = 6 CO_OPTIMIZED = 0x0001 CO_NEWLOCALS = 0x0002 Modified: python/trunk/Lib/compiler/pycodegen.py ============================================================================== --- python/trunk/Lib/compiler/pycodegen.py (original) +++ python/trunk/Lib/compiler/pycodegen.py Sat Feb 7 01:54:41 2009 @@ -7,7 +7,8 @@ from compiler import ast, parse, walk, syntax from compiler import pyassem, misc, future, symbols -from compiler.consts import SC_LOCAL, SC_GLOBAL, SC_FREE, SC_CELL +from compiler.consts import SC_LOCAL, SC_GLOBAL_IMPLICIT, SC_GLOBAL_EXPLICT, \ + SC_FREE, SC_CELL from compiler.consts import (CO_VARARGS, CO_VARKEYWORDS, CO_NEWLOCALS, CO_NESTED, CO_GENERATOR, CO_FUTURE_DIVISION, CO_FUTURE_ABSIMPORT, CO_FUTURE_WITH_STATEMENT, CO_FUTURE_PRINT_FUNCTION) @@ -282,7 +283,9 @@ self.emit(prefix + '_NAME', name) else: self.emit(prefix + '_FAST', name) - elif scope == SC_GLOBAL: + elif scope == SC_GLOBAL_EXPLICT: + self.emit(prefix + '_GLOBAL', name) + elif scope == SC_GLOBAL_IMPLICIT: if not self.optimized: self.emit(prefix + '_NAME', name) else: Modified: python/trunk/Lib/compiler/symbols.py ============================================================================== --- python/trunk/Lib/compiler/symbols.py (original) +++ python/trunk/Lib/compiler/symbols.py Sat Feb 7 01:54:41 2009 @@ -1,7 +1,8 @@ """Module symbol-table generator""" from compiler import ast -from compiler.consts import SC_LOCAL, SC_GLOBAL, SC_FREE, SC_CELL, SC_UNKNOWN +from compiler.consts import SC_LOCAL, SC_GLOBAL_IMPLICIT, SC_GLOBAL_EXPLICT, \ + SC_FREE, SC_CELL, SC_UNKNOWN from compiler.misc import mangle import types @@ -89,7 +90,7 @@ The scope of a name could be LOCAL, GLOBAL, FREE, or CELL. """ if name in self.globals: - return SC_GLOBAL + return SC_GLOBAL_EXPLICT if name in self.cells: return SC_CELL if name in self.defs: @@ -99,7 +100,7 @@ if self.nested: return SC_UNKNOWN else: - return SC_GLOBAL + return SC_GLOBAL_IMPLICIT def get_free_vars(self): if not self.nested: @@ -152,7 +153,7 @@ if sc == SC_UNKNOWN or sc == SC_FREE \ or isinstance(self, ClassScope): self.frees[name] = 1 - elif sc == SC_GLOBAL: + elif sc == SC_GLOBAL_IMPLICIT: child_globals.append(name) elif isinstance(self, FunctionScope) and sc == SC_LOCAL: self.cells[name] = 1 Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Feb 7 01:54:41 2009 @@ -410,6 +410,9 @@ protocol numbers are supplied outside the allowed 0-65536 range on bind() and getservbyport(). +- Issue #999042: The Python compiler now handles explict global statements + correctly (should be assigned using STORE_GLOBAL opcode). + Tools/Demos ----------- From python-checkins at python.org Sat Feb 7 02:15:28 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 7 Feb 2009 02:15:28 +0100 (CET) Subject: [Python-checkins] r69395 - in python/branches/py3k: Doc/library/importlib.rst Lib/importlib/NOTES Lib/importlib/__init__.py Lib/importlib/_bootstrap.py Lib/importlib/test/import_/test___package__.py Lib/importlib/test/import_/test_caching.py Lib/importlib/test/import_/test_path.py Lib/importlib/test/import_/util.py Lib/importlib/test/test_api.py Message-ID: <20090207011528.0E3C21E4002@bag.python.org> Author: brett.cannon Date: Sat Feb 7 02:15:27 2009 New Revision: 69395 Log: Rewrite the code implementing __import__ for importlib. Now it is much simpler and relies much more on meta path finders to abstract out various parts of import. As part of this the semantics for import_module tightened up and now follow __import__ much more closely (biggest thing is that the 'package' argument must now already be imported, else a SystemError is raised). Modified: python/branches/py3k/Doc/library/importlib.rst python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/__init__.py python/branches/py3k/Lib/importlib/_bootstrap.py python/branches/py3k/Lib/importlib/test/import_/test___package__.py python/branches/py3k/Lib/importlib/test/import_/test_caching.py python/branches/py3k/Lib/importlib/test/import_/test_path.py python/branches/py3k/Lib/importlib/test/import_/util.py python/branches/py3k/Lib/importlib/test/test_api.py Modified: python/branches/py3k/Doc/library/importlib.rst ============================================================================== --- python/branches/py3k/Doc/library/importlib.rst (original) +++ python/branches/py3k/Doc/library/importlib.rst Sat Feb 7 02:15:27 2009 @@ -72,11 +72,15 @@ import in absolute or relative terms (e.g. either ``pkg.mod`` or ``..mod``). If the name is specified in relative terms, then the *package* argument must be - specified to the package which is to act as the anchor for resolving the + set to the package which is to act as the anchor for resolving the package name (e.g. ``import_module('..mod', 'pkg.subpkg')`` will import - ``pkg.mod``). The specified module will be inserted into - :data:`sys.modules` and returned. + ``pkg.mod``). + The :func:`import_module` function acts as a simplifying wrapper around + :func:`__import__`. This means all semantics of the function are derived + from :func:`__import__`, including requiring the package where an import is + occuring from to already be imported (i.e., *package* must already be + imported). :mod:`importlib.machinery` -- Importers and path hooks ------------------------------------------------------ Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sat Feb 7 02:15:27 2009 @@ -1,35 +1,10 @@ to do ///// -* Create sandbox directory for a distutils packaging of what is in Python 2.7. - * Use rpartition for getting the package of a module. - + Make sure that an empty string is acceptable for __package__. - -* Create meta_path importer for sys.path. - - + Document. - -* Refactor __import__. - - + Create a greatest common denominator function for __import__/import_module - that takes in an absolute module name and performs the import. - - - Needs of __import__ - - * Figure out caller's package. - * Import module. - * Set __package__. - * Figure out what module to return. - - - Needs of import_module - - * Resolve name/level. - * Import module. - - + Use GCD import for __import__. - + Use GCD import for import_module. + + Make sure there is a test for the empty string as acceptable for + __package__. * Implement PEP 302 protocol for loaders (should just be a matter of testing). @@ -66,13 +41,11 @@ * source_path * bytecode_path - * write_bytecode + * write_bytecode (not abstract) + util - - get_module decorator (new name) - - check_name decorator (new name) - - resolve_name + - get_module decorator (rename: module_for_loader) + machinery @@ -88,6 +61,8 @@ * SourceFinder * (?) Loader + - PathFinder + * Write benchmark suite. * OPTIMIZE! Modified: python/branches/py3k/Lib/importlib/__init__.py ============================================================================== --- python/branches/py3k/Lib/importlib/__init__.py (original) +++ python/branches/py3k/Lib/importlib/__init__.py Sat Feb 7 02:15:27 2009 @@ -29,7 +29,7 @@ """Set __import__ to an instance of Import.""" global original__import__ original__import__ = __import__ - __builtins__['__import__'] = Import() + __builtins__['__import__'] = _bootstrap._import def _reset__import__(): @@ -114,7 +114,7 @@ # Public API ######################################################### -__import__ = _bootstrap.Import().__call__ +__import__ = _bootstrap._import def import_module(name, package=None): @@ -125,17 +125,15 @@ relative import to an absolute import. """ + level = 0 if name.startswith('.'): if not package: raise TypeError("relative imports require the 'package' argument") - level = 0 for character in name: if character != '.': break level += 1 - name = Import._resolve_name(name[level:], package, level) - __import__(name) - return sys.modules[name] + return _bootstrap._gcd_import(name[level:], package, level) # XXX This should go away once the public API is done. Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Sat Feb 7 02:15:27 2009 @@ -681,22 +681,31 @@ being made from, and the level adjustment. This function represents the greatest common denominator of functionality - between import_module and __import__. + between import_module and __import__. This includes settting __package__ if + the loader did not. + """ - if package and package not in sys.modules: - msg = "Parent module {0!r} not loaded, cannot perform relative import" - raise SystemError(msg.format(package)) - dot = len(package) + if package: + if not hasattr(package, 'rindex'): + raise ValueError("__package__ not set to a string") + elif package not in sys.modules: + msg = ("Parent module {0!r} not loaded, cannot perform relative " + "import") + raise SystemError(msg.format(package)) + if not name and level == 0: + raise ValueError("Empty module name") if level > 0: + dot = len(package) for x in range(level, 1, -1): try: dot = package.rindex('.', 0, dot) - except AttributeError: - raise ValueError("__package__ not set to a string") except ValueError: - raise ValueError("attempted relative import beyond top-level " - "package") - name = "{0}.{1}".format(package[:dot], name) + raise ValueError("attempted relative import beyond " + "top-level package") + if name: + name = "{0}.{1}".format(package[:dot], name) + else: + name = package[:dot] with ImportLockContext(): try: return sys.modules[name] @@ -706,320 +715,84 @@ path = None if parent: if parent not in sys.modules: - parent_module = _gcd_import(parent) - else: - parent_module = sys.modules[parent] + _gcd_import(parent) + # Backwards-compatibility; be nicer to skip the dict lookup. + parent_module = sys.modules[parent] path = parent_module.__path__ - for finder in sys.meta_path + [PathFinder]: + meta_path = (sys.meta_path + + [BuiltinImporter, FrozenImporter, PathFinder]) + for finder in meta_path: loader = finder.find_module(name, path) - if loader: # XXX Worth checking for None explicitly? - return loader.load_module(name) + if loader is not None: + loader.load_module(name) + break else: raise ImportError("No module named {0}".format(name)) + # Backwards-compatibility; be nicer to skip the dict lookup. + module = sys.modules[name] + if parent: + # Set the module as an attribute on its parent. + setattr(parent_module, name.rpartition('.')[2], module) + # Set __package__ if the loader did not. + if not hasattr(module, '__package__') or module.__package__ is None: + # Watch out for what comes out of sys.modules to not be a module, + # e.g. an int. + try: + module.__package__ = module.__name__ + if not hasattr(module, '__path__'): + module.__package__ = module.__package__.rpartition('.')[0] + except AttributeError: + pass + return module -class Import(object): - - """Class that implements the __import__ interface. +def _import(name, globals={}, locals={}, fromlist=[], level=0): + """Import a module. - Backwards compatibility is maintained by extending sys.meta_path - interally (for handling built-in and frozen modules) and providing a - default path hooks entry for extension modules, .py, and .pyc - files. Both are controlled during instance initialization. + The 'globals' argument is used to infer where the import is occuring from + to handle relative imports. The 'locals' argument is ignored. The + 'fromlist' argument specifies what should exist as attributes on the module + being imported (e.g. ``from module import ``). The 'level' + argument represents the package location to import from in a relative + import (e.g. ``from ..pkg import mod`` would have a 'level' of 2). """ - - def __init__(self, default_path_hook=None, - extended_meta_path=None): - """Store a default path hook entry and a sequence to internally extend - sys.meta_path by (passing in None uses default importers).""" - if extended_meta_path is None: - self.extended_meta_path = BuiltinImporter, FrozenImporter - else: - self.extended_meta_path = extended_meta_path - self.default_path_hook = default_path_hook - if self.default_path_hook is None: - # Create a handler to deal with extension modules, .py, and .pyc - # files. Built-in and frozen modules are handled by sys.meta_path - # entries. - importers = [ExtensionFileImporter, PyFileImporter] - self.default_path_hook = chaining_fs_path_hook(*importers) - - def _search_meta_path(self, name, path=None): - """Check the importers on sys.meta_path for a loader along with the - extended meta path sequence stored within this instance. - - The extended sys.meta_path entries are searched after the entries on - sys.meta_path. - - """ - for entry in (tuple(sys.meta_path) + self.extended_meta_path): - loader = entry.find_module(name, path) - if loader: - return loader - else: - raise ImportError("No module named %s" % name) - - def _sys_path_importer(self, path_entry): - """Return the importer for the specified path, from - sys.path_importer_cache if possible. - - If None is stored in sys.path_importer_cache then use the default path - hook. - - """ + if level == 0: + module = _gcd_import(name) + else: + # __package__ is not guaranteed to be defined. try: - # See if an importer is cached. - importer = sys.path_importer_cache[path_entry] - # If None was returned, use default importer factory. - if importer is None: - return self.default_path_hook(path_entry) - else: - return importer + package = globals['__package__'] except KeyError: - # No cached importer found; try to get a new one from - # sys.path_hooks or imp.NullImporter. - for importer_factory in (sys.path_hooks + [imp.NullImporter]): - try: - importer = importer_factory(path_entry) - sys.path_importer_cache[path_entry] = importer - return importer - except ImportError: - continue - else: - # No importer factory on sys.path_hooks works; use the default - # importer factory and store None in sys.path_importer_cache. + package = globals['__name__'] + if '__path__' not in globals: + package = package.rpartition('.')[0] + module = _gcd_import(name, package, level) + # The hell that is fromlist ... + if not fromlist: + # Return up to the first dot in 'name'. This is complicated by the fact + # that 'name' may be relative. + if level == 0: + return sys.modules[name.partition('.')[0]] + elif not name: + return module + else: + cut_off = len(name) - len(name.partition('.')[0]) + return sys.modules[module.__name__[:-cut_off]] + else: + # If a package was imported, try to import stuff from fromlist. + if hasattr(module, '__path__'): + if '*' in fromlist and hasattr(module, '__all__'): + fromlist.remove('*') + fromlist.extend(module.__all__) + for x in (y for y in fromlist if not hasattr(module,y)): try: - importer = self.default_path_hook(path_entry) - sys.path_importer_cache[path_entry] = None - return importer + _gcd_import('{0}.{1}'.format(module.__name__, x)) except ImportError: - raise ImportError("no importer found for %s" % path_entry) - - def _search_std_path(self, name, path=None): - """Check sys.path or 'path' (depending if 'path' is set) for the - named module and return its loader.""" - if path: - search_paths = path - else: - search_paths = sys.path - for entry in search_paths: - try: - importer = self._sys_path_importer(entry) - except ImportError: - continue - loader = importer.find_module(name) - if loader: - return loader - else: - raise ImportError("No module named %s" % name) - - def module_from_cache(self, name): - """Try to return the named module from sys.modules. - - Return False if the module is not in the cache. - """ - if name in sys.modules: - return sys.modules[name] - else: - return False - - def post_import(self, module): - """Perform any desired post-import processing on the module.""" - return module - - def _import_module(self, name, path=None): - """Import the specified module with no handling of parent modules. - - If None is set for a value in sys.modules (to signify that a relative - import was attempted and failed) then ImportError is raised. - - """ - cached_module = self.module_from_cache(name) - if cached_module is not False: - if cached_module is None: - raise ImportError("relative import redirect") - else: - return cached_module - try: - # Attempt to find a loader on sys.meta_path. - loader = self._search_meta_path(name, path) - except ImportError: - # sys.meta_path search failed. Attempt to find a loader on - # sys.path. If this fails then module cannot be found. - loader = self._search_std_path(name, path) - # A loader was found. It is the loader's responsibility to have put an - # entry in sys.modules. - module = self.post_import(loader.load_module(name)) - # 'module' could be something like None. - if not hasattr(module, '__name__'): - return module - # Set __package__. - if not hasattr(module, '__package__') or module.__package__ is None: - if hasattr(module, '__path__'): - module.__package__ = module.__name__ - elif '.' in module.__name__: - pkg_name = module.__name__.rsplit('.', 1)[0] - module.__package__ = pkg_name - else: - module.__package__ = None + pass return module - def _import_full_module(self, name): - """Import a module and set it on its parent if needed.""" - path_list = None - parent_name = name.rsplit('.', 1)[0] - parent = None - if parent_name != name: - parent = sys.modules[parent_name] - try: - path_list = parent.__path__ - except AttributeError: - pass - self._import_module(name, path_list) - module = sys.modules[name] - if parent: - tail = name.rsplit('.', 1)[-1] - setattr(parent, tail, module) - - def _find_package(self, name, has_path): - """Return the package that the caller is in or None.""" - if has_path: - return name - elif '.' in name: - return name.rsplit('.', 1)[0] - else: - return None - - @staticmethod - def _resolve_name(name, package, level): - """Return the absolute name of the module to be imported.""" - level -= 1 - try: - if package.count('.') < level: - raise ValueError("attempted relative import beyond top-level " - "package") - except AttributeError: - raise ValueError("__package__ not set to a string") - base = package.rsplit('.', level)[0] - if name: - return "{0}.{1}".format(base, name) - else: - return base - - def _return_module(self, absolute_name, relative_name, fromlist): - """Return the proper module based on what module was requested (and its - absolute module name), who is requesting it, and whether any specific - attributes were specified. - - The semantics of this method revolve around 'fromlist'. When it is - empty, the module up to the first dot is to be returned. When the - module being requested is an absolute name this is simple (and - relative_name is an empty string). But if the requested module was - a relative import (as signaled by relative_name having a non-false - value), then the name up to the first dot in the relative name resolved - to an absolute name is to be returned. - - When fromlist is not empty and the module being imported is a package, - then the values - in fromlist need to be checked for. If a value is not a pre-existing - attribute a relative import is attempted. If it fails then suppressed - the failure silently. - - """ - if not fromlist: - if relative_name: - absolute_base = absolute_name.rpartition(relative_name)[0] - relative_head = relative_name.split('.', 1)[0] - to_return = absolute_base + relative_head - else: - to_return = absolute_name.split('.', 1)[0] - return sys.modules[to_return] - # When fromlist is not empty, return the actual module specified in - # the import. - else: - module = sys.modules[absolute_name] - if hasattr(module, '__path__') and hasattr(module, '__name__'): - # When fromlist has a value and the imported module is a - # package, then if a name in fromlist is not found as an - # attribute on module, try a relative import to find it. - # Failure is fine and the exception is suppressed. - check_for = list(fromlist) - if '*' in check_for and hasattr(module, '__all__'): - check_for.extend(module.__all__) - for item in check_for: - if item == '*': - continue - if not hasattr(module, item): - resolved_name = self._resolve_name(item, - module.__name__, 1) - try: - self._import_full_module(resolved_name) - except ImportError: - pass - return module - - def __call__(self, name, globals={}, locals={}, fromlist=[], level=0): - """Import a module. - - The 'name' argument is the name of the module to be imported (e.g., - 'foo' in ``import foo`` or ``from foo import ...``). - - 'globals' and 'locals' are the global and local namespace dictionaries - of the module where the import statement appears. 'globals' is used to - introspect the __path__ and __name__ attributes of the module making - the call. 'local's is ignored. - - 'fromlist' lists any specific objects that are to eventually be put - into the namespace (e.g., ``from for.bar import baz`` would have 'baz' - in the fromlist, and this includes '*'). An entry of '*' will lead to - a check for __all__ being defined on the module. If it is defined then - the values in __all__ will be checked to make sure that all values are - attributes on the module, attempting a module import relative to 'name' - to set that attribute. - - When 'name' is a dotted name, there are two different situations to - consider for the return value. One is when the fromlist is empty. - In this situation the import statement imports and returns the name up - to the first dot. All subsequent names are imported but set as - attributes as needed on parent modules. When fromlist is not empty - then the module represented by the full dotted name is returned. - - 'level' represents possible relative imports. - A value of 0 is for absolute module names. Any positive value - represents the number of dots listed in the relative import statement - (e.g. has a value of 2 for ``from .. import foo``). - - """ - # TODO(brett.cannon) outdated check; just care that level >= 0 - if not name and level < 1: - raise ValueError("Empty module name") - is_pkg = True if '__path__' in globals else False - caller_name = globals.get('__name__') - package = globals.get('__package__') - if caller_name and not package: - package = self._find_package(caller_name, '__path__' in globals) - if package and package not in sys.modules: - if not hasattr(package, 'rsplit'): - raise ValueError("__package__ not set to a string") - msg = ("Parent module {0!r} not loaded, " - "cannot perform relative import") - raise SystemError(msg.format(package)) - with ImportLockContext(): - if level: - imported_name = self._resolve_name(name, package, level) - else: - imported_name = name - parent_name = imported_name.rsplit('.', 1)[0] - if parent_name != imported_name and parent_name not in sys.modules: - self.__call__(parent_name, level=0) - # This call will also handle setting the attribute on the - # package. - self._import_full_module(imported_name) - relative_name = '' if imported_name == name else name - return self._return_module(imported_name, relative_name, fromlist) - # XXX Eventually replace with a proper __all__ value (i.e., don't expose os # replacements but do expose _ExtensionFileLoader, etc. for testing). __all__ = [obj for obj in globals().keys() if not obj.startswith('__')] Modified: python/branches/py3k/Lib/importlib/test/import_/test___package__.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test___package__.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test___package__.py Sat Feb 7 02:15:27 2009 @@ -38,8 +38,9 @@ with util.mock_modules('pkg.__init__', 'pkg.fake') as importer: with util.import_state(meta_path=[importer]): import_util.import_('pkg.fake') - module = import_util.import_('', globals={'__package__': 'pkg.fake'}, - fromlist=['attr'], level=2) + module = import_util.import_('', + globals={'__package__': 'pkg.fake'}, + fromlist=['attr'], level=2) self.assertEquals(module.__name__, 'pkg') def test_using___name__(self): @@ -82,7 +83,7 @@ with util.import_state(meta_path=[mock]): del mock['top_level'].__package__ module = import_util.import_('top_level') - self.assert_(module.__package__ is None) + self.assertEqual(module.__package__, '') # [package] def test_package(self): Modified: python/branches/py3k/Lib/importlib/test/import_/test_caching.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_caching.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_caching.py Sat Feb 7 02:15:27 2009 @@ -64,7 +64,8 @@ with util.import_state(meta_path=[importer]): module = import_util.import_('pkg', fromlist=['module']) self.assert_(hasattr(module, 'module')) - self.assertEquals(id(module.module), id(sys.modules['pkg.module'])) + self.assertEquals(id(module.module), + id(sys.modules['pkg.module'])) def test_main(): Modified: python/branches/py3k/Lib/importlib/test/import_/test_path.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_path.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_path.py Sat Feb 7 02:15:27 2009 @@ -10,148 +10,6 @@ import unittest -class BaseTests(unittest.TestCase): - - """When sys.meta_path cannot find the desired module, sys.path is - consulted. For each entry on the sequence [order], sys.path_importer_cache - is checked to see if it contains a key for the entry [cache check]. If an - importer is found then it is consulted before trying the next entry in - sys.path [cache use]. The 'path' argument to find_module() is never used - when trying to find a module [path not used]. - - If an entry from sys.path is not in sys.path_importer_cache, sys.path_hooks - is called in turn [hooks order]. If a path hook cannot handle an entry, - ImportError is raised [hook failure]. Otherwise the resulting object is - cached in sys.path_importer_cache and then consulted [hook success]. If no - hook is found, None is set in sys.path_importer_cache and the default - importer is tried [no hook]. - - For use of __path__ in a package, the above is all true, just substitute - "sys.path" for "__path__". - - """ - - def order_test(self, to_import, entry, search_path, path=[]): - # [order] - log = [] - class LogFindModule(util.mock_modules): - def find_module(self, fullname): - log.append(self) - return super().find_module(fullname) - - assert len(search_path) == 2 - misser = LogFindModule(search_path[0]) - hitter = LogFindModule(to_import) - with nested(misser, hitter): - cache = dict(zip(search_path, (misser, hitter))) - with util.import_state(path=path, path_importer_cache=cache): - import_util.import_(to_import) - self.assertEquals(log[0], misser) - self.assertEquals(log[1], hitter) - - @import_util.importlib_only # __import__ uses PyDict_GetItem(), bypassing log. - def cache_use_test(self, to_import, entry, path=[]): - # [cache check], [cache use] - log = [] - class LoggingDict(dict): - def __getitem__(self, item): - log.append(item) - return super(LoggingDict, self).__getitem__(item) - - with util.mock_modules(to_import) as importer: - cache = LoggingDict() - cache[entry] = importer - with util.import_state(path=[entry], path_importer_cache=cache): - module = import_util.import_(to_import, fromlist=['a']) - self.assert_(module is importer[to_import]) - self.assertEquals(len(cache), 1) - self.assertEquals([entry], log) - - def hooks_order_test(self, to_import, entry, path=[]): - # [hooks order], [hooks failure], [hook success] - log = [] - def logging_hook(entry): - log.append(entry) - raise ImportError - with util.mock_modules(to_import) as importer: - hitter = import_util.mock_path_hook(entry, importer=importer) - path_hooks = [logging_hook, logging_hook, hitter] - with util.import_state(path_hooks=path_hooks, path=path): - import_util.import_(to_import) - self.assertEquals(sys.path_importer_cache[entry], importer) - self.assertEquals(len(log), 2) - - # [no hook] XXX Worry about after deciding how to handle the default hook. - - def path_argument_test(self, to_import): - # [path not used] - class BadImporter: - """Class to help detect TypeError from calling find_module() with - an improper number of arguments.""" - def find_module(name): - raise ImportError - - try: - import_util.import_(to_import) - except ImportError: - pass - - -class PathTests(BaseTests): - - """Tests for sys.path.""" - - def test_order(self): - self.order_test('hit', 'second', ['first', 'second'], - ['first', 'second']) - - def test_cache_use(self): - entry = "found!" - self.cache_use_test('hit', entry, [entry]) - - def test_hooks_order(self): - entry = "found!" - self.hooks_order_test('hit', entry, [entry]) - - def test_path_argument(self): - name = 'total junk' - with util.uncache(name): - self.path_argument_test(name) - - -class __path__Tests(BaseTests): - - """Tests for __path__.""" - - def run_test(self, test, entry, path, *args): - with util.mock_modules('pkg.__init__') as importer: - importer['pkg'].__path__ = path - importer.load_module('pkg') - test('pkg.hit', entry, *args) - - - @import_util.importlib_only # XXX Unknown reason why this fails. - def test_order(self): - self.run_test(self.order_test, 'second', ('first', 'second'), ['first', - 'second']) - - def test_cache_use(self): - location = "I'm here!" - self.run_test(self.cache_use_test, location, [location]) - - def test_hooks_order(self): - location = "I'm here!" - self.run_test(self.hooks_order_test, location, [location]) - - def test_path_argument(self): - module = imp.new_module('pkg') - module.__path__ = ['random __path__'] - name = 'pkg.whatever' - sys.modules['pkg'] = module - with util.uncache('pkg', name): - self.path_argument_test(name) - - class FinderTests(unittest.TestCase): """Tests for SysPathImporter.""" Modified: python/branches/py3k/Lib/importlib/test/import_/util.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/util.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/util.py Sat Feb 7 02:15:27 2009 @@ -1,5 +1,5 @@ import functools -import importlib +import importlib._bootstrap using___import__ = False @@ -9,7 +9,8 @@ """Delegate to allow for injecting different implementations of import.""" if using___import__: return __import__(*args, **kwargs) - return importlib.Import()(*args, **kwargs) + #return importlib.Import()(*args, **kwargs) + return importlib._bootstrap._import(*args, **kwargs) def importlib_only(fxn): Modified: python/branches/py3k/Lib/importlib/test/test_api.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/test_api.py (original) +++ python/branches/py3k/Lib/importlib/test/test_api.py Sat Feb 7 02:15:27 2009 @@ -1,6 +1,8 @@ -import unittest -import importlib from . import util +import imp +import importlib +import sys +import unittest class ImportModuleTests(unittest.TestCase): @@ -33,6 +35,7 @@ relative_name = '.{0}'.format(module_name) with util.mock_modules(pkg_long_name, absolute_name) as mock: with util.import_state(meta_path=[mock]): + importlib.import_module(pkg_name) module = importlib.import_module(relative_name, pkg_name) self.assertEqual(module.__name__, absolute_name) @@ -44,6 +47,7 @@ name = '{0}.mod'.format(pkg_name) with util.mock_modules(pkg_long_name, name) as mock: with util.import_state(meta_path=[mock]): + importlib.import_module(pkg_name) module = importlib.import_module(name, pkg_name) self.assertEqual(module.__name__, name) From python-checkins at python.org Sat Feb 7 02:35:08 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 7 Feb 2009 02:35:08 +0100 (CET) Subject: [Python-checkins] r69396 - python/branches/py3k Message-ID: <20090207013508.6203E1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 7 02:35:08 2009 New Revision: 69396 Log: Blocked revisions 69373-69374,69389,69394 via svnmerge ........ r69373 | neil.schemenauer | 2009-02-06 15:08:52 -0600 (Fri, 06 Feb 2009) | 5 lines Overhaul Lib/compiler block ordering. The previous code was filled with hacks. The new code is based on issue #2472 posted by Antoine Pitrou. I did some further cleanups of the pyassem code and optimized the block ordering pass. ........ r69374 | neil.schemenauer | 2009-02-06 15:33:45 -0600 (Fri, 06 Feb 2009) | 6 lines Convert "srcdir" into an absolute path if that seems prudent. Currrently the only user of this is Lib/distutils/tests/test_build_ext.py (in order to find the source for xxmodule.c). I'm not sure if other platforms need similar tweaks, I'm not brave enough to attempt it without being able to test. ........ r69389 | neil.schemenauer | 2009-02-06 18:13:39 -0600 (Fri, 06 Feb 2009) | 2 lines Make names generated for 'with' variables match the built-in compiler. ........ r69394 | neil.schemenauer | 2009-02-06 18:54:41 -0600 (Fri, 06 Feb 2009) | 4 lines Issue #999042: The Python compiler now handles explict global statements correctly (should be assigned using STORE_GLOBAL opcode). This was done by having the system table differentiate between explict and implicit globals. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat Feb 7 02:38:38 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 7 Feb 2009 02:38:38 +0100 (CET) Subject: [Python-checkins] r69397 - in python/branches/py3k/Lib/importlib: _bootstrap.py test/frozen/test_loader.py Message-ID: <20090207013838.7093A1E4002@bag.python.org> Author: brett.cannon Date: Sat Feb 7 02:38:38 2009 New Revision: 69397 Log: Move importlib's frozen importer over to rpartition for setting __package__. Modified: python/branches/py3k/Lib/importlib/_bootstrap.py python/branches/py3k/Lib/importlib/test/frozen/test_loader.py Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Sat Feb 7 02:38:38 2009 @@ -138,10 +138,9 @@ if cls.find_module(fullname) is None: raise ImportError("{0} is not a frozen module".format(fullname)) module = imp.init_frozen(fullname) - if hasattr(module, '__path__'): - module.__package__ = module.__name__ - elif '.' in module.__name__: - module.__package__ = module.__name__.rsplit('.', 1)[0] + module.__package__ = module.__name__ + if not hasattr(module, '__path__'): + module.__package__ = module.__package__.rpartition('.')[0] return module Modified: python/branches/py3k/Lib/importlib/test/frozen/test_loader.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/frozen/test_loader.py (original) +++ python/branches/py3k/Lib/importlib/test/frozen/test_loader.py Sat Feb 7 02:38:38 2009 @@ -9,7 +9,7 @@ with util.uncache('__hello__'): module = machinery.FrozenImporter.load_module('__hello__') check = {'__name__': '__hello__', '__file__': '', - '__package__': None} + '__package__': ''} for attr, value in check.items(): self.assertEqual(getattr(module, attr), value) From python-checkins at python.org Sat Feb 7 02:40:19 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 7 Feb 2009 02:40:19 +0100 (CET) Subject: [Python-checkins] r69398 - in python/branches/py3k/Lib/importlib: _bootstrap.py test/builtin/test_loader.py Message-ID: <20090207014019.7424F1E4002@bag.python.org> Author: brett.cannon Date: Sat Feb 7 02:40:19 2009 New Revision: 69398 Log: Move importlib's built-in importer to use rpartition for __package__. Modified: python/branches/py3k/Lib/importlib/_bootstrap.py python/branches/py3k/Lib/importlib/test/builtin/test_loader.py Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Sat Feb 7 02:40:19 2009 @@ -115,7 +115,9 @@ """Load a built-in module.""" if fullname not in sys.builtin_module_names: raise ImportError("{0} is not a built-in module".format(fullname)) - return imp.init_builtin(fullname) + module = imp.init_builtin(fullname) + module.__package__ = '' + return module class FrozenImporter: Modified: python/branches/py3k/Lib/importlib/test/builtin/test_loader.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/builtin/test_loader.py (original) +++ python/branches/py3k/Lib/importlib/test/builtin/test_loader.py Sat Feb 7 02:40:19 2009 @@ -15,7 +15,7 @@ assert 'errno' in sys.builtin_module_names name = 'errno' - verification = {'__name__': 'errno', '__package__': None} + verification = {'__name__': 'errno', '__package__': ''} def verify(self, module): """Verify that the module matches against what it should have.""" From python-checkins at python.org Sat Feb 7 02:52:26 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 7 Feb 2009 02:52:26 +0100 (CET) Subject: [Python-checkins] r69399 - in python/branches/py3k/Lib/importlib: NOTES _bootstrap.py test/extension/test_loader.py test/source/test_loader.py Message-ID: <20090207015226.2EEB61E4002@bag.python.org> Author: brett.cannon Date: Sat Feb 7 02:52:25 2009 New Revision: 69399 Log: Move importlib completely over to using rpartition and accepting the empty string for top-level modules. Modified: python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/_bootstrap.py python/branches/py3k/Lib/importlib/test/extension/test_loader.py python/branches/py3k/Lib/importlib/test/source/test_loader.py Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sat Feb 7 02:52:25 2009 @@ -1,10 +1,7 @@ to do ///// -* Use rpartition for getting the package of a module. - - + Make sure there is a test for the empty string as acceptable for - __package__. +* Extract test_path_hooks constants into a util module for extension testing. * Implement PEP 302 protocol for loaders (should just be a matter of testing). Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Sat Feb 7 02:52:25 2009 @@ -90,6 +90,18 @@ self.obj.close() +def set___package__(fxn): + """Set __package__ on the returned module.""" + def wrapper(*args, **kwargs): + module = fxn(*args, **kwargs) + if not hasattr(module, '__package__') or module.__package__ is None: + module.__package__ = module.__name__ + if not hasattr(module, '__path__'): + module.__package__ = module.__package__.rpartition('.')[0] + return module + return wrapper + + class BuiltinImporter: """Meta path loader for built-in modules. @@ -111,12 +123,12 @@ return cls if imp.is_builtin(fullname) else None @classmethod + @set___package__ def load_module(cls, fullname): """Load a built-in module.""" if fullname not in sys.builtin_module_names: raise ImportError("{0} is not a built-in module".format(fullname)) module = imp.init_builtin(fullname) - module.__package__ = '' return module @@ -135,14 +147,12 @@ return cls if imp.is_frozen(fullname) else None @classmethod + @set___package__ def load_module(cls, fullname): """Load a frozen module.""" if cls.find_module(fullname) is None: raise ImportError("{0} is not a frozen module".format(fullname)) module = imp.init_frozen(fullname) - module.__package__ = module.__name__ - if not hasattr(module, '__path__'): - module.__package__ = module.__package__.rpartition('.')[0] return module @@ -230,6 +240,7 @@ raise ValueError("extension modules cannot be packages") @check_name + @set___package__ def load_module(self, fullname): """Load an extension module.""" assert self._name == fullname @@ -368,11 +379,9 @@ module.__loader__ = self if self._is_pkg: module.__path__ = [module.__file__.rsplit(path_sep, 1)[0]] - module.__package__ = module.__name__ - elif '.' in module.__name__: - module.__package__ = module.__name__.rsplit('.', 1)[0] - else: - module.__package__ = None + module.__package__ = module.__name__ + if not hasattr(module, '__path__'): + module.__package__ = module.__package__.rpartition('.')[0] exec(code_object, module.__dict__) return module Modified: python/branches/py3k/Lib/importlib/test/extension/test_loader.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/extension/test_loader.py (original) +++ python/branches/py3k/Lib/importlib/test/extension/test_loader.py Sat Feb 7 02:52:25 2009 @@ -21,7 +21,8 @@ with util.uncache(test_path_hook.NAME): module = self.load_module(test_path_hook.NAME) for attr, value in [('__name__', test_path_hook.NAME), - ('__file__', test_path_hook.FILEPATH)]: + ('__file__', test_path_hook.FILEPATH), + ('__package__', '')]: self.assertEqual(getattr(module, attr), value) self.assert_(test_path_hook.NAME in sys.modules) Modified: python/branches/py3k/Lib/importlib/test/source/test_loader.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/test_loader.py (original) +++ python/branches/py3k/Lib/importlib/test/source/test_loader.py Sat Feb 7 02:52:25 2009 @@ -23,7 +23,7 @@ module = loader.load_module('_temp') self.assert_('_temp' in sys.modules) check = {'__name__': '_temp', '__file__': mapping['_temp'], - '__package__': None} + '__package__': ''} for attr, value in check.items(): self.assertEqual(getattr(module, attr), value) From python-checkins at python.org Sat Feb 7 02:57:14 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 7 Feb 2009 02:57:14 +0100 (CET) Subject: [Python-checkins] r69400 - python/branches/py3k/Lib/importlib/NOTES Message-ID: <20090207015714.73D221E4002@bag.python.org> Author: brett.cannon Date: Sat Feb 7 02:57:14 2009 New Revision: 69400 Log: Add a note for importlib about backporting some of functools.wraps functionality. Modified: python/branches/py3k/Lib/importlib/NOTES Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sat Feb 7 02:57:14 2009 @@ -3,6 +3,8 @@ * Extract test_path_hooks constants into a util module for extension testing. +* Backport a poor-man's functools.wraps. + * Implement PEP 302 protocol for loaders (should just be a matter of testing). + Built-in. @@ -40,9 +42,10 @@ * bytecode_path * write_bytecode (not abstract) - + util + + util (for decorators, make sure to wrap with functools.wraps) - get_module decorator (rename: module_for_loader) + - set___package__ decorator + machinery From python-checkins at python.org Sat Feb 7 03:06:43 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 7 Feb 2009 03:06:43 +0100 (CET) Subject: [Python-checkins] r69401 - in python/branches/py3k/Lib/importlib: NOTES test/extension/test_case_sensitivity.py test/extension/test_finder.py test/extension/test_loader.py test/extension/test_path_hook.py test/util.py Message-ID: <20090207020643.6AA711E4002@bag.python.org> Author: brett.cannon Date: Sat Feb 7 03:06:43 2009 New Revision: 69401 Log: Factor out helper code from importlib.test.extension.test_path_hook. Modified: python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/test/extension/test_case_sensitivity.py python/branches/py3k/Lib/importlib/test/extension/test_finder.py python/branches/py3k/Lib/importlib/test/extension/test_loader.py python/branches/py3k/Lib/importlib/test/extension/test_path_hook.py python/branches/py3k/Lib/importlib/test/util.py Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sat Feb 7 03:06:43 2009 @@ -1,8 +1,6 @@ to do ///// -* Extract test_path_hooks constants into a util module for extension testing. - * Backport a poor-man's functools.wraps. * Implement PEP 302 protocol for loaders (should just be a matter of testing). 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 Sat Feb 7 03:06:43 2009 @@ -3,17 +3,17 @@ import unittest import importlib from .. import util -from . import test_path_hook +from . import util as ext_util @util.case_insensitive_tests class ExtensionModuleCaseSensitivityTest(unittest.TestCase): def find_module(self): - good_name = test_path_hook.NAME + good_name = ext_util.NAME bad_name = good_name.upper() assert good_name != bad_name - finder = importlib.ExtensionFileImporter(test_path_hook.PATH) + finder = importlib.ExtensionFileImporter(ext_util.PATH) return finder.find_module(bad_name) def test_case_sensitive(self): Modified: python/branches/py3k/Lib/importlib/test/extension/test_finder.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/extension/test_finder.py (original) +++ python/branches/py3k/Lib/importlib/test/extension/test_finder.py Sat Feb 7 03:06:43 2009 @@ -1,6 +1,6 @@ import importlib from .. import abc -from . import test_path_hook +from . import util import unittest @@ -9,11 +9,11 @@ """Test the finder for extension modules.""" def find_module(self, fullname): - importer = importlib.ExtensionFileImporter(test_path_hook.PATH) + importer = importlib.ExtensionFileImporter(util.PATH) return importer.find_module(fullname) def test_module(self): - self.assert_(self.find_module(test_path_hook.NAME)) + self.assert_(self.find_module(util.NAME)) def test_package(self): # Extension modules cannot be an __init__ for a package. Modified: python/branches/py3k/Lib/importlib/test/extension/test_loader.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/extension/test_loader.py (original) +++ python/branches/py3k/Lib/importlib/test/extension/test_loader.py Sat Feb 7 03:06:43 2009 @@ -1,5 +1,5 @@ import importlib -from . import test_path_hook +from . import util as ext_util from .. import abc from .. import util @@ -12,19 +12,18 @@ """Test load_module() for extension modules.""" def load_module(self, fullname): - loader = importlib._ExtensionFileLoader(test_path_hook.NAME, - test_path_hook.FILEPATH, - False) + loader = importlib._ExtensionFileLoader(ext_util.NAME, + ext_util.FILEPATH, False) return loader.load_module(fullname) def test_module(self): - with util.uncache(test_path_hook.NAME): - module = self.load_module(test_path_hook.NAME) - for attr, value in [('__name__', test_path_hook.NAME), - ('__file__', test_path_hook.FILEPATH), + with util.uncache(ext_util.NAME): + module = self.load_module(ext_util.NAME) + for attr, value in [('__name__', ext_util.NAME), + ('__file__', ext_util.FILEPATH), ('__package__', '')]: self.assertEqual(getattr(module, attr), value) - self.assert_(test_path_hook.NAME in sys.modules) + self.assert_(ext_util.NAME in sys.modules) def test_package(self): # Extensions are not found in packages. @@ -35,9 +34,9 @@ pass def test_module_reuse(self): - with util.uncache(test_path_hook.NAME): - module1 = self.load_module(test_path_hook.NAME) - module2 = self.load_module(test_path_hook.NAME) + with util.uncache(ext_util.NAME): + module1 = self.load_module(ext_util.NAME) + module2 = self.load_module(ext_util.NAME) self.assert_(module1 is module2) def test_state_after_failure(self): Modified: python/branches/py3k/Lib/importlib/test/extension/test_path_hook.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/extension/test_path_hook.py (original) +++ python/branches/py3k/Lib/importlib/test/extension/test_path_hook.py Sat Feb 7 03:06:43 2009 @@ -1,31 +1,12 @@ import importlib +from . import util import collections import imp -from os import path import sys import unittest -PATH = None -EXT = None -FILENAME = None -NAME = '_testcapi' -_file_exts = [x[0] for x in imp.get_suffixes() if x[2] == imp.C_EXTENSION] -try: - for PATH in sys.path: - for EXT in _file_exts: - FILENAME = NAME + EXT - FILEPATH = path.join(PATH, FILENAME) - if path.exists(path.join(PATH, FILENAME)): - raise StopIteration - else: - PATH = EXT = FILENAME = FILEPATH = None -except StopIteration: - pass -del _file_exts - - class PathHookTests(unittest.TestCase): """Test the path hook for extension modules.""" @@ -38,7 +19,7 @@ def test_success(self): # Path hook should handle a directory where a known extension module # exists. - self.assert_(hasattr(self.hook(PATH), 'find_module')) + self.assert_(hasattr(self.hook(util.PATH), 'find_module')) def test_main(): 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 Sat Feb 7 03:06:43 2009 @@ -2,6 +2,7 @@ import imp import os.path from test.support import unlink +import unittest import sys @@ -9,7 +10,7 @@ """Class decorator that nullifies tests that require a case-insensitive file system.""" if sys.platform not in ('win32', 'darwin', 'cygwin'): - return object() + return unittest.TestCase else: return class_ From python-checkins at python.org Sat Feb 7 03:13:29 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 7 Feb 2009 03:13:29 +0100 (CET) Subject: [Python-checkins] r69402 - in python/branches/py3k/Lib/importlib: NOTES _bootstrap.py Message-ID: <20090207021329.61DBB1E4002@bag.python.org> Author: brett.cannon Date: Sat Feb 7 03:13:28 2009 New Revision: 69402 Log: Create a simple substitute for functools.wraps to use in importlib._bootstrap. Modified: python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/_bootstrap.py Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sat Feb 7 03:13:28 2009 @@ -1,8 +1,6 @@ to do ///// -* Backport a poor-man's functools.wraps. - * Implement PEP 302 protocol for loaders (should just be a matter of testing). + Built-in. Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Sat Feb 7 03:13:28 2009 @@ -90,6 +90,13 @@ self.obj.close() +def wrap(new, old): + """Simple substitute for functools.wraps.""" + for replace in ['__module__', '__name__', '__doc__']: + setattr(new, replace, getattr(old, replace)) + new.__dict__.update(old.__dict__) + + def set___package__(fxn): """Set __package__ on the returned module.""" def wrapper(*args, **kwargs): @@ -99,6 +106,7 @@ if not hasattr(module, '__path__'): module.__package__ = module.__package__.rpartition('.')[0] return module + wrap(wrapper, fxn) return wrapper @@ -213,9 +221,7 @@ if self._name != name: raise ImportError("loader cannot handle %s" % name) return method(self, name, *args, **kwargs) - inner.__name__ = method.__name__ - inner.__doc__ = method.__doc__ - inner.__dict__.update(method.__dict__) + wrap(inner, method) return inner @@ -318,6 +324,7 @@ elif hasattr(module, attr): delattr(module, attr) raise + wrap(decorated, fxn) return decorated From python-checkins at python.org Sat Feb 7 03:14:07 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 7 Feb 2009 03:14:07 +0100 (CET) Subject: [Python-checkins] r69403 - python/branches/py3k/Lib/importlib/NOTES Message-ID: <20090207021407.F02291E4002@bag.python.org> Author: brett.cannon Date: Sat Feb 7 03:14:07 2009 New Revision: 69403 Log: Update NOTES for importlib now that a replacement for functools.wraps is available. Modified: python/branches/py3k/Lib/importlib/NOTES Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sat Feb 7 03:14:07 2009 @@ -38,7 +38,7 @@ * bytecode_path * write_bytecode (not abstract) - + util (for decorators, make sure to wrap with functools.wraps) + + util - get_module decorator (rename: module_for_loader) - set___package__ decorator From python-checkins at python.org Sat Feb 7 03:20:29 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 7 Feb 2009 03:20:29 +0100 (CET) Subject: [Python-checkins] r69404 - in python/trunk/Lib: lib-tk/ttk.py test/test_tcl.py Message-ID: <20090207022029.9E8211E4002@bag.python.org> Author: guilherme.polo Date: Sat Feb 7 03:20:29 2009 New Revision: 69404 Log: Eliminated the need to use ttk.__loadtk__ and the problems related it. Modified: python/trunk/Lib/lib-tk/ttk.py python/trunk/Lib/test/test_tcl.py Modified: python/trunk/Lib/lib-tk/ttk.py ============================================================================== --- python/trunk/Lib/lib-tk/ttk.py (original) +++ python/trunk/Lib/lib-tk/ttk.py Sat Feb 7 03:20:29 2009 @@ -29,32 +29,41 @@ _flatten = Tkinter._flatten -# Verify if Tk is new enough to not need Tile checking +# Verify if Tk is new enough to not need the Tile package _REQUIRE_TILE = True if Tkinter.TkVersion < 8.5 else False -def _loadttk(loadtk): - # This extends the default Tkinter.Tk._loadtk method so we can be - # sure that ttk is available for use, or not. - def _wrapper(self): - loadtk(self) - - if _REQUIRE_TILE: - import os - tilelib = os.environ.get('TILE_LIBRARY') - if tilelib: - # append custom tile path to the the list of directories that - # Tcl uses when attempting to resolve packages with the package - # command - self.tk.eval('global auto_path; ' - 'lappend auto_path {%s}' % tilelib) - self.tk.eval('package require tile') # TclError may be raised here - - return _wrapper - -# Store the original Tkinter.Tk._loadtk before replacing it just in case -# someone wants to restore it. -__loadtk__ = Tkinter.Tk._loadtk -Tkinter.Tk._loadtk = _loadttk(Tkinter.Tk._loadtk) +def _load_tile(master): + if _REQUIRE_TILE: + import os + tilelib = os.environ.get('TILE_LIBRARY') + if tilelib: + # append custom tile path to the the list of directories that + # Tcl uses when attempting to resolve packages with the package + # command + master.tk.eval( + 'global auto_path; ' + 'lappend auto_path {%s}' % tilelib) + + master.tk.eval('package require tile') # TclError may be raised here + master._tile_loaded = True + + +def _setup_master(master=None): + """If master is not None, itself is returned. If master is None, + the default master is returned if there is one, otherwise a new + master is created and returned. + + If it is not allowed to use the default root and master is None, + RuntimeError is raised.""" + if master is None: + if Tkinter._support_default_root: + master = Tkinter._default_root or Tkinter.Tk() + else: + raise RuntimeError( + "No master specified and Tkinter is " + "configured to not support default root") + return master + def _format_optdict(optdict, script=False, ignore=None): @@ -366,12 +375,11 @@ _name = "ttk::style" def __init__(self, master=None): - if master is None: - if Tkinter._support_default_root: - master = Tkinter._default_root or Tkinter.Tk() - else: - raise RuntimeError("No master specified and Tkinter is " - "configured to not support default master") + master = _setup_master(master) + + if not getattr(master, '_tile_loaded', False): + # Load tile now, if needed + _load_tile(master) self.master = master self.tk = self.master.tk @@ -548,6 +556,10 @@ active, disabled, focus, pressed, selected, background, readonly, alternate, invalid """ + master = _setup_master(master) + if not getattr(master, '_tile_loaded', False): + # Load tile now, if needed + _load_tile(master) Tkinter.Widget.__init__(self, master, widgetname, kw=kw) Modified: python/trunk/Lib/test/test_tcl.py ============================================================================== --- python/trunk/Lib/test/test_tcl.py (original) +++ python/trunk/Lib/test/test_tcl.py Sat Feb 7 03:20:29 2009 @@ -4,15 +4,9 @@ import os import _tkinter from test import test_support -from Tkinter import Tk, Tcl +from Tkinter import Tcl from _tkinter import TclError -# Restore Tkinter.Tk._loadtk that may have been overridden by ttk. -# If this is not done then this test may fail for reasons related -# to ttk only (like failing to load the tile package). -from ttk import __loadtk__ -Tk._loadtk = __loadtk__ - class TkinterTest(unittest.TestCase): From python-checkins at python.org Sat Feb 7 03:21:24 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 7 Feb 2009 03:21:24 +0100 (CET) Subject: [Python-checkins] r69405 - python/branches/release26-maint Message-ID: <20090207022124.87B4C1E4002@bag.python.org> Author: guilherme.polo Date: Sat Feb 7 03:21:24 2009 New Revision: 69405 Log: Blocked revisions 69404 via svnmerge ........ r69404 | guilherme.polo | 2009-02-07 00:20:29 -0200 (Sat, 07 Feb 2009) | 2 lines Eliminated the need to use ttk.__loadtk__ and the problems related it. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sat Feb 7 03:33:47 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 7 Feb 2009 03:33:47 +0100 (CET) Subject: [Python-checkins] r69406 - in python/branches/py3k: Lib/test/test_tcl.py Lib/tkinter/ttk.py Message-ID: <20090207023347.5BB461E4002@bag.python.org> Author: guilherme.polo Date: Sat Feb 7 03:33:47 2009 New Revision: 69406 Log: Merged revisions 69404 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69404 | guilherme.polo | 2009-02-07 00:20:29 -0200 (Sat, 07 Feb 2009) | 2 lines Eliminated the need to use ttk.__loadtk__ and the problems related it. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_tcl.py python/branches/py3k/Lib/tkinter/ttk.py 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 Sat Feb 7 03:33:47 2009 @@ -4,15 +4,9 @@ import os import _tkinter from test import support -from tkinter import Tk, Tcl +from tkinter import Tcl from _tkinter import TclError -# Restore Tkinter.Tk._loadtk that may have been overridden by ttk. -# If this is not done then this test may fail for reasons related -# to ttk only (like failing to load the tile package). -from tkinter.ttk import __loadtk__ -Tk._loadtk = __loadtk__ - class TkinterTest(unittest.TestCase): Modified: python/branches/py3k/Lib/tkinter/ttk.py ============================================================================== --- python/branches/py3k/Lib/tkinter/ttk.py (original) +++ python/branches/py3k/Lib/tkinter/ttk.py Sat Feb 7 03:33:47 2009 @@ -29,32 +29,40 @@ _flatten = tkinter._flatten -# Verify if Tk is new enough to not need Tile checking +# Verify if Tk is new enough to not need the Tile package _REQUIRE_TILE = True if tkinter.TkVersion < 8.5 else False -def _loadttk(loadtk): - # This extends the default tkinter.Tk._loadtk method so we can be - # sure that ttk is available for use, or not. - def _wrapper(self): - loadtk(self) - - if _REQUIRE_TILE: - import os - tilelib = os.environ.get('TILE_LIBRARY') - if tilelib: - # append custom tile path to the the list of directories that - # Tcl uses when attempting to resolve packages with the package - # command - self.tk.eval('global auto_path; ' - 'lappend auto_path {%s}' % tilelib) - self.tk.eval('package require tile') # TclError may be raised here - - return _wrapper - -# Store the original tkinter.Tk._loadtk before replacing it just in case -# someone wants to restore it. -__loadtk__ = tkinter.Tk._loadtk -tkinter.Tk._loadtk = _loadttk(tkinter.Tk._loadtk) +def _load_tile(master): + if _REQUIRE_TILE: + import os + tilelib = os.environ.get('TILE_LIBRARY') + if tilelib: + # append custom tile path to the the list of directories that + # Tcl uses when attempting to resolve packages with the package + # command + master.tk.eval( + 'global auto_path; ' + 'lappend auto_path {%s}' % tilelib) + + master.tk.eval('package require tile') # TclError may be raised here + master._tile_loaded = True + + +def _setup_master(master=None): + """If master is not None, itself is returned. If master is None, + the default master is returned if there is one, otherwise a new + master is created and returned. + + If it is not allowed to use the default root and master is None, + RuntimeError is raised.""" + if master is None: + if tkinter._support_default_root: + master = tkinter._default_root or tkinter.Tk() + else: + raise RuntimeError( + "No master specified and tkinter is " + "configured to not support default root") + return master def _format_optdict(optdict, script=False, ignore=None): @@ -366,12 +374,11 @@ _name = "ttk::style" def __init__(self, master=None): - if master is None: - if tkinter._support_default_root: - master = tkinter._default_root or tkinter.Tk() - else: - raise RuntimeError("No master specified and tkinter is " - "configured to not support default master") + master = _setup_master(master) + + if not getattr(master, '_tile_loaded', False): + # Load tile now, if needed + _load_tile(master) self.master = master self.tk = self.master.tk @@ -548,6 +555,10 @@ active, disabled, focus, pressed, selected, background, readonly, alternate, invalid """ + master = _setup_master(master) + if not getattr(master, '_tile_loaded', False): + # Load tile now, if needed + _load_tile(master) tkinter.Widget.__init__(self, master, widgetname, kw=kw) From python-checkins at python.org Sat Feb 7 03:33:52 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 7 Feb 2009 03:33:52 +0100 (CET) Subject: [Python-checkins] r69407 - python/branches/py3k/Lib/importlib/test/extension/util.py Message-ID: <20090207023352.E5B1B1E4002@bag.python.org> Author: brett.cannon Date: Sat Feb 7 03:33:52 2009 New Revision: 69407 Log: Add the missing importlib.test.extension.util. Added: python/branches/py3k/Lib/importlib/test/extension/util.py Added: python/branches/py3k/Lib/importlib/test/extension/util.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/extension/util.py Sat Feb 7 03:33:52 2009 @@ -0,0 +1,21 @@ +import imp +import os +import sys + +PATH = None +EXT = None +FILENAME = None +NAME = '_testcapi' +_file_exts = [x[0] for x in imp.get_suffixes() if x[2] == imp.C_EXTENSION] +try: + for PATH in sys.path: + for EXT in _file_exts: + FILENAME = NAME + EXT + FILEPATH = os.path.join(PATH, FILENAME) + if os.path.exists(os.path.join(PATH, FILENAME)): + raise StopIteration + else: + PATH = EXT = FILENAME = FILEPATH = None +except StopIteration: + pass +del _file_exts From python-checkins at python.org Sat Feb 7 03:38:10 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 7 Feb 2009 03:38:10 +0100 (CET) Subject: [Python-checkins] r69408 - python/branches/release30-maint Message-ID: <20090207023810.F19071E4002@bag.python.org> Author: guilherme.polo Date: Sat Feb 7 03:38:10 2009 New Revision: 69408 Log: Blocked revisions 69406 via svnmerge ................ r69406 | guilherme.polo | 2009-02-07 00:33:47 -0200 (Sat, 07 Feb 2009) | 9 lines Merged revisions 69404 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69404 | guilherme.polo | 2009-02-07 00:20:29 -0200 (Sat, 07 Feb 2009) | 2 lines Eliminated the need to use ttk.__loadtk__ and the problems related it. ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Sat Feb 7 03:52:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 07 Feb 2009 02:52:15 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090207025215.541B41E4002@bag.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/212 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: benjamin.peterson,brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sat Feb 7 04:13:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 07 Feb 2009 03:13:28 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090207031328.E9A251E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/610 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neil.schemenauer BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_cmath test_optparse make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 7 04:28:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 07 Feb 2009 03:28:45 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090207032845.AA0511E4002@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/831 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: guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sat Feb 7 04:45:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 07 Feb 2009 03:45:15 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090207034515.957411E4002@bag.python.org> The Buildbot has detected a new failure of OS X x86 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/108 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/bsddb/test/test_thread.py", line 306, in readerThread rec = dbutils.DeadlockWrap(c.next, max_retries=10) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/bsddb/dbutils.py", line 68, in DeadlockWrap return function(*_args, **_kwargs) DBLockDeadlockError: (-30995, 'DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock') 1 test failed: test_mmap make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Feb 7 13:21:18 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 7 Feb 2009 13:21:18 +0100 (CET) Subject: [Python-checkins] r69409 - python/trunk/Doc/library/xmlrpclib.rst Message-ID: <20090207122118.223601E4002@bag.python.org> Author: georg.brandl Date: Sat Feb 7 13:21:17 2009 New Revision: 69409 Log: #5174: fix wrong file closing in example. 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 Sat Feb 7 13:21:17 2009 @@ -318,9 +318,8 @@ import xmlrpclib def python_logo(): - handle = open("python_logo.jpg") - return xmlrpclib.Binary(handle.read()) - handle.close() + with open("python_logo.jpg") as handle: + return xmlrpclib.Binary(handle.read()) server = SimpleXMLRPCServer(("localhost", 8000)) print "Listening on port 8000..." @@ -333,9 +332,8 @@ import xmlrpclib proxy = xmlrpclib.ServerProxy("http://localhost:8000/") - handle = open("fetched_python_logo.jpg", "w") - handle.write(proxy.python_logo().data) - handle.close() + with open("fetched_python_logo.jpg", "w") as handle: + handle.write(proxy.python_logo().data) .. _fault-objects: From python-checkins at python.org Sat Feb 7 15:53:32 2009 From: python-checkins at python.org (neil.schemenauer) Date: Sat, 7 Feb 2009 15:53:32 +0100 (CET) Subject: [Python-checkins] r69410 - python/trunk/Lib/test/test_hotshot.py Message-ID: <20090207145332.1261B1E4002@bag.python.org> Author: neil.schemenauer Date: Sat Feb 7 15:53:31 2009 New Revision: 69410 Log: Fix broken test in test_hotshot. Treating the current directory as an empty file is sloppy and non-portable. Use NamedTemporaryFile to make an empty file. Modified: python/trunk/Lib/test/test_hotshot.py Modified: python/trunk/Lib/test/test_hotshot.py ============================================================================== --- python/trunk/Lib/test/test_hotshot.py (original) +++ python/trunk/Lib/test/test_hotshot.py Sat Feb 7 15:53:31 2009 @@ -3,6 +3,7 @@ import os import pprint import unittest +import tempfile import _hotshot import gc @@ -127,7 +128,12 @@ os.remove(test_support.TESTFN) def test_logreader_eof_error(self): - self.assertRaises((IOError, EOFError), _hotshot.logreader, ".") + emptyfile = tempfile.NamedTemporaryFile() + try: + self.assertRaises((IOError, EOFError), _hotshot.logreader, + emptyfile.name) + finally: + emptyfile.close() gc.collect() def test_main(): From python-checkins at python.org Sat Feb 7 18:13:31 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 7 Feb 2009 18:13:31 +0100 (CET) Subject: [Python-checkins] r69411 - in python/branches/py3k: Misc/NEWS Tools/pybench/Calls.py Tools/pybench/CommandLine.py Tools/pybench/README Tools/pybench/Strings.py Tools/pybench/pybench.py Tools/pybench/systimes.py Message-ID: <20090207171331.B3EE01E4002@bag.python.org> Author: antoine.pitrou Date: Sat Feb 7 18:13:31 2009 New Revision: 69411 Log: Issue #4704: remove use of cmp() in pybench, bump its version number to 2.1, and make it 2.6-compatible. Modified: python/branches/py3k/Misc/NEWS python/branches/py3k/Tools/pybench/Calls.py python/branches/py3k/Tools/pybench/CommandLine.py python/branches/py3k/Tools/pybench/README python/branches/py3k/Tools/pybench/Strings.py python/branches/py3k/Tools/pybench/pybench.py python/branches/py3k/Tools/pybench/systimes.py Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Feb 7 18:13:31 2009 @@ -394,6 +394,9 @@ Tools/Demos ----------- +- Issue #4704: remove use of cmp() in pybench, bump its version number to 2.1, + and make it 2.6-compatible. + - Ttk demos added in Demo/tkinter/ttk/ - Issue #4677: add two list comprehension tests to pybench. Modified: python/branches/py3k/Tools/pybench/Calls.py ============================================================================== --- python/branches/py3k/Tools/pybench/Calls.py (original) +++ python/branches/py3k/Tools/pybench/Calls.py Sat Feb 7 18:13:31 2009 @@ -2,7 +2,7 @@ class PythonFunctionCalls(Test): - version = 2.0 + version = 2.1 operations = 5*(1+4+4+2) rounds = 60000 @@ -178,8 +178,8 @@ # localize functions f0 = globals f1 = hash - f2 = cmp - f3 = range + f2 = divmod + f3 = max # do calls for i in range(self.rounds): @@ -279,8 +279,8 @@ # localize functions f0 = dir f1 = hash - f2 = range - f3 = range + f2 = divmod + f3 = max # do calls for i in range(self.rounds): Modified: python/branches/py3k/Tools/pybench/CommandLine.py ============================================================================== --- python/branches/py3k/Tools/pybench/CommandLine.py (original) +++ python/branches/py3k/Tools/pybench/CommandLine.py Sat Feb 7 18:13:31 2009 @@ -11,6 +11,8 @@ """ +from __future__ import print_function + __copyright__ = """\ Copyright (c), 1997-2006, Marc-Andre Lemburg (mal at lemburg.com) Copyright (c), 2000-2006, eGenix.com Software GmbH (info at egenix.com) Modified: python/branches/py3k/Tools/pybench/README ============================================================================== --- python/branches/py3k/Tools/pybench/README (original) +++ python/branches/py3k/Tools/pybench/README Sat Feb 7 18:13:31 2009 @@ -82,7 +82,7 @@ --examples show examples of usage Version: - 2.0 + 2.1 The normal operation is to run the suite and display the results. Use -f to save them for later reuse or comparisons. @@ -95,9 +95,9 @@ Examples: -python2.1 pybench.py -f p21.pybench -python2.5 pybench.py -f p25.pybench -python pybench.py -s p25.pybench -c p21.pybench +python3.0 pybench.py -f p30.pybench +python3.1 pybench.py -f p31.pybench +python pybench.py -s p31.pybench -c p30.pybench """ License @@ -111,9 +111,9 @@ """ ------------------------------------------------------------------------------- -PYBENCH 2.0 +PYBENCH 2.1 ------------------------------------------------------------------------------- -* using Python 2.4.2 +* using CPython 3.0 * disabled garbage collection * system check interval set to maximum: 2147483647 * using timer: time.time @@ -141,8 +141,9 @@ Processor: x86_64 Python: + Implementation: CPython Executable: /usr/local/bin/python - Version: 2.4.2 + Version: 3.0 Compiler: GCC 3.3.4 (pre 3.3.5 20040809) Bits: 64bit Build: Oct 1 2005 15:24:35 (#1) @@ -331,6 +332,11 @@ Version History --------------- + 2.1: made some minor changes for compatibility with Python 3.0: + - replaced cmp with divmod and range with max in Calls.py + (cmp no longer exists in 3.0, and range is a list in + Python 2.x and an iterator in Python 3.x) + 2.0: rewrote parts of pybench which resulted in more repeatable timings: - made timer a parameter Modified: python/branches/py3k/Tools/pybench/Strings.py ============================================================================== --- python/branches/py3k/Tools/pybench/Strings.py (original) +++ python/branches/py3k/Tools/pybench/Strings.py Sat Feb 7 18:13:31 2009 @@ -1,6 +1,12 @@ from pybench import Test import sys +try: + intern +except NameError: + intern = sys.intern + + class ConcatStrings(Test): version = 2.0 @@ -174,7 +180,7 @@ def test(self): # Make sure the strings *are* interned - s = sys.intern(''.join(map(str,range(10)))) + s = intern(''.join(map(str,range(10)))) t = s for i in range(self.rounds): @@ -240,7 +246,7 @@ def calibrate(self): - s = sys.intern(''.join(map(str,range(10)))) + s = intern(''.join(map(str,range(10)))) t = s for i in range(self.rounds): Modified: python/branches/py3k/Tools/pybench/pybench.py ============================================================================== --- python/branches/py3k/Tools/pybench/pybench.py (original) +++ python/branches/py3k/Tools/pybench/pybench.py Sat Feb 7 18:13:31 2009 @@ -3,14 +3,15 @@ """ A Python Benchmark Suite """ -# -# Note: Please keep this module compatible to Python 1.5.2. +# Note: Please keep this module compatible to Python 2.6. # # Tests may include features in later Python versions, but these # should then be embedded in try-except clauses in the configuration # module Setup.py. # +from __future__ import print_function + # pybench Copyright __copyright__ = """\ Copyright (c), 1997-2006, Marc-Andre Lemburg (mal at lemburg.com) @@ -44,7 +45,7 @@ import pickle # Version number; version history: see README file ! -__version__ = '2.0' +__version__ = '2.1' ### Constants @@ -174,7 +175,7 @@ # Version number of the test as float (x.yy); this is important # for comparisons of benchmark runs - tests with unequal version # number will not get compared. - version = 2.0 + version = 2.1 # The number of abstract operations done in each round of the # test. An operation is the basic unit of what you want to @@ -403,7 +404,7 @@ roundtime = 0 # Benchmark version number as float x.yy - version = 2.0 + version = 2.1 # Produce verbose output ? verbose = 0 Modified: python/branches/py3k/Tools/pybench/systimes.py ============================================================================== --- python/branches/py3k/Tools/pybench/systimes.py (original) +++ python/branches/py3k/Tools/pybench/systimes.py Sat Feb 7 18:13:31 2009 @@ -31,6 +31,9 @@ the author. All Rights Reserved. """ + +from __future__ import print_function + import time, sys # From python-checkins at python.org Sat Feb 7 18:28:46 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 7 Feb 2009 18:28:46 +0100 (CET) Subject: [Python-checkins] r69412 - in python/branches/release30-maint: Misc/NEWS Tools/pybench/Calls.py Tools/pybench/CommandLine.py Tools/pybench/README Tools/pybench/Strings.py Tools/pybench/pybench.py Tools/pybench/systimes.py Message-ID: <20090207172846.E07E81E4002@bag.python.org> Author: antoine.pitrou Date: Sat Feb 7 18:28:46 2009 New Revision: 69412 Log: Merged revisions 69411 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69411 | antoine.pitrou | 2009-02-07 18:13:31 +0100 (sam., 07 f?vr. 2009) | 4 lines Issue #4704: remove use of cmp() in pybench, bump its version number to 2.1, and make it 2.6-compatible. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Tools/pybench/Calls.py python/branches/release30-maint/Tools/pybench/CommandLine.py python/branches/release30-maint/Tools/pybench/README python/branches/release30-maint/Tools/pybench/Strings.py python/branches/release30-maint/Tools/pybench/pybench.py python/branches/release30-maint/Tools/pybench/systimes.py Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat Feb 7 18:28:46 2009 @@ -264,6 +264,9 @@ Tools/Demos ----------- +- Issue #4704: remove use of cmp() in pybench, bump its version number to 2.1, + and make it 2.6-compatible. + - Issue #4677: add two list comprehension tests to pybench. Modified: python/branches/release30-maint/Tools/pybench/Calls.py ============================================================================== --- python/branches/release30-maint/Tools/pybench/Calls.py (original) +++ python/branches/release30-maint/Tools/pybench/Calls.py Sat Feb 7 18:28:46 2009 @@ -2,7 +2,7 @@ class PythonFunctionCalls(Test): - version = 2.0 + version = 2.1 operations = 5*(1+4+4+2) rounds = 60000 @@ -178,8 +178,8 @@ # localize functions f0 = globals f1 = hash - f2 = cmp - f3 = range + f2 = divmod + f3 = max # do calls for i in range(self.rounds): @@ -279,8 +279,8 @@ # localize functions f0 = dir f1 = hash - f2 = range - f3 = range + f2 = divmod + f3 = max # do calls for i in range(self.rounds): Modified: python/branches/release30-maint/Tools/pybench/CommandLine.py ============================================================================== --- python/branches/release30-maint/Tools/pybench/CommandLine.py (original) +++ python/branches/release30-maint/Tools/pybench/CommandLine.py Sat Feb 7 18:28:46 2009 @@ -11,6 +11,8 @@ """ +from __future__ import print_function + __copyright__ = """\ Copyright (c), 1997-2006, Marc-Andre Lemburg (mal at lemburg.com) Copyright (c), 2000-2006, eGenix.com Software GmbH (info at egenix.com) Modified: python/branches/release30-maint/Tools/pybench/README ============================================================================== --- python/branches/release30-maint/Tools/pybench/README (original) +++ python/branches/release30-maint/Tools/pybench/README Sat Feb 7 18:28:46 2009 @@ -82,7 +82,7 @@ --examples show examples of usage Version: - 2.0 + 2.1 The normal operation is to run the suite and display the results. Use -f to save them for later reuse or comparisons. @@ -95,9 +95,9 @@ Examples: -python2.1 pybench.py -f p21.pybench -python2.5 pybench.py -f p25.pybench -python pybench.py -s p25.pybench -c p21.pybench +python3.0 pybench.py -f p30.pybench +python3.1 pybench.py -f p31.pybench +python pybench.py -s p31.pybench -c p30.pybench """ License @@ -111,9 +111,9 @@ """ ------------------------------------------------------------------------------- -PYBENCH 2.0 +PYBENCH 2.1 ------------------------------------------------------------------------------- -* using Python 2.4.2 +* using CPython 3.0 * disabled garbage collection * system check interval set to maximum: 2147483647 * using timer: time.time @@ -141,8 +141,9 @@ Processor: x86_64 Python: + Implementation: CPython Executable: /usr/local/bin/python - Version: 2.4.2 + Version: 3.0 Compiler: GCC 3.3.4 (pre 3.3.5 20040809) Bits: 64bit Build: Oct 1 2005 15:24:35 (#1) @@ -331,6 +332,11 @@ Version History --------------- + 2.1: made some minor changes for compatibility with Python 3.0: + - replaced cmp with divmod and range with max in Calls.py + (cmp no longer exists in 3.0, and range is a list in + Python 2.x and an iterator in Python 3.x) + 2.0: rewrote parts of pybench which resulted in more repeatable timings: - made timer a parameter Modified: python/branches/release30-maint/Tools/pybench/Strings.py ============================================================================== --- python/branches/release30-maint/Tools/pybench/Strings.py (original) +++ python/branches/release30-maint/Tools/pybench/Strings.py Sat Feb 7 18:28:46 2009 @@ -1,6 +1,12 @@ from pybench import Test import sys +try: + intern +except NameError: + intern = sys.intern + + class ConcatStrings(Test): version = 2.0 @@ -174,7 +180,7 @@ def test(self): # Make sure the strings *are* interned - s = sys.intern(''.join(map(str,range(10)))) + s = intern(''.join(map(str,range(10)))) t = s for i in range(self.rounds): @@ -240,7 +246,7 @@ def calibrate(self): - s = sys.intern(''.join(map(str,range(10)))) + s = intern(''.join(map(str,range(10)))) t = s for i in range(self.rounds): Modified: python/branches/release30-maint/Tools/pybench/pybench.py ============================================================================== --- python/branches/release30-maint/Tools/pybench/pybench.py (original) +++ python/branches/release30-maint/Tools/pybench/pybench.py Sat Feb 7 18:28:46 2009 @@ -3,14 +3,15 @@ """ A Python Benchmark Suite """ -# -# Note: Please keep this module compatible to Python 1.5.2. +# Note: Please keep this module compatible to Python 2.6. # # Tests may include features in later Python versions, but these # should then be embedded in try-except clauses in the configuration # module Setup.py. # +from __future__ import print_function + # pybench Copyright __copyright__ = """\ Copyright (c), 1997-2006, Marc-Andre Lemburg (mal at lemburg.com) @@ -44,7 +45,7 @@ import pickle # Version number; version history: see README file ! -__version__ = '2.0' +__version__ = '2.1' ### Constants @@ -174,7 +175,7 @@ # Version number of the test as float (x.yy); this is important # for comparisons of benchmark runs - tests with unequal version # number will not get compared. - version = 2.0 + version = 2.1 # The number of abstract operations done in each round of the # test. An operation is the basic unit of what you want to @@ -403,7 +404,7 @@ roundtime = 0 # Benchmark version number as float x.yy - version = 2.0 + version = 2.1 # Produce verbose output ? verbose = 0 Modified: python/branches/release30-maint/Tools/pybench/systimes.py ============================================================================== --- python/branches/release30-maint/Tools/pybench/systimes.py (original) +++ python/branches/release30-maint/Tools/pybench/systimes.py Sat Feb 7 18:28:46 2009 @@ -31,6 +31,9 @@ the author. All Rights Reserved. """ + +from __future__ import print_function + import time, sys # From buildbot at python.org Sat Feb 7 18:49:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 07 Feb 2009 17:49:50 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090207174950.E2C181E4002@bag.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/214 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 failed slave lost sincerely, -The Buildbot From buildbot at python.org Sat Feb 7 19:02:51 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 07 Feb 2009 18:02:51 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20090207180251.478E51E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%203.0/builds/122 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch branches/release30-maint] 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 Sat Feb 7 19:35:16 2009 From: python-checkins at python.org (neil.schemenauer) Date: Sat, 7 Feb 2009 19:35:16 +0100 (CET) Subject: [Python-checkins] r69413 - python/trunk/Lib/test/test_compiler.py Message-ID: <20090207183516.95B0A1E4002@bag.python.org> Author: neil.schemenauer Date: Sat Feb 7 19:35:16 2009 New Revision: 69413 Log: Add test for issue #999042, explict global statement works. Modified: python/trunk/Lib/test/test_compiler.py Modified: python/trunk/Lib/test/test_compiler.py ============================================================================== --- python/trunk/Lib/test/test_compiler.py (original) +++ python/trunk/Lib/test/test_compiler.py Sat Feb 7 19:35:16 2009 @@ -165,6 +165,13 @@ exec c in dct self.assertEquals(dct.get('result'), 1) + def testGlobal(self): + code = compiler.compile('global x\nx=1', '', 'exec') + d1 = {'__builtins__': {}} + d2 = {} + exec code in d1, d2 + # x should be in the globals dict + self.assertEquals(d1.get('x'), 1) def testPrintFunction(self): c = compiler.compile('from __future__ import print_function\n' From buildbot at python.org Sat Feb 7 19:47:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 07 Feb 2009 18:47:31 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090207184731.BEE751E4002@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/136 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: 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.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 Feb 7 19:49:55 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 7 Feb 2009 19:49:55 +0100 (CET) Subject: [Python-checkins] r69414 - python/trunk/Doc/library/functions.rst Message-ID: <20090207184955.17FF71E4002@bag.python.org> Author: georg.brandl Date: Sat Feb 7 19:49:54 2009 New Revision: 69414 Log: make "super only for new-style classes" a note. 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 Sat Feb 7 19:49:54 2009 @@ -1171,8 +1171,10 @@ If the second argument is omitted the super object returned is unbound. If the second argument is an object, ``isinstance(obj, type)`` must be true. If the second argument is a type, - ``issubclass(type2, type)`` must be true. :func:`super` only works for - :term:`new-style class`\es. + ``issubclass(type2, type)`` must be true. + + .. note:: + :func:`super` only works for :term:`new-style class`\es. There are two typical use cases for "super". In a class hierarchy with single inheritance, "super" can be used to refer to parent classes without From python-checkins at python.org Sat Feb 7 20:08:24 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 7 Feb 2009 20:08:24 +0100 (CET) Subject: [Python-checkins] r69415 - in python/trunk/Lib: shutil.py test/test_shutil.py Message-ID: <20090207190824.4FCCD1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 7 20:08:22 2009 New Revision: 69415 Log: make destinsrc private Modified: python/trunk/Lib/shutil.py python/trunk/Lib/test/test_shutil.py Modified: python/trunk/Lib/shutil.py ============================================================================== --- python/trunk/Lib/shutil.py (original) +++ python/trunk/Lib/shutil.py Sat Feb 7 20:08:22 2009 @@ -256,7 +256,7 @@ os.rename(src, real_dst) except OSError: if os.path.isdir(src): - if destinsrc(src, dst): + if _destinsrc(src, dst): raise Error, "Cannot move a directory '%s' into itself '%s'." % (src, dst) copytree(src, real_dst, symlinks=True) rmtree(src) @@ -264,7 +264,7 @@ copy2(src, real_dst) os.unlink(src) -def destinsrc(src, dst): +def _destinsrc(src, dst): src = abspath(src) dst = abspath(dst) if not src.endswith(os.path.sep): Modified: python/trunk/Lib/test/test_shutil.py ============================================================================== --- python/trunk/Lib/test/test_shutil.py (original) +++ python/trunk/Lib/test/test_shutil.py Sat Feb 7 20:08:22 2009 @@ -346,8 +346,8 @@ for src, dst in [('srcdir', 'srcdir/dest')]: src = os.path.join(TESTFN, src) dst = os.path.join(TESTFN, dst) - self.assert_(shutil.destinsrc(src, dst), - msg='destinsrc() wrongly concluded that ' + self.assert_(shutil._destinsrc(src, dst), + msg='_destinsrc() wrongly concluded that ' 'dst (%s) is not in src (%s)' % (dst, src)) finally: shutil.rmtree(TESTFN, ignore_errors=True) @@ -358,8 +358,8 @@ for src, dst in [('srcdir', 'src/dest'), ('srcdir', 'srcdir.new')]: src = os.path.join(TESTFN, src) dst = os.path.join(TESTFN, dst) - self.failIf(shutil.destinsrc(src, dst), - msg='destinsrc() wrongly concluded that ' + self.failIf(shutil._destinsrc(src, dst), + msg='_destinsrc() wrongly concluded that ' 'dst (%s) is in src (%s)' % (dst, src)) finally: shutil.rmtree(TESTFN, ignore_errors=True) From nnorwitz at gmail.com Sat Feb 7 23:17:23 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 7 Feb 2009 17:17:23 -0500 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090207221723.GA2776@python.psfb.org> More important issues: ---------------------- test_distutils leaked [103, 103, 103] references, sum=309 Less important issues: ---------------------- test_cmd_line leaked [25, -25, 25] references, sum=25 test_smtplib leaked [-88, 88, -14] references, sum=-14 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 From python-checkins at python.org Sat Feb 7 23:55:24 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 7 Feb 2009 23:55:24 +0100 (CET) Subject: [Python-checkins] r69416 - python/branches/py3k/Lib/http/client.py Message-ID: <20090207225524.E72C41E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 7 23:55:24 2009 New Revision: 69416 Log: fix typo and test_urllib failures Modified: python/branches/py3k/Lib/http/client.py Modified: python/branches/py3k/Lib/http/client.py ============================================================================== --- python/branches/py3k/Lib/http/client.py (original) +++ python/branches/py3k/Lib/http/client.py Sat Feb 7 23:55:24 2009 @@ -272,7 +272,7 @@ # applies to HTTP/1.1 connections.) This will happen if a self.fp.read() # is done (without a size) whether self.fp is buffered or not. # So, no self.fp.read() by clients unless they know what they are doing. - self.fp = sock.makefile("rb") + self.fp = sock.makefile(sock, "rb") self.debuglevel = debuglevel self.strict = strict self._method = method From python-checkins at python.org Sun Feb 8 00:01:21 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 8 Feb 2009 00:01:21 +0100 (CET) Subject: [Python-checkins] r69417 - in python/trunk/Doc: library/2to3.rst tools/sphinxext/pyspecific.py Message-ID: <20090207230121.D570B1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 8 00:01:19 2009 New Revision: 69417 Log: document individual 2to3 fixers Modified: python/trunk/Doc/library/2to3.rst python/trunk/Doc/tools/sphinxext/pyspecific.py Modified: python/trunk/Doc/library/2to3.rst ============================================================================== --- python/trunk/Doc/library/2to3.rst (original) +++ python/trunk/Doc/library/2to3.rst Sun Feb 8 00:01:19 2009 @@ -14,6 +14,8 @@ automatically. +.. _2to3-using: + Using 2to3 ---------- @@ -52,10 +54,10 @@ Comments and exact indentation are preserved throughout the translation process. -By default, 2to3 runs a set of predefined fixers. The :option:`-l` flag lists -all available fixers. An explicit set of fixers to run can be given with -:option:`-f`. Likewise the :option:`-x` explicitly disables a fixer. The -following example runs only the ``imports`` and ``has_key`` fixers:: +By default, 2to3 runs a set of :ref:`predefined fixers <2to3-fixers>`. The +:option:`-l` flag lists all available fixers. An explicit set of fixers to run +can be given with :option:`-f`. Likewise the :option:`-x` explicitly disables a +fixer. The following example runs only the ``imports`` and ``has_key`` fixers:: $ 2to3 -f imports -f has_key example.py @@ -84,12 +86,258 @@ The :option:`-v` option enables output of more information on the translation process. -When the :option:`-p` is passed, 2to3 treats ``print`` as a function instead of -a statement. This is useful when ``from __future__ import print_function`` is -being used. If this option is not given, the print fixer will surround print -calls in an extra set of parentheses because it cannot differentiate between the -print statement with parentheses (such as ``print ("a" + "b" + "c")``) and a -true function call. +When the :option:`-p` is passed, the :2to3fixer:`print` fixer ``print`` as a +function instead of a statement. This is useful when ``from __future__ import +print_function`` is being used. If this option is not given, the print fixer +will surround print calls in an extra set of parentheses because it cannot +differentiate between the print statement with parentheses (such as ``print +("a" + "b" + "c")``) and a true function call. + + +.. _2to3-fixers: + +Fixers +------ + +Each step of tranforming code is encapsulated in a fixer. The command ``2to3 +-l`` lists them. As :ref:`documented above <2to3-using>`, each can be turned on +and off individually. They are described here in more detail. + + +.. 2to3fixer:: apply + + Removes usage of :func:`apply`. For example ``apply(function, *args, + **kwargs)`` is converted to ``function(*args, **kwargs)``. + +.. 2to3fixer:: basestring + + Converts :class:`basestring` to :class:`str`. + +.. 2to3fixer:: buffer + + Converts :class:`buffer` to :class:`memoryview`. This fixer is optional + because the :class:`memoryview` API is similar but not exactly the same as + that of :class:`buffer`. + +.. 2to3fixer:: callable + + Converts ``callable(x)`` to ``hasattr(x, "__call_")``. + +.. 2to3fixer:: dict + + Fixes dictionary iteration methods. :meth:`dict.iteritems` is converted to + :meth:`dict.items`, :meth:`dict.iterkeys` to :meth:`dict.keys`, and + :meth:`dict.itervalues` to :meth:`dict.values`. It also wraps existing + usages of :meth:`dict.items`, :meth:`dict.keys`, and :meth:`dict.values` in a + call to :class:`list`. + +.. 2to3fixer:: except + + Converts ``except X, T`` to ``except X as T``. + +.. 2to3fixer:: exec + + Converts the :keyword:`exec` statement to the :func:`exec` function. + +.. 2to3fixer:: execfile + + Removes usage of :func:`execfile`. The argument to :func:`execfile` is + wrapped in calls to :func:`open`, :func:`compile`, and :func:`exec`. + +.. 2to3fixer:: filter + + Wraps :func:`filter` in a :class:`list` call. + +.. 2to3fixer:: funcattrs + + Fixes function attributes that have been renamed. For example, + ``my_function.func_closure`` is converted to ``my_function.__closure__``. + +.. 2to3fixer:: future + + Removes ``from __future__ import new_feature`` statements. + +.. 2to3fixer:: getcwdu + + Renames :func:`os.getcwdu` to :func:`os.getcwd`. + +.. 2to3fixer:: has_key + + Changes ``dict.has_key(key)`` to ``key in dict``. + +.. 2to3fixer:: idioms + + This optional fixer preforms several transformations that make Python code + more idiomatic. Type comparisions like ``type(x) is SomeClass`` and + ``type(x) == SomeClass`` are converted to ``isinstance(x, SomeClass)``. + ``while 1`` becomes ``while True``. This fixer also tries to make use of + :func:`sorted` in appropiate places. For example, this block :: + + L = list(some_iterable) + L.sort() + + is changed to :: + + L = sorted(some_iterable) + +.. 2to3fixer:: import + + Detects sibling imports and converts them to relative imports. + +.. 2to3fixer:: imports + + Handles module renames in the standard library. + +.. 2to3fixer:: imports2 + + Handles other modules reanmes in the standard library. It is separate from + :2to3fixer:`imports` only because of technical limitations. + +.. 2to3fixer:: input + + Converts ``input(prompt)`` to ``eval(input(prompt))`` + +.. 2to3fixer:: intern + + Converts :func:`intern` to :func:`sys.itern`. + +.. 2to3fixer:: isinstance + + Fixes duplicate types in the second argument of :func:`isinstance`. For + example, ``isinstance(x, (int, int))`` is converted to ``isinstance(x, + (int))``. + +.. 2to3fixer:: itertools_imports + + Removes imports of :func:`itertools.ifilter`, :func:`itertools.izip`, and + :func:`itertools.imap`. Imports of :func:`itertools.ifilterfalse` are also + changed to :func:`itertools.filterfalse`. + +.. 2to3fixer:: itertools + + Changes usage of :func:`itertools.ifilter`, :func:`itertools.izip`, and + :func:`itertools.imap` to their builtin equivalents. + :func:`itertools.ifilterfalse` is changed to :func:`itertools.filterfalse`. + +.. 2to3fixer:: long + + Strips the ``L`` prefix on numbers and renamed :class:`long` to :class:`int`. + +.. 2to3fixer:: map + + Wraps :func:`map` in a :class:`list` call. It also changes ``map(none, x)`` + to ``list(x)``. Using ``from future_builtins import map`` disables this + fixer. + +.. 2to3fixer:: metaclass + + Converts the old metaclass syntax (``__metaclass__ = Meta`` in the class + body) to the new (``class X(metaclass=Meta)``). + +.. 2to3fixer:: methodattrs + + Fixes old method attribute names. For example, ``meth.im_func`` is converted + to ``meth.__func__``. + +.. 2to3fixer:: ne + + Converts the old not-equal syntax, ``<>``, to ``!=``. + +.. 2to3fixer:: next + + Converts the use of iterator's :meth:`next` methods to the :func:`next` + function. It also renames :meth:`next` methods to :meth:`~object.__next__`. + +.. 2to3fixer:: nonzero + + Renames :meth:`~object.__nonzero__` to :meth:`~object.__bool__`. + +.. 2to3fixer:: paren + + Add extra parenthesis where they are required in list comprehensions. For + example, ``[x for x in 1, 2]`` to ``[x for x in (1, 2)]``. + +.. 2to3fixer:: print + + Converts the :keyword:`print` statement to the :func:`print` function. + +.. 2to3fixer:: raises + + Converts ``raise E, V`` to ``raise E(V)``, and ``raise E, V, T`` as ``raise + E(V).with_traceback(T)``. If ``E`` is a tuple, the translation will be + incorrect because substituting tuples for exceptions has been removed in 3.0. + +.. 2to3fixer:: raw_input + + Converts :func:`raw_input` to :func:`input`. + +.. 2to3fixer:: reduce + + Handles the move of :func:`reduce` to :func:`functools.reduce`. + +.. 2to3fixer:: renames + + Changes :data:`sys.maxint` to :data:`sys.maxsize`. + +.. 2to3fixer:: repr + + Replaces backtick repr with the :func:`repr` function. + +.. 2to3fixer:: set_literal + + Replaces use of the :class:`set` constructor with set literals. This fixer + is optional. + +.. 2to3fixer:: standard_error + + Renames :exc:`StandardError` to :exc:`Exception`. + +.. 2to3fixer:: sys_exc + + Changes the deprecated :data:`sys.exc_value`, :data:`sys.exc_type`, + :data:`sys.exc_traceback` to use :func:`sys.exc_info`. + +.. 2to3fixer:: throw + + Fixes the API change in generators :meth:`throw` method. + +.. 2to3fixer:: tuple_params + + Removes implicit tuple parameter unpacking. This fixer inserts temporary + variables. + +.. 2to3fixer:: types + + Fixes code broken from the removal of some members in the :mod:`types` + module. + +.. 2to3fixer:: unicode + + Renames :class:`unicode` to :class:`str`. + +.. 2to3fixer:: urllib + + Handles the rename of :mod:`urllib` and :mod:`urllib2` to the :mod:`urllib` + package. + +.. 2to3fixer:: ws_comma + + Removes excess whitespace from comma separated items. This fixer is + optional. + +.. 2to3fixer:: xrange + + Renames :func:`xrange` to :func:`range` and wraps existing :func:`range` + calls with :class:`list`. + +.. 2to3fixer:: xreadlines + + Change ``for x in file.xreadlines()`` to ``for x in file``. + +.. 2to3fixer:: zip + + Wraps :func:`zip` usage in a :class:`list` call. This is disabled when + ``from future_builtins import zip`` appears. :mod:`lib2to3` - 2to3's library Modified: python/trunk/Doc/tools/sphinxext/pyspecific.py ============================================================================== --- python/trunk/Doc/tools/sphinxext/pyspecific.py (original) +++ python/trunk/Doc/tools/sphinxext/pyspecific.py Sun Feb 8 00:01:19 2009 @@ -124,3 +124,4 @@ app.add_builder(suspicious.CheckSuspiciousMarkupBuilder) app.add_description_unit('opcode', 'opcode', '%s (opcode)', parse_opcode_signature) + app.add_description_unit('2to3fixer', '2to3fixer', '%s (2to3 fixer)') From python-checkins at python.org Sun Feb 8 01:29:20 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 8 Feb 2009 01:29:20 +0100 (CET) Subject: [Python-checkins] r69418 - python/branches/py3k/Lib/http/client.py Message-ID: <20090208002920.57B4D1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 8 01:29:20 2009 New Revision: 69418 Log: revert 69416; it didn't help much Modified: python/branches/py3k/Lib/http/client.py Modified: python/branches/py3k/Lib/http/client.py ============================================================================== --- python/branches/py3k/Lib/http/client.py (original) +++ python/branches/py3k/Lib/http/client.py Sun Feb 8 01:29:20 2009 @@ -272,7 +272,7 @@ # applies to HTTP/1.1 connections.) This will happen if a self.fp.read() # is done (without a size) whether self.fp is buffered or not. # So, no self.fp.read() by clients unless they know what they are doing. - self.fp = sock.makefile(sock, "rb") + self.fp = sock.makefile("rb") self.debuglevel = debuglevel self.strict = strict self._method = method From python-checkins at python.org Sun Feb 8 02:26:34 2009 From: python-checkins at python.org (nick.coghlan) Date: Sun, 8 Feb 2009 02:26:34 +0100 (CET) Subject: [Python-checkins] r69419 - in python/trunk: Doc/library/runpy.rst Doc/using/cmdline.rst Lib/runpy.py Lib/test/test_cmd_line_script.py Misc/ACKS Misc/NEWS Message-ID: <20090208012634.E98B11E4002@bag.python.org> Author: nick.coghlan Date: Sun Feb 8 02:26:34 2009 New Revision: 69419 Log: Issue 4195: Restore the ability to execute packages with the -m switch (but this time in a way that leaves the import machinery in a valid state). (Original patch by Andi Vajda) Modified: python/trunk/Doc/library/runpy.rst python/trunk/Doc/using/cmdline.rst python/trunk/Lib/runpy.py python/trunk/Lib/test/test_cmd_line_script.py python/trunk/Misc/ACKS python/trunk/Misc/NEWS Modified: python/trunk/Doc/library/runpy.rst ============================================================================== --- python/trunk/Doc/library/runpy.rst (original) +++ python/trunk/Doc/library/runpy.rst Sun Feb 8 02:26:34 2009 @@ -28,17 +28,22 @@ mechanism (refer to PEP 302 for details) and then executed in a fresh module namespace. + If the supplied module name refers to a package rather than a normal module, + then that package is imported and the ``__main__`` submodule within that + package is then executed and the resulting module globals dictionary returned. + The optional dictionary argument *init_globals* may be used to pre-populate the globals dictionary before the code is executed. The supplied dictionary will not be modified. If any of the special global variables below are defined in the supplied dictionary, those definitions are overridden by the ``run_module`` function. - The special global variables ``__name__``, ``__file__``, ``__loader__`` and - ``__builtins__`` are set in the globals dictionary before the module code is - executed. + The special global variables ``__name__``, ``__file__``, ``__loader__``, + ``__builtins__`` and ``__package__`` are set in the globals dictionary before + the module code is executed. - ``__name__`` is set to *run_name* if this optional argument is supplied, and the + ``__name__`` is set to *run_name* if this optional argument is supplied, to + ``mod_name + '.__main__'`` if the named module is a package and to the *mod_name* argument otherwise. ``__loader__`` is set to the PEP 302 module loader used to retrieve the code for @@ -50,6 +55,9 @@ ``__builtins__`` is automatically initialised with a reference to the top level namespace of the :mod:`__builtin__` module. + ``__package__`` is set to *mod_name* if the named module is a package and to + ``mod_name.rpartition('.')[0]`` otherwise. + If the argument *alter_sys* is supplied and evaluates to ``True``, then ``sys.argv[0]`` is updated with the value of ``__file__`` and ``sys.modules[__name__]`` is updated with a temporary module object for the @@ -62,8 +70,15 @@ function from threaded code. + .. versionchanged:: 2.7 + Added ability to execute packages by looking for a ``__main__`` submodule + + .. seealso:: :pep:`338` - Executing modules as scripts - PEP written and implemented by Nick Coghlan. + PEP written and implemented by Nick Coghlan. + + :pep:`366` - Main module explicit relative imports + PEP written and implemented by Nick Coghlan. Modified: python/trunk/Doc/using/cmdline.rst ============================================================================== --- python/trunk/Doc/using/cmdline.rst (original) +++ python/trunk/Doc/using/cmdline.rst Sun Feb 8 02:26:34 2009 @@ -78,6 +78,12 @@ the implementation may not always enforce this (e.g. it may allow you to use a name that includes a hyphen). + Package names are also permitted. When a package name is supplied instead + of a normal module, the interpreter will execute ``.__main__`` as + the main module. This behaviour is deliberately similar to the handling + of directories and zipfiles that are passed to the interpreter as the + script argument. + .. note:: This option cannot be used with builtin modules and extension modules @@ -97,7 +103,7 @@ .. seealso:: :func:`runpy.run_module` - The actual implementation of this feature. + Equivalent functionality directly available to Python code :pep:`338` -- Executing modules as scripts @@ -106,6 +112,9 @@ .. versionchanged:: 2.5 The named module can now be located inside a package. + .. versionchanged:: 2.7 + Supply the package name to run a ``__main__`` submodule. + .. describe:: - Modified: python/trunk/Lib/runpy.py ============================================================================== --- python/trunk/Lib/runpy.py (original) +++ python/trunk/Lib/runpy.py Sun Feb 8 02:26:34 2009 @@ -80,13 +80,19 @@ if loader is None: raise ImportError("No module named %s" % mod_name) if loader.is_package(mod_name): - raise ImportError(("%s is a package and cannot " + - "be directly executed") % mod_name) + if mod_name == "__main__" or mod_name.endswith(".__main__"): + raise ImportError(("Cannot use package as __main__ module")) + try: + pkg_main_name = mod_name + ".__main__" + return _get_module_details(pkg_main_name) + except ImportError, e: + raise ImportError(("%s; %r is a package and cannot " + + "be directly executed") %(e, mod_name)) code = loader.get_code(mod_name) if code is None: raise ImportError("No code object available for %s" % mod_name) filename = _get_filename(loader, mod_name) - return loader, code, filename + return mod_name, loader, code, filename # XXX ncoghlan: Should this be documented and made public? @@ -101,12 +107,12 @@ __loader__ """ try: - loader, code, fname = _get_module_details(mod_name) + mod_name, loader, code, fname = _get_module_details(mod_name) except ImportError as exc: # Try to provide a good error message # for directories, zip files and the -m switch if set_argv0: - # For -m switch, just disply the exception + # For -m switch, just display the exception info = str(exc) else: # For directories/zipfiles, let the user @@ -127,7 +133,7 @@ Returns the resulting top level namespace dictionary """ - loader, code, fname = _get_module_details(mod_name) + mod_name, loader, code, fname = _get_module_details(mod_name) if run_name is None: run_name = mod_name pkg_name = mod_name.rpartition('.')[0] Modified: python/trunk/Lib/test/test_cmd_line_script.py ============================================================================== --- python/trunk/Lib/test/test_cmd_line_script.py (original) +++ python/trunk/Lib/test/test_cmd_line_script.py Sun Feb 8 02:26:34 2009 @@ -158,6 +158,16 @@ self.assert_(printed_package in data) self.assert_(printed_argv0 in data) + def _check_import_error(self, script_name, expected_msg, + *cmd_line_switches): + run_args = cmd_line_switches + (script_name,) + exit_code, data = _run_python(*run_args) + if verbose: + print 'Output from test script %r:' % script_name + print data + print 'Expected output: %r' % expected_msg + self.assert_(expected_msg in data) + def test_basic_script(self): with temp_dir() as script_dir: script_name = _make_test_script(script_dir, 'script') @@ -182,6 +192,11 @@ os.remove(script_name) self._check_script(script_dir, compiled_name, script_dir, '') + def test_directory_error(self): + with temp_dir() as script_dir: + msg = "can't find '__main__.py' in %r" % script_dir + self._check_import_error(script_dir, msg) + def test_zipfile(self): with temp_dir() as script_dir: script_name = _make_test_script(script_dir, '__main__') @@ -195,6 +210,13 @@ zip_name, run_name = _make_test_zip(script_dir, 'test_zip', compiled_name) self._check_script(zip_name, run_name, zip_name, '') + def test_zipfile_error(self): + with temp_dir() as script_dir: + script_name = _make_test_script(script_dir, 'not_main') + zip_name, run_name = _make_test_zip(script_dir, 'test_zip', script_name) + msg = "can't find '__main__.py' in %r" % zip_name + self._check_import_error(zip_name, msg) + def test_module_in_package(self): with temp_dir() as script_dir: pkg_dir = os.path.join(script_dir, 'test_pkg') @@ -215,6 +237,47 @@ launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg.test_pkg.script', zip_name) self._check_script(launch_name, run_name, run_name, 'test_pkg.test_pkg') + def test_package(self): + with temp_dir() as script_dir: + pkg_dir = os.path.join(script_dir, 'test_pkg') + _make_test_pkg(pkg_dir) + script_name = _make_test_script(pkg_dir, '__main__') + launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg') + self._check_script(launch_name, script_name, + script_name, 'test_pkg') + + def test_package_compiled(self): + with temp_dir() as script_dir: + pkg_dir = os.path.join(script_dir, 'test_pkg') + _make_test_pkg(pkg_dir) + script_name = _make_test_script(pkg_dir, '__main__') + compiled_name = _compile_test_script(script_name) + os.remove(script_name) + launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg') + self._check_script(launch_name, compiled_name, + compiled_name, 'test_pkg') + + def test_package_error(self): + with temp_dir() as script_dir: + pkg_dir = os.path.join(script_dir, 'test_pkg') + _make_test_pkg(pkg_dir) + msg = ("'test_pkg' is a package and cannot " + "be directly executed") + launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg') + self._check_import_error(launch_name, msg) + + def test_package_recursion(self): + with temp_dir() as script_dir: + pkg_dir = os.path.join(script_dir, 'test_pkg') + _make_test_pkg(pkg_dir) + main_dir = os.path.join(pkg_dir, '__main__') + _make_test_pkg(main_dir) + msg = ("Cannot use package as __main__ module; " + "'test_pkg' is a package and cannot " + "be directly executed") + launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg') + self._check_import_error(launch_name, msg) + def test_main(): test.test_support.run_unittest(CmdLineTest) Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Sun Feb 8 02:26:34 2009 @@ -712,6 +712,7 @@ Roger Upole Michael Urman Hector Urtubia +Andi Vajda Atul Varma Dmitry Vasiliev Alexandre Vassalotti Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Feb 8 02:26:34 2009 @@ -149,6 +149,10 @@ Library ------- +- Issue #4195: The ``runpy`` module (and the ``-m`` switch) now support + the execution of packages by looking for and executing a ``__main__`` + submodule when a package name is supplied. + - Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will not be used again (this requires Tcl/Tk 8.3.1), also fix a memory leak in Tkapp_Call when calling from a thread different than the one that created From python-checkins at python.org Sun Feb 8 02:46:01 2009 From: python-checkins at python.org (nick.coghlan) Date: Sun, 8 Feb 2009 02:46:01 +0100 (CET) Subject: [Python-checkins] r69420 - python/trunk/Misc/NEWS Message-ID: <20090208014601.BE1631E4002@bag.python.org> Author: nick.coghlan Date: Sun Feb 8 02:46:01 2009 New Revision: 69420 Log: Mention patch submitter in NEWS entry for r69419 Modified: python/trunk/Misc/NEWS Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Feb 8 02:46:01 2009 @@ -151,7 +151,8 @@ - Issue #4195: The ``runpy`` module (and the ``-m`` switch) now support the execution of packages by looking for and executing a ``__main__`` - submodule when a package name is supplied. + submodule when a package name is supplied. Initial patch by Andi + Vajda. - Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will not be used again (this requires Tcl/Tk 8.3.1), also fix a memory leak in From python-checkins at python.org Sun Feb 8 02:58:26 2009 From: python-checkins at python.org (nick.coghlan) Date: Sun, 8 Feb 2009 02:58:26 +0100 (CET) Subject: [Python-checkins] r69421 - in python/branches/py3k: Doc/library/runpy.rst Doc/using/cmdline.rst Lib/runpy.py Lib/test/test_cmd_line_script.py Misc/ACKS Misc/NEWS Message-ID: <20090208015826.9939D1E4002@bag.python.org> Author: nick.coghlan Date: Sun Feb 8 02:58:26 2009 New Revision: 69421 Log: Merged revisions 69419-69420 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69419 | nick.coghlan | 2009-02-08 11:26:34 +1000 (Sun, 08 Feb 2009) | 1 line Issue 4195: Restore the ability to execute packages with the -m switch (but this time in a way that leaves the import machinery in a valid state). (Original patch by Andi Vajda) ........ r69420 | nick.coghlan | 2009-02-08 11:46:01 +1000 (Sun, 08 Feb 2009) | 1 line Mention patch submitter in NEWS entry for r69419 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/runpy.rst python/branches/py3k/Doc/using/cmdline.rst python/branches/py3k/Lib/runpy.py python/branches/py3k/Lib/test/test_cmd_line_script.py python/branches/py3k/Misc/ACKS python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Doc/library/runpy.rst ============================================================================== --- python/branches/py3k/Doc/library/runpy.rst (original) +++ python/branches/py3k/Doc/library/runpy.rst Sun Feb 8 02:58:26 2009 @@ -26,17 +26,22 @@ mechanism (refer to PEP 302 for details) and then executed in a fresh module namespace. + If the supplied module name refers to a package rather than a normal module, + then that package is imported and the ``__main__`` submodule within that + package is then executed and the resulting module globals dictionary returned. + The optional dictionary argument *init_globals* may be used to pre-populate the globals dictionary before the code is executed. The supplied dictionary will not be modified. If any of the special global variables below are defined in the supplied dictionary, those definitions are overridden by the ``run_module`` function. - The special global variables ``__name__``, ``__file__``, ``__loader__`` and - ``__builtins__`` are set in the globals dictionary before the module code is - executed. + The special global variables ``__name__``, ``__file__``, ``__loader__``, + ``__builtins__`` and ``__package__`` are set in the globals dictionary before + the module code is executed. - ``__name__`` is set to *run_name* if this optional argument is supplied, and the + ``__name__`` is set to *run_name* if this optional argument is supplied, to + ``mod_name + '.__main__'`` if the named module is a package and to the *mod_name* argument otherwise. ``__loader__`` is set to the PEP 302 module loader used to retrieve the code for @@ -48,6 +53,9 @@ ``__builtins__`` is automatically initialised with a reference to the top level namespace of the :mod:`builtins` module. + ``__package__`` is set to *mod_name* if the named module is a package and to + ``mod_name.rpartition('.')[0]`` otherwise. + If the argument *alter_sys* is supplied and evaluates to ``True``, then ``sys.argv[0]`` is updated with the value of ``__file__`` and ``sys.modules[__name__]`` is updated with a temporary module object for the @@ -60,8 +68,15 @@ function from threaded code. + .. versionchanged:: 3.1 + Added ability to execute packages by looking for a ``__main__`` submodule + + .. seealso:: :pep:`338` - Executing modules as scripts - PEP written and implemented by Nick Coghlan. + PEP written and implemented by Nick Coghlan. + + :pep:`366` - Main module explicit relative imports + PEP written and implemented by Nick Coghlan. Modified: python/branches/py3k/Doc/using/cmdline.rst ============================================================================== --- python/branches/py3k/Doc/using/cmdline.rst (original) +++ python/branches/py3k/Doc/using/cmdline.rst Sun Feb 8 02:58:26 2009 @@ -78,6 +78,12 @@ the implementation may not always enforce this (e.g. it may allow you to use a name that includes a hyphen). + Package names are also permitted. When a package name is supplied instead + of a normal module, the interpreter will execute ``.__main__`` as + the main module. This behaviour is deliberately similar to the handling + of directories and zipfiles that are passed to the interpreter as the + script argument. + .. note:: This option cannot be used with builtin modules and extension modules @@ -97,11 +103,14 @@ .. seealso:: :func:`runpy.run_module` - The actual implementation of this feature. + Equivalent functionality directly available to Python code :pep:`338` -- Executing modules as scripts + .. versionchanged:: 3.1 + Supply the package name to run a ``__main__`` submodule. + .. describe:: - Read commands from standard input (:data:`sys.stdin`). If standard input is Modified: python/branches/py3k/Lib/runpy.py ============================================================================== --- python/branches/py3k/Lib/runpy.py (original) +++ python/branches/py3k/Lib/runpy.py Sun Feb 8 02:58:26 2009 @@ -80,13 +80,19 @@ if loader is None: raise ImportError("No module named %s" % mod_name) if loader.is_package(mod_name): - raise ImportError(("%s is a package and cannot " + - "be directly executed") % mod_name) + if mod_name == "__main__" or mod_name.endswith(".__main__"): + raise ImportError(("Cannot use package as __main__ module")) + try: + pkg_main_name = mod_name + ".__main__" + return _get_module_details(pkg_main_name) + except ImportError as e: + raise ImportError(("%s; %r is a package and cannot " + + "be directly executed") %(e, mod_name)) code = loader.get_code(mod_name) if code is None: raise ImportError("No code object available for %s" % mod_name) filename = _get_filename(loader, mod_name) - return loader, code, filename + return mod_name, loader, code, filename # XXX ncoghlan: Should this be documented and made public? @@ -101,12 +107,12 @@ __loader__ """ try: - loader, code, fname = _get_module_details(mod_name) + mod_name, loader, code, fname = _get_module_details(mod_name) except ImportError as exc: # Try to provide a good error message # for directories, zip files and the -m switch if set_argv0: - # For -m switch, just disply the exception + # For -m switch, just display the exception info = str(exc) else: # For directories/zipfiles, let the user @@ -127,7 +133,7 @@ Returns the resulting top level namespace dictionary """ - loader, code, fname = _get_module_details(mod_name) + mod_name, loader, code, fname = _get_module_details(mod_name) if run_name is None: run_name = mod_name pkg_name = mod_name.rpartition('.')[0] Modified: python/branches/py3k/Lib/test/test_cmd_line_script.py ============================================================================== --- python/branches/py3k/Lib/test/test_cmd_line_script.py (original) +++ python/branches/py3k/Lib/test/test_cmd_line_script.py Sun Feb 8 02:58:26 2009 @@ -113,7 +113,7 @@ os.unlink(script_name) #if verbose: # zip_file = zipfile.ZipFile(zip_name, 'r') - # print 'Contents of %r:' % zip_name + # print('Contents of %r:' % zip_name) # zip_file.printdir() # zip_file.close() return zip_name, os.path.join(zip_name, script_name_in_zip) @@ -158,6 +158,16 @@ self.assert_(printed_package in data) self.assert_(printed_argv0 in data) + def _check_import_error(self, script_name, expected_msg, + *cmd_line_switches): + run_args = cmd_line_switches + (script_name,) + exit_code, data = _run_python(*run_args) + if verbose: + print('Output from test script %r:' % script_name) + print(data) + print('Expected output: %r' % expected_msg) + self.assert_(expected_msg in data) + def test_basic_script(self): with temp_dir() as script_dir: script_name = _make_test_script(script_dir, 'script') @@ -182,6 +192,11 @@ os.remove(script_name) self._check_script(script_dir, compiled_name, script_dir, '') + def test_directory_error(self): + with temp_dir() as script_dir: + msg = "can't find '__main__.py' in %r" % script_dir + self._check_import_error(script_dir, msg) + def test_zipfile(self): with temp_dir() as script_dir: script_name = _make_test_script(script_dir, '__main__') @@ -195,6 +210,13 @@ zip_name, run_name = _make_test_zip(script_dir, 'test_zip', compiled_name) self._check_script(zip_name, run_name, zip_name, '') + def test_zipfile_error(self): + with temp_dir() as script_dir: + script_name = _make_test_script(script_dir, 'not_main') + zip_name, run_name = _make_test_zip(script_dir, 'test_zip', script_name) + msg = "can't find '__main__.py' in %r" % zip_name + self._check_import_error(zip_name, msg) + def test_module_in_package(self): with temp_dir() as script_dir: pkg_dir = os.path.join(script_dir, 'test_pkg') @@ -215,6 +237,47 @@ launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg.test_pkg.script', zip_name) self._check_script(launch_name, run_name, run_name, 'test_pkg.test_pkg') + def test_package(self): + with temp_dir() as script_dir: + pkg_dir = os.path.join(script_dir, 'test_pkg') + _make_test_pkg(pkg_dir) + script_name = _make_test_script(pkg_dir, '__main__') + launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg') + self._check_script(launch_name, script_name, + script_name, 'test_pkg') + + def test_package_compiled(self): + with temp_dir() as script_dir: + pkg_dir = os.path.join(script_dir, 'test_pkg') + _make_test_pkg(pkg_dir) + script_name = _make_test_script(pkg_dir, '__main__') + compiled_name = _compile_test_script(script_name) + os.remove(script_name) + launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg') + self._check_script(launch_name, compiled_name, + compiled_name, 'test_pkg') + + def test_package_error(self): + with temp_dir() as script_dir: + pkg_dir = os.path.join(script_dir, 'test_pkg') + _make_test_pkg(pkg_dir) + msg = ("'test_pkg' is a package and cannot " + "be directly executed") + launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg') + self._check_import_error(launch_name, msg) + + def test_package_recursion(self): + with temp_dir() as script_dir: + pkg_dir = os.path.join(script_dir, 'test_pkg') + _make_test_pkg(pkg_dir) + main_dir = os.path.join(pkg_dir, '__main__') + _make_test_pkg(main_dir) + msg = ("Cannot use package as __main__ module; " + "'test_pkg' is a package and cannot " + "be directly executed") + launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg') + self._check_import_error(launch_name, msg) + def test_main(): test.support.run_unittest(CmdLineTest) Modified: python/branches/py3k/Misc/ACKS ============================================================================== --- python/branches/py3k/Misc/ACKS (original) +++ python/branches/py3k/Misc/ACKS Sun Feb 8 02:58:26 2009 @@ -714,6 +714,7 @@ Roger Upole Michael Urman Hector Urtubia +Andi Vajda Atul Varma Dmitry Vasiliev Alexandre Vassalotti Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun Feb 8 02:58:26 2009 @@ -155,6 +155,11 @@ Library ------- +- Issue #4195: The ``runpy`` module (and the ``-m`` switch) now support + the execution of packages by looking for and executing a ``__main__`` + submodule when a package name is supplied. Initial patch by Andi + Vajda. + - Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will not be used again (this requires Tcl/Tk 8.3.1), also fix a memory leak in Tkapp_Call when calling from a thread different than the one that created From python-checkins at python.org Sun Feb 8 03:03:19 2009 From: python-checkins at python.org (nick.coghlan) Date: Sun, 8 Feb 2009 03:03:19 +0100 (CET) Subject: [Python-checkins] r69422 - python/branches/release26-maint Message-ID: <20090208020319.25AD51E4002@bag.python.org> Author: nick.coghlan Date: Sun Feb 8 03:03:18 2009 New Revision: 69422 Log: Blocked revisions 69419-69420 via svnmerge ........ r69419 | nick.coghlan | 2009-02-08 11:26:34 +1000 (Sun, 08 Feb 2009) | 1 line Issue 4195: Restore the ability to execute packages with the -m switch (but this time in a way that leaves the import machinery in a valid state). (Original patch by Andi Vajda) ........ r69420 | nick.coghlan | 2009-02-08 11:46:01 +1000 (Sun, 08 Feb 2009) | 1 line Mention patch submitter in NEWS entry for r69419 ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun Feb 8 03:06:38 2009 From: python-checkins at python.org (nick.coghlan) Date: Sun, 8 Feb 2009 03:06:38 +0100 (CET) Subject: [Python-checkins] r69423 - python/branches/release30-maint Message-ID: <20090208020638.0724A1E4002@bag.python.org> Author: nick.coghlan Date: Sun Feb 8 03:06:37 2009 New Revision: 69423 Log: Blocked revisions 69421 via svnmerge ................ r69421 | nick.coghlan | 2009-02-08 11:58:26 +1000 (Sun, 08 Feb 2009) | 13 lines Merged revisions 69419-69420 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69419 | nick.coghlan | 2009-02-08 11:26:34 +1000 (Sun, 08 Feb 2009) | 1 line Issue 4195: Restore the ability to execute packages with the -m switch (but this time in a way that leaves the import machinery in a valid state). (Original patch by Andi Vajda) ........ r69420 | nick.coghlan | 2009-02-08 11:46:01 +1000 (Sun, 08 Feb 2009) | 1 line Mention patch submitter in NEWS entry for r69419 ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun Feb 8 03:41:23 2009 From: python-checkins at python.org (nick.coghlan) Date: Sun, 8 Feb 2009 03:41:23 +0100 (CET) Subject: [Python-checkins] r69424 - peps/trunk/pep-0302.txt Message-ID: <20090208024123.274601E400C@bag.python.org> Author: nick.coghlan Date: Sun Feb 8 03:41:22 2009 New Revision: 69424 Log: Since PEP 302 still serves as the de facto documentation of the import loader system, mention the new optional loader extension introduced by PEP 338 Modified: peps/trunk/pep-0302.txt Modified: peps/trunk/pep-0302.txt ============================================================================== --- peps/trunk/pep-0302.txt (original) +++ peps/trunk/pep-0302.txt Sun Feb 8 03:41:22 2009 @@ -360,12 +360,13 @@ Optional Extensions to the Importer Protocol - The Importer Protocol defines two optional extensions. One is to - retrieve data files, the other is to support module packaging tools + The Importer Protocol defines three optional extensions. One is to + retrieve data files, the second is to support module packaging tools and/or tools that analyze module dependencies (for example Freeze - [3]). The latter category of tools usually don't actually *load* + [3]), while the last is to support execution of modules as scripts. + The latter two categories of tools usually don't actually *load* modules, they only need to know if and where they are available. - Both extensions are highly recommended for general purpose + All three extensions are highly recommended for general purpose importers, but may safely be left out if those features aren't needed. @@ -413,6 +414,18 @@ raise ImportError if the module can't be found by the importer at all). + To support execution of modules as scripts [9], the above three + methods for finding the code associated with a module must be + implemented. In addition to those methods, the following method + may be provided in order to allow the ``runpy`` module to correctly + set the ``__file__`` attribute: + + loader.get_filename(fullname) + + This method should return the value that ``__file__`` would be set + to if the named module was loaded. If the module is not found, then + ImportError should be raised. + Integration with the 'imp' module @@ -575,6 +588,9 @@ [8] Quixote, a framework for developing Web applications http://www.mems-exchange.org/software/quixote/ + [9] PEP 338: Executing modules as scripts + http://www.python.org/dev/peps/pep-0338/ + Copyright From python-checkins at python.org Sun Feb 8 04:17:00 2009 From: python-checkins at python.org (nick.coghlan) Date: Sun, 8 Feb 2009 04:17:00 +0100 (CET) Subject: [Python-checkins] r69425 - in python/trunk: Doc/library/zipimport.rst Lib/test/test_zipimport.py Misc/NEWS Modules/zipimport.c Message-ID: <20090208031700.DC7041E4002@bag.python.org> Author: nick.coghlan Date: Sun Feb 8 04:17:00 2009 New Revision: 69425 Log: Issue #4512 closeout: Make ZipImport.get_filename() a public method Modified: python/trunk/Doc/library/zipimport.rst python/trunk/Lib/test/test_zipimport.py python/trunk/Misc/NEWS python/trunk/Modules/zipimport.c Modified: python/trunk/Doc/library/zipimport.rst ============================================================================== --- python/trunk/Doc/library/zipimport.rst (original) +++ python/trunk/Doc/library/zipimport.rst Sun Feb 8 04:17:00 2009 @@ -94,6 +94,15 @@ file wasn't found. + .. method:: get_filename(fullname) + + Return the value ``__file__`` would be set to if the specified module + was imported. Raise :exc:`ZipImportError` if the module couldn't be + found. + + .. versionadded:: 2.7 + + .. method:: get_source(fullname) Return the source code for the specified module. Raise Modified: python/trunk/Lib/test/test_zipimport.py ============================================================================== --- python/trunk/Lib/test/test_zipimport.py (original) +++ python/trunk/Lib/test/test_zipimport.py Sun Feb 8 04:17:00 2009 @@ -215,7 +215,7 @@ self.assertEquals(zi.archive, TEMP_ZIP) self.assertEquals(zi.is_package(TESTPACK), True) mod = zi.load_module(TESTPACK) - self.assertEquals(zi._get_filename(TESTPACK), mod.__file__) + self.assertEquals(zi.get_filename(TESTPACK), mod.__file__) self.assertEquals(zi.is_package(packdir + '__init__'), False) self.assertEquals(zi.is_package(packdir + TESTPACK2), True) @@ -227,11 +227,11 @@ mod = sys.modules[mod_name] self.assertEquals(zi.get_source(TESTPACK), None) self.assertEquals(zi.get_source(mod_path), None) - self.assertEquals(zi._get_filename(mod_path), mod.__file__) + self.assertEquals(zi.get_filename(mod_path), mod.__file__) # To pass in the module name instead of the path, we must use the right importer loader = mod.__loader__ self.assertEquals(loader.get_source(mod_name), None) - self.assertEquals(loader._get_filename(mod_name), mod.__file__) + self.assertEquals(loader.get_filename(mod_name), mod.__file__) # test prefix and archivepath members zi2 = zipimport.zipimporter(TEMP_ZIP + os.sep + TESTPACK) @@ -260,7 +260,7 @@ self.assertEquals(zi.prefix, packdir) self.assertEquals(zi.is_package(TESTPACK2), True) mod = zi.load_module(TESTPACK2) - self.assertEquals(zi._get_filename(TESTPACK2), mod.__file__) + self.assertEquals(zi.get_filename(TESTPACK2), mod.__file__) self.assertEquals(zi.is_package(TESTPACK2 + os.sep + '__init__'), False) self.assertEquals(zi.is_package(TESTPACK2 + os.sep + TESTMOD), False) @@ -271,11 +271,11 @@ mod = sys.modules[mod_name] self.assertEquals(zi.get_source(TESTPACK2), None) self.assertEquals(zi.get_source(mod_path), None) - self.assertEquals(zi._get_filename(mod_path), mod.__file__) + self.assertEquals(zi.get_filename(mod_path), mod.__file__) # To pass in the module name instead of the path, we must use the right importer loader = mod.__loader__ self.assertEquals(loader.get_source(mod_name), None) - self.assertEquals(loader._get_filename(mod_name), mod.__file__) + self.assertEquals(loader.get_filename(mod_name), mod.__file__) finally: z.close() os.remove(TEMP_ZIP) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Feb 8 04:17:00 2009 @@ -149,6 +149,9 @@ Library ------- +- Issue #4512 (part 2): Promote ``ZipImporter._get_filename()`` to be a + public documented method ``ZipImporter.get_filename()``. + - Issue #4195: The ``runpy`` module (and the ``-m`` switch) now support the execution of packages by looking for and executing a ``__main__`` submodule when a package name is supplied. Initial patch by Andi Modified: python/trunk/Modules/zipimport.c ============================================================================== --- python/trunk/Modules/zipimport.c (original) +++ python/trunk/Modules/zipimport.c Sun Feb 8 04:17:00 2009 @@ -378,7 +378,7 @@ char *fullname, *modpath; int ispackage; - if (!PyArg_ParseTuple(args, "s:zipimporter._get_filename", + if (!PyArg_ParseTuple(args, "s:zipimporter.get_filename", &fullname)) return NULL; @@ -553,7 +553,7 @@ PyDoc_STRVAR(doc_get_filename, -"_get_filename(fullname) -> filename string.\n\ +"get_filename(fullname) -> filename string.\n\ \n\ Return the filename for the specified module."); @@ -568,7 +568,7 @@ doc_get_code}, {"get_source", zipimporter_get_source, METH_VARARGS, doc_get_source}, - {"_get_filename", zipimporter_get_filename, METH_VARARGS, + {"get_filename", zipimporter_get_filename, METH_VARARGS, doc_get_filename}, {"is_package", zipimporter_is_package, METH_VARARGS, doc_is_package}, From python-checkins at python.org Sun Feb 8 04:37:27 2009 From: python-checkins at python.org (nick.coghlan) Date: Sun, 8 Feb 2009 04:37:27 +0100 (CET) Subject: [Python-checkins] r69426 - in python/branches/py3k: Doc/library/zipimport.rst Lib/test/test_zipimport.py Misc/NEWS Modules/zipimport.c Message-ID: <20090208033727.DA3141E4002@bag.python.org> Author: nick.coghlan Date: Sun Feb 8 04:37:27 2009 New Revision: 69426 Log: Merged revisions 69425 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69425 | nick.coghlan | 2009-02-08 13:17:00 +1000 (Sun, 08 Feb 2009) | 1 line Issue #4512 closeout: Make ZipImport.get_filename() a public method ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/zipimport.rst python/branches/py3k/Lib/test/test_zipimport.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/zipimport.c Modified: python/branches/py3k/Doc/library/zipimport.rst ============================================================================== --- python/branches/py3k/Doc/library/zipimport.rst (original) +++ python/branches/py3k/Doc/library/zipimport.rst Sun Feb 8 04:37:27 2009 @@ -88,6 +88,15 @@ file wasn't found. + .. method:: get_filename(fullname) + + Return the value ``__file__`` would be set to if the specified module + was imported. Raise :exc:`ZipImportError` if the module couldn't be + found. + + .. versionadded:: 3.1 + + .. method:: get_source(fullname) Return the source code for the specified module. Raise Modified: python/branches/py3k/Lib/test/test_zipimport.py ============================================================================== --- python/branches/py3k/Lib/test/test_zipimport.py (original) +++ python/branches/py3k/Lib/test/test_zipimport.py Sun Feb 8 04:37:27 2009 @@ -212,7 +212,7 @@ self.assertEquals(zi.archive, TEMP_ZIP) self.assertEquals(zi.is_package(TESTPACK), True) mod = zi.load_module(TESTPACK) - self.assertEquals(zi._get_filename(TESTPACK), mod.__file__) + self.assertEquals(zi.get_filename(TESTPACK), mod.__file__) self.assertEquals(zi.is_package(packdir + '__init__'), False) self.assertEquals(zi.is_package(packdir + TESTPACK2), True) @@ -224,11 +224,11 @@ mod = sys.modules[mod_name] self.assertEquals(zi.get_source(TESTPACK), None) self.assertEquals(zi.get_source(mod_path), None) - self.assertEquals(zi._get_filename(mod_path), mod.__file__) + self.assertEquals(zi.get_filename(mod_path), mod.__file__) # To pass in the module name instead of the path, we must use the right importer loader = mod.__loader__ self.assertEquals(loader.get_source(mod_name), None) - self.assertEquals(loader._get_filename(mod_name), mod.__file__) + self.assertEquals(loader.get_filename(mod_name), mod.__file__) # test prefix and archivepath members zi2 = zipimport.zipimporter(TEMP_ZIP + os.sep + TESTPACK) @@ -257,7 +257,7 @@ self.assertEquals(zi.prefix, packdir) self.assertEquals(zi.is_package(TESTPACK2), True) mod = zi.load_module(TESTPACK2) - self.assertEquals(zi._get_filename(TESTPACK2), mod.__file__) + self.assertEquals(zi.get_filename(TESTPACK2), mod.__file__) self.assertEquals(zi.is_package(TESTPACK2 + os.sep + '__init__'), False) self.assertEquals(zi.is_package(TESTPACK2 + os.sep + TESTMOD), False) @@ -268,11 +268,11 @@ mod = sys.modules[mod_name] self.assertEquals(zi.get_source(TESTPACK2), None) self.assertEquals(zi.get_source(mod_path), None) - self.assertEquals(zi._get_filename(mod_path), mod.__file__) + self.assertEquals(zi.get_filename(mod_path), mod.__file__) # To pass in the module name instead of the path, we must use the right importer loader = mod.__loader__ self.assertEquals(loader.get_source(mod_name), None) - self.assertEquals(loader._get_filename(mod_name), mod.__file__) + self.assertEquals(loader.get_filename(mod_name), mod.__file__) finally: z.close() os.remove(TEMP_ZIP) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun Feb 8 04:37:27 2009 @@ -155,6 +155,9 @@ Library ------- +- Issue #4512 (part 2): Promote ``ZipImporter._get_filename()`` to be a + public documented method ``ZipImporter.get_filename()``. + - Issue #4195: The ``runpy`` module (and the ``-m`` switch) now support the execution of packages by looking for and executing a ``__main__`` submodule when a package name is supplied. Initial patch by Andi Modified: python/branches/py3k/Modules/zipimport.c ============================================================================== --- python/branches/py3k/Modules/zipimport.c (original) +++ python/branches/py3k/Modules/zipimport.c Sun Feb 8 04:37:27 2009 @@ -363,7 +363,7 @@ char *fullname, *modpath; int ispackage; - if (!PyArg_ParseTuple(args, "s:zipimporter._get_filename", + if (!PyArg_ParseTuple(args, "s:zipimporter.get_filename", &fullname)) return NULL; @@ -543,7 +543,7 @@ PyDoc_STRVAR(doc_get_filename, -"_get_filename(fullname) -> filename string.\n\ +"get_filename(fullname) -> filename string.\n\ \n\ Return the filename for the specified module."); @@ -558,7 +558,7 @@ doc_get_code}, {"get_source", zipimporter_get_source, METH_VARARGS, doc_get_source}, - {"_get_filename", zipimporter_get_filename, METH_VARARGS, + {"get_filename", zipimporter_get_filename, METH_VARARGS, doc_get_filename}, {"is_package", zipimporter_is_package, METH_VARARGS, doc_is_package}, From python-checkins at python.org Sun Feb 8 04:41:40 2009 From: python-checkins at python.org (nick.coghlan) Date: Sun, 8 Feb 2009 04:41:40 +0100 (CET) Subject: [Python-checkins] r69427 - python/branches/release26-maint Message-ID: <20090208034140.048221E4002@bag.python.org> Author: nick.coghlan Date: Sun Feb 8 04:41:39 2009 New Revision: 69427 Log: Blocked revisions 69425 via svnmerge ........ r69425 | nick.coghlan | 2009-02-08 13:17:00 +1000 (Sun, 08 Feb 2009) | 1 line Issue #4512 closeout: Make ZipImport.get_filename() a public method ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun Feb 8 04:43:03 2009 From: python-checkins at python.org (nick.coghlan) Date: Sun, 8 Feb 2009 04:43:03 +0100 (CET) Subject: [Python-checkins] r69428 - python/branches/release30-maint Message-ID: <20090208034303.D23431E4002@bag.python.org> Author: nick.coghlan Date: Sun Feb 8 04:43:03 2009 New Revision: 69428 Log: Blocked revisions 69426 via svnmerge ................ r69426 | nick.coghlan | 2009-02-08 13:37:27 +1000 (Sun, 08 Feb 2009) | 9 lines Merged revisions 69425 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69425 | nick.coghlan | 2009-02-08 13:17:00 +1000 (Sun, 08 Feb 2009) | 1 line Issue #4512 closeout: Make ZipImport.get_filename() a public method ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun Feb 8 05:01:00 2009 From: python-checkins at python.org (nick.coghlan) Date: Sun, 8 Feb 2009 05:01:00 +0100 (CET) Subject: [Python-checkins] r69429 - python/branches/py3k/Lib/test/test_urllib.py Message-ID: <20090208040100.4AFF61E4002@bag.python.org> Author: nick.coghlan Date: Sun Feb 8 05:01:00 2009 New Revision: 69429 Log: Fix broken socket.makefile emulation in test_urllib Modified: python/branches/py3k/Lib/test/test_urllib.py 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 Sun Feb 8 05:01:00 2009 @@ -146,7 +146,8 @@ def fakehttp(self, fakedata): class FakeSocket(io.BytesIO): def sendall(self, str): pass - def makefile(self, mode, name): return self + def makefile(self, *args, **kwds): + return self def read(self, amt=None): if self.closed: return b"" return io.BytesIO.read(self, amt) From buildbot at python.org Sun Feb 8 05:36:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 08 Feb 2009 04:36:15 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090208043615.3E3791E4002@bag.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/219 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: nick.coghlan BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Sun Feb 8 06:29:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 08 Feb 2009 05:29:56 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090208052956.704A21E4002@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/104 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: nick.coghlan BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Sun Feb 8 06:29:58 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 08 Feb 2009 05:29:58 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.0 Message-ID: <20090208052959.046D41E401E@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/137 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: nick.coghlan BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Sun Feb 8 08:16:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 08 Feb 2009 07:16:38 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090208071639.01E8C1E4002@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/101 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: nick.coghlan BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sun Feb 8 08:31:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 08 Feb 2009 07:31:22 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090208073122.4BE331E4002@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/138 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: nick.coghlan 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 43, 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 Feb 8 10:36:24 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 8 Feb 2009 10:36:24 +0100 (CET) Subject: [Python-checkins] r69430 - tracker/instances/python-dev/scripts/roundup-summary Message-ID: <20090208093624.2B3151E4002@bag.python.org> Author: martin.v.loewis Date: Sun Feb 8 10:36:23 2009 New Revision: 69430 Log: Issue #234: sort durations before computing the median. Modified: tracker/instances/python-dev/scripts/roundup-summary Modified: tracker/instances/python-dev/scripts/roundup-summary ============================================================================== --- tracker/instances/python-dev/scripts/roundup-summary (original) +++ tracker/instances/python-dev/scripts/roundup-summary Sun Feb 8 10:36:23 2009 @@ -836,6 +836,7 @@ if options.debug: print >>bugfile, 'Min duration:', durations[-1], '; max', durations[0] averageDuration = sum(durations)/len(durations) + durations.sort() medianDuration = durations[len(durations)/2] else: averageDuration = "N/A" From python-checkins at python.org Sun Feb 8 12:02:10 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 8 Feb 2009 12:02:10 +0100 (CET) Subject: [Python-checkins] r69431 - python/branches/py3k/Objects/typeobject.c Message-ID: <20090208110210.C76851E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 8 12:02:10 2009 New Revision: 69431 Log: Issue #1717: add a DeprecationWarning in 3.x on type initialization for types that implement tp_reserved (formerly tp_compare) but not tp_richcompare. Modified: python/branches/py3k/Objects/typeobject.c Modified: python/branches/py3k/Objects/typeobject.c ============================================================================== --- python/branches/py3k/Objects/typeobject.c (original) +++ python/branches/py3k/Objects/typeobject.c Sun Feb 8 12:02:10 2009 @@ -3886,6 +3886,21 @@ goto error; } + /* Warn for a type that implements tp_compare (now known as + tp_reserved) but not tp_richcompare. */ + if (type->tp_reserved && !type->tp_richcompare) { + int error; + char msg[240]; + PyOS_snprintf(msg, sizeof(msg), + "Type %.100s defines tp_reserved (formerly " + "tp_compare) but not tp_richcompare. " + "Comparisons may not behave as intended.", + type->tp_name); + error = PyErr_WarnEx(PyExc_DeprecationWarning, msg, 1); + if (error == -1) + goto error; + } + /* All done -- set the ready flag */ assert(type->tp_dict != NULL); type->tp_flags = From python-checkins at python.org Sun Feb 8 12:05:01 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 8 Feb 2009 12:05:01 +0100 (CET) Subject: [Python-checkins] r69432 - in python/branches/release30-maint: Objects/typeobject.c Message-ID: <20090208110501.B001E1E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 8 12:05:01 2009 New Revision: 69432 Log: Merged revisions 69431 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69431 | mark.dickinson | 2009-02-08 11:02:10 +0000 (Sun, 08 Feb 2009) | 4 lines Issue #1717: add a DeprecationWarning in 3.x on type initialization for types that implement tp_reserved (formerly tp_compare) but not tp_richcompare. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Objects/typeobject.c Modified: python/branches/release30-maint/Objects/typeobject.c ============================================================================== --- python/branches/release30-maint/Objects/typeobject.c (original) +++ python/branches/release30-maint/Objects/typeobject.c Sun Feb 8 12:05:01 2009 @@ -3886,6 +3886,21 @@ goto error; } + /* Warn for a type that implements tp_compare (now known as + tp_reserved) but not tp_richcompare. */ + if (type->tp_reserved && !type->tp_richcompare) { + int error; + char msg[240]; + PyOS_snprintf(msg, sizeof(msg), + "Type %.100s defines tp_reserved (formerly " + "tp_compare) but not tp_richcompare. " + "Comparisons may not behave as intended.", + type->tp_name); + error = PyErr_WarnEx(PyExc_DeprecationWarning, msg, 1); + if (error == -1) + goto error; + } + /* All done -- set the ready flag */ assert(type->tp_dict != NULL); type->tp_flags = From buildbot at python.org Sun Feb 8 12:41:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 08 Feb 2009 11:41:41 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090208114141.86D991E4002@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/314 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: sincerely, -The Buildbot From buildbot at python.org Sun Feb 8 12:45:24 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 08 Feb 2009 11:45:24 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090208114524.607D71E4002@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/243 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: 1 test failed: test_zipfile make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun Feb 8 12:50:32 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 08 Feb 2009 11:50:32 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20090208115032.1F3041E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%203.0/builds/125 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 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_email make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Feb 8 14:58:10 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 8 Feb 2009 14:58:10 +0100 (CET) Subject: [Python-checkins] r69433 - python/trunk/Objects/abstract.c Message-ID: <20090208135810.90B981E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 8 14:58:10 2009 New Revision: 69433 Log: Remove redundant assignment in _PyObject_LengthHint Modified: python/trunk/Objects/abstract.c Modified: python/trunk/Objects/abstract.c ============================================================================== --- python/trunk/Objects/abstract.c (original) +++ python/trunk/Objects/abstract.c Sun Feb 8 14:58:10 2009 @@ -123,7 +123,7 @@ PyErr_Clear(); return defaultvalue; } - rv = rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue; + rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue; Py_DECREF(ro); return rv; } From python-checkins at python.org Sun Feb 8 15:00:21 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 8 Feb 2009 15:00:21 +0100 (CET) Subject: [Python-checkins] r69434 - python/branches/py3k Message-ID: <20090208140021.47E601E4019@bag.python.org> Author: mark.dickinson Date: Sun Feb 8 15:00:21 2009 New Revision: 69434 Log: Blocked revisions 69433 via svnmerge ........ r69433 | mark.dickinson | 2009-02-08 13:58:10 +0000 (Sun, 08 Feb 2009) | 2 lines Remove redundant assignment in _PyObject_LengthHint ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sun Feb 8 15:38:13 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 8 Feb 2009 15:38:13 +0100 (CET) Subject: [Python-checkins] r69435 - python/trunk/Doc/library/2to3.rst Message-ID: <20090208143813.E92FE1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 8 15:38:13 2009 New Revision: 69435 Log: document numliterals fixer 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 Sun Feb 8 15:38:13 2009 @@ -252,6 +252,10 @@ Renames :meth:`~object.__nonzero__` to :meth:`~object.__bool__`. +.. 2to3fixer:: numliterals + + Converts octal literals into the new syntax. + .. 2to3fixer:: paren Add extra parenthesis where they are required in list comprehensions. For From python-checkins at python.org Sun Feb 8 15:42:28 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 8 Feb 2009 15:42:28 +0100 (CET) Subject: [Python-checkins] r69436 - python/trunk/Objects/object.c Message-ID: <20090208144228.51FCE1E400C@bag.python.org> Author: mark.dickinson Date: Sun Feb 8 15:42:28 2009 New Revision: 69436 Log: Issue #789290: make sure that hash(2**63) == hash(2.**63) on 64-bit platforms. The previous code was fragile, depending on the twin accidents that: (1) in C, casting the double value 2.**63 to long returns the integer value -2**63, and (2) in Python, hash(-2**63) == hash(2**63). There's already a test for this in test_hash. Modified: python/trunk/Objects/object.c Modified: python/trunk/Objects/object.c ============================================================================== --- python/trunk/Objects/object.c (original) +++ python/trunk/Objects/object.c Sun Feb 8 15:42:28 2009 @@ -1028,7 +1028,7 @@ fractpart = modf(v, &intpart); if (fractpart == 0.0) { /* This must return the same hash as an equal int or long. */ - if (intpart > LONG_MAX || -intpart > LONG_MAX) { + if (intpart > LONG_MAX/2 || -intpart > LONG_MAX/2) { /* Convert to long and use its hash. */ PyObject *plong; /* converted to Python long */ if (Py_IS_INFINITY(intpart)) From buildbot at python.org Sun Feb 8 15:52:58 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 08 Feb 2009 14:52:58 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090208145258.42F331E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/617 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sun Feb 8 15:56:08 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 8 Feb 2009 15:56:08 +0100 (CET) Subject: [Python-checkins] r69437 - in python/branches/release26-maint: Objects/abstract.c Objects/object.c Message-ID: <20090208145608.D49681E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 8 15:56:08 2009 New Revision: 69437 Log: Merged revisions 69433,69436 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69433 | mark.dickinson | 2009-02-08 13:58:10 +0000 (Sun, 08 Feb 2009) | 2 lines Remove redundant assignment in _PyObject_LengthHint ........ r69436 | mark.dickinson | 2009-02-08 14:42:28 +0000 (Sun, 08 Feb 2009) | 10 lines Issue #789290: make sure that hash(2**63) == hash(2.**63) on 64-bit platforms. The previous code was fragile, depending on the twin accidents that: (1) in C, casting the double value 2.**63 to long returns the integer value -2**63, and (2) in Python, hash(-2**63) == hash(2**63). There's already a test for this in test_hash. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Objects/abstract.c python/branches/release26-maint/Objects/object.c Modified: python/branches/release26-maint/Objects/abstract.c ============================================================================== --- python/branches/release26-maint/Objects/abstract.c (original) +++ python/branches/release26-maint/Objects/abstract.c Sun Feb 8 15:56:08 2009 @@ -123,7 +123,7 @@ PyErr_Clear(); return defaultvalue; } - rv = rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue; + rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue; Py_DECREF(ro); return rv; } Modified: python/branches/release26-maint/Objects/object.c ============================================================================== --- python/branches/release26-maint/Objects/object.c (original) +++ python/branches/release26-maint/Objects/object.c Sun Feb 8 15:56:08 2009 @@ -1023,7 +1023,7 @@ fractpart = modf(v, &intpart); if (fractpart == 0.0) { /* This must return the same hash as an equal int or long. */ - if (intpart > LONG_MAX || -intpart > LONG_MAX) { + if (intpart > LONG_MAX/2 || -intpart > LONG_MAX/2) { /* Convert to long and use its hash. */ PyObject *plong; /* converted to Python long */ if (Py_IS_INFINITY(intpart)) From python-checkins at python.org Sun Feb 8 16:00:52 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 8 Feb 2009 16:00:52 +0100 (CET) Subject: [Python-checkins] r69438 - in python/branches/py3k: Misc/NEWS Objects/memoryobject.c Message-ID: <20090208150052.D080B1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 8 16:00:52 2009 New Revision: 69438 Log: remove memoryview.__str__ #5182 Modified: python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/memoryobject.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun Feb 8 16:00:52 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #5182: Removed memoryview.__str__. + - Issue #1717: Removed builtin cmp() function, dropped tp_compare slot, the C API functions PyObject_Compare and PyUnicode_Compare and the type definition cmpfunc. The tp_compare slot has been renamed Modified: python/branches/py3k/Objects/memoryobject.c ============================================================================== --- python/branches/py3k/Objects/memoryobject.c (original) +++ python/branches/py3k/Objects/memoryobject.c Sun Feb 8 16:00:52 2009 @@ -498,22 +498,6 @@ return PyUnicode_FromFormat("", self); } - -static PyObject * -memory_str(PyMemoryViewObject *self) -{ - Py_buffer view; - PyObject *res; - - if (PyObject_GetBuffer((PyObject *)self, &view, PyBUF_FULL) < 0) - return NULL; - - res = PyBytes_FromStringAndSize(NULL, view.len); - PyBuffer_ToContiguous(PyBytes_AS_STRING(res), &view, view.len, 'C'); - PyBuffer_Release(&view); - return res; -} - /* Sequence methods */ static Py_ssize_t memory_length(PyMemoryViewObject *self) @@ -812,7 +796,7 @@ &memory_as_mapping, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ - (reprfunc)memory_str, /* tp_str */ + 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ &memory_as_buffer, /* tp_as_buffer */ From python-checkins at python.org Sun Feb 8 16:07:39 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 8 Feb 2009 16:07:39 +0100 (CET) Subject: [Python-checkins] r69439 - in python/branches/release30-maint: Misc/NEWS Objects/memoryobject.c Message-ID: <20090208150739.952221E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 8 16:07:39 2009 New Revision: 69439 Log: Merged revisions 69438 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69438 | benjamin.peterson | 2009-02-08 09:00:52 -0600 (Sun, 08 Feb 2009) | 1 line remove memoryview.__str__ #5182 ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Objects/memoryobject.c Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sun Feb 8 16:07:39 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #5182: Removed memoryview.__str__. + - Issue #1717: Removed builtin cmp() function, dropped tp_compare slot, the C API functions PyObject_Compare and PyUnicode_Compare and the type definition cmpfunc. The tp_compare slot has been renamed Modified: python/branches/release30-maint/Objects/memoryobject.c ============================================================================== --- python/branches/release30-maint/Objects/memoryobject.c (original) +++ python/branches/release30-maint/Objects/memoryobject.c Sun Feb 8 16:07:39 2009 @@ -498,22 +498,6 @@ return PyUnicode_FromFormat("", self); } - -static PyObject * -memory_str(PyMemoryViewObject *self) -{ - Py_buffer view; - PyObject *res; - - if (PyObject_GetBuffer((PyObject *)self, &view, PyBUF_FULL) < 0) - return NULL; - - res = PyBytes_FromStringAndSize(NULL, view.len); - PyBuffer_ToContiguous(PyBytes_AS_STRING(res), &view, view.len, 'C'); - PyBuffer_Release(&view); - return res; -} - /* Sequence methods */ static Py_ssize_t memory_length(PyMemoryViewObject *self) @@ -812,7 +796,7 @@ &memory_as_mapping, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ - (reprfunc)memory_str, /* tp_str */ + 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ &memory_as_buffer, /* tp_as_buffer */ From python-checkins at python.org Sun Feb 8 16:09:21 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 8 Feb 2009 16:09:21 +0100 (CET) Subject: [Python-checkins] r69440 - in python/branches/py3k: Objects/object.c Message-ID: <20090208150921.5E71C1E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 8 16:09:21 2009 New Revision: 69440 Log: Merged revisions 69436 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69436 | mark.dickinson | 2009-02-08 14:42:28 +0000 (Sun, 08 Feb 2009) | 10 lines Issue #789290: make sure that hash(2**63) == hash(2.**63) on 64-bit platforms. The previous code was fragile, depending on the twin accidents that: (1) in C, casting the double value 2.**63 to long returns the integer value -2**63, and (2) in Python, hash(-2**63) == hash(2**63). There's already a test for this in test_hash. ........ Modified: python/branches/py3k/ (props changed) 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 Sun Feb 8 16:09:21 2009 @@ -655,7 +655,7 @@ fractpart = modf(v, &intpart); if (fractpart == 0.0) { /* This must return the same hash as an equal int or long. */ - if (intpart > LONG_MAX || -intpart > LONG_MAX) { + if (intpart > LONG_MAX/2 || -intpart > LONG_MAX/2) { /* Convert to long and use its hash. */ PyObject *plong; /* converted to Python long */ if (Py_IS_INFINITY(intpart)) From python-checkins at python.org Sun Feb 8 16:11:29 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 8 Feb 2009 16:11:29 +0100 (CET) Subject: [Python-checkins] r69441 - in python/branches/release30-maint: Objects/object.c Message-ID: <20090208151129.CC8331E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 8 16:11:29 2009 New Revision: 69441 Log: Merged revisions 69440 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69440 | mark.dickinson | 2009-02-08 15:09:21 +0000 (Sun, 08 Feb 2009) | 17 lines Merged revisions 69436 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69436 | mark.dickinson | 2009-02-08 14:42:28 +0000 (Sun, 08 Feb 2009) | 10 lines Issue #789290: make sure that hash(2**63) == hash(2.**63) on 64-bit platforms. The previous code was fragile, depending on the twin accidents that: (1) in C, casting the double value 2.**63 to long returns the integer value -2**63, and (2) in Python, hash(-2**63) == hash(2**63). There's already a test for this in test_hash. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Objects/object.c Modified: python/branches/release30-maint/Objects/object.c ============================================================================== --- python/branches/release30-maint/Objects/object.c (original) +++ python/branches/release30-maint/Objects/object.c Sun Feb 8 16:11:29 2009 @@ -650,7 +650,7 @@ fractpart = modf(v, &intpart); if (fractpart == 0.0) { /* This must return the same hash as an equal int or long. */ - if (intpart > LONG_MAX || -intpart > LONG_MAX) { + if (intpart > LONG_MAX/2 || -intpart > LONG_MAX/2) { /* Convert to long and use its hash. */ PyObject *plong; /* converted to Python long */ if (Py_IS_INFINITY(intpart)) From buildbot at python.org Sun Feb 8 16:14:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 08 Feb 2009 15:14:34 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.x Message-ID: <20090208151435.199D31E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%203.x/builds/295 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 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_calendar test_email test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Feb 8 16:14:57 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 8 Feb 2009 16:14:57 +0100 (CET) Subject: [Python-checkins] r69442 - python/trunk/Doc/library/2to3.rst Message-ID: <20090208151457.5E0E31E400C@bag.python.org> Author: benjamin.peterson Date: Sun Feb 8 16:14:57 2009 New Revision: 69442 Log: a few edits and typos 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 Sun Feb 8 16:14:57 2009 @@ -146,7 +146,7 @@ .. 2to3fixer:: filter - Wraps :func:`filter` in a :class:`list` call. + Wraps :func:`filter` usage in a :class:`list` call. .. 2to3fixer:: funcattrs @@ -190,8 +190,8 @@ .. 2to3fixer:: imports2 - Handles other modules reanmes in the standard library. It is separate from - :2to3fixer:`imports` only because of technical limitations. + Handles other modules renames in the standard library. It is separate from + the :2to3fixer:`imports` fixer only because of technical limitations. .. 2to3fixer:: input @@ -199,7 +199,7 @@ .. 2to3fixer:: intern - Converts :func:`intern` to :func:`sys.itern`. + Converts :func:`intern` to :func:`sys.intern`. .. 2to3fixer:: isinstance @@ -221,11 +221,12 @@ .. 2to3fixer:: long - Strips the ``L`` prefix on numbers and renamed :class:`long` to :class:`int`. + Strips the ``L`` prefix on long literals and renames :class:`long` to + :class:`int`. .. 2to3fixer:: map - Wraps :func:`map` in a :class:`list` call. It also changes ``map(none, x)`` + Wraps :func:`map` in a :class:`list` call. It also changes ``map(None, x)`` to ``list(x)``. Using ``from future_builtins import map`` disables this fixer. @@ -259,7 +260,7 @@ .. 2to3fixer:: paren Add extra parenthesis where they are required in list comprehensions. For - example, ``[x for x in 1, 2]`` to ``[x for x in (1, 2)]``. + example, ``[x for x in 1, 2]`` becomes ``[x for x in (1, 2)]``. .. 2to3fixer:: print @@ -267,7 +268,7 @@ .. 2to3fixer:: raises - Converts ``raise E, V`` to ``raise E(V)``, and ``raise E, V, T`` as ``raise + Converts ``raise E, V`` to ``raise E(V)``, and ``raise E, V, T`` to ``raise E(V).with_traceback(T)``. If ``E`` is a tuple, the translation will be incorrect because substituting tuples for exceptions has been removed in 3.0. @@ -303,7 +304,7 @@ .. 2to3fixer:: throw - Fixes the API change in generators :meth:`throw` method. + Fixes the API change in generator's :meth:`throw` method. .. 2to3fixer:: tuple_params @@ -336,7 +337,7 @@ .. 2to3fixer:: xreadlines - Change ``for x in file.xreadlines()`` to ``for x in file``. + Changes ``for x in file.xreadlines()`` to ``for x in file``. .. 2to3fixer:: zip From buildbot at python.org Sun Feb 8 16:37:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 08 Feb 2009 15:37:11 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090208153711.9156B1E4002@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/257 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_posix test_subprocess ====================================================================== 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From buildbot at python.org Sun Feb 8 17:18:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 08 Feb 2009 16:18:39 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090208161839.B98081E4031@bag.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/222 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: benjamin.peterson BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Sun Feb 8 18:33:11 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 8 Feb 2009 18:33:11 +0100 (CET) Subject: [Python-checkins] r69443 - python/trunk/Python/ceval.c Message-ID: <20090208173312.31E471E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 8 18:33:11 2009 New Revision: 69443 Log: Silence 'arg may be used uninitialized in this function' warning from gcc. Modified: python/trunk/Python/ceval.c Modified: python/trunk/Python/ceval.c ============================================================================== --- python/trunk/Python/ceval.c (original) +++ python/trunk/Python/ceval.c Sun Feb 8 18:33:11 2009 @@ -450,7 +450,7 @@ for (i=0; i Author: mark.dickinson Date: Sun Feb 8 18:39:43 2009 New Revision: 69444 Log: Blocked revisions 69443 via svnmerge ........ r69443 | mark.dickinson | 2009-02-08 17:33:11 +0000 (Sun, 08 Feb 2009) | 2 lines Silence 'arg may be used uninitialized in this function' warning from gcc. ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Sun Feb 8 18:52:04 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 08 Feb 2009 17:52:04 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090208175204.164311E4002@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/140 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,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 Sun Feb 8 19:22:19 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 8 Feb 2009 19:22:19 +0100 (CET) Subject: [Python-checkins] r69445 - in distutils: branches/latest_trunk_r318 trunk Message-ID: <20090208182219.27B361E4002@bag.python.org> Author: tarek.ziade Date: Sun Feb 8 19:22:19 2009 New Revision: 69445 Log: moving the latest trunk in the old distutils Added: distutils/branches/latest_trunk_r318/ - copied from r69444, /distutils/trunk/ Removed: distutils/trunk/ From python-checkins at python.org Sun Feb 8 19:26:17 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 8 Feb 2009 19:26:17 +0100 (CET) Subject: [Python-checkins] r69446 - in distutils/trunk: README.txt Message-ID: <20090208182617.E14071E4002@bag.python.org> Author: tarek.ziade Date: Sun Feb 8 19:26:17 2009 New Revision: 69446 Log: added an empty trunk with a README.txt file Added: distutils/trunk/ distutils/trunk/README.txt (contents, props changed) Added: distutils/trunk/README.txt ============================================================================== --- (empty file) +++ distutils/trunk/README.txt Sun Feb 8 19:26:17 2009 @@ -0,0 +1,12 @@ +======= +Warning +======= + +The Distutils standalone project is no longer maintained. +You may find the latest trunk version in the branches in `latest_trunk_r318`. + +The Distutils package is now part of the Standard Library and is maintained +and evolves there. + +Distutils-SIG home page : http://www.python.org/community/sigs/current/distutils-sig + From python-checkins at python.org Sun Feb 8 20:06:08 2009 From: python-checkins at python.org (vinay.sajip) Date: Sun, 8 Feb 2009 20:06:08 +0100 (CET) Subject: [Python-checkins] r69447 - in python/trunk: Lib/logging/__init__.py Lib/test/test_logging.py Misc/NEWS Message-ID: <20090208190608.626821E4002@bag.python.org> Author: vinay.sajip Date: Sun Feb 8 20:06:08 2009 New Revision: 69447 Log: Issue #5170: Fixed Unicode output bug in logging and added test case. This is a regression which did not occur in 2.5. Modified: python/trunk/Lib/logging/__init__.py python/trunk/Lib/test/test_logging.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 Sun Feb 8 20:06:08 2009 @@ -758,17 +758,19 @@ """ try: msg = self.format(record) + stream = self.stream fs = "%s\n" if not hasattr(types, "UnicodeType"): #if no unicode support... - self.stream.write(fs % msg) + stream.write(fs % msg) else: try: - if getattr(self.stream, 'encoding', None) is not None: - self.stream.write(fs % msg.encode(self.stream.encoding)) + if (isinstance(msg, unicode) or + getattr(stream, 'encoding', None) is None): + stream.write(fs % msg) else: - self.stream.write(fs % msg) + stream.write(fs % msg.encode(stream.encoding)) except UnicodeError: - self.stream.write(fs % msg.encode("UTF-8")) + stream.write(fs % msg.encode("UTF-8")) self.flush() except (KeyboardInterrupt, SystemExit): raise Modified: python/trunk/Lib/test/test_logging.py ============================================================================== --- python/trunk/Lib/test/test_logging.py (original) +++ python/trunk/Lib/test/test_logging.py Sun Feb 8 20:06:08 2009 @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2001-2004 by Vinay Sajip. All Rights Reserved. +# Copyright 2001-2009 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, @@ -18,13 +18,14 @@ """Test harness for the logging module. Run all tests. -Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved. +Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved. """ import logging import logging.handlers import logging.config +import codecs import copy import cPickle import cStringIO @@ -860,6 +861,7 @@ ('foo', 'DEBUG', '3'), ]) + class EncodingTest(BaseTest): def test_encoding_plain_file(self): # In Python 2.x, a plain file object is treated as having no encoding. @@ -886,6 +888,27 @@ if os.path.isfile(fn): os.remove(fn) + def test_encoding_cyrillic_unicode(self): + log = logging.getLogger("test") + #Get a message in Unicode: Do svidanya in Cyrillic (meaning goodbye) + message = u'\u0434\u043e \u0441\u0432\u0438\u0434\u0430\u043d\u0438\u044f' + #Ensure it's written in a Cyrillic encoding + writer_class = codecs.getwriter('cp1251') + stream = cStringIO.StringIO() + writer = writer_class(stream, 'strict') + handler = logging.StreamHandler(writer) + log.addHandler(handler) + try: + log.warning(message) + finally: + log.removeHandler(handler) + handler.close() + # check we wrote exactly those bytes, ignoring trailing \n etc + s = stream.getvalue() + #Compare against what the data should be when encoded in CP-1251 + self.assertEqual(s, '\xe4\xee \xf1\xe2\xe8\xe4\xe0\xed\xe8\xff\n') + + class WarningsTest(BaseTest): def test_warnings(self): logging.captureWarnings(True) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Feb 8 20:06:08 2009 @@ -149,6 +149,9 @@ Library ------- +- Issue #5170: Fixed Unicode output bug in logging and added test case. + This is a regression which did not occur in 2.5. + - Issue #4512 (part 2): Promote ``ZipImporter._get_filename()`` to be a public documented method ``ZipImporter.get_filename()``. @@ -162,7 +165,7 @@ Tkapp_Call when calling from a thread different than the one that created the Tcl interpreter. Patch by Robert Hancock. -- Issue #1520877: Now distutils.sysconfig reads $AR from the +- Issue #1520877: Now distutils.sysconfig reads $AR from the environment/Makefile. Patch by Douglas Greiman. - Issue #4285: Change sys.version_info to be a named tuple. Patch by @@ -171,7 +174,7 @@ - Issue #1276768: The verbose option was not used in the code of distutils.file_util and distutils.dir_util. -- Issue #5132: Fixed trouble building extensions under Solaris with +- Issue #5132: Fixed trouble building extensions under Solaris with --enabled-shared activated. Initial patch by Dave Peterson. - Issue #1581476: Always use the Tcl global namespace when calling into Tcl. @@ -212,7 +215,7 @@ - Issue #4710: Extract directories properly in the zipfile module; allow adding directories to a zipfile. -- Issue #3807: _multiprocessing build fails when configure is passed +- Issue #3807: _multiprocessing build fails when configure is passed --without-threads argument. When this occurs, _multiprocessing will be disabled, and not compiled. From python-checkins at python.org Sun Feb 8 20:14:41 2009 From: python-checkins at python.org (vinay.sajip) Date: Sun, 8 Feb 2009 20:14:41 +0100 (CET) Subject: [Python-checkins] r69448 - in python/branches/release26-maint: Lib/logging/__init__.py Lib/test/test_logging.py Misc/NEWS Message-ID: <20090208191441.6B73A1E4002@bag.python.org> Author: vinay.sajip Date: Sun Feb 8 20:14:41 2009 New Revision: 69448 Log: Issue #5170: Fixed Unicode output bug in logging and added test case. This is a regression which did not occur in 2.5. Modified: python/branches/release26-maint/Lib/logging/__init__.py python/branches/release26-maint/Lib/test/test_logging.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 Sun Feb 8 20:14:41 2009 @@ -748,17 +748,19 @@ """ try: msg = self.format(record) + stream = self.stream fs = "%s\n" if not hasattr(types, "UnicodeType"): #if no unicode support... - self.stream.write(fs % msg) + stream.write(fs % msg) else: try: - if getattr(self.stream, 'encoding', None) is not None: - self.stream.write(fs % msg.encode(self.stream.encoding)) + if (isinstance(msg, unicode) or + getattr(stream, 'encoding', None) is None): + stream.write(fs % msg) else: - self.stream.write(fs % msg) + stream.write(fs % msg.encode(stream.encoding)) except UnicodeError: - self.stream.write(fs % msg.encode("UTF-8")) + stream.write(fs % msg.encode("UTF-8")) self.flush() except (KeyboardInterrupt, SystemExit): raise Modified: python/branches/release26-maint/Lib/test/test_logging.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_logging.py (original) +++ python/branches/release26-maint/Lib/test/test_logging.py Sun Feb 8 20:14:41 2009 @@ -859,6 +859,7 @@ ('foo', 'DEBUG', '3'), ]) + class EncodingTest(BaseTest): def test_encoding_plain_file(self): # In Python 2.x, a plain file object is treated as having no encoding. @@ -885,6 +886,27 @@ if os.path.isfile(fn): os.remove(fn) + def test_encoding_cyrillic_unicode(self): + log = logging.getLogger("test") + #Get a message in Unicode: Do svidanya in Cyrillic (meaning goodbye) + message = u'\u0434\u043e \u0441\u0432\u0438\u0434\u0430\u043d\u0438\u044f' + #Ensure it's written in a Cyrillic encoding + writer_class = codecs.getwriter('cp1251') + stream = cStringIO.StringIO() + writer = writer_class(stream, 'strict') + handler = logging.StreamHandler(writer) + log.addHandler(handler) + try: + log.warning(message) + finally: + log.removeHandler(handler) + handler.close() + # check we wrote exactly those bytes, ignoring trailing \n etc + s = stream.getvalue() + #Compare against what the data should be when encoded in CP-1251 + self.assertEqual(s, '\xe4\xee \xf1\xe2\xe8\xe4\xe0\xed\xe8\xff\n') + + # Set the locale to the platform-dependent default. I have no idea # why the test does this, but in any case we save the current locale # first and restore it at the end. Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sun Feb 8 20:14:41 2009 @@ -80,11 +80,14 @@ Library ------- +- Issue #5170: Fixed Unicode output bug in logging and added test case. + This is a regression which did not occur in 2.5. + - Partial fix to issue #1731706: memory leak in Tkapp_Call when calling from a thread different than the one that created the Tcl interpreter. Patch by Robert Hancock. -- Issue #5132: Fixed trouble building extensions under Solaris with +- Issue #5132: Fixed trouble building extensions under Solaris with --enabled-shared activated. Initial patch by Dave Peterson. - Issue #1581476: Always use the Tcl global namespace when calling into Tcl. From python-checkins at python.org Sun Feb 8 20:16:37 2009 From: python-checkins at python.org (vinay.sajip) Date: Sun, 8 Feb 2009 20:16:37 +0100 (CET) Subject: [Python-checkins] r69449 - python/branches/release26-maint/Lib/test/test_logging.py Message-ID: <20090208191637.707F71E4002@bag.python.org> Author: vinay.sajip Date: Sun Feb 8 20:16:37 2009 New Revision: 69449 Log: Fixed missing import. Modified: python/branches/release26-maint/Lib/test/test_logging.py Modified: python/branches/release26-maint/Lib/test/test_logging.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_logging.py (original) +++ python/branches/release26-maint/Lib/test/test_logging.py Sun Feb 8 20:16:37 2009 @@ -25,6 +25,7 @@ import logging.handlers import logging.config +import codecs import copy import cPickle import cStringIO From buildbot at python.org Sun Feb 8 20:34:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 08 Feb 2009 19:34:54 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090208193454.5BF041E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/620 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: vinay.sajip BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test___all__ test_bsddb test_whichdb ====================================================================== ERROR: test_all (test.test___all__.AllTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test___all__.py", line 66, in test_all self.check_all("dbhash") File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test___all__.py", line 16, in check_all exec "import %s" % modname in names File "", line 1, in File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' Traceback (most recent call last): File "./Lib/test/regrtest.py", line 551, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_bsddb.py", line 8, in import dbhash # Just so we know it's imported File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' Traceback (most recent call last): File "./Lib/test/regrtest.py", line 551, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_whichdb.py", line 40, in mod = __import__(name) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/dbhash.py", line 16, in error = bsddb.error # Exported for anydbm AttributeError: 'module' object has no attribute 'error' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun Feb 8 21:06:24 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 08 Feb 2009 20:06:24 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090208200624.B61661E4002@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/259 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_posix test_subprocess ====================================================================== 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Sun Feb 8 21:39:06 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 8 Feb 2009 21:39:06 +0100 (CET) Subject: [Python-checkins] r69450 - in python/branches/io-c: Demo/tkinter/README Demo/tkinter/ttk Doc/c-api/allocation.rst Doc/c-api/arg.rst Doc/c-api/bool.rst Doc/c-api/buffer.rst Doc/c-api/bytearray.rst Doc/c-api/bytes.rst Doc/c-api/cell.rst Doc/c-api/cobject.rst Doc/c-api/complex.rst Doc/c-api/conversion.rst Doc/c-api/datetime.rst Doc/c-api/descriptor.rst Doc/c-api/dict.rst Doc/c-api/exceptions.rst Doc/c-api/file.rst Doc/c-api/float.rst Doc/c-api/function.rst Doc/c-api/gcsupport.rst Doc/c-api/gen.rst Doc/c-api/import.rst Doc/c-api/init.rst Doc/c-api/iter.rst Doc/c-api/iterator.rst Doc/c-api/list.rst Doc/c-api/long.rst Doc/c-api/mapping.rst Doc/c-api/marshal.rst Doc/c-api/method.rst Doc/c-api/module.rst Doc/c-api/none.rst Doc/c-api/number.rst Doc/c-api/objbuffer.rst Doc/c-api/object.rst Doc/c-api/objimpl.rst Doc/c-api/reflection.rst Doc/c-api/sequence.rst Doc/c-api/set.rst Doc/c-api/slice.rst Doc/c-api/structures.rst Doc/c-api/sys.rst Doc/c-api/tuple.rst Doc/c-api/type.rst Doc/c-api/typeobj.rst Doc/c-api/unicode.rst Doc/c-api/weakref.rst Doc/documenting/markup.rst Doc/extending/newtypes.rst Doc/glossary.rst Doc/includes/noddy.c Doc/includes/noddy2.c Doc/includes/noddy3.c Doc/includes/noddy4.c Doc/includes/shoddy.c Doc/includes/sqlite3/collation_reverse.py Doc/includes/typestruct.h Doc/library/ast.rst Doc/library/binascii.rst Doc/library/collections.rst Doc/library/copyreg.rst Doc/library/ctypes.rst Doc/library/datetime.rst Doc/library/fractions.rst Doc/library/functions.rst Doc/library/html.entities.rst Doc/library/importlib.rst Doc/library/io.rst Doc/library/itertools.rst Doc/library/json.rst Doc/library/locale.rst Doc/library/multiprocessing.rst Doc/library/operator.rst Doc/library/optparse.rst Doc/library/plistlib.rst Doc/library/queue.rst Doc/library/reprlib.rst Doc/library/runpy.rst Doc/library/shelve.rst Doc/library/sys.rst Doc/library/threading.rst Doc/library/tk.rst Doc/library/tkinter.ttk.rst Doc/library/unittest.rst Doc/library/zipimport.rst Doc/library/zlib.rst Doc/reference/datamodel.rst Doc/reference/executionmodel.rst Doc/reference/expressions.rst Doc/reference/grammar.rst Doc/reference/simple_stmts.rst Doc/tools/sphinxext/download.html Doc/tools/sphinxext/pyspecific.py Doc/tutorial/floatingpoint.rst Doc/tutorial/modules.rst Doc/using/cmdline.rst Doc/whatsnew/2.7.rst Doc/whatsnew/3.0.rst Include/abstract.h Include/code.h Include/object.h Lib/_abcoll.py Lib/colorsys.py Lib/decimal.py Lib/distutils/README Lib/distutils/__init__.py Lib/distutils/cmd.py Lib/distutils/command/build_ext.py Lib/distutils/command/install_lib.py Lib/distutils/command/wininst-9.0-amd64.exe Lib/distutils/command/wininst-9.0.exe Lib/distutils/dir_util.py Lib/distutils/file_util.py Lib/distutils/sysconfig.py Lib/distutils/tests/test_build_ext.py Lib/distutils/tests/test_cmd.py Lib/distutils/tests/test_dir_util.py Lib/distutils/tests/test_file_util.py Lib/distutils/tests/test_sdist.py Lib/distutils/tests/test_sysconfig.py Lib/heapq.py Lib/http/client.py Lib/importlib/NOTES Lib/importlib/__init__.py Lib/importlib/_bootstrap.py Lib/importlib/machinery.py Lib/importlib/test/ Message-ID: <20090208203906.CAA751E4002@bag.python.org> Author: antoine.pitrou Date: Sun Feb 8 21:39:02 2009 New Revision: 69450 Log: Merged revisions 69041,69051,69055,69064,69068,69072,69075,69081-69082,69086,69088-69089,69092,69096,69098,69101,69105,69108,69110-69111,69114,69116-69118,69120,69132-69133,69136,69138,69150-69151,69164-69168,69170-69174,69176-69179,69181,69184,69188,69190,69192,69197-69198,69202,69207,69209-69210,69213-69214,69218,69222,69224,69229,69233-69234,69239,69246-69247,69249,69251,69254,69259,69261,69274,69279-69284,69287,69290-69292,69294,69296,69306-69308,69313,69318,69320-69321,69323,69326,69335-69336,69344,69346,69349-69350,69352,69354,69358,69362,69368,69370,69372,69375,69379-69380,69387,69392,69395-69403,69406-69407,69411,69416,69418,69421,69426,69429,69431,69434,69438,69440,69444 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69041 | mark.hammond | 2009-01-28 00:46:57 +0100 (mer., 28 janv. 2009) | 10 lines Merged revisions 69038 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69038 | mark.hammond | 2009-01-28 10:12:23 +1100 (Wed, 28 Jan 2009) | 3 lines On Windows, use the Python 'Activation Context' when loading extensions to avoid problems loading the CRT from a private assembly. Via bug 4566. ........ ................ r69051 | guilherme.polo | 2009-01-28 15:41:10 +0100 (mer., 28 janv. 2009) | 9 lines Merged revisions 69050 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69050 | guilherme.polo | 2009-01-28 11:09:03 -0200 (Wed, 28 Jan 2009) | 2 lines Added the ttk module. See issue #2983: Ttk support for Tkinter. ........ ................ r69055 | guilherme.polo | 2009-01-28 17:06:51 +0100 (mer., 28 janv. 2009) | 9 lines Merged revisions 69053 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69053 | guilherme.polo | 2009-01-28 13:56:01 -0200 (Wed, 28 Jan 2009) | 2 lines Demos for ttk added. ........ ................ r69064 | guilherme.polo | 2009-01-28 21:40:48 +0100 (mer., 28 janv. 2009) | 23 lines Merged revisions 69060-69063 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69060 | guilherme.polo | 2009-01-28 17:23:28 -0200 (Wed, 28 Jan 2009) | 2 lines Added support for collecting tests only from specific packages. ........ r69061 | guilherme.polo | 2009-01-28 17:28:04 -0200 (Wed, 28 Jan 2009) | 4 lines * Renaming test_tk_* to test_ttk_* since that is what they are testing. * Added ttk tests to the expected skips mapping just like where test_tcl was expected to be skipped too. ........ r69062 | guilherme.polo | 2009-01-28 18:02:01 -0200 (Wed, 28 Jan 2009) | 1 line Make sure the root windows gets destroyed ........ r69063 | guilherme.polo | 2009-01-28 18:03:26 -0200 (Wed, 28 Jan 2009) | 2 lines Issue #5083: New 'gui' resource for regrtest. ........ ................ r69068 | mark.dickinson | 2009-01-28 22:25:58 +0100 (mer., 28 janv. 2009) | 3 lines Issue #4707: round(x, n) now returns an integer when x is an integer. Previously it returned a float. ................ r69072 | raymond.hettinger | 2009-01-29 00:33:59 +0100 (jeu., 29 janv. 2009) | 1 line Beef-up tests for collections ABCs. ................ r69075 | raymond.hettinger | 2009-01-29 01:01:27 +0100 (jeu., 29 janv. 2009) | 1 line Correct docs for ABCs (MutableSequence was missing __setiem). Simplify the table by taking out inherited requirements for abstract methods. ................ r69081 | benjamin.peterson | 2009-01-29 02:59:38 +0100 (jeu., 29 janv. 2009) | 14 lines Blocked revisions 69070,69074 via svnmerge ........ r69070 | raymond.hettinger | 2009-01-28 17:02:26 -0600 (Wed, 28 Jan 2009) | 6 lines Issue 4920: Fixed next() vs __next__() issues in the ABCs for Iterator and MutableSet. Also added thorough test for required abstractmethods. ........ r69074 | raymond.hettinger | 2009-01-28 17:58:16 -0600 (Wed, 28 Jan 2009) | 1 line Correct docs for ABCs (MutableSequence was missing __setiem). Simplify the table by taking out inherited requirements for abstract methods. ........ ................ r69082 | benjamin.peterson | 2009-01-29 03:14:30 +0100 (jeu., 29 janv. 2009) | 8 lines Blocked revisions 68521 via svnmerge ........ r68521 | hirokazu.yamamoto | 2009-01-10 21:28:13 -0600 (Sat, 10 Jan 2009) | 1 line Fixed version number in build_ssl.bat. ........ ................ r69086 | raymond.hettinger | 2009-01-29 04:41:55 +0100 (jeu., 29 janv. 2009) | 1 line Update itertools.__doc__ to include all tools. ................ r69088 | raymond.hettinger | 2009-01-29 04:48:02 +0100 (jeu., 29 janv. 2009) | 1 line Fix typo. ................ r69089 | benjamin.peterson | 2009-01-29 04:52:26 +0100 (jeu., 29 janv. 2009) | 12 lines Blocked revisions 69085,69087 via svnmerge ........ r69085 | raymond.hettinger | 2009-01-28 21:21:42 -0600 (Wed, 28 Jan 2009) | 1 line Update itertools.__doc__ to include all tools. ........ r69087 | raymond.hettinger | 2009-01-28 21:43:44 -0600 (Wed, 28 Jan 2009) | 1 line Fix typo. ........ ................ r69092 | brett.cannon | 2009-01-29 05:10:21 +0100 (jeu., 29 janv. 2009) | 17 lines Merged revisions 69078-69080 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69078 | brett.cannon | 2009-01-28 16:54:11 -0800 (Wed, 28 Jan 2009) | 2 lines Clarify some __del__ stuff. ........ r69079 | brett.cannon | 2009-01-28 16:54:32 -0800 (Wed, 28 Jan 2009) | 2 lines Minor spelling mistake in datetime docs. ........ r69080 | brett.cannon | 2009-01-28 16:55:33 -0800 (Wed, 28 Jan 2009) | 2 lines Ignore .pyc and .pyo files. ........ ................ r69096 | mark.hammond | 2009-01-29 13:36:50 +0100 (jeu., 29 janv. 2009) | 9 lines Merged revisions 69094 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69094 | mark.hammond | 2009-01-29 23:13:31 +1100 (Thu, 29 Jan 2009) | 2 lines Fix issue5075: bdist_wininst should not depend on the vc runtime? ........ ................ r69098 | mark.hammond | 2009-01-29 14:08:01 +0100 (jeu., 29 janv. 2009) | 2 lines Fix issue5076: bdist_wininst fails on py3k ................ r69101 | antoine.pitrou | 2009-01-29 21:26:59 +0100 (jeu., 29 janv. 2009) | 11 lines Merged revisions 69100 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69100 | antoine.pitrou | 2009-01-29 21:19:34 +0100 (jeu., 29 janv. 2009) | 5 lines Issue #2047: shutil.move() could believe that its destination path was inside its source path if it began with the same letters (e.g. "src" vs. "src.new"). ........ ................ r69105 | raymond.hettinger | 2009-01-29 23:26:20 +0100 (jeu., 29 janv. 2009) | 1 line Fix error in docs. The source says proto 2 is the default. ................ r69108 | tarek.ziade | 2009-01-30 00:54:06 +0100 (ven., 30 janv. 2009) | 9 lines Merged revisions 69106 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69106 | tarek.ziade | 2009-01-30 00:49:17 +0100 (Fri, 30 Jan 2009) | 1 line fixed test_make_distribution so it runs on any platform, as long as tar an gzip are available ........ ................ r69110 | brett.cannon | 2009-01-30 01:22:35 +0100 (ven., 30 janv. 2009) | 2 lines Merge testing ABCs for importlib into importlib.test.abc. ................ r69111 | brett.cannon | 2009-01-30 02:31:34 +0100 (ven., 30 janv. 2009) | 3 lines The trace module was trying to turn ints into ints since co_lnotab was changed to a bytes object. ................ r69114 | benjamin.peterson | 2009-01-30 03:29:43 +0100 (ven., 30 janv. 2009) | 1 line fix a case of set_daemon #5087 ................ r69116 | benjamin.peterson | 2009-01-30 04:01:08 +0100 (ven., 30 janv. 2009) | 16 lines Blocked revisions 68772,68892,69039 via svnmerge ........ r68772 | benjamin.peterson | 2009-01-19 09:42:23 -0600 (Mon, 19 Jan 2009) | 1 line add a note about the ftruncate change ........ r68892 | martin.v.loewis | 2009-01-24 09:45:18 -0600 (Sat, 24 Jan 2009) | 2 lines Add heading for 2.7a0. ........ r69039 | benjamin.peterson | 2009-01-27 17:15:48 -0600 (Tue, 27 Jan 2009) | 1 line use True and False ........ ................ r69117 | hirokazu.yamamoto | 2009-01-30 04:15:05 +0100 (ven., 30 janv. 2009) | 1 line Issue #5041: Fixed memory leak. ................ r69118 | benjamin.peterson | 2009-01-30 04:39:35 +0100 (ven., 30 janv. 2009) | 34 lines Merged revisions 68884,68973,68978,69003,69083,69112-69113 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68884 | kristjan.jonsson | 2009-01-24 04:52:26 -0600 (Sat, 24 Jan 2009) | 1 line Add a test for UNC import paths, see issue 3677 ........ r68973 | georg.brandl | 2009-01-26 15:29:38 -0600 (Mon, 26 Jan 2009) | 2 lines Copy over docs on advanced role features from Sphinx docs. ........ r68978 | mark.dickinson | 2009-01-26 15:51:56 -0600 (Mon, 26 Jan 2009) | 3 lines Issue #5073: Fix occasional failure of bsddb/test/test_lock.py. Thanks Hirokazu Yamamoto for the patch. ........ r69003 | benjamin.peterson | 2009-01-26 21:07:53 -0600 (Mon, 26 Jan 2009) | 1 line excellent place to use a set() #5069 ........ r69083 | benjamin.peterson | 2009-01-28 21:03:00 -0600 (Wed, 28 Jan 2009) | 1 line fix download url ........ r69112 | benjamin.peterson | 2009-01-29 20:02:25 -0600 (Thu, 29 Jan 2009) | 1 line pep8tify conditionals ........ r69113 | benjamin.peterson | 2009-01-29 20:24:39 -0600 (Thu, 29 Jan 2009) | 1 line make _tkinter._flatten check the result of PySequence_Size for errors #3880 ........ ................ r69120 | benjamin.peterson | 2009-01-30 05:00:29 +0100 (ven., 30 janv. 2009) | 21 lines Merged revisions 68840,68881,68943,68945 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68840 | andrew.kuchling | 2009-01-20 20:15:43 -0600 (Tue, 20 Jan 2009) | 1 line Add some items ........ r68881 | andrew.kuchling | 2009-01-23 21:28:18 -0600 (Fri, 23 Jan 2009) | 1 line Add various items ........ r68943 | tarek.ziade | 2009-01-25 16:09:10 -0600 (Sun, 25 Jan 2009) | 1 line Issue #5052: removed backward compatibility information (out of date) ........ r68945 | tarek.ziade | 2009-01-25 16:11:04 -0600 (Sun, 25 Jan 2009) | 1 line added missing module docstring ........ ................ r69132 | benjamin.peterson | 2009-01-31 04:57:19 +0100 (sam., 31 janv. 2009) | 1 line comprehrensions now have proper scoping #5106 ................ r69133 | mark.dickinson | 2009-01-31 13:12:41 +0100 (sam., 31 janv. 2009) | 3 lines Make Python/makeopcodetargets runnable with Python 2.3. With any luck, this should solve the 'failed compile' on the x86 gentoo 3.x buildbot. ................ r69136 | benjamin.peterson | 2009-01-31 17:36:08 +0100 (sam., 31 janv. 2009) | 1 line detabify Objects/unicodeobject.c ................ r69138 | benjamin.peterson | 2009-01-31 17:41:58 +0100 (sam., 31 janv. 2009) | 8 lines Blocked revisions 69134 via svnmerge ........ r69134 | benjamin.peterson | 2009-01-31 10:29:18 -0600 (Sat, 31 Jan 2009) | 1 line completely detabify unicodeobject.c ........ ................ r69150 | benjamin.peterson | 2009-01-31 23:14:21 +0100 (sam., 31 janv. 2009) | 1 line fix indentation again ................ r69151 | benjamin.peterson | 2009-01-31 23:17:25 +0100 (sam., 31 janv. 2009) | 12 lines Blocked revisions 69146,69149 via svnmerge ........ r69146 | benjamin.peterson | 2009-01-31 15:47:42 -0600 (Sat, 31 Jan 2009) | 1 line fix indentation ........ r69149 | benjamin.peterson | 2009-01-31 16:03:19 -0600 (Sat, 31 Jan 2009) | 1 line fix indentation; looks like all I managed to do the first time is make things uglier ........ ................ r69164 | gregory.p.smith | 2009-02-01 01:30:50 +0100 (dim., 01 f?vr. 2009) | 2 lines documentation wording fix for issue4903 ................ r69165 | brett.cannon | 2009-02-01 01:37:13 +0100 (dim., 01 f?vr. 2009) | 1 line Move built-in loader tests to importlib.test.abc.LoaderTests. ................ r69166 | brett.cannon | 2009-02-01 01:49:41 +0100 (dim., 01 f?vr. 2009) | 1 line Move extension module loader tests over to importlib.test.abc.LoaderTests. ................ r69167 | brett.cannon | 2009-02-01 02:34:13 +0100 (dim., 01 f?vr. 2009) | 4 lines Fix importlib.machinery.FrozenImporter.load_module() to set __package__ properly. Discovered by also moving the loader tests over to importlib.test.abc.LoaderTests. ................ r69168 | brett.cannon | 2009-02-01 03:05:11 +0100 (dim., 01 f?vr. 2009) | 3 lines Move source loader tests (including reload tests) over to importlib.test.abc.LoaderTests. ................ r69170 | brett.cannon | 2009-02-01 04:08:31 +0100 (dim., 01 f?vr. 2009) | 3 lines Split out support code that is specific to source tests out of importlib.test.support to importlib.test.source.util. ................ r69171 | brett.cannon | 2009-02-01 04:51:54 +0100 (dim., 01 f?vr. 2009) | 2 lines Do not execute the .pyc/.pyo files as well as the .py files. ................ r69172 | brett.cannon | 2009-02-01 05:00:05 +0100 (dim., 01 f?vr. 2009) | 2 lines Rename importlib.test.support to importlib.test.util. ................ r69173 | brett.cannon | 2009-02-01 05:28:04 +0100 (dim., 01 f?vr. 2009) | 2 lines Move import semantic util code to importlib.test.import_.util. ................ r69174 | brett.cannon | 2009-02-01 06:04:06 +0100 (dim., 01 f?vr. 2009) | 1 line Remove an outdated todo item from importlib. ................ r69176 | brett.cannon | 2009-02-01 06:33:17 +0100 (dim., 01 f?vr. 2009) | 2 lines Expose source_path and bytecode_path on _PyFileLoader. ................ r69177 | brett.cannon | 2009-02-01 06:43:31 +0100 (dim., 01 f?vr. 2009) | 3 lines Ditch read_source() and read_bytecode() and replace with *_path() and get_data(). ................ r69178 | brett.cannon | 2009-02-01 06:55:23 +0100 (dim., 01 f?vr. 2009) | 1 line Update importlib notes. ................ r69179 | brett.cannon | 2009-02-01 07:07:57 +0100 (dim., 01 f?vr. 2009) | 1 line Simplify write_bytecode for importlib. ................ r69181 | mark.dickinson | 2009-02-01 11:28:51 +0100 (dim., 01 f?vr. 2009) | 3 lines Issue #1717, stage 2: remove uses of tp_compare in Modules and most Objects. ................ r69184 | mark.dickinson | 2009-02-01 13:13:56 +0100 (dim., 01 f?vr. 2009) | 3 lines Issue #1717: remove the cmp builtin function, the C-API functions PyObject_Cmp, PyObject_Compare, and various support functions. ................ r69188 | mark.dickinson | 2009-02-01 14:59:22 +0100 (dim., 01 f?vr. 2009) | 6 lines Issue #1717, continued: remove PyObject_Compare and Py_CmpToRich declarations from object.h; don't inherit tp_compare slot on subclasses; and raise TypeError when initializing a type that has a nonzero tp_compare slot. Fix up comparison-related comments in object.c and code.h. ................ r69190 | mark.dickinson | 2009-02-01 15:18:10 +0100 (dim., 01 f?vr. 2009) | 2 lines Issue #1717: documentation fixes related to the cmp removal. ................ r69192 | mark.dickinson | 2009-02-01 21:36:08 +0100 (dim., 01 f?vr. 2009) | 2 lines Remove exception for non-NULL tp_compare that was introduced in r69188. ................ r69197 | guilherme.polo | 2009-02-02 02:02:20 +0100 (lun., 02 f?vr. 2009) | 10 lines Recorded merge of revisions 69195 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69195 | guilherme.polo | 2009-02-01 22:38:54 -0200 (Sun, 01 Feb 2009) | 3 lines Use a single Tcl interpreter through all these tests, this may help some failing buildbots. ........ ................ r69198 | brett.cannon | 2009-02-02 06:58:30 +0100 (lun., 02 f?vr. 2009) | 3 lines Note to move __package__ stuff over to rpartition to make Nick happy. Also make sure that accepting the empty string for top-level modules is okay. ................ r69202 | hirokazu.yamamoto | 2009-02-02 10:15:41 +0100 (lun., 02 f?vr. 2009) | 9 lines Merged revisions 69200 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69200 | hirokazu.yamamoto | 2009-02-02 17:01:17 +0900 | 1 line Set native svn:eol-style property for text files. ........ ................ r69207 | martin.v.loewis | 2009-02-02 16:32:22 +0100 (lun., 02 f?vr. 2009) | 9 lines Merged revisions 69205 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69205 | martin.v.loewis | 2009-02-02 15:23:16 +0100 (Mo, 02 Feb 2009) | 1 line Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. ........ ................ r69209 | kristjan.jonsson | 2009-02-02 17:04:04 +0100 (lun., 02 f?vr. 2009) | 4 lines merging / reimplementing r68532 from the trunk to Py3k Enable buffering for HTTPResponse's fp. read() behaves identically for buffered and non-buffered IO. read(n) also won't block if n bytes are availble on the socket. There is therefore no reason not to use buffering. The reason 2.x disables buffering by default, that some clients may be accessing the underlying socket directly and so bypass the buffering buffer, doesn't apply in 3.x with its redesigned IO library. See issue 4448 and issue 4879 ................ r69210 | brett.cannon | 2009-02-02 20:19:36 +0100 (lun., 02 f?vr. 2009) | 5 lines To prevent another screw-up on my part where my prototype gets lost thanks to an ``svn revert`` (gee, maybe more atomic commits by use of something like a DVCS would help with this? Wish someone would get on that ...), I am checking in an untested, work-in-progress meta path finder to handle sys.path. ................ r69213 | brett.cannon | 2009-02-02 21:32:29 +0100 (lun., 02 f?vr. 2009) | 1 line Add some notes for importlib to package up what is in Python 2.7 as well as modules that can probably get replaced by importlib at some point. ................ r69214 | mark.dickinson | 2009-02-02 21:36:42 +0100 (lun., 02 f?vr. 2009) | 4 lines Issue #1717: rename tp_compare to tp_reserved. I'll change the type of tp_compare in a separate commit, for ease of reversion should things go wrong. ................ r69218 | mark.dickinson | 2009-02-02 22:11:16 +0100 (lun., 02 f?vr. 2009) | 3 lines Change type of tp_reserved from cmpfunc to (void *); remove definition of cmpfunc. ................ r69222 | guilherme.polo | 2009-02-02 22:17:09 +0100 (lun., 02 f?vr. 2009) | 13 lines Merged revisions 69217,69219 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69217 | guilherme.polo | 2009-02-02 19:08:32 -0200 (Mon, 02 Feb 2009) | 1 line Fix for issue #1581476 ........ r69219 | guilherme.polo | 2009-02-02 19:14:14 -0200 (Mon, 02 Feb 2009) | 1 line NEWS entry for issue #1581476 ........ ................ r69224 | mark.dickinson | 2009-02-02 22:29:40 +0100 (lun., 02 f?vr. 2009) | 3 lines Issue #1717, continued: Doc fixes and other cleanup related to renaming of tp_compare. ................ r69229 | raymond.hettinger | 2009-02-02 23:55:09 +0100 (lun., 02 f?vr. 2009) | 1 line Issue 1242657: list(obj) can swallow KeyboardInterrupt. ................ r69233 | benjamin.peterson | 2009-02-03 02:47:16 +0100 (mar., 03 f?vr. 2009) | 16 lines Blocked revisions 68532,69161,69227 via svnmerge ........ r68532 | kristjan.jonsson | 2009-01-11 10:23:37 -0600 (Sun, 11 Jan 2009) | 1 line Issue 4879: Allow buffering for HTTPResponse ........ r69161 | gregory.p.smith | 2009-01-31 18:24:21 -0600 (Sat, 31 Jan 2009) | 2 lines wording for for issue4903. ........ r69227 | raymond.hettinger | 2009-02-02 15:50:13 -0600 (Mon, 02 Feb 2009) | 1 line Issue 1242657: list(obj) can swallow KeyboardInterrupt. ........ ................ r69234 | raymond.hettinger | 2009-02-03 03:12:10 +0100 (mar., 03 f?vr. 2009) | 1 line Validate that __length_hint__ returns a usable result. ................ r69239 | benjamin.peterson | 2009-02-03 03:30:19 +0100 (mar., 03 f?vr. 2009) | 8 lines Blocked revisions 69237 via svnmerge ........ r69237 | raymond.hettinger | 2009-02-02 20:23:19 -0600 (Mon, 02 Feb 2009) | 1 line Validate that __length_hint__ returns a usable result. ........ ................ r69246 | raymond.hettinger | 2009-02-03 04:54:28 +0100 (mar., 03 f?vr. 2009) | 1 line Register decimals as numbers.Number ................ r69247 | benjamin.peterson | 2009-02-03 05:08:48 +0100 (mar., 03 f?vr. 2009) | 8 lines Blocked revisions 69242 via svnmerge ........ r69242 | raymond.hettinger | 2009-02-02 21:37:03 -0600 (Mon, 02 Feb 2009) | 1 line Register decimals as numbers.Number ........ ................ r69249 | raymond.hettinger | 2009-02-03 05:19:10 +0100 (mar., 03 f?vr. 2009) | 1 line The default shelve pickle protocol should have been 3. ................ r69251 | brett.cannon | 2009-02-03 05:57:48 +0100 (mar., 03 f?vr. 2009) | 1 line Add importlib to the Makefile. ................ r69254 | brett.cannon | 2009-02-03 06:00:53 +0100 (mar., 03 f?vr. 2009) | 9 lines Blocked revisions 69252 via svnmerge ........ r69252 | brett.cannon | 2009-02-02 20:58:29 -0800 (Mon, 02 Feb 2009) | 3 lines Make importlib a package. This allows using svn:externals in the sandbox to package up the code for separate distribution. ........ ................ r69259 | kristjan.jonsson | 2009-02-03 11:57:52 +0100 (mar., 03 f?vr. 2009) | 1 line r69209 caused the fp of HTTPResponse objects to be a io.BufferedReader instead of a socket.SocketIO. This moves the underlying socket.socket object from r.fp._sock to r.fp.raw._sock. Since _sock is an internal object, this should be ok. The change is for the testsuite only, to assert socket state. ................ r69261 | thomas.heller | 2009-02-03 20:34:18 +0100 (mar., 03 f?vr. 2009) | 16 lines Merged revisions 69260 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69260 | thomas.heller | 2009-02-03 18:07:40 +0100 (Di, 03 Feb 2009) | 9 lines This refactoring should make it easier to add new calling conventions. Replace ffi_call_STDCALL and ffi_call_SYSV by a ffi_call_x86 function that cleans up the stack when FFI_SYSV is used, and does nothing for FFI_STDCALL. Remove libffi_msvc\win32.S, which is out of date and also unused; it was only used for building ctypes with the MingW compiler. ........ ................ r69274 | raymond.hettinger | 2009-02-04 12:41:45 +0100 (mer., 04 f?vr. 2009) | 1 line Tweak the docs for Counter() objects. ................ r69279 | raymond.hettinger | 2009-02-04 20:45:13 +0100 (mer., 04 f?vr. 2009) | 1 line Minor doc fixes. ................ r69280 | benjamin.peterson | 2009-02-05 01:05:45 +0100 (jeu., 05 f?vr. 2009) | 8 lines Blocked revisions 69276 via svnmerge ........ r69276 | raymond.hettinger | 2009-02-04 13:25:17 -0600 (Wed, 04 Feb 2009) | 1 line Clarify that named tuples do not have to subclass tuple. ........ ................ r69281 | brett.cannon | 2009-02-05 03:52:18 +0100 (jeu., 05 f?vr. 2009) | 3 lines Rename importlib._bootstrap.SysPathFinder to PathFinder and expose off of importlib.machinery. Also make the methods either class or staticmethods. ................ r69282 | brett.cannon | 2009-02-05 03:52:57 +0100 (jeu., 05 f?vr. 2009) | 2 lines Check in the fact that importlib.machinery.PathFinder now exists. ................ r69283 | brett.cannon | 2009-02-05 03:53:23 +0100 (jeu., 05 f?vr. 2009) | 2 lines Begin writing tests for importlib.machinery.PathFinder. ................ r69284 | brett.cannon | 2009-02-05 03:53:47 +0100 (jeu., 05 f?vr. 2009) | 2 lines Update NOTES for importlib about PathFinder. ................ r69287 | tarek.ziade | 2009-02-05 10:08:59 +0100 (jeu., 05 f?vr. 2009) | 9 lines Merged revisions 69285 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69285 | tarek.ziade | 2009-02-05 10:06:23 +0100 (Thu, 05 Feb 2009) | 1 line Fix comment for #1835 ........ ................ r69290 | georg.brandl | 2009-02-05 11:40:48 +0100 (jeu., 05 f?vr. 2009) | 1 line #5130: replace "unicode" by "bytes" in examples for sequence types. ................ r69291 | georg.brandl | 2009-02-05 11:47:16 +0100 (jeu., 05 f?vr. 2009) | 1 line #5107: document that default encoding is the same as locale.getpreferredencoding(). ................ r69292 | georg.brandl | 2009-02-05 11:56:37 +0100 (jeu., 05 f?vr. 2009) | 1 line #5096: document PyErr_PrintEx(). ................ r69294 | georg.brandl | 2009-02-05 12:01:54 +0100 (jeu., 05 f?vr. 2009) | 1 line #4992: next() method -> next() function. ................ r69296 | georg.brandl | 2009-02-05 12:24:04 +0100 (jeu., 05 f?vr. 2009) | 8 lines Blocked revisions 69295 via svnmerge ........ r69295 | georg.brandl | 2009-02-05 12:23:47 +0100 (Do, 05 Feb 2009) | 1 line PyErr_PrintEx is also in 2.x... ........ ................ r69306 | neil.schemenauer | 2009-02-05 17:33:41 +0100 (jeu., 05 f?vr. 2009) | 3 lines Fix get_python_inc() to work when building in a directory separate from the source. Also, define 'srcdir' on non-posix platforms. ................ r69307 | neil.schemenauer | 2009-02-05 17:35:04 +0100 (jeu., 05 f?vr. 2009) | 4 lines Since sysconfig.get_python_inc() now works when building in a directory other than the source directory, simplify the test code in test_sysconfig.py. ................ r69308 | neil.schemenauer | 2009-02-05 17:35:45 +0100 (jeu., 05 f?vr. 2009) | 4 lines Make setup.py work when building in a directory other than the source directory. Mainly, use 'srcdir' rather than os.getcwd() or '.'. ................ r69313 | brett.cannon | 2009-02-05 23:02:03 +0100 (jeu., 05 f?vr. 2009) | 3 lines Implement test for sys.path_importer_cache having None for importlib.machinery.PathFinder. ................ r69318 | tarek.ziade | 2009-02-05 23:56:14 +0100 (jeu., 05 f?vr. 2009) | 9 lines Merged revisions 69316 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69316 | tarek.ziade | 2009-02-05 23:52:52 +0100 (Thu, 05 Feb 2009) | 1 line Fixed #5132: enable extensions to link on Solaris ........ ................ r69320 | brett.cannon | 2009-02-06 00:36:02 +0100 (ven., 06 f?vr. 2009) | 2 lines Add tests for using sys.path_hooks by importlib.machinery.PathFinder. ................ r69321 | brett.cannon | 2009-02-06 01:07:49 +0100 (ven., 06 f?vr. 2009) | 3 lines Finish implementing tests for importlib.machinery.PathFinder by testing that implicit hooks are handled properly. ................ r69323 | neil.schemenauer | 2009-02-06 01:27:50 +0100 (ven., 06 f?vr. 2009) | 2 lines Distutils apparently requires an absolute path so provide one. ................ r69326 | tarek.ziade | 2009-02-06 01:38:35 +0100 (ven., 06 f?vr. 2009) | 9 lines Merged revisions 69324 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69324 | tarek.ziade | 2009-02-06 01:31:59 +0100 (Fri, 06 Feb 2009) | 1 line Fixed #1276768: verbose option was not used in the code. ........ ................ r69335 | tarek.ziade | 2009-02-06 01:52:52 +0100 (ven., 06 f?vr. 2009) | 9 lines Merged revisions 69330 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69330 | tarek.ziade | 2009-02-06 01:46:57 +0100 (Fri, 06 Feb 2009) | 1 line README now reflects the current state ........ ................ r69336 | tarek.ziade | 2009-02-06 01:53:43 +0100 (ven., 06 f?vr. 2009) | 9 lines Merged revisions 69332 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69332 | tarek.ziade | 2009-02-06 01:49:45 +0100 (Fri, 06 Feb 2009) | 1 line using >= so setting verbose to 2 will work as well ........ ................ r69344 | tarek.ziade | 2009-02-06 02:18:36 +0100 (ven., 06 f?vr. 2009) | 9 lines Merged revisions 69342 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69342 | tarek.ziade | 2009-02-06 02:15:51 +0100 (Fri, 06 Feb 2009) | 1 line fixed #1520877: now distutils reads Read from the environment/Makefile ........ ................ r69346 | eric.smith | 2009-02-06 02:32:42 +0100 (ven., 06 f?vr. 2009) | 10 lines Merged revisions 69331 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69331 | eric.smith | 2009-02-05 19:48:26 -0500 (Thu, 05 Feb 2009) | 2 lines Implement issue #4285, convert sys.version_info to a named tuple. Patch by Ross Light. ........ ................ r69349 | benjamin.peterson | 2009-02-06 03:02:07 +0100 (ven., 06 f?vr. 2009) | 75 lines Blocked revisions 69240,69242,69252-69253,69257,69262,69271-69273,69302-69305,69315,69322 via svnmerge ........ r69240 | raymond.hettinger | 2009-02-02 21:18:14 -0600 (Mon, 02 Feb 2009) | 1 line Record operator deprecations in docs. ........ r69242 | raymond.hettinger | 2009-02-02 21:37:03 -0600 (Mon, 02 Feb 2009) | 1 line Register decimals as numbers.Number ........ r69252 | brett.cannon | 2009-02-02 22:58:29 -0600 (Mon, 02 Feb 2009) | 3 lines Make importlib a package. This allows using svn:externals in the sandbox to package up the code for separate distribution. ........ r69253 | brett.cannon | 2009-02-02 22:59:58 -0600 (Mon, 02 Feb 2009) | 1 line Ignore bytecode files in importlib. ........ r69257 | brett.cannon | 2009-02-02 23:08:22 -0600 (Mon, 02 Feb 2009) | 1 line Backport importlib to at least Python 2.5 by getting rid of use of str.format. ........ r69262 | brett.cannon | 2009-02-03 15:13:05 -0600 (Tue, 03 Feb 2009) | 5 lines Make importlib backwards-compatible to Python 2.2 (but this is not promised to last; just doing it to be nice). Also fix a message for an exception. ........ r69271 | raymond.hettinger | 2009-02-04 04:52:32 -0600 (Wed, 04 Feb 2009) | 1 line Minor doc fixups. ........ r69272 | raymond.hettinger | 2009-02-04 05:14:18 -0600 (Wed, 04 Feb 2009) | 1 line Doc fixes. Remove overbroad, redundant warnings. Fixup example code. ........ r69273 | raymond.hettinger | 2009-02-04 05:31:30 -0600 (Wed, 04 Feb 2009) | 1 line Tweak the docs for Counter() objects. ........ r69302 | neil.schemenauer | 2009-02-05 10:14:39 -0600 (Thu, 05 Feb 2009) | 3 lines Fix get_python_inc() to work when building in a directory separate from the source. Also, define 'srcdir' on non-posix platforms. ........ r69303 | neil.schemenauer | 2009-02-05 10:19:05 -0600 (Thu, 05 Feb 2009) | 4 lines Since sysconfig.get_python_inc() now works when building in a directory other than the source directory, simplify the test code in test_sysconfig.py. ........ r69304 | neil.schemenauer | 2009-02-05 10:25:16 -0600 (Thu, 05 Feb 2009) | 4 lines Fix test_build_ext.py to work when building in a separate directory. Since "srcdir" should now be defined on all platforms, use it to find the module source. ........ r69305 | neil.schemenauer | 2009-02-05 10:32:29 -0600 (Thu, 05 Feb 2009) | 4 lines Make setup.py work when building in a directory other than the source directory. Mainly use 'srcdir' rather than os.getcwd() or '.'. ........ r69315 | neil.schemenauer | 2009-02-05 16:14:04 -0600 (Thu, 05 Feb 2009) | 2 lines Oops, Mac build needs the 'incdirlist' variable so restore it. ........ r69322 | neil.schemenauer | 2009-02-05 18:21:55 -0600 (Thu, 05 Feb 2009) | 2 lines Distutils apparently requires an absolute path so provide one. ........ ................ r69350 | benjamin.peterson | 2009-02-06 03:40:07 +0100 (ven., 06 f?vr. 2009) | 96 lines Merged revisions 69129-69131,69139-69140,69143,69154-69159,69169,69288-69289,69293,69297-69301,69348 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69129 | benjamin.peterson | 2009-01-30 19:42:55 -0600 (Fri, 30 Jan 2009) | 1 line check the errno in bad fd cases ........ r69130 | andrew.kuchling | 2009-01-30 20:50:09 -0600 (Fri, 30 Jan 2009) | 1 line Add a section ........ r69131 | andrew.kuchling | 2009-01-30 21:26:02 -0600 (Fri, 30 Jan 2009) | 1 line Text edits and markup fixes ........ r69139 | mark.dickinson | 2009-01-31 10:44:04 -0600 (Sat, 31 Jan 2009) | 2 lines Add an extra test for long <-> float hash equivalence. ........ r69140 | benjamin.peterson | 2009-01-31 10:52:03 -0600 (Sat, 31 Jan 2009) | 1 line PyErr_BadInternalCall() raises a SystemError, not TypeError #5112 ........ r69143 | benjamin.peterson | 2009-01-31 15:00:10 -0600 (Sat, 31 Jan 2009) | 1 line I believe the intention here was to avoid a global lookup ........ r69154 | benjamin.peterson | 2009-01-31 16:33:02 -0600 (Sat, 31 Jan 2009) | 1 line fix indentation in comment ........ r69155 | david.goodger | 2009-01-31 16:53:46 -0600 (Sat, 31 Jan 2009) | 1 line markup fix ........ r69156 | gregory.p.smith | 2009-01-31 16:57:30 -0600 (Sat, 31 Jan 2009) | 4 lines - Issue #5104: The socket module now raises OverflowError when 16-bit port and protocol numbers are supplied outside the allowed 0-65536 range on bind() and getservbyport(). ........ r69157 | benjamin.peterson | 2009-01-31 17:43:25 -0600 (Sat, 31 Jan 2009) | 1 line add explanatory comment ........ r69158 | benjamin.peterson | 2009-01-31 17:54:38 -0600 (Sat, 31 Jan 2009) | 1 line more flags which only work for function blocks ........ r69159 | gregory.p.smith | 2009-01-31 18:16:01 -0600 (Sat, 31 Jan 2009) | 2 lines Update doc wording as suggested in issue4903. ........ r69169 | guilherme.polo | 2009-01-31 20:56:16 -0600 (Sat, 31 Jan 2009) | 3 lines Restore Tkinter.Tk._loadtk so this test doesn't fail for problems related to ttk. ........ r69288 | georg.brandl | 2009-02-05 04:30:57 -0600 (Thu, 05 Feb 2009) | 1 line #5153: fix typo in example. ........ r69289 | georg.brandl | 2009-02-05 04:37:07 -0600 (Thu, 05 Feb 2009) | 1 line #5144: document that PySys_SetArgv prepends the script directory (or the empty string) to sys.path. ........ r69293 | georg.brandl | 2009-02-05 04:59:28 -0600 (Thu, 05 Feb 2009) | 1 line #5059: fix example. ........ r69297 | georg.brandl | 2009-02-05 05:32:18 -0600 (Thu, 05 Feb 2009) | 1 line #5015: document PythonHome API functions. ........ r69298 | georg.brandl | 2009-02-05 05:33:21 -0600 (Thu, 05 Feb 2009) | 1 line #4827: fix callback example. ........ r69299 | georg.brandl | 2009-02-05 05:35:28 -0600 (Thu, 05 Feb 2009) | 1 line #4820: use correct module for ctypes.util. ........ r69300 | georg.brandl | 2009-02-05 05:38:23 -0600 (Thu, 05 Feb 2009) | 1 line #4563: disable alpha and roman lists, fixes wrong formatting of contributor list. ........ r69301 | georg.brandl | 2009-02-05 05:40:35 -0600 (Thu, 05 Feb 2009) | 1 line #5031: fix Thread.daemon property docs. ........ r69348 | benjamin.peterson | 2009-02-05 19:47:31 -0600 (Thu, 05 Feb 2009) | 1 line fix download link ........ ................ r69352 | brett.cannon | 2009-02-06 03:47:33 +0100 (ven., 06 f?vr. 2009) | 3 lines Initial, untested stab at writing a common denominator function for __import__ and import_module. ................ r69354 | benjamin.peterson | 2009-02-06 04:01:24 +0100 (ven., 06 f?vr. 2009) | 17 lines Merged revisions 69141,69211-69212 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69141 | benjamin.peterson | 2009-01-31 14:01:48 -0600 (Sat, 31 Jan 2009) | 1 line fix indentation ........ r69211 | guilherme.polo | 2009-02-02 14:23:29 -0600 (Mon, 02 Feb 2009) | 1 line Restore the previous geometry before leaving the test ........ r69212 | guilherme.polo | 2009-02-02 14:28:59 -0600 (Mon, 02 Feb 2009) | 1 line Moving to importlib ........ ................ r69358 | tarek.ziade | 2009-02-06 09:22:21 +0100 (ven., 06 f?vr. 2009) | 9 lines Merged revisions 69356 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69356 | tarek.ziade | 2009-02-06 09:20:15 +0100 (Fri, 06 Feb 2009) | 1 line Fixed #3987 : removed unused import ........ ................ r69362 | tarek.ziade | 2009-02-06 10:03:10 +0100 (ven., 06 f?vr. 2009) | 9 lines Merged revisions 69360 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69360 | tarek.ziade | 2009-02-06 09:55:23 +0100 (Fri, 06 Feb 2009) | 1 line removed types usage and added test coverage (work for #3986) ........ ................ r69368 | tarek.ziade | 2009-02-06 14:33:47 +0100 (ven., 06 f?vr. 2009) | 9 lines Merged revisions 69366 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69366 | tarek.ziade | 2009-02-06 14:27:38 +0100 (Fri, 06 Feb 2009) | 1 line Fixed #5167: test_customize_compiler does not apply under non unix compilers ........ ................ r69370 | mark.dickinson | 2009-02-06 17:39:11 +0100 (ven., 06 f?vr. 2009) | 3 lines Replace references to python-3000 mailing list with python-dev in README. ................ r69372 | georg.brandl | 2009-02-06 19:11:01 +0100 (ven., 06 f?vr. 2009) | 1 line #5173: StandardError wasn't removed in 2.6. ................ r69375 | neil.schemenauer | 2009-02-06 22:42:05 +0100 (ven., 06 f?vr. 2009) | 4 lines Make test_build_ext.py use sysconfig "srcdir" to find the source for xxmodule.c. Have sysconfig make the srcdir path absolute if that seems necessary (running non-installed Python outside the build directory). ................ r69379 | guilherme.polo | 2009-02-07 00:04:44 +0100 (sam., 07 f?vr. 2009) | 2 lines Fixing changes from the last merge. ................ r69380 | guilherme.polo | 2009-02-07 00:16:11 +0100 (sam., 07 f?vr. 2009) | 17 lines Merged revisions 69376-69377 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69376 | guilherme.polo | 2009-02-06 20:26:22 -0200 (Fri, 06 Feb 2009) | 3 lines Partial fix to issue #1731706: memory leak in Tkapp_Call when calling from a thread different than the one that created the Tcl interpreter. ........ r69377 | guilherme.polo | 2009-02-06 20:48:07 -0200 (Fri, 06 Feb 2009) | 5 lines Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will not be used again (this requires Tcl/Tk 8.3.1), also fix a memory leak in Tkapp_Call when calling from a thread different than the one that created the Tcl interpreter. ........ ................ r69387 | tarek.ziade | 2009-02-07 01:10:48 +0100 (sam., 07 f?vr. 2009) | 9 lines Merged revisions 69385 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69385 | tarek.ziade | 2009-02-07 01:05:39 +0100 (Sat, 07 Feb 2009) | 1 line #3986 replacing string and types call (like in the Py3k branch), and put exec_msg call at the right place ........ ................ r69392 | guilherme.polo | 2009-02-07 01:45:10 +0100 (sam., 07 f?vr. 2009) | 1 line long -> int ................ r69395 | brett.cannon | 2009-02-07 02:15:27 +0100 (sam., 07 f?vr. 2009) | 8 lines Rewrite the code implementing __import__ for importlib. Now it is much simpler and relies much more on meta path finders to abstract out various parts of import. As part of this the semantics for import_module tightened up and now follow __import__ much more closely (biggest thing is that the 'package' argument must now already be imported, else a SystemError is raised). ................ r69396 | benjamin.peterson | 2009-02-07 02:35:08 +0100 (sam., 07 f?vr. 2009) | 29 lines Blocked revisions 69373-69374,69389,69394 via svnmerge ........ r69373 | neil.schemenauer | 2009-02-06 15:08:52 -0600 (Fri, 06 Feb 2009) | 5 lines Overhaul Lib/compiler block ordering. The previous code was filled with hacks. The new code is based on issue #2472 posted by Antoine Pitrou. I did some further cleanups of the pyassem code and optimized the block ordering pass. ........ r69374 | neil.schemenauer | 2009-02-06 15:33:45 -0600 (Fri, 06 Feb 2009) | 6 lines Convert "srcdir" into an absolute path if that seems prudent. Currrently the only user of this is Lib/distutils/tests/test_build_ext.py (in order to find the source for xxmodule.c). I'm not sure if other platforms need similar tweaks, I'm not brave enough to attempt it without being able to test. ........ r69389 | neil.schemenauer | 2009-02-06 18:13:39 -0600 (Fri, 06 Feb 2009) | 2 lines Make names generated for 'with' variables match the built-in compiler. ........ r69394 | neil.schemenauer | 2009-02-06 18:54:41 -0600 (Fri, 06 Feb 2009) | 4 lines Issue #999042: The Python compiler now handles explict global statements correctly (should be assigned using STORE_GLOBAL opcode). This was done by having the system table differentiate between explict and implicit globals. ........ ................ r69397 | brett.cannon | 2009-02-07 02:38:38 +0100 (sam., 07 f?vr. 2009) | 2 lines Move importlib's frozen importer over to rpartition for setting __package__. ................ r69398 | brett.cannon | 2009-02-07 02:40:19 +0100 (sam., 07 f?vr. 2009) | 2 lines Move importlib's built-in importer to use rpartition for __package__. ................ r69399 | brett.cannon | 2009-02-07 02:52:25 +0100 (sam., 07 f?vr. 2009) | 3 lines Move importlib completely over to using rpartition and accepting the empty string for top-level modules. ................ r69400 | brett.cannon | 2009-02-07 02:57:14 +0100 (sam., 07 f?vr. 2009) | 1 line Add a note for importlib about backporting some of functools.wraps functionality. ................ r69401 | brett.cannon | 2009-02-07 03:06:43 +0100 (sam., 07 f?vr. 2009) | 2 lines Factor out helper code from importlib.test.extension.test_path_hook. ................ r69402 | brett.cannon | 2009-02-07 03:13:28 +0100 (sam., 07 f?vr. 2009) | 2 lines Create a simple substitute for functools.wraps to use in importlib._bootstrap. ................ r69403 | brett.cannon | 2009-02-07 03:14:07 +0100 (sam., 07 f?vr. 2009) | 3 lines Update NOTES for importlib now that a replacement for functools.wraps is available. ................ r69406 | guilherme.polo | 2009-02-07 03:33:47 +0100 (sam., 07 f?vr. 2009) | 9 lines Merged revisions 69404 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69404 | guilherme.polo | 2009-02-07 00:20:29 -0200 (Sat, 07 Feb 2009) | 2 lines Eliminated the need to use ttk.__loadtk__ and the problems related it. ........ ................ r69407 | brett.cannon | 2009-02-07 03:33:52 +0100 (sam., 07 f?vr. 2009) | 2 lines Add the missing importlib.test.extension.util. ................ r69411 | antoine.pitrou | 2009-02-07 18:13:31 +0100 (sam., 07 f?vr. 2009) | 4 lines Issue #4704: remove use of cmp() in pybench, bump its version number to 2.1, and make it 2.6-compatible. ................ r69416 | benjamin.peterson | 2009-02-07 23:55:24 +0100 (sam., 07 f?vr. 2009) | 1 line fix typo and test_urllib failures ................ r69418 | benjamin.peterson | 2009-02-08 01:29:20 +0100 (dim., 08 f?vr. 2009) | 1 line revert 69416; it didn't help much ................ r69421 | nick.coghlan | 2009-02-08 02:58:26 +0100 (dim., 08 f?vr. 2009) | 13 lines Merged revisions 69419-69420 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69419 | nick.coghlan | 2009-02-08 11:26:34 +1000 (Sun, 08 Feb 2009) | 1 line Issue 4195: Restore the ability to execute packages with the -m switch (but this time in a way that leaves the import machinery in a valid state). (Original patch by Andi Vajda) ........ r69420 | nick.coghlan | 2009-02-08 11:46:01 +1000 (Sun, 08 Feb 2009) | 1 line Mention patch submitter in NEWS entry for r69419 ........ ................ r69426 | nick.coghlan | 2009-02-08 04:37:27 +0100 (dim., 08 f?vr. 2009) | 9 lines Merged revisions 69425 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69425 | nick.coghlan | 2009-02-08 13:17:00 +1000 (Sun, 08 Feb 2009) | 1 line Issue #4512 closeout: Make ZipImport.get_filename() a public method ........ ................ r69429 | nick.coghlan | 2009-02-08 05:01:00 +0100 (dim., 08 f?vr. 2009) | 1 line Fix broken socket.makefile emulation in test_urllib ................ r69431 | mark.dickinson | 2009-02-08 12:02:10 +0100 (dim., 08 f?vr. 2009) | 4 lines Issue #1717: add a DeprecationWarning in 3.x on type initialization for types that implement tp_reserved (formerly tp_compare) but not tp_richcompare. ................ r69434 | mark.dickinson | 2009-02-08 15:00:21 +0100 (dim., 08 f?vr. 2009) | 8 lines Blocked revisions 69433 via svnmerge ........ r69433 | mark.dickinson | 2009-02-08 13:58:10 +0000 (Sun, 08 Feb 2009) | 2 lines Remove redundant assignment in _PyObject_LengthHint ........ ................ r69438 | benjamin.peterson | 2009-02-08 16:00:52 +0100 (dim., 08 f?vr. 2009) | 1 line remove memoryview.__str__ #5182 ................ r69440 | mark.dickinson | 2009-02-08 16:09:21 +0100 (dim., 08 f?vr. 2009) | 17 lines Merged revisions 69436 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69436 | mark.dickinson | 2009-02-08 14:42:28 +0000 (Sun, 08 Feb 2009) | 10 lines Issue #789290: make sure that hash(2**63) == hash(2.**63) on 64-bit platforms. The previous code was fragile, depending on the twin accidents that: (1) in C, casting the double value 2.**63 to long returns the integer value -2**63, and (2) in Python, hash(-2**63) == hash(2**63). There's already a test for this in test_hash. ........ ................ r69444 | mark.dickinson | 2009-02-08 18:39:43 +0100 (dim., 08 f?vr. 2009) | 8 lines Blocked revisions 69443 via svnmerge ........ r69443 | mark.dickinson | 2009-02-08 17:33:11 +0000 (Sun, 08 Feb 2009) | 2 lines Silence 'arg may be used uninitialized in this function' warning from gcc. ........ ................ Added: python/branches/io-c/Demo/tkinter/ttk/ - copied from r69444, /python/branches/py3k/Demo/tkinter/ttk/ python/branches/io-c/Doc/library/tkinter.ttk.rst - copied unchanged from r69444, /python/branches/py3k/Doc/library/tkinter.ttk.rst python/branches/io-c/Lib/distutils/tests/test_cmd.py - copied unchanged from r69444, /python/branches/py3k/Lib/distutils/tests/test_cmd.py python/branches/io-c/Lib/distutils/tests/test_dir_util.py - copied unchanged from r69444, /python/branches/py3k/Lib/distutils/tests/test_dir_util.py python/branches/io-c/Lib/distutils/tests/test_file_util.py - copied unchanged from r69444, /python/branches/py3k/Lib/distutils/tests/test_file_util.py python/branches/io-c/Lib/importlib/test/abc.py - copied unchanged from r69444, /python/branches/py3k/Lib/importlib/test/abc.py python/branches/io-c/Lib/importlib/test/extension/util.py - copied unchanged from r69444, /python/branches/py3k/Lib/importlib/test/extension/util.py python/branches/io-c/Lib/importlib/test/import_/util.py - copied unchanged from r69444, /python/branches/py3k/Lib/importlib/test/import_/util.py python/branches/io-c/Lib/importlib/test/source/util.py - copied unchanged from r69444, /python/branches/py3k/Lib/importlib/test/source/util.py python/branches/io-c/Lib/importlib/test/util.py - copied unchanged from r69444, /python/branches/py3k/Lib/importlib/test/util.py python/branches/io-c/Lib/test/test_ttk_guionly.py - copied unchanged from r69444, /python/branches/py3k/Lib/test/test_ttk_guionly.py python/branches/io-c/Lib/test/test_ttk_textonly.py - copied unchanged from r69444, /python/branches/py3k/Lib/test/test_ttk_textonly.py python/branches/io-c/Lib/tkinter/test/ - copied from r69444, /python/branches/py3k/Lib/tkinter/test/ python/branches/io-c/Lib/tkinter/ttk.py - copied unchanged from r69444, /python/branches/py3k/Lib/tkinter/ttk.py Removed: python/branches/io-c/Lib/importlib/test/finder_tests.py python/branches/io-c/Lib/importlib/test/frozen/support.py python/branches/io-c/Lib/importlib/test/loader_tests.py python/branches/io-c/Lib/importlib/test/source/test_reload.py python/branches/io-c/Lib/importlib/test/support.py python/branches/io-c/Modules/_ctypes/libffi_msvc/win32.S Modified: python/branches/io-c/ (props changed) python/branches/io-c/Demo/tkinter/README python/branches/io-c/Doc/c-api/allocation.rst (props changed) python/branches/io-c/Doc/c-api/arg.rst (props changed) python/branches/io-c/Doc/c-api/bool.rst (props changed) python/branches/io-c/Doc/c-api/buffer.rst (props changed) python/branches/io-c/Doc/c-api/bytearray.rst (props changed) python/branches/io-c/Doc/c-api/bytes.rst (props changed) python/branches/io-c/Doc/c-api/cell.rst (props changed) python/branches/io-c/Doc/c-api/cobject.rst (props changed) python/branches/io-c/Doc/c-api/complex.rst (props changed) python/branches/io-c/Doc/c-api/conversion.rst (props changed) python/branches/io-c/Doc/c-api/datetime.rst (props changed) python/branches/io-c/Doc/c-api/descriptor.rst (props changed) python/branches/io-c/Doc/c-api/dict.rst (props changed) python/branches/io-c/Doc/c-api/exceptions.rst python/branches/io-c/Doc/c-api/file.rst (props changed) python/branches/io-c/Doc/c-api/float.rst (props changed) python/branches/io-c/Doc/c-api/function.rst (props changed) python/branches/io-c/Doc/c-api/gcsupport.rst (props changed) python/branches/io-c/Doc/c-api/gen.rst (props changed) python/branches/io-c/Doc/c-api/import.rst (props changed) python/branches/io-c/Doc/c-api/init.rst python/branches/io-c/Doc/c-api/iter.rst (props changed) python/branches/io-c/Doc/c-api/iterator.rst (props changed) python/branches/io-c/Doc/c-api/list.rst (props changed) python/branches/io-c/Doc/c-api/long.rst (props changed) python/branches/io-c/Doc/c-api/mapping.rst (props changed) python/branches/io-c/Doc/c-api/marshal.rst (props changed) python/branches/io-c/Doc/c-api/method.rst (props changed) python/branches/io-c/Doc/c-api/module.rst (props changed) python/branches/io-c/Doc/c-api/none.rst (props changed) python/branches/io-c/Doc/c-api/number.rst (props changed) python/branches/io-c/Doc/c-api/objbuffer.rst (props changed) python/branches/io-c/Doc/c-api/object.rst (contents, props changed) python/branches/io-c/Doc/c-api/objimpl.rst (props changed) python/branches/io-c/Doc/c-api/reflection.rst (props changed) python/branches/io-c/Doc/c-api/sequence.rst (props changed) python/branches/io-c/Doc/c-api/set.rst (props changed) python/branches/io-c/Doc/c-api/slice.rst (props changed) python/branches/io-c/Doc/c-api/structures.rst (props changed) python/branches/io-c/Doc/c-api/sys.rst (props changed) python/branches/io-c/Doc/c-api/tuple.rst (props changed) python/branches/io-c/Doc/c-api/type.rst (props changed) python/branches/io-c/Doc/c-api/typeobj.rst (contents, props changed) python/branches/io-c/Doc/c-api/unicode.rst (props changed) python/branches/io-c/Doc/c-api/weakref.rst (props changed) python/branches/io-c/Doc/documenting/markup.rst python/branches/io-c/Doc/extending/newtypes.rst python/branches/io-c/Doc/glossary.rst python/branches/io-c/Doc/includes/noddy.c python/branches/io-c/Doc/includes/noddy2.c python/branches/io-c/Doc/includes/noddy3.c python/branches/io-c/Doc/includes/noddy4.c python/branches/io-c/Doc/includes/shoddy.c python/branches/io-c/Doc/includes/sqlite3/collation_reverse.py python/branches/io-c/Doc/includes/typestruct.h python/branches/io-c/Doc/library/ast.rst (props changed) python/branches/io-c/Doc/library/binascii.rst python/branches/io-c/Doc/library/collections.rst python/branches/io-c/Doc/library/copyreg.rst (props changed) python/branches/io-c/Doc/library/ctypes.rst python/branches/io-c/Doc/library/datetime.rst python/branches/io-c/Doc/library/fractions.rst (props changed) python/branches/io-c/Doc/library/functions.rst python/branches/io-c/Doc/library/html.entities.rst (props changed) python/branches/io-c/Doc/library/importlib.rst (contents, props changed) python/branches/io-c/Doc/library/io.rst (props changed) python/branches/io-c/Doc/library/itertools.rst python/branches/io-c/Doc/library/json.rst (props changed) python/branches/io-c/Doc/library/locale.rst python/branches/io-c/Doc/library/multiprocessing.rst (props changed) python/branches/io-c/Doc/library/operator.rst python/branches/io-c/Doc/library/optparse.rst python/branches/io-c/Doc/library/plistlib.rst (props changed) python/branches/io-c/Doc/library/queue.rst python/branches/io-c/Doc/library/reprlib.rst (props changed) python/branches/io-c/Doc/library/runpy.rst python/branches/io-c/Doc/library/shelve.rst python/branches/io-c/Doc/library/sys.rst python/branches/io-c/Doc/library/threading.rst python/branches/io-c/Doc/library/tk.rst python/branches/io-c/Doc/library/unittest.rst python/branches/io-c/Doc/library/zipimport.rst python/branches/io-c/Doc/library/zlib.rst python/branches/io-c/Doc/reference/datamodel.rst python/branches/io-c/Doc/reference/executionmodel.rst python/branches/io-c/Doc/reference/expressions.rst python/branches/io-c/Doc/reference/grammar.rst (props changed) python/branches/io-c/Doc/reference/simple_stmts.rst python/branches/io-c/Doc/tools/sphinxext/download.html python/branches/io-c/Doc/tools/sphinxext/pyspecific.py python/branches/io-c/Doc/tutorial/floatingpoint.rst python/branches/io-c/Doc/tutorial/modules.rst python/branches/io-c/Doc/using/cmdline.rst python/branches/io-c/Doc/whatsnew/2.7.rst (contents, props changed) python/branches/io-c/Doc/whatsnew/3.0.rst python/branches/io-c/Include/abstract.h python/branches/io-c/Include/code.h python/branches/io-c/Include/object.h python/branches/io-c/Lib/_abcoll.py python/branches/io-c/Lib/colorsys.py python/branches/io-c/Lib/decimal.py python/branches/io-c/Lib/distutils/README python/branches/io-c/Lib/distutils/__init__.py python/branches/io-c/Lib/distutils/cmd.py python/branches/io-c/Lib/distutils/command/build_ext.py python/branches/io-c/Lib/distutils/command/install_lib.py python/branches/io-c/Lib/distutils/command/wininst-9.0-amd64.exe python/branches/io-c/Lib/distutils/command/wininst-9.0.exe python/branches/io-c/Lib/distutils/dir_util.py python/branches/io-c/Lib/distutils/file_util.py python/branches/io-c/Lib/distutils/sysconfig.py python/branches/io-c/Lib/distutils/tests/test_build_ext.py python/branches/io-c/Lib/distutils/tests/test_sdist.py python/branches/io-c/Lib/distutils/tests/test_sysconfig.py python/branches/io-c/Lib/heapq.py python/branches/io-c/Lib/http/client.py python/branches/io-c/Lib/importlib/NOTES python/branches/io-c/Lib/importlib/__init__.py python/branches/io-c/Lib/importlib/_bootstrap.py python/branches/io-c/Lib/importlib/machinery.py python/branches/io-c/Lib/importlib/test/__init__.py python/branches/io-c/Lib/importlib/test/builtin/test_finder.py python/branches/io-c/Lib/importlib/test/builtin/test_loader.py python/branches/io-c/Lib/importlib/test/extension/test_case_sensitivity.py python/branches/io-c/Lib/importlib/test/extension/test_finder.py python/branches/io-c/Lib/importlib/test/extension/test_loader.py python/branches/io-c/Lib/importlib/test/extension/test_path_hook.py python/branches/io-c/Lib/importlib/test/frozen/test_finder.py python/branches/io-c/Lib/importlib/test/frozen/test_loader.py python/branches/io-c/Lib/importlib/test/import_/test___package__.py python/branches/io-c/Lib/importlib/test/import_/test_caching.py python/branches/io-c/Lib/importlib/test/import_/test_fromlist.py python/branches/io-c/Lib/importlib/test/import_/test_meta_path.py python/branches/io-c/Lib/importlib/test/import_/test_packages.py python/branches/io-c/Lib/importlib/test/import_/test_path.py python/branches/io-c/Lib/importlib/test/import_/test_relative_imports.py python/branches/io-c/Lib/importlib/test/source/test_case_sensitivity.py python/branches/io-c/Lib/importlib/test/source/test_finder.py python/branches/io-c/Lib/importlib/test/source/test_loader.py python/branches/io-c/Lib/importlib/test/source/test_path_hook.py python/branches/io-c/Lib/importlib/test/source/test_source_encoding.py python/branches/io-c/Lib/importlib/test/test_api.py python/branches/io-c/Lib/posixpath.py python/branches/io-c/Lib/runpy.py python/branches/io-c/Lib/shelve.py python/branches/io-c/Lib/shutil.py python/branches/io-c/Lib/test/regrtest.py python/branches/io-c/Lib/test/test_builtin.py python/branches/io-c/Lib/test/test_cmd_line_script.py python/branches/io-c/Lib/test/test_collections.py python/branches/io-c/Lib/test/test_decimal.py python/branches/io-c/Lib/test/test_descr.py python/branches/io-c/Lib/test/test_funcattrs.py python/branches/io-c/Lib/test/test_hash.py python/branches/io-c/Lib/test/test_iterlen.py python/branches/io-c/Lib/test/test_itertools.py python/branches/io-c/Lib/test/test_long.py python/branches/io-c/Lib/test/test_os.py python/branches/io-c/Lib/test/test_parser.py python/branches/io-c/Lib/test/test_shutil.py python/branches/io-c/Lib/test/test_socket.py python/branches/io-c/Lib/test/test_sys.py python/branches/io-c/Lib/test/test_tcl.py python/branches/io-c/Lib/test/test_urllib.py python/branches/io-c/Lib/test/test_urllib2net.py python/branches/io-c/Lib/test/test_zipimport.py python/branches/io-c/Lib/trace.py python/branches/io-c/Lib/xmlrpc/client.py python/branches/io-c/Makefile.pre.in python/branches/io-c/Misc/ACKS python/branches/io-c/Misc/NEWS python/branches/io-c/Modules/_bytesio.c python/branches/io-c/Modules/_collectionsmodule.c python/branches/io-c/Modules/_csv.c python/branches/io-c/Modules/_ctypes/_ctypes.c python/branches/io-c/Modules/_ctypes/callbacks.c python/branches/io-c/Modules/_ctypes/callproc.c python/branches/io-c/Modules/_ctypes/cfield.c python/branches/io-c/Modules/_ctypes/libffi_msvc/ffi.c python/branches/io-c/Modules/_ctypes/libffi_msvc/win32.c python/branches/io-c/Modules/_ctypes/stgdict.c python/branches/io-c/Modules/_curses_panel.c python/branches/io-c/Modules/_cursesmodule.c python/branches/io-c/Modules/_dbmmodule.c python/branches/io-c/Modules/_elementtree.c python/branches/io-c/Modules/_fileio.c python/branches/io-c/Modules/_functoolsmodule.c python/branches/io-c/Modules/_gdbmmodule.c python/branches/io-c/Modules/_hashopenssl.c python/branches/io-c/Modules/_localemodule.c python/branches/io-c/Modules/_lsprof.c python/branches/io-c/Modules/_multiprocessing/connection.h python/branches/io-c/Modules/_multiprocessing/semaphore.c python/branches/io-c/Modules/_pickle.c python/branches/io-c/Modules/_randommodule.c python/branches/io-c/Modules/_sqlite/cache.c python/branches/io-c/Modules/_sqlite/connection.c python/branches/io-c/Modules/_sqlite/cursor.c python/branches/io-c/Modules/_sqlite/prepare_protocol.c python/branches/io-c/Modules/_sqlite/row.c python/branches/io-c/Modules/_sqlite/statement.c python/branches/io-c/Modules/_sre.c python/branches/io-c/Modules/_ssl.c python/branches/io-c/Modules/_stringio.c python/branches/io-c/Modules/_struct.c python/branches/io-c/Modules/_testcapimodule.c python/branches/io-c/Modules/_threadmodule.c python/branches/io-c/Modules/_tkinter.c python/branches/io-c/Modules/arraymodule.c python/branches/io-c/Modules/bz2module.c python/branches/io-c/Modules/cjkcodecs/multibytecodec.c python/branches/io-c/Modules/datetimemodule.c python/branches/io-c/Modules/itertoolsmodule.c python/branches/io-c/Modules/md5module.c python/branches/io-c/Modules/mmapmodule.c python/branches/io-c/Modules/operator.c python/branches/io-c/Modules/ossaudiodev.c python/branches/io-c/Modules/parsermodule.c python/branches/io-c/Modules/pyexpat.c python/branches/io-c/Modules/selectmodule.c python/branches/io-c/Modules/sha1module.c python/branches/io-c/Modules/sha256module.c python/branches/io-c/Modules/sha512module.c python/branches/io-c/Modules/socketmodule.c python/branches/io-c/Modules/unicodedata.c python/branches/io-c/Modules/xxmodule.c python/branches/io-c/Modules/xxsubtype.c python/branches/io-c/Modules/zipimport.c python/branches/io-c/Modules/zlibmodule.c python/branches/io-c/Objects/abstract.c python/branches/io-c/Objects/boolobject.c python/branches/io-c/Objects/bytearrayobject.c python/branches/io-c/Objects/bytesobject.c python/branches/io-c/Objects/cellobject.c python/branches/io-c/Objects/classobject.c python/branches/io-c/Objects/cobject.c python/branches/io-c/Objects/codeobject.c python/branches/io-c/Objects/complexobject.c python/branches/io-c/Objects/descrobject.c python/branches/io-c/Objects/dictobject.c python/branches/io-c/Objects/enumobject.c python/branches/io-c/Objects/exceptions.c python/branches/io-c/Objects/fileobject.c python/branches/io-c/Objects/floatobject.c python/branches/io-c/Objects/frameobject.c python/branches/io-c/Objects/funcobject.c python/branches/io-c/Objects/genobject.c python/branches/io-c/Objects/iterobject.c python/branches/io-c/Objects/listobject.c python/branches/io-c/Objects/longobject.c python/branches/io-c/Objects/memoryobject.c python/branches/io-c/Objects/methodobject.c python/branches/io-c/Objects/moduleobject.c python/branches/io-c/Objects/object.c python/branches/io-c/Objects/rangeobject.c python/branches/io-c/Objects/setobject.c python/branches/io-c/Objects/sliceobject.c python/branches/io-c/Objects/stringlib/string_format.h python/branches/io-c/Objects/structseq.c python/branches/io-c/Objects/tupleobject.c python/branches/io-c/Objects/typeobject.c python/branches/io-c/Objects/unicodeobject.c python/branches/io-c/Objects/weakrefobject.c python/branches/io-c/PC/_msi.c python/branches/io-c/PC/_subprocess.c python/branches/io-c/PC/bdist_wininst/install.c python/branches/io-c/PC/dl_nt.c python/branches/io-c/PC/getpathp.c python/branches/io-c/PC/winreg.c python/branches/io-c/PCbuild/bdist_wininst.vcproj python/branches/io-c/Parser/asdl_c.py python/branches/io-c/Python/Python-ast.c python/branches/io-c/Python/bltinmodule.c python/branches/io-c/Python/compile.c python/branches/io-c/Python/dynload_win.c python/branches/io-c/Python/import.c python/branches/io-c/Python/makeopcodetargets.py python/branches/io-c/Python/symtable.c python/branches/io-c/Python/sysmodule.c python/branches/io-c/Python/traceback.c python/branches/io-c/README python/branches/io-c/Tools/framer/framer/slots.py python/branches/io-c/Tools/pybench/Calls.py python/branches/io-c/Tools/pybench/CommandLine.py python/branches/io-c/Tools/pybench/README python/branches/io-c/Tools/pybench/Strings.py python/branches/io-c/Tools/pybench/pybench.py python/branches/io-c/Tools/pybench/systimes.py python/branches/io-c/setup.py Modified: python/branches/io-c/Demo/tkinter/README ============================================================================== --- python/branches/io-c/Demo/tkinter/README (original) +++ python/branches/io-c/Demo/tkinter/README Sun Feb 8 21:39:02 2009 @@ -8,3 +8,4 @@ guido my original example set (fairly random collection) matt Matt Conway's examples, to go with his lifesaver document +ttk Examples using the ttk module Modified: python/branches/io-c/Doc/c-api/exceptions.rst ============================================================================== --- python/branches/io-c/Doc/c-api/exceptions.rst (original) +++ python/branches/io-c/Doc/c-api/exceptions.rst Sun Feb 8 21:39:02 2009 @@ -35,12 +35,21 @@ Either alphabetical or some kind of structure. -.. cfunction:: void PyErr_Print() +.. cfunction:: void PyErr_PrintEx(int set_sys_last_vars) Print a standard traceback to ``sys.stderr`` and clear the error indicator. Call this function only when the error indicator is set. (Otherwise it will cause a fatal error!) + If *set_sys_last_vars* is nonzero, the variables :data:`sys.last_type`, + :data:`sys.last_value` and :data:`sys.last_traceback` will be set to the + type, value and traceback of the printed exception, respectively. + + +.. cfunction:: void PyErr_Print() + + Alias for ``PyErr_PrintEx(1)``. + .. cfunction:: PyObject* PyErr_Occurred() @@ -271,9 +280,10 @@ .. cfunction:: void PyErr_BadInternalCall() - This is a shorthand for ``PyErr_SetString(PyExc_TypeError, message)``, where - *message* indicates that an internal operation (e.g. a Python/C API function) - was invoked with an illegal argument. It is mostly for internal use. + This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, + where *message* indicates that an internal operation (e.g. a Python/C API + function) was invoked with an illegal argument. It is mostly for internal + use. .. cfunction:: int PyErr_WarnEx(PyObject *category, char *message, int stacklevel) Modified: python/branches/io-c/Doc/c-api/init.rst ============================================================================== --- python/branches/io-c/Doc/c-api/init.rst (original) +++ python/branches/io-c/Doc/c-api/init.rst Sun Feb 8 21:39:02 2009 @@ -350,18 +350,36 @@ single: Py_FatalError() single: argv (in module sys) - Set ``sys.argv`` based on *argc* and *argv*. These parameters are similar to - those passed to the program's :cfunc:`main` function with the difference that - the first entry should refer to the script file to be executed rather than the - executable hosting the Python interpreter. If there isn't a script that will be - run, the first entry in *argv* can be an empty string. If this function fails - to initialize ``sys.argv``, a fatal condition is signalled using - :cfunc:`Py_FatalError`. + Set :data:`sys.argv` based on *argc* and *argv*. These parameters are + similar to those passed to the program's :cfunc:`main` function with the + difference that the first entry should refer to the script file to be + executed rather than the executable hosting the Python interpreter. If there + isn't a script that will be run, the first entry in *argv* can be an empty + string. If this function fails to initialize :data:`sys.argv`, a fatal + condition is signalled using :cfunc:`Py_FatalError`. + + This function also prepends the executed script's path to :data:`sys.path`. + If no script is executed (in the case of calling ``python -c`` or just the + interactive interpreter), the empty string is used instead. .. XXX impl. doesn't seem consistent in allowing 0/NULL for the params; check w/ Guido. +.. cfunction:: void Py_SetPythonHome(char *home) + + Set the default "home" directory, that is, the location of the standard + Python libraries. The libraries are searched in + :file:`{home}/lib/python{version}` and :file:`{home}/lib/python{version}`. + + +.. cfunction:: char* Py_GetPythonHome() + + Return the default "home", that is, the value set by a previous call to + :cfunc:`Py_SetPythonHome`, or the value of the :envvar:`PYTHONHOME` + environment variable if it is set. + + .. _threads: Thread State and the Global Interpreter Lock Modified: python/branches/io-c/Doc/c-api/object.rst ============================================================================== --- python/branches/io-c/Doc/c-api/object.rst (original) +++ python/branches/io-c/Doc/c-api/object.rst Sun Feb 8 21:39:02 2009 @@ -89,27 +89,6 @@ *opid*. -.. cfunction:: int PyObject_Cmp(PyObject *o1, PyObject *o2, int *result) - - .. index:: builtin: cmp - - Compare the values of *o1* and *o2* using a routine provided by *o1*, if one - exists, otherwise with a routine provided by *o2*. The result of the comparison - is returned in *result*. Returns ``-1`` on failure. This is the equivalent of - the Python statement ``result = cmp(o1, o2)``. - - -.. cfunction:: int PyObject_Compare(PyObject *o1, PyObject *o2) - - .. index:: builtin: cmp - - Compare the values of *o1* and *o2* using a routine provided by *o1*, if one - exists, otherwise with a routine provided by *o2*. Returns the result of the - comparison on success. On error, the value returned is undefined; use - :cfunc:`PyErr_Occurred` to detect an error. This is equivalent to the Python - expression ``cmp(o1, o2)``. - - .. cfunction:: PyObject* PyObject_Repr(PyObject *o) .. index:: builtin: repr Modified: python/branches/io-c/Doc/c-api/typeobj.rst ============================================================================== --- python/branches/io-c/Doc/c-api/typeobj.rst (original) +++ python/branches/io-c/Doc/c-api/typeobj.rst Sun Feb 8 21:39:02 2009 @@ -23,7 +23,7 @@ Typedefs: unaryfunc, binaryfunc, ternaryfunc, inquiry, intargfunc, intintargfunc, intobjargproc, intintobjargproc, objobjargproc, destructor, freefunc, printfunc, getattrfunc, getattrofunc, setattrfunc, setattrofunc, -cmpfunc, reprfunc, hashfunc +reprfunc, hashfunc The structure definition for :ctype:`PyTypeObject` can be found in :file:`Include/object.h`. For convenience of reference, this repeats the @@ -244,19 +244,9 @@ the subtype's :attr:`tp_setattr` and :attr:`tp_setattro` are both *NULL*. -.. cmember:: cmpfunc PyTypeObject.tp_compare +.. cmember:: void* PyTypeObject.tp_reserved - An optional pointer to the three-way comparison function. - - The signature is the same as for :cfunc:`PyObject_Compare`. The function should - return ``1`` if *self* greater than *other*, ``0`` if *self* is equal to - *other*, and ``-1`` if *self* less than *other*. It should return ``-1`` and - set an exception condition when an error occurred during the comparison. - - This field is inherited by subtypes together with :attr:`tp_richcompare` and - :attr:`tp_hash`: a subtypes inherits all three of :attr:`tp_compare`, - :attr:`tp_richcompare`, and :attr:`tp_hash` when the subtype's - :attr:`tp_compare`, :attr:`tp_richcompare`, and :attr:`tp_hash` are all *NULL*. + Reserved slot, formerly known as tp_compare. .. cmember:: reprfunc PyTypeObject.tp_repr @@ -329,14 +319,13 @@ the Python level will result in the ``tp_hash`` slot being set to :cfunc:`PyObject_HashNotImplemented`. - When this field is not set, two possibilities exist: if the :attr:`tp_compare` - and :attr:`tp_richcompare` fields are both *NULL*, a default hash value based on - the object's address is returned; otherwise, a :exc:`TypeError` is raised. - - This field is inherited by subtypes together with :attr:`tp_richcompare` and - :attr:`tp_compare`: a subtypes inherits all three of :attr:`tp_compare`, - :attr:`tp_richcompare`, and :attr:`tp_hash`, when the subtype's - :attr:`tp_compare`, :attr:`tp_richcompare` and :attr:`tp_hash` are all *NULL*. + When this field is not set, an attempt to take the hash of the + object raises :exc:`TypeError`. + + This field is inherited by subtypes together with + :attr:`tp_richcompare`: a subtype inherits both of + :attr:`tp_richcompare` and :attr:`tp_hash`, when the subtype's + :attr:`tp_richcompare` and :attr:`tp_hash` are both *NULL*. .. cmember:: ternaryfunc PyTypeObject.tp_call @@ -596,10 +585,10 @@ comparisons makes sense (e.g. ``==`` and ``!=``, but not ``<`` and friends), directly raise :exc:`TypeError` in the rich comparison function. - This field is inherited by subtypes together with :attr:`tp_compare` and - :attr:`tp_hash`: a subtype inherits all three of :attr:`tp_compare`, - :attr:`tp_richcompare`, and :attr:`tp_hash`, when the subtype's - :attr:`tp_compare`, :attr:`tp_richcompare`, and :attr:`tp_hash` are all *NULL*. + This field is inherited by subtypes together with :attr:`tp_hash`: + a subtype inherits :attr:`tp_richcompare` and :attr:`tp_hash` when + the subtype's :attr:`tp_richcompare` and :attr:`tp_hash` are both + *NULL*. The following constants are defined to be used as the third argument for :attr:`tp_richcompare` and for :cfunc:`PyObject_RichCompare`: Modified: python/branches/io-c/Doc/documenting/markup.rst ============================================================================== --- python/branches/io-c/Doc/documenting/markup.rst (original) +++ python/branches/io-c/Doc/documenting/markup.rst Sun Feb 8 21:39:02 2009 @@ -290,10 +290,22 @@ For all other roles, you have to write ``:rolename:`content```. -.. note:: +There are some additional facilities that make cross-referencing roles more +versatile: - For all cross-referencing roles, if you prefix the content with ``!``, no - reference/hyperlink will be created. +* You may supply an explicit title and reference target, like in reST direct + hyperlinks: ``:role:`title ``` will refer to *target*, but the link + text will be *title*. + +* If you prefix the content with ``!``, no reference/hyperlink will be created. + +* For the Python object roles, if you prefix the content with ``~``, the link + text will only be the last component of the target. For example, + ``:meth:`~Queue.Queue.get``` will refer to ``Queue.Queue.get`` but only + display ``get`` as the link text. + + In HTML output, the link's ``title`` attribute (that is e.g. shown as a + tool-tip on mouse-hover) will always be the full target name. The following roles refer to objects in modules and are possibly hyperlinked if a matching identifier is found: Modified: python/branches/io-c/Doc/extending/newtypes.rst ============================================================================== --- python/branches/io-c/Doc/extending/newtypes.rst (original) +++ python/branches/io-c/Doc/extending/newtypes.rst Sun Feb 8 21:39:02 2009 @@ -80,7 +80,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1484,10 +1484,10 @@ comes with the source distribution of Python. In order to learn how to implement any specific method for your new data type, -do the following: Download and unpack the Python source distribution. Go the -:file:`Objects` directory, then search the C source files for ``tp_`` plus the -function you want (for example, ``tp_compare``). You will find examples of the -function you want to implement. +do the following: Download and unpack the Python source distribution. Go to +the :file:`Objects` directory, then search the C source files for ``tp_`` plus +the function you want (for example, ``tp_richcompare``). You will find examples +of the function you want to implement. When you need to verify that an object is an instance of the type you are implementing, use the :cfunc:`PyObject_TypeCheck` function. A sample of its use Modified: python/branches/io-c/Doc/glossary.rst ============================================================================== --- python/branches/io-c/Doc/glossary.rst (original) +++ python/branches/io-c/Doc/glossary.rst Sun Feb 8 21:39:02 2009 @@ -393,7 +393,7 @@ also :term:`immutable`. named tuple - Any tuple subclass whose indexable elements are also accessible using + Any tuple-like class whose indexable elements are also accessible using named attributes (for example, :func:`time.localtime` returns a tuple-like object where the *year* is accessible either with an index such as ``t[0]`` or with a named attribute like ``t.tm_year``). @@ -484,7 +484,7 @@ indices via the :meth:`__getitem__` special method and defines a :meth:`len` method that returns the length of the sequence. Some built-in sequence types are :class:`list`, :class:`str`, - :class:`tuple`, and :class:`unicode`. Note that :class:`dict` also + :class:`tuple`, and :class:`bytes`. Note that :class:`dict` also supports :meth:`__getitem__` and :meth:`__len__`, but is considered a mapping rather than a sequence because the lookups use arbitrary :term:`immutable` keys rather than integers. Modified: python/branches/io-c/Doc/includes/noddy.c ============================================================================== --- python/branches/io-c/Doc/includes/noddy.c (original) +++ python/branches/io-c/Doc/includes/noddy.c Sun Feb 8 21:39:02 2009 @@ -14,7 +14,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Doc/includes/noddy2.c ============================================================================== --- python/branches/io-c/Doc/includes/noddy2.c (original) +++ python/branches/io-c/Doc/includes/noddy2.c Sun Feb 8 21:39:02 2009 @@ -131,7 +131,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Doc/includes/noddy3.c ============================================================================== --- python/branches/io-c/Doc/includes/noddy3.c (original) +++ python/branches/io-c/Doc/includes/noddy3.c Sun Feb 8 21:39:02 2009 @@ -184,7 +184,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Doc/includes/noddy4.c ============================================================================== --- python/branches/io-c/Doc/includes/noddy4.c (original) +++ python/branches/io-c/Doc/includes/noddy4.c Sun Feb 8 21:39:02 2009 @@ -165,7 +165,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Doc/includes/shoddy.c ============================================================================== --- python/branches/io-c/Doc/includes/shoddy.c (original) +++ python/branches/io-c/Doc/includes/shoddy.c Sun Feb 8 21:39:02 2009 @@ -39,7 +39,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Doc/includes/sqlite3/collation_reverse.py ============================================================================== --- python/branches/io-c/Doc/includes/sqlite3/collation_reverse.py (original) +++ python/branches/io-c/Doc/includes/sqlite3/collation_reverse.py Sun Feb 8 21:39:02 2009 @@ -1,7 +1,12 @@ import sqlite3 def collate_reverse(string1, string2): - return -cmp(string1, string2) + if string1 == string2: + return 0 + elif string1 < string2: + return 1 + else: + return -1 con = sqlite3.connect(":memory:") con.create_collation("reverse", collate_reverse) Modified: python/branches/io-c/Doc/includes/typestruct.h ============================================================================== --- python/branches/io-c/Doc/includes/typestruct.h (original) +++ python/branches/io-c/Doc/includes/typestruct.h Sun Feb 8 21:39:02 2009 @@ -9,7 +9,7 @@ printfunc tp_print; getattrfunc tp_getattr; setattrfunc tp_setattr; - cmpfunc tp_compare; + void *tp_reserved; reprfunc tp_repr; /* Method suites for standard classes */ Modified: python/branches/io-c/Doc/library/binascii.rst ============================================================================== --- python/branches/io-c/Doc/library/binascii.rst (original) +++ python/branches/io-c/Doc/library/binascii.rst Sun Feb 8 21:39:02 2009 @@ -120,11 +120,11 @@ To generate the same numeric value across all Python versions and platforms use crc32(data) & 0xffffffff. If you are only using the checksum in packed binary format this is not necessary as the - return value will have the correct 32bit binary representation + return value is the correct 32bit binary representation regardless of sign. .. versionchanged:: 3.0 - The return value will always be unsigned and in the range [0, 2**32-1] + The return value is unsigned and in the range [0, 2**32-1] regardless of platform. Modified: python/branches/io-c/Doc/library/collections.rst ============================================================================== --- python/branches/io-c/Doc/library/collections.rst (original) +++ python/branches/io-c/Doc/library/collections.rst Sun Feb 8 21:39:02 2009 @@ -45,31 +45,29 @@ :class:`Callable` ``__call__`` :class:`Sequence` :class:`Sized`, ``__getitem__`` ``__contains__``. ``__iter__``, ``__reversed__``. - :class:`Iterable`, and ``__len__`` ``index``, and ``count`` + :class:`Iterable`, ``index``, and ``count`` :class:`Container` -:class:`MutableSequence` :class:`Sequence` ``__getitem__`` Inherited Sequence methods and +:class:`MutableSequence` :class:`Sequence` ``__setitem__`` Inherited Sequence methods and ``__delitem__``, ``append``, ``reverse``, ``extend``, ``pop``, - ``insert``, ``remove``, and ``__iadd__`` - and ``__len__`` + and ``insert`` ``remove``, and ``__iadd__`` -:class:`Set` :class:`Sized`, ``__len__``, ``__le__``, ``__lt__``, ``__eq__``, ``__ne__``, - :class:`Iterable`, ``__iter__``, and ``__gt__``, ``__ge__``, ``__and__``, ``__or__`` - :class:`Container` ``__contains__`` ``__sub__``, ``__xor__``, and ``isdisjoint`` +:class:`Set` :class:`Sized`, ``__le__``, ``__lt__``, ``__eq__``, ``__ne__``, + :class:`Iterable`, ``__gt__``, ``__ge__``, ``__and__``, ``__or__`` + :class:`Container` ``__sub__``, ``__xor__``, and ``isdisjoint`` :class:`MutableSet` :class:`Set` ``add`` and Inherited Set methods and ``discard`` ``clear``, ``pop``, ``remove``, ``__ior__``, ``__iand__``, ``__ixor__``, and ``__isub__`` -:class:`Mapping` :class:`Sized`, ``__getitem__``, ``__contains__``, ``keys``, ``items``, ``values``, - :class:`Iterable`, ``__len__``. and ``get``, ``__eq__``, and ``__ne__`` - :class:`Container` ``__iter__`` - -:class:`MutableMapping` :class:`Mapping` ``__getitem__`` Inherited Mapping methods and - ``__setitem__``, ``pop``, ``popitem``, ``clear``, ``update``, - ``__delitem__``, and ``setdefault`` - ``__iter__``, and - ``__len__`` +:class:`Mapping` :class:`Sized`, ``__getitem__`` ``__contains__``, ``keys``, ``items``, ``values``, + :class:`Iterable`, ``get``, ``__eq__``, and ``__ne__`` + :class:`Container` + +:class:`MutableMapping` :class:`Mapping` ``__setitem__`` and Inherited Mapping methods and + ``__delitem__`` ``pop``, ``popitem``, ``clear``, ``update``, + and ``setdefault`` + :class:`MappingView` :class:`Sized` ``__len__`` :class:`KeysView` :class:`MappingView`, ``__contains__``, @@ -146,14 +144,14 @@ A counter tool is provided to support convenient and rapid tallies. For example:: - # Tally occurrences of words in a list + >>> # Tally occurrences of words in a list >>> cnt = Counter() >>> for word in ['red', 'blue', 'red', 'green', 'blue', 'blue']: ... cnt[word] += 1 >>> cnt Counter({'blue': 3, 'red': 2, 'green': 1}) - # Find the ten most common words in Hamlet + >>> # Find the ten most common words in Hamlet >>> import re >>> words = re.findall('\w+', open('hamlet.txt').read().lower()) >>> Counter(words).most_common(10) @@ -208,7 +206,7 @@ .. method:: most_common([n]) Return a list of the *n* most common elements and their counts from the - most common to the least. If *n* not specified, :func:`most_common` + 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:: @@ -246,8 +244,8 @@ contain repeated elements (with counts of one or more). Addition and subtraction combine counters by adding or subtracting the counts of corresponding elements. Intersection and union return the minimum and maximum -of corresponding counts. All four multiset operations exclude results with -counts less than one:: +of corresponding counts. Each operation can accept inputs with signed counts, +but the output excludes results with counts less than one. >>> c = Counter(a=3, b=1) >>> d = Counter(a=1, b=2) Modified: python/branches/io-c/Doc/library/ctypes.rst ============================================================================== --- python/branches/io-c/Doc/library/ctypes.rst (original) +++ python/branches/io-c/Doc/library/ctypes.rst Sun Feb 8 21:39:02 2009 @@ -1272,6 +1272,7 @@ .. data:: find_library(name) + :module: ctypes.util :noindex: Try to find a library and return a pathname. *name* is the library name without Modified: python/branches/io-c/Doc/library/datetime.rst ============================================================================== --- python/branches/io-c/Doc/library/datetime.rst (original) +++ python/branches/io-c/Doc/library/datetime.rst Sun Feb 8 21:39:02 2009 @@ -1266,7 +1266,7 @@ :class:`tzinfo` Objects ----------------------- -:class:`tzinfo` is an abstract base clase, meaning that this class should not be +:class:`tzinfo` is an abstract base class, meaning that this class should not be instantiated directly. You need to derive a concrete subclass, and (at least) supply implementations of the standard :class:`tzinfo` methods needed by the :class:`datetime` methods you use. The :mod:`datetime` module does not supply Modified: python/branches/io-c/Doc/library/functions.rst ============================================================================== --- python/branches/io-c/Doc/library/functions.rst (original) +++ python/branches/io-c/Doc/library/functions.rst Sun Feb 8 21:39:02 2009 @@ -666,9 +666,14 @@ Other common values are ``'w'`` for writing (truncating the file if it already exists), and ``'a'`` for appending (which on *some* Unix systems, means that *all* writes append to the end of the file regardless of the - current seek position). In text mode, if *encoding* is not specified the - encoding used is platform dependent. (For reading and writing raw bytes use - binary mode and leave *encoding* unspecified.) The available modes are: + current seek position). + + In text mode, if *encoding* is not specified the encoding used is the same as + returned by :func:`locale.getpreferredencoding`, if the :mod:`locale` module + is available, else ASCII. For reading and writing raw bytes, use binary mode + and leave *encoding* unspecified. + + The available modes are: ========= =============================================================== Character Meaning Modified: python/branches/io-c/Doc/library/importlib.rst ============================================================================== --- python/branches/io-c/Doc/library/importlib.rst (original) +++ python/branches/io-c/Doc/library/importlib.rst Sun Feb 8 21:39:02 2009 @@ -72,11 +72,15 @@ import in absolute or relative terms (e.g. either ``pkg.mod`` or ``..mod``). If the name is specified in relative terms, then the *package* argument must be - specified to the package which is to act as the anchor for resolving the + set to the package which is to act as the anchor for resolving the package name (e.g. ``import_module('..mod', 'pkg.subpkg')`` will import - ``pkg.mod``). The specified module will be inserted into - :data:`sys.modules` and returned. + ``pkg.mod``). + The :func:`import_module` function acts as a simplifying wrapper around + :func:`__import__`. This means all semantics of the function are derived + from :func:`__import__`, including requiring the package where an import is + occuring from to already be imported (i.e., *package* must already be + imported). :mod:`importlib.machinery` -- Importers and path hooks ------------------------------------------------------ Modified: python/branches/io-c/Doc/library/itertools.rst ============================================================================== --- python/branches/io-c/Doc/library/itertools.rst (original) +++ python/branches/io-c/Doc/library/itertools.rst Sun Feb 8 21:39:02 2009 @@ -290,7 +290,7 @@ class groupby(object): # [k for k, g in groupby('AAAABBBCCDAABBB')] --> A B C D A B - # [(list(g)) for k, g in groupby('AAAABBBCCD')] --> AAAA BBB CC D + # [list(g) for k, g in groupby('AAAABBBCCD')] --> AAAA BBB CC D def __init__(self, iterable, key=None): if key is None: key = lambda x: x @@ -591,8 +591,8 @@ return map(function, count(start)) def nth(iterable, n): - "Returns the nth item or empty list" - return list(islice(iterable, n, n+1)) + "Returns the nth item or None" + return next(islice(iterable, n, None), None) def quantify(iterable, pred=bool): "Count how many times the predicate is true" @@ -654,26 +654,26 @@ s = list(iterable) return chain.from_iterable(combinations(s, r) for r in range(len(s)+1)) - def unique_everseen(iterable, key=None): - "List unique elements, preserving order. Remember all elements ever seen." - # unique_everseen('AAAABBBCCDAABBB') --> A B C D - # unique_everseen('ABBCcAD', str.lower) --> A B C D - seen = set() - seen_add = seen.add - if key is None: - for element in iterable: - if element not in seen: - seen_add(element) - yield element - else: - for element in iterable: - k = key(element) - if k not in seen: - seen_add(k) - yield element - - def unique_justseen(iterable, key=None): - "List unique elements, preserving order. Remember only the element just seen." - # unique_justseen('AAAABBBCCDAABBB') --> A B C D A B - # unique_justseen('ABBCcAD', str.lower) --> A B C A D - return map(next, map(itemgetter(1), groupby(iterable, key))) + def unique_everseen(iterable, key=None): + "List unique elements, preserving order. Remember all elements ever seen." + # unique_everseen('AAAABBBCCDAABBB') --> A B C D + # unique_everseen('ABBCcAD', str.lower) --> A B C D + seen = set() + seen_add = seen.add + if key is None: + for element in iterable: + if element not in seen: + seen_add(element) + yield element + else: + for element in iterable: + k = key(element) + if k not in seen: + seen_add(k) + yield element + + def unique_justseen(iterable, key=None): + "List unique elements, preserving order. Remember only the element just seen." + # unique_justseen('AAAABBBCCDAABBB') --> A B C D A B + # unique_justseen('ABBCcAD', str.lower) --> A B C A D + return map(next, imap(itemgetter(1), groupby(iterable, key))) Modified: python/branches/io-c/Doc/library/locale.rst ============================================================================== --- python/branches/io-c/Doc/library/locale.rst (original) +++ python/branches/io-c/Doc/library/locale.rst Sun Feb 8 21:39:02 2009 @@ -225,12 +225,11 @@ .. function:: strxfrm(string) - .. index:: builtin: cmp - - Transforms a string to one that can be used for the built-in function - :func:`cmp`, and still returns locale-aware results. This function can be used - when the same string is compared repeatedly, e.g. when collating a sequence of - strings. + Transforms a string to one that can be used in locale-aware + comparisons. For example, ``strxfrm(s1) < strxfrm(s2)`` is + equivalent to ``strcoll(s1, s2) < 0``. This function can be used + when the same string is compared repeatedly, e.g. when collating a + sequence of strings. .. function:: format(format, val[, grouping[, monetary]]) Modified: python/branches/io-c/Doc/library/operator.rst ============================================================================== --- python/branches/io-c/Doc/library/operator.rst (original) +++ python/branches/io-c/Doc/library/operator.rst Sun Feb 8 21:39:02 2009 @@ -43,9 +43,9 @@ equivalent to ``a < b``, ``le(a, b)`` is equivalent to ``a <= b``, ``eq(a, b)`` is equivalent to ``a == b``, ``ne(a, b)`` is equivalent to ``a != b``, ``gt(a, b)`` is equivalent to ``a > b`` and ``ge(a, b)`` is equivalent to ``a - >= b``. Note that unlike the built-in :func:`cmp`, these functions can - return any value, which may or may not be interpretable as a Boolean value. - See :ref:`comparisons` for more information about rich comparisons. + >= b``. Note that these functions can return any value, which may + or may not be interpretable as a Boolean value. See + :ref:`comparisons` for more information about rich comparisons. The logical operations are also generally applicable to all objects, and support Modified: python/branches/io-c/Doc/library/optparse.rst ============================================================================== --- python/branches/io-c/Doc/library/optparse.rst (original) +++ python/branches/io-c/Doc/library/optparse.rst Sun Feb 8 21:39:02 2009 @@ -1506,7 +1506,7 @@ records that the option was seen:: def record_foo_seen(option, opt_str, value, parser): - parser.saw_foo = True + parser.values.saw_foo = True parser.add_option("--foo", action="callback", callback=record_foo_seen) @@ -1646,7 +1646,7 @@ value.append(arg) del parser.rargs[:len(value)] - setattr(parser.values, option.dest, value)) + setattr(parser.values, option.dest, value) [...] parser.add_option("-c", "--callback", dest="vararg_attr", Modified: python/branches/io-c/Doc/library/queue.rst ============================================================================== --- python/branches/io-c/Doc/library/queue.rst (original) +++ python/branches/io-c/Doc/library/queue.rst Sun Feb 8 21:39:02 2009 @@ -147,7 +147,7 @@ q = Queue() for i in range(num_worker_threads): t = Thread(target=worker) - t.set_daemon(True) + t.daemon = True t.start() for item in source(): Modified: python/branches/io-c/Doc/library/runpy.rst ============================================================================== --- python/branches/io-c/Doc/library/runpy.rst (original) +++ python/branches/io-c/Doc/library/runpy.rst Sun Feb 8 21:39:02 2009 @@ -26,17 +26,22 @@ mechanism (refer to PEP 302 for details) and then executed in a fresh module namespace. + If the supplied module name refers to a package rather than a normal module, + then that package is imported and the ``__main__`` submodule within that + package is then executed and the resulting module globals dictionary returned. + The optional dictionary argument *init_globals* may be used to pre-populate the globals dictionary before the code is executed. The supplied dictionary will not be modified. If any of the special global variables below are defined in the supplied dictionary, those definitions are overridden by the ``run_module`` function. - The special global variables ``__name__``, ``__file__``, ``__loader__`` and - ``__builtins__`` are set in the globals dictionary before the module code is - executed. + The special global variables ``__name__``, ``__file__``, ``__loader__``, + ``__builtins__`` and ``__package__`` are set in the globals dictionary before + the module code is executed. - ``__name__`` is set to *run_name* if this optional argument is supplied, and the + ``__name__`` is set to *run_name* if this optional argument is supplied, to + ``mod_name + '.__main__'`` if the named module is a package and to the *mod_name* argument otherwise. ``__loader__`` is set to the PEP 302 module loader used to retrieve the code for @@ -48,6 +53,9 @@ ``__builtins__`` is automatically initialised with a reference to the top level namespace of the :mod:`builtins` module. + ``__package__`` is set to *mod_name* if the named module is a package and to + ``mod_name.rpartition('.')[0]`` otherwise. + If the argument *alter_sys* is supplied and evaluates to ``True``, then ``sys.argv[0]`` is updated with the value of ``__file__`` and ``sys.modules[__name__]`` is updated with a temporary module object for the @@ -60,8 +68,15 @@ function from threaded code. + .. versionchanged:: 3.1 + Added ability to execute packages by looking for a ``__main__`` submodule + + .. seealso:: :pep:`338` - Executing modules as scripts - PEP written and implemented by Nick Coghlan. + PEP written and implemented by Nick Coghlan. + + :pep:`366` - Main module explicit relative imports + PEP written and implemented by Nick Coghlan. Modified: python/branches/io-c/Doc/library/shelve.rst ============================================================================== --- python/branches/io-c/Doc/library/shelve.rst (original) +++ python/branches/io-c/Doc/library/shelve.rst Sun Feb 8 21:39:02 2009 @@ -23,7 +23,7 @@ database file is opened for reading and writing. The optional *flag* parameter has the same interpretation as the *flag* parameter of :func:`dbm.open`. - By default, version 0 pickles are used to serialize values. The version of the + 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 Modified: python/branches/io-c/Doc/library/sys.rst ============================================================================== --- python/branches/io-c/Doc/library/sys.rst (original) +++ python/branches/io-c/Doc/library/sys.rst Sun Feb 8 21:39:02 2009 @@ -769,8 +769,12 @@ *micro*, *releaselevel*, and *serial*. All values except *releaselevel* are integers; the release level is ``'alpha'``, ``'beta'``, ``'candidate'``, or ``'final'``. The ``version_info`` value corresponding to the Python version 2.0 - is ``(2, 0, 0, 'final', 0)``. + is ``(2, 0, 0, 'final', 0)``. The components can also be accessed by name, + so ``sys.version_info[0]`` is equivalent to ``sys.version_info.major`` + and so on. + .. versionchanged:: 2.7 + Added named component attributes .. data:: warnoptions Modified: python/branches/io-c/Doc/library/threading.rst ============================================================================== --- python/branches/io-c/Doc/library/threading.rst (original) +++ python/branches/io-c/Doc/library/threading.rst Sun Feb 8 21:39:02 2009 @@ -198,7 +198,7 @@ A thread can be flagged as a "daemon thread". The significance of this flag is that the entire Python program exits when only daemon threads are left. The initial value is inherited from the creating thread. The flag can be set -through the :attr:`daemon` attribute. +through the :attr:`daemon` property. There is a "main thread" object; this corresponds to the initial thread of control in the Python program. It is not a daemon thread. @@ -312,10 +312,11 @@ .. attribute:: Thread.daemon - The thread's daemon flag. This must be set before :meth:`start` is called, - otherwise :exc:`RuntimeError` is raised. - - The initial value is inherited from the creating thread. + A boolean value indicating whether this thread is a daemon thread (True) or + not (False). This must be set before :meth:`start` is called, otherwise + :exc:`RuntimeError` is raised. Its initial value is inherited from the + creating thread; the main thread is not a daemon thread and therefore all + threads created in the main thread default to :attr:`daemon` = ``False``. The entire Python program exits when no alive non-daemon threads are left. Modified: python/branches/io-c/Doc/library/tk.rst ============================================================================== --- python/branches/io-c/Doc/library/tk.rst (original) +++ python/branches/io-c/Doc/library/tk.rst Sun Feb 8 21:39:02 2009 @@ -12,8 +12,8 @@ Tk/Tcl has long been an integral part of Python. It provides a robust and platform independent windowing toolkit, that is available to Python programmers -using the :mod:`tkinter` package, and its extension, the :mod:`tkinter.tix` -module. +using the :mod:`tkinter` package, and its extension, the :mod:`tkinter.tix` and +the :mod:`tkinter.ttk` modules. The :mod:`tkinter` package is a thin object-oriented layer on top of Tcl/Tk. To use :mod:`tkinter`, you don't need to write Tcl code, but you will need to @@ -33,6 +33,7 @@ .. toctree:: tkinter.rst + tkinter.ttk.rst tkinter.tix.rst tkinter.scrolledtext.rst turtle.rst Modified: python/branches/io-c/Doc/library/unittest.rst ============================================================================== --- python/branches/io-c/Doc/library/unittest.rst (original) +++ python/branches/io-c/Doc/library/unittest.rst Sun Feb 8 21:39:02 2009 @@ -327,8 +327,9 @@ ``WidgetTestCase.testResize``. :class:`TestLoader` uses the ``'test'`` method name prefix to identify test methods automatically. -Note that the order in which the various test cases will be run is determined by -sorting the test function names with the built-in :func:`cmp` function. +Note that the order in which the various test cases will be run is +determined by sorting the test function names with respect to the +built-in ordering for strings. Often it is desirable to group suites of test cases together, so as to run tests for the whole system at once. This is easy, since :class:`TestSuite` instances @@ -921,9 +922,13 @@ .. attribute:: TestLoader.sortTestMethodsUsing Function to be used to compare method names when sorting them in - :meth:`getTestCaseNames` and all the :meth:`loadTestsFrom\*` methods. The - default value is the built-in :func:`cmp` function; the attribute can also be - set to :const:`None` to disable the sort. + :meth:`getTestCaseNames` and all the :meth:`loadTestsFrom\*` + methods. This should be a function that takes two arguments + ``self`` and ``other``, and returns ``-1`` if ``self`` precedes + ``other`` in the desired ordering, ``1`` if ``other`` precedes + ``self``, and ``0`` if ``self`` and ``other`` are equal. The + default ordering is the built-in ordering for strings. This + attribute can also be set to :const:`None` to disable the sort. .. attribute:: TestLoader.suiteClass Modified: python/branches/io-c/Doc/library/zipimport.rst ============================================================================== --- python/branches/io-c/Doc/library/zipimport.rst (original) +++ python/branches/io-c/Doc/library/zipimport.rst Sun Feb 8 21:39:02 2009 @@ -88,6 +88,15 @@ file wasn't found. + .. method:: get_filename(fullname) + + Return the value ``__file__`` would be set to if the specified module + was imported. Raise :exc:`ZipImportError` if the module couldn't be + found. + + .. versionadded:: 3.1 + + .. method:: get_source(fullname) Return the source code for the specified module. Raise Modified: python/branches/io-c/Doc/library/zlib.rst ============================================================================== --- python/branches/io-c/Doc/library/zlib.rst (original) +++ python/branches/io-c/Doc/library/zlib.rst Sun Feb 8 21:39:02 2009 @@ -48,11 +48,11 @@ To generate the same numeric value across all Python versions and platforms use adler32(data) & 0xffffffff. If you are only using the checksum in packed binary format this is not necessary as the - return value will have the correct 32bit binary representation + return value is the correct 32bit binary representation regardless of sign. .. versionchanged:: 3.0 - The return value will always be unsigned and in the range [0, 2**32-1] + The return value is unsigned and in the range [0, 2**32-1] regardless of platform. @@ -93,11 +93,11 @@ To generate the same numeric value across all Python versions and platforms use crc32(data) & 0xffffffff. If you are only using the checksum in packed binary format this is not necessary as the - return value will have the correct 32bit binary representation + return value is the correct 32bit binary representation regardless of sign. .. versionchanged:: 3.0 - The return value will always be unsigned and in the range [0, 2**32-1] + The return value is unsigned and in the range [0, 2**32-1] regardless of platform. Modified: python/branches/io-c/Doc/reference/datamodel.rst ============================================================================== --- python/branches/io-c/Doc/reference/datamodel.rst (original) +++ python/branches/io-c/Doc/reference/datamodel.rst Sun Feb 8 21:39:02 2009 @@ -1096,7 +1096,9 @@ is printed to ``sys.stderr`` instead. Also, when :meth:`__del__` is invoked in response to a module being deleted (e.g., when execution of the program is done), other globals referenced by the :meth:`__del__` method may already have - been deleted. For this reason, :meth:`__del__` methods should do the absolute + been deleted or in the process of being torn down (e.g. the import + machinery shutting down). For this reason, :meth:`__del__` methods + should do the absolute minimum needed to maintain external invariants. Starting with version 1.5, Python guarantees that globals whose name begins with a single underscore are deleted from their module before other globals are deleted; if no other Modified: python/branches/io-c/Doc/reference/executionmodel.rst ============================================================================== --- python/branches/io-c/Doc/reference/executionmodel.rst (original) +++ python/branches/io-c/Doc/reference/executionmodel.rst Sun Feb 8 21:39:02 2009 @@ -51,8 +51,8 @@ within the defining one, unless a contained block introduces a different binding for the name. The scope of names defined in a class block is limited to the class block; it does not extend to the code blocks of methods -- this includes -generator expressions since they are implemented using a function scope. This -means that the following will fail:: +comprehensions and generator expressions since they are implemented using a +function scope. This means that the following will fail:: class A: a = 42 Modified: python/branches/io-c/Doc/reference/expressions.rst ============================================================================== --- python/branches/io-c/Doc/reference/expressions.rst (original) +++ python/branches/io-c/Doc/reference/expressions.rst Sun Feb 8 21:39:02 2009 @@ -1022,8 +1022,8 @@ length. If not equal, the sequences are ordered the same as their first differing - elements. For example, ``cmp([1,2,x], [1,2,y])`` returns the same as - ``cmp(x,y)``. If the corresponding element does not exist, the shorter + elements. For example, ``[1,2,x] <= [1,2,y]`` has the same value as + ``x <= y``. If the corresponding element does not exist, the shorter sequence is ordered first (for example, ``[1,2] < [1,2,3]``). * Mappings (dictionaries) compare equal if and only if their sorted ``(key, Modified: python/branches/io-c/Doc/reference/simple_stmts.rst ============================================================================== --- python/branches/io-c/Doc/reference/simple_stmts.rst (original) +++ python/branches/io-c/Doc/reference/simple_stmts.rst Sun Feb 8 21:39:02 2009 @@ -441,14 +441,14 @@ create a generator function instead of a normal function. When a generator function is called, it returns an iterator known as a generator iterator, or more commonly, a generator. The body of the generator function is -executed by calling the generator's :meth:`next` method repeatedly until it -raises an exception. +executed by calling the :func:`next` function on the generator repeatedly until +it raises an exception. When a :keyword:`yield` statement is executed, the state of the generator is frozen and the value of :token:`expression_list` is returned to :meth:`next`'s caller. By "frozen" we mean that all local state is retained, including the current bindings of local variables, the instruction pointer, and the internal -evaluation stack: enough information is saved so that the next time :meth:`next` +evaluation stack: enough information is saved so that the next time :func:`next` is invoked, the function can proceed exactly as if the :keyword:`yield` statement were just another external call. Modified: python/branches/io-c/Doc/tools/sphinxext/download.html ============================================================================== --- python/branches/io-c/Doc/tools/sphinxext/download.html (original) +++ python/branches/io-c/Doc/tools/sphinxext/download.html Sun Feb 8 21:39:02 2009 @@ -31,7 +31,7 @@ Download (ca. 4 MB) Plain Text - Download (ca. 2 MB) + Download (ca. 2 MB) Download (ca. 1.5 MB) Modified: python/branches/io-c/Doc/tools/sphinxext/pyspecific.py ============================================================================== --- python/branches/io-c/Doc/tools/sphinxext/pyspecific.py (original) +++ python/branches/io-c/Doc/tools/sphinxext/pyspecific.py Sun Feb 8 21:39:02 2009 @@ -13,6 +13,14 @@ from docutils import nodes, utils +# monkey-patch reST parser to disable alphabetic and roman enumerated lists +from docutils.parsers.rst.states import Body +Body.enum.converters['loweralpha'] = \ + Body.enum.converters['upperalpha'] = \ + Body.enum.converters['lowerroman'] = \ + Body.enum.converters['upperroman'] = lambda x: None + + def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): issue = utils.unescape(text) text = 'issue ' + issue Modified: python/branches/io-c/Doc/tutorial/floatingpoint.rst ============================================================================== --- python/branches/io-c/Doc/tutorial/floatingpoint.rst (original) +++ python/branches/io-c/Doc/tutorial/floatingpoint.rst Sun Feb 8 21:39:02 2009 @@ -200,7 +200,7 @@ machines today (November 2000) use IEEE-754 floating point arithmetic, and almost all platforms map Python floats to IEEE-754 "double precision". 754 doubles contain 53 bits of precision, so on input the computer strives to -convert 0.1 to the closest fraction it can of the form *J*/2\*\**N* where *J* is +convert 0.1 to the closest fraction it can of the form *J*/2**\ *N* where *J* is an integer containing exactly 53 bits. Rewriting :: 1 / 10 ~= J / (2**N) Modified: python/branches/io-c/Doc/tutorial/modules.rst ============================================================================== --- python/branches/io-c/Doc/tutorial/modules.rst (original) +++ python/branches/io-c/Doc/tutorial/modules.rst Sun Feb 8 21:39:02 2009 @@ -317,25 +317,25 @@ >>> dir(builtins) ['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'Buffer - Error', 'DeprecationWarning', 'EOFError', 'Ellipsis', 'EnvironmentError', 'Excep - tion', 'False', 'FloatingPointError', 'FutureWarning', 'GeneratorExit', 'IOError - ', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexError', 'KeyError', - 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'NameError', 'None', 'NotImp - lemented', 'NotImplementedError', 'OSError', 'OverflowError', 'PendingDeprecatio - nWarning', 'ReferenceError', 'RuntimeError', 'RuntimeWarning', 'StopIteration', - 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'TabError', 'True', - 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError', 'UnicodeEncodeError', ' - UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning', 'UserWarning', 'ValueE - rror', 'Warning', 'ZeroDivisionError', '__build_class__', '__debug__', '__doc__' - , '__import__', '__name__', 'abs', 'all', 'any', 'basestring', 'bin', 'bool', 'b - uffer', 'bytes', 'chr', 'chr8', 'classmethod', 'cmp', 'compile', 'complex', 'cop - yright', 'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'ex - ec', 'exit', 'filter', 'float', 'frozenset', 'getattr', 'globals', 'hasattr', 'h - ash', 'help', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', ' - len', 'license', 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', 'o - bject', 'oct', 'open', 'ord', 'pow', 'print', 'property', 'quit', 'range', 'repr - ', 'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'st - r', 'str8', 'sum', 'super', 'trunc', 'tuple', 'type', 'vars', 'zip'] + Error', 'BytesWarning', 'DeprecationWarning', 'EOFError', 'Ellipsis', 'Environme + ntError', 'Exception', 'False', 'FloatingPointError', 'FutureWarning', 'Generato + rExit', 'IOError', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexErr + or', 'KeyError', 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'NameError', + 'None', 'NotImplemented', 'NotImplementedError', 'OSError', 'OverflowError', 'P + endingDeprecationWarning', 'ReferenceError', 'RuntimeError', 'RuntimeWarning', ' + StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'Ta + bError', 'True', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError', 'Unicod + eEncodeError', 'UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning', 'UserW + arning', 'ValueError', 'Warning', 'ZeroDivisionError', '__build_class__', '__deb + ug__', '__doc__', '__import__', '__name__', '__package__', 'abs', 'all', 'any', + 'ascii', 'bin', 'bool', 'bytearray', 'bytes', 'chr', 'classmethod', 'compile', ' + complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate + ', 'eval', 'exec', 'exit', 'filter', 'float', 'format', 'frozenset', 'getattr', + 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'int', 'isinstance', + 'issubclass', 'iter', 'len', 'license', 'list', 'locals', 'map', 'max', 'memory + view', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property' + , 'quit', 'range', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 'sort + ed', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars', 'zip'] .. _tut-packages: Modified: python/branches/io-c/Doc/using/cmdline.rst ============================================================================== --- python/branches/io-c/Doc/using/cmdline.rst (original) +++ python/branches/io-c/Doc/using/cmdline.rst Sun Feb 8 21:39:02 2009 @@ -78,6 +78,12 @@ the implementation may not always enforce this (e.g. it may allow you to use a name that includes a hyphen). + Package names are also permitted. When a package name is supplied instead + of a normal module, the interpreter will execute ``.__main__`` as + the main module. This behaviour is deliberately similar to the handling + of directories and zipfiles that are passed to the interpreter as the + script argument. + .. note:: This option cannot be used with builtin modules and extension modules @@ -97,11 +103,14 @@ .. seealso:: :func:`runpy.run_module` - The actual implementation of this feature. + Equivalent functionality directly available to Python code :pep:`338` -- Executing modules as scripts + .. versionchanged:: 3.1 + Supply the package name to run a ``__main__`` submodule. + .. describe:: - Read commands from standard input (:data:`sys.stdin`). If standard input is Modified: python/branches/io-c/Doc/whatsnew/2.7.rst ============================================================================== --- python/branches/io-c/Doc/whatsnew/2.7.rst (original) +++ python/branches/io-c/Doc/whatsnew/2.7.rst Sun Feb 8 21:39:02 2009 @@ -6,6 +6,8 @@ :Release: |release| :Date: |today| +.. Fix accents on Kristjan Valur Jonsson, Fuerstenau. + .. $Id$ Rules for maintenance: @@ -60,11 +62,6 @@ .. ======================================================================== -Kristj?n Valur J?nsson, issue 4293 -Py_AddPendingCall is now thread safe. This allows any worker thread -to submit notifications to the python main thread. This is particularly -useful for asynchronous IO operations. - Other Language Changes ====================== @@ -95,7 +92,19 @@ Optimizations ------------- -To be written. +A few performance enhancements have been added: + +* The garbage collector now performs better when many objects are + being allocated without deallocating any. A full garbage collection + pass is only performed when the middle generation has been collected + 10 times and when the number of survivor objects from the middle + generation exceeds 10% of the number of objects in the oldest + generation. The second condition was added to reduce the number + of full garbage collections as the number of objects on the heap grows, + avoiding quadratic performance when allocating very many objects. + (Suggested by Martin von Loewis and implemented by Antoine Pitrou; + :issue:`4074`.) + .. ====================================================================== @@ -108,6 +117,62 @@ :file:`Misc/NEWS` file in the source tree for a more complete list of changes, or look through the Subversion logs for all the details. +* It is not mandatory anymore to store clear text passwords in the + :file:`.pypirc` file when registering and uploading packages to PyPI. As long + as the username is present in that file, the :mod:`distutils` package will + prompt for the password if not present. (Added by tarek, with the initial + contribution of Nathan Van Gheem; :issue:`4394`.) + +* The :mod:`bz2` module's :class:`BZ2File` now supports the context + management protocol, so you can write ``with bz2.BZ2File(...) as f: ...``. + (Contributed by Hagen Fuerstenau; :issue:`3860`.) + +* A new :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`:: + + >>> 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` + returns an iterator over the contained element, repeating each element + as many times as its count:: + + >>> c.most_common(5) + [(' ', 6), ('e', 5), ('s', 3), ('a', 2), ('i', 2)] + >>> c.elements() -> + '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'] + + Contributed by Raymond Hettinger; :issue:`1696199`. + +* The :mod:`gzip` module's :class:`GzipFile` now supports the context + management protocol, so you can write ``with gzip.GzipFile(...) as f: ...``. + (Contributed by Hagen Fuerstenau; :issue:`3860`.) + +* The :class:`io.FileIO` class now raises an :exc:`OSError` when passed + an invalid file descriptor. (Implemented by Benjamin Peterson; + :issue:`4991`.) + +* The :mod:`pydoc` module now has help for the various symbols that Python + uses. You can now do ``help('<<')`` or ``help('@')``, for example. + (Contributed by David Laban; :issue:`4739`.) + * A new function in the :mod:`subprocess` module, :func:`check_output`, runs a command with a specified set of arguments and returns the command's output as a string if the command runs without @@ -125,15 +190,30 @@ (Contributed by Gregory P. Smith.) -* It is not mandatory anymore to store clear text passwords in the - :file:`.pypirc` file when registering and uploading packages to PyPI. As long - as the username is present in that file, the :mod:`distutils` package will - prompt for the password if not present. (Added by tarek, with the initial - contribution of Nathan Van Gheem; :issue:`4394`.) +* 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`.) .. ====================================================================== .. whole new modules get described in subsections here +ttk: Themed Widgets for Tk +-------------------------- + +Tcl/Tk 8.5 includes a set of themed widgets that re-implement basic Tk +widgets but have a more customizable appearance and can therefore more +closely resemble the native platform's widgets. This widget +set was originally called Tile, but was renamed to Ttk (for "themed Tk") +on being added to Tcl/Tck release 8.5. + +XXX write a brief discussion and an example here. + +The :mod:`ttk` module was written by Guilherme Polo and added in +:issue:`2983`. An alternate version called ``Tile.py``, written by +Martin Franklin and maintained by Kevin Walzer, was proposed for +inclusion in :issue:`2618`, but the authors argued that Guilherme +Polo's work was more comprehensive. + .. ====================================================================== @@ -145,7 +225,13 @@ * If you use the :file:`.gdbinit` file provided with Python, the "pyo" macro in the 2.7 version will now work when the thread being debugged doesn't hold the GIL; the macro will now acquire it before printing. - (Contributed by haypo XXX; :issue:`3632`.) + (Contributed by Victor Stinner; :issue:`3632`.) + +* :cfunc:`Py_AddPendingCall` is now thread safe, letting any + worker thread submit notifications to the main Python thread. This + is particularly useful for asynchronous IO operations. + (Contributed by Kristjan Valur Jonsson; :issue:`4293`.) + .. ====================================================================== @@ -157,7 +243,11 @@ :data:`CRT_ASSEMBLY_VERSION`, :data:`VC_ASSEMBLY_PUBLICKEYTOKEN`, and :data:`LIBRARIES_ASSEMBLY_NAME_PREFIX`. - (Added by Martin von Loewis (XXX check); :issue:`4365`.) + (Contributed by David Cournapeau; :issue:`4365`.) + +* The new :cfunc:`_beginthreadex` API is used to start threads, and + the native thread-local storage functions are now used. + (Contributed by Kristjan Valur Jonsson; :issue:`3582`.) .. ====================================================================== Modified: python/branches/io-c/Doc/whatsnew/3.0.rst ============================================================================== --- python/branches/io-c/Doc/whatsnew/3.0.rst (original) +++ python/branches/io-c/Doc/whatsnew/3.0.rst Sun Feb 8 21:39:02 2009 @@ -691,7 +691,7 @@ idiom for handling all exceptions except for this latter category is to use :keyword:`except` :exc:`Exception`. -* :exc:`StandardError` was removed (in 2.6 already). +* :exc:`StandardError` was removed. * Exceptions no longer behave as sequences. Use the :attr:`args` attribute instead. Modified: python/branches/io-c/Include/abstract.h ============================================================================== --- python/branches/io-c/Include/abstract.h (original) +++ python/branches/io-c/Include/abstract.h Sun Feb 8 21:39:02 2009 @@ -228,29 +228,6 @@ */ #define PyObject_DelAttr(O,A) PyObject_SetAttr((O),(A),NULL) - PyAPI_FUNC(int) PyObject_Cmp(PyObject *o1, PyObject *o2, int *result); - - /* - Compare the values of o1 and o2 using a routine provided by - o1, if one exists, otherwise with a routine provided by o2. - The result of the comparison is returned in result. Returns - -1 on failure. This is the equivalent of the Python - statement: result=cmp(o1,o2). - - */ - - /* Implemented elsewhere: - - int PyObject_Compare(PyObject *o1, PyObject *o2); - - Compare the values of o1 and o2 using a routine provided by - o1, if one exists, otherwise with a routine provided by o2. - Returns the result of the comparison on success. On error, - the value returned is undefined. This is equivalent to the - Python expression: cmp(o1,o2). - - */ - /* Implemented elsewhere: PyObject *PyObject_Repr(PyObject *o); @@ -415,7 +392,7 @@ /* Guess the size of object o using len(o) or o.__length_hint__(). If neither of those return a non-negative value, then return the - default value. This function never fails. All exceptions are cleared. + default value. If one of the calls fails, this function returns -1. */ PyAPI_FUNC(PyObject *) PyObject_GetItem(PyObject *o, PyObject *key); Modified: python/branches/io-c/Include/code.h ============================================================================== --- python/branches/io-c/Include/code.h (original) +++ python/branches/io-c/Include/code.h Sun Feb 8 21:39:02 2009 @@ -20,7 +20,7 @@ PyObject *co_varnames; /* tuple of strings (local variable names) */ PyObject *co_freevars; /* tuple of strings (free variable names) */ PyObject *co_cellvars; /* tuple of strings (cell variable names) */ - /* The rest doesn't count for hash/cmp */ + /* The rest doesn't count for hash or comparisons */ PyObject *co_filename; /* unicode (where it was loaded from) */ PyObject *co_name; /* unicode (name, for reference) */ int co_firstlineno; /* first source line number */ Modified: python/branches/io-c/Include/object.h ============================================================================== --- python/branches/io-c/Include/object.h (original) +++ python/branches/io-c/Include/object.h Sun Feb 8 21:39:02 2009 @@ -274,7 +274,6 @@ typedef PyObject *(*getattrofunc)(PyObject *, PyObject *); typedef int (*setattrfunc)(PyObject *, char *, PyObject *); typedef int (*setattrofunc)(PyObject *, PyObject *, PyObject *); -typedef int (*cmpfunc)(PyObject *, PyObject *); typedef PyObject *(*reprfunc)(PyObject *); typedef long (*hashfunc)(PyObject *); typedef PyObject *(*richcmpfunc) (PyObject *, PyObject *, int); @@ -297,7 +296,7 @@ printfunc tp_print; getattrfunc tp_getattr; setattrfunc tp_setattr; - cmpfunc tp_compare; + void *tp_reserved; /* formerly known as tp_compare */ reprfunc tp_repr; /* Method suites for standard classes */ @@ -426,10 +425,8 @@ PyAPI_FUNC(PyObject *) PyObject_Str(PyObject *); PyAPI_FUNC(PyObject *) PyObject_ASCII(PyObject *); PyAPI_FUNC(PyObject *) PyObject_Bytes(PyObject *); -PyAPI_FUNC(int) PyObject_Compare(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyObject_RichCompare(PyObject *, PyObject *, int); PyAPI_FUNC(int) PyObject_RichCompareBool(PyObject *, PyObject *, int); -PyAPI_FUNC(PyObject *) Py_CmpToRich(int op, int cmp); PyAPI_FUNC(PyObject *) PyObject_GetAttrString(PyObject *, const char *); PyAPI_FUNC(int) PyObject_SetAttrString(PyObject *, const char *, PyObject *); PyAPI_FUNC(int) PyObject_HasAttrString(PyObject *, const char *); Modified: python/branches/io-c/Lib/_abcoll.py ============================================================================== --- python/branches/io-c/Lib/_abcoll.py (original) +++ python/branches/io-c/Lib/_abcoll.py Sun Feb 8 21:39:02 2009 @@ -301,7 +301,7 @@ """Return the popped value. Raise KeyError if empty.""" it = iter(self) try: - value = it.__next__() + value = next(it) except StopIteration: raise KeyError self.discard(value) Modified: python/branches/io-c/Lib/colorsys.py ============================================================================== --- python/branches/io-c/Lib/colorsys.py (original) +++ python/branches/io-c/Lib/colorsys.py Sun Feb 8 21:39:02 2009 @@ -44,12 +44,18 @@ r = y + 0.948262*i + 0.624013*q g = y - 0.276066*i - 0.639810*q b = y - 1.105450*i + 1.729860*q - if r < 0.0: r = 0.0 - if g < 0.0: g = 0.0 - if b < 0.0: b = 0.0 - if r > 1.0: r = 1.0 - if g > 1.0: g = 1.0 - if b > 1.0: b = 1.0 + if r < 0.0: + r = 0.0 + if g < 0.0: + g = 0.0 + if b < 0.0: + b = 0.0 + if r > 1.0: + r = 1.0 + if g > 1.0: + g = 1.0 + if b > 1.0: + b = 1.0 return (r, g, b) @@ -63,30 +69,42 @@ minc = min(r, g, b) # XXX Can optimize (maxc+minc) and (maxc-minc) l = (minc+maxc)/2.0 - if minc == maxc: return 0.0, l, 0.0 - if l <= 0.5: s = (maxc-minc) / (maxc+minc) - else: s = (maxc-minc) / (2.0-maxc-minc) + if minc == maxc: + return 0.0, l, 0.0 + if l <= 0.5: + s = (maxc-minc) / (maxc+minc) + else: + s = (maxc-minc) / (2.0-maxc-minc) rc = (maxc-r) / (maxc-minc) gc = (maxc-g) / (maxc-minc) bc = (maxc-b) / (maxc-minc) - if r == maxc: h = bc-gc - elif g == maxc: h = 2.0+rc-bc - else: h = 4.0+gc-rc + if r == maxc: + h = bc-gc + elif g == maxc: + h = 2.0+rc-bc + else: + h = 4.0+gc-rc h = (h/6.0) % 1.0 return h, l, s def hls_to_rgb(h, l, s): - if s == 0.0: return l, l, l - if l <= 0.5: m2 = l * (1.0+s) - else: m2 = l+s-(l*s) + if s == 0.0: + return l, l, l + if l <= 0.5: + m2 = l * (1.0+s) + else: + m2 = l+s-(l*s) m1 = 2.0*l - m2 return (_v(m1, m2, h+ONE_THIRD), _v(m1, m2, h), _v(m1, m2, h-ONE_THIRD)) def _v(m1, m2, hue): hue = hue % 1.0 - if hue < ONE_SIXTH: return m1 + (m2-m1)*hue*6.0 - if hue < 0.5: return m2 - if hue < TWO_THIRD: return m1 + (m2-m1)*(TWO_THIRD-hue)*6.0 + if hue < ONE_SIXTH: + return m1 + (m2-m1)*hue*6.0 + if hue < 0.5: + return m2 + if hue < TWO_THIRD: + return m1 + (m2-m1)*(TWO_THIRD-hue)*6.0 return m1 @@ -99,29 +117,40 @@ maxc = max(r, g, b) minc = min(r, g, b) v = maxc - if minc == maxc: return 0.0, 0.0, v + if minc == maxc: + return 0.0, 0.0, v s = (maxc-minc) / maxc rc = (maxc-r) / (maxc-minc) gc = (maxc-g) / (maxc-minc) bc = (maxc-b) / (maxc-minc) - if r == maxc: h = bc-gc - elif g == maxc: h = 2.0+rc-bc - else: h = 4.0+gc-rc + if r == maxc: + h = bc-gc + elif g == maxc: + h = 2.0+rc-bc + else: + h = 4.0+gc-rc h = (h/6.0) % 1.0 return h, s, v def hsv_to_rgb(h, s, v): - if s == 0.0: return v, v, v + if s == 0.0: + return v, v, v i = int(h*6.0) # XXX assume int() truncates! f = (h*6.0) - i p = v*(1.0 - s) q = v*(1.0 - s*f) t = v*(1.0 - s*(1.0-f)) i = i%6 - if i == 0: return v, t, p - if i == 1: return q, v, p - if i == 2: return p, v, t - if i == 3: return p, q, v - if i == 4: return t, p, v - if i == 5: return v, p, q + if i == 0: + return v, t, p + if i == 1: + return q, v, p + if i == 2: + return p, v, t + if i == 3: + return p, q, v + if i == 4: + return t, p, v + if i == 5: + return v, p, q # Cannot get here Modified: python/branches/io-c/Lib/decimal.py ============================================================================== --- python/branches/io-c/Lib/decimal.py (original) +++ python/branches/io-c/Lib/decimal.py Sun Feb 8 21:39:02 2009 @@ -136,6 +136,7 @@ import copy as _copy import math as _math +import numbers as _numbers try: from collections import namedtuple as _namedtuple @@ -3695,6 +3696,12 @@ return self +# Register Decimal as a kind of Number (an abstract base class). +# However, do not register it as Real (because Decimals are not +# interoperable with floats). +_numbers.Number.register(Decimal) + + ##### Context class ####################################################### Modified: python/branches/io-c/Lib/distutils/README ============================================================================== --- python/branches/io-c/Lib/distutils/README (original) +++ python/branches/io-c/Lib/distutils/README Sun Feb 8 21:39:02 2009 @@ -1,22 +1,11 @@ -This directory contains only a subset of the Distutils, specifically -the Python modules in the 'distutils' and 'distutils.command' -packages. This is all you need to distribute and install Python -modules using the Distutils. There is also a separately packaged -standalone version of the Distutils available for people who want to -upgrade the Distutils without upgrading Python, available from the -Distutils web page: +This directory contains the Distutils package. - http://www.python.org/sigs/distutils-sig/ +There's a full documentation available at: -The standalone version includes all of the code in this directory, -plus documentation, test scripts, examples, etc. + http://docs.python.org/distutils/ -The Distutils documentation is divided into two documents, "Installing -Python Modules", which explains how to install Python packages, and -"Distributing Python Modules", which explains how to write setup.py -files. Both documents are part of the standard Python documentation -set, and are available from http://www.python.org/doc/current/ . +The Distutils-SIG web page is also a good starting point: - Greg Ward (gward at python.net) + http://www.python.org/sigs/distutils-sig/ $Id$ Modified: python/branches/io-c/Lib/distutils/__init__.py ============================================================================== --- python/branches/io-c/Lib/distutils/__init__.py (original) +++ python/branches/io-c/Lib/distutils/__init__.py Sun Feb 8 21:39:02 2009 @@ -12,13 +12,8 @@ # Distutils version # -# Please coordinate with Marc-Andre Lemburg when adding -# new features to distutils that would warrant bumping the version number. +# Updated automatically by the Python release process. # -# In general, major and minor version should loosely follow the Python -# version number the distutils code was shipped with. -# - #--start constants-- __version__ = "3.1a0" #--end constants-- Modified: python/branches/io-c/Lib/distutils/cmd.py ============================================================================== --- python/branches/io-c/Lib/distutils/cmd.py (original) +++ python/branches/io-c/Lib/distutils/cmd.py Sun Feb 8 21:39:02 2009 @@ -7,7 +7,7 @@ __revision__ = "$Id$" import sys, os, re -from distutils.errors import * +from distutils.errors import DistutilsOptionError from distutils import util, dir_util, file_util, archive_util, dep_util from distutils import log @@ -155,15 +155,15 @@ from distutils.fancy_getopt import longopt_xlate if header is None: header = "command options for '%s':" % self.get_command_name() - print(indent + header) + self.announce(indent + header, level=log.INFO) indent = indent + " " for (option, _, _) in self.user_options: option = longopt_xlate(option) if option[-1] == "=": option = option[:-1] value = getattr(self, option) - print(indent + "%s = %s" % (option, value)) - + self.announce(indent + "%s = %s" % (option, value), + level=log.INFO) def run(self): """A command's raison d'etre: carry out the action it exists to @@ -383,12 +383,9 @@ and it is true, then the command is unconditionally run -- does no timestamp checks. """ - if exec_msg is None: - exec_msg = "generating %s from %s" % (outfile, ', '.join(infiles)) if skip_msg is None: skip_msg = "skipping %s (inputs unchanged)" % outfile - # Allow 'infiles' to be a single string if isinstance(infiles, str): infiles = (infiles,) @@ -396,10 +393,13 @@ raise TypeError( "'infiles' must be a string, or a list or tuple of strings") + if exec_msg is None: + exec_msg = "generating %s from %s" % (outfile, ', '.join(infiles)) + # If 'outfile' must be regenerated (either because it doesn't # exist, is out-of-date, or the 'force' flag is true) then # perform the action that presumably regenerates it - if self.force or dep_util.newer_group (infiles, outfile): + if self.force or dep_util.newer_group(infiles, outfile): self.execute(func, args, exec_msg, level) # Otherwise, print the "skip" message else: Modified: python/branches/io-c/Lib/distutils/command/build_ext.py ============================================================================== --- python/branches/io-c/Lib/distutils/command/build_ext.py (original) +++ python/branches/io-c/Lib/distutils/command/build_ext.py Sun Feb 8 21:39:02 2009 @@ -229,10 +229,12 @@ # building python standard extensions self.library_dirs.append('.') - # for extensions under Linux with a shared Python library, + # for extensions under Linux or Solaris with a shared Python library, # Python's library directory must be appended to library_dirs - if (sys.platform.startswith('linux') or sys.platform.startswith('gnu')) \ - and sysconfig.get_config_var('Py_ENABLE_SHARED'): + sysconfig.get_config_var('Py_ENABLE_SHARED') + if ((sys.platform.startswith('linux') or sys.platform.startswith('gnu') + or sys.platform.startswith('sunos')) + and sysconfig.get_config_var('Py_ENABLE_SHARED')): if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): # building third party extensions self.library_dirs.append(sysconfig.get_config_var('LIBDIR')) Modified: python/branches/io-c/Lib/distutils/command/install_lib.py ============================================================================== --- python/branches/io-c/Lib/distutils/command/install_lib.py (original) +++ python/branches/io-c/Lib/distutils/command/install_lib.py Sun Feb 8 21:39:02 2009 @@ -1,3 +1,8 @@ +"""distutils.command.install_lib + +Implements the Distutils 'install_lib' command +(install all Python modules).""" + __revision__ = "$Id$" import sys, os Modified: python/branches/io-c/Lib/distutils/command/wininst-9.0-amd64.exe ============================================================================== Binary files. No diff available. Modified: python/branches/io-c/Lib/distutils/command/wininst-9.0.exe ============================================================================== Binary files. No diff available. Modified: python/branches/io-c/Lib/distutils/dir_util.py ============================================================================== --- python/branches/io-c/Lib/distutils/dir_util.py (original) +++ python/branches/io-c/Lib/distutils/dir_util.py Sun Feb 8 21:39:02 2009 @@ -15,7 +15,7 @@ # 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=0, dry_run=0): +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 @@ -48,13 +48,9 @@ tails = [tail] # stack of lone dirs to create while head and tail and not os.path.isdir(head): - #print "splitting '%s': " % head, (head, tail) = os.path.split(head) - #print "to ('%s','%s')" % (head, tail) tails.insert(0, tail) # push next higher dir onto stack - #print "stack of tails:", tails - # now 'head' contains the deepest directory that already exists # (that is, the child of 'head' in 'name' is the highest directory # that does *not* exist) @@ -66,7 +62,8 @@ if _path_created.get(abs_head): continue - log.info("creating %s", head) + if verbose >= 1: + log.info("creating %s", head) if not dry_run: try: @@ -82,7 +79,7 @@ # mkpath () -def create_tree (base_dir, files, mode=0o777, verbose=0, dry_run=0): +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 @@ -99,7 +96,7 @@ # Now create them for dir in sorted(need_dir): - mkpath(dir, mode, dry_run=dry_run) + mkpath(dir, mode, verbose=verbose, dry_run=dry_run) # create_tree () @@ -109,7 +106,7 @@ preserve_times=1, preserve_symlinks=0, update=0, - verbose=0, + verbose=1, dry_run=0): """Copy an entire directory tree 'src' to a new location 'dst'. Both @@ -146,7 +143,7 @@ "error listing files in '%s': %s" % (src, errstr)) if not dry_run: - mkpath(dst) + mkpath(dst, verbose=verbose) outputs = [] @@ -156,7 +153,8 @@ if preserve_symlinks and os.path.islink(src_name): link_dest = os.readlink(src_name) - log.info("linking %s -> %s", dst_name, link_dest) + if verbose >= 1: + log.info("linking %s -> %s", dst_name, link_dest) if not dry_run: os.symlink(link_dest, dst_name) outputs.append(dst_name) @@ -165,10 +163,11 @@ outputs.extend( copy_tree(src_name, dst_name, preserve_mode, preserve_times, preserve_symlinks, update, - dry_run=dry_run)) + verbose=verbose, dry_run=dry_run)) else: copy_file(src_name, dst_name, preserve_mode, - preserve_times, update, dry_run=dry_run) + preserve_times, update, verbose=verbose, + dry_run=dry_run) outputs.append(dst_name) return outputs @@ -184,14 +183,15 @@ cmdtuples.append((os.rmdir, path)) -def remove_tree (directory, verbose=0, dry_run=0): +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). """ from distutils.util import grok_environment_error global _path_created - log.info("removing '%s' (and everything under it)", directory) + if verbose >= 1: + log.info("removing '%s' (and everything under it)", directory) if dry_run: return cmdtuples = [] Modified: python/branches/io-c/Lib/distutils/file_util.py ============================================================================== --- python/branches/io-c/Lib/distutils/file_util.py (original) +++ python/branches/io-c/Lib/distutils/file_util.py Sun Feb 8 21:39:02 2009 @@ -67,7 +67,7 @@ fsrc.close() def copy_file(src, dst, preserve_mode=1, preserve_times=1, update=0, - link=None, verbose=0, dry_run=0): + link=None, verbose=1, dry_run=0): """Copy a file 'src' to 'dst'. If 'dst' is a directory, then 'src' is copied there with the same name; otherwise, it must be a filename. (If the file exists, it will be ruthlessly clobbered.) If 'preserve_mode' @@ -112,17 +112,20 @@ dir = os.path.dirname(dst) if update and not newer(src, dst): - log.debug("not copying %s (output up-to-date)", src) + if verbose >= 1: + log.debug("not copying %s (output up-to-date)", src) return (dst, 0) try: action = _copy_action[link] except KeyError: raise ValueError("invalid value '%s' for 'link' argument" % link) - if os.path.basename(dst) == os.path.basename(src): - log.info("%s %s -> %s", action, src, dir) - else: - log.info("%s %s -> %s", action, src, dst) + + if verbose >= 1: + if os.path.basename(dst) == os.path.basename(src): + log.info("%s %s -> %s", action, src, dir) + else: + log.info("%s %s -> %s", action, src, dst) if dry_run: return (dst, 1) @@ -164,7 +167,7 @@ # XXX I suspect this is Unix-specific -- need porting help! def move_file (src, dst, - verbose=0, + verbose=1, dry_run=0): """Move a file 'src' to 'dst'. If 'dst' is a directory, the file will @@ -177,7 +180,8 @@ from os.path import exists, isfile, isdir, basename, dirname import errno - log.info("moving %s -> %s", src, dst) + if verbose >= 1: + log.info("moving %s -> %s", src, dst) if dry_run: return dst @@ -209,7 +213,7 @@ "couldn't move '%s' to '%s': %s" % (src, dst, msg)) if copy_it: - copy_file(src, dst) + copy_file(src, dst, verbose=verbose) try: os.unlink(src) except os.error as e: Modified: python/branches/io-c/Lib/distutils/sysconfig.py ============================================================================== --- python/branches/io-c/Lib/distutils/sysconfig.py (original) +++ python/branches/io-c/Lib/distutils/sysconfig.py Sun Feb 8 21:39:02 2009 @@ -72,14 +72,17 @@ prefix = plat_specific and EXEC_PREFIX or PREFIX if os.name == "posix": if python_build: + # Assume the executable is in the build directory. The + # pyconfig.h file should be in the same directory. Since + # the build directory may not be the source directory, we + # must use "srcdir" from the makefile to find the "Include" + # directory. base = os.path.dirname(os.path.abspath(sys.executable)) if plat_specific: - inc_dir = base + return base else: - inc_dir = os.path.join(base, "Include") - if not os.path.exists(inc_dir): - inc_dir = os.path.join(os.path.dirname(base), "Include") - return inc_dir + incdir = os.path.join(get_config_var('srcdir'), 'Include') + return os.path.normpath(incdir) return os.path.join(prefix, "include", "python" + get_python_version()) elif os.name == "nt": return os.path.join(prefix, "include") @@ -157,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) = \ + (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar) = \ get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', - 'CCSHARED', 'LDSHARED', 'SO') + 'CCSHARED', 'LDSHARED', 'SO', 'AR') if 'CC' in os.environ: cc = os.environ['CC'] @@ -180,6 +183,8 @@ cpp = cpp + ' ' + os.environ['CPPFLAGS'] cflags = cflags + ' ' + os.environ['CPPFLAGS'] ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] + if 'AR' in os.environ: + ar = os.environ['AR'] cc_cmd = cc + ' ' + cflags compiler.set_executables( @@ -188,7 +193,8 @@ compiler_so=cc_cmd + ' ' + ccshared, compiler_cxx=cxx, linker_so=ldshared, - linker_exe=cc) + linker_exe=cc, + archiver=ar) compiler.shared_lib_extension = so_ext @@ -498,6 +504,20 @@ _config_vars['prefix'] = PREFIX _config_vars['exec_prefix'] = EXEC_PREFIX + # Convert srcdir into an absolute path if it appears necessary. + # Normally it is relative to the build directory. However, during + # testing, for example, we might be running a non-installed python + # from a different directory. + if python_build and os.name == "posix": + base = os.path.dirname(os.path.abspath(sys.executable)) + if (not os.path.isabs(_config_vars['srcdir']) and + base != os.getcwd()): + # srcdir is relative and we are not in the same directory + # as the executable. Assume executable is in the build + # directory and make srcdir absolute. + srcdir = os.path.join(base, _config_vars['srcdir']) + _config_vars['srcdir'] = os.path.normpath(srcdir) + if sys.platform == 'darwin': kernel_version = os.uname()[2] # Kernel version (8.4.3) major_version = int(kernel_version.split('.')[0]) Modified: python/branches/io-c/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/io-c/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/io-c/Lib/distutils/tests/test_build_ext.py Sun Feb 8 21:39:02 2009 @@ -15,6 +15,10 @@ # Don't load the xx module more than once. ALREADY_TESTED = False +def _get_source_filename(): + srcdir = sysconfig.get_config_var('srcdir') + return os.path.join(srcdir, 'Modules', 'xxmodule.c') + class BuildExtTestCase(unittest.TestCase): def setUp(self): # Create a simple test environment @@ -22,9 +26,7 @@ self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_") self.sys_path = sys.path[:] sys.path.append(self.tmp_dir) - - xx_c = os.path.join(sysconfig.project_base, 'Modules', 'xxmodule.c') - shutil.copy(xx_c, self.tmp_dir) + shutil.copy(_get_source_filename(), self.tmp_dir) def test_build_ext(self): global ALREADY_TESTED @@ -75,10 +77,33 @@ # 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') + def test_solaris_enable_shared(self): + dist = Distribution({'name': 'xx'}) + cmd = build_ext(dist) + old = sys.platform + + sys.platform = 'sunos' # fooling finalize_options + from distutils.sysconfig import _config_vars + old_var = _config_vars.get('Py_ENABLE_SHARED') + _config_vars['Py_ENABLE_SHARED'] = 1 + try: + cmd.ensure_finalized() + finally: + sys.platform = old + if old_var is None: + del _config_vars['Py_ENABLE_SHARED'] + else: + _config_vars['Py_ENABLE_SHARED'] = old_var + + # make sur we get some lobrary dirs under solaris + self.assert_(len(cmd.library_dirs) > 0) + def test_suite(): - if not sysconfig.python_build: + src = _get_source_filename() + if not os.path.exists(src): if support.verbose: - print('test_build_ext: The test must be run in a python build dir') + print('test_build_ext: Cannot find source code (test' + ' must run in python build dir)') return unittest.TestSuite() else: return unittest.makeSuite(BuildExtTestCase) Modified: python/branches/io-c/Lib/distutils/tests/test_sdist.py ============================================================================== --- python/branches/io-c/Lib/distutils/tests/test_sdist.py (original) +++ python/branches/io-c/Lib/distutils/tests/test_sdist.py Sun Feb 8 21:39:02 2009 @@ -10,7 +10,7 @@ from distutils.core import Distribution from distutils.tests.test_config import PyPIRCCommandTestCase from distutils.errors import DistutilsExecError -from distutils.spawn import spawn +from distutils.spawn import find_executable CURDIR = os.path.dirname(__file__) TEMP_PKG = join(CURDIR, 'temppkg') @@ -111,15 +111,12 @@ def test_make_distribution(self): - self._init_tmp_pkg() + # check if tar and gzip are installed + if (find_executable('tar') is None or + find_executable('gzip') is None): + return - # check if tar is installed under win32 - if sys.platform == 'win32': - try: - spawn('tar --help') - except DistutilsExecError: - # let's return, no need to go further - return + self._init_tmp_pkg() # now building a sdist dist = Distribution() Modified: python/branches/io-c/Lib/distutils/tests/test_sysconfig.py ============================================================================== --- python/branches/io-c/Lib/distutils/tests/test_sysconfig.py (original) +++ python/branches/io-c/Lib/distutils/tests/test_sysconfig.py Sun Feb 8 21:39:02 2009 @@ -1,6 +1,8 @@ """Tests for distutils.dist.""" from distutils import sysconfig +from distutils.ccompiler import get_default_compiler + import os import unittest @@ -8,6 +10,13 @@ class SysconfigTestCase(unittest.TestCase): + def setUp(self): + self.old_AR = os.environ.get('AR') + + def tearDown(self): + if self.old_AR is not None: + os.environ['AR'] = self.old_AR + def test_get_config_h_filename(self): config_h = sysconfig.get_config_h_filename() self.assert_(os.path.isfile(config_h), config_h) @@ -19,27 +28,10 @@ # test for pythonxx.lib? def test_get_python_inc(self): - # The check for srcdir is copied from Python's setup.py, - # and is necessary to make this test pass when building - # Python in a directory other than the source directory. - (srcdir,) = sysconfig.get_config_vars('srcdir') - if not srcdir: - inc_dir = sysconfig.get_python_inc() - else: - # This test is not really a proper test: when building - # Python from source, even in the same directory, - # we won't be testing the same thing as when running - # distutils' tests on an installed Python. Nevertheless, - # let's try to do our best: if we are running Python's - # unittests from a build directory that is not the source - # directory, the normal inc_dir will exist, it will just not - # contain anything of interest. - inc_dir = sysconfig.get_python_inc() - self.assert_(os.path.isdir(inc_dir)) - # Now test the source location, to make sure Python.h does - # exist. - inc_dir = os.path.join(os.getcwd(), srcdir, 'Include') - inc_dir = os.path.normpath(inc_dir) + inc_dir = sysconfig.get_python_inc() + # This is not much of a test. We make sure Python.h exists + # in the directory returned by get_python_inc() but we don't know + # it is the correct file. self.assert_(os.path.isdir(inc_dir), inc_dir) python_h = os.path.join(inc_dir, "Python.h") self.assert_(os.path.isfile(python_h), python_h) @@ -49,6 +41,25 @@ self.assert_(isinstance(cvars, dict)) self.assert_(cvars) + def test_customize_compiler(self): + + # not testing if default compiler is not unix + if get_default_compiler() != 'unix': + return + + os.environ['AR'] = 'xxx' + + # make sure AR gets caught + class compiler: + compiler_type = 'unix' + + def set_executables(self, **kw): + self.exes = kw + + comp = compiler() + sysconfig.customize_compiler(comp) + self.assertEquals(comp.exes['archiver'], 'xxx') + def test_suite(): suite = unittest.TestSuite() Modified: python/branches/io-c/Lib/heapq.py ============================================================================== --- python/branches/io-c/Lib/heapq.py (original) +++ python/branches/io-c/Lib/heapq.py Sun Feb 8 21:39:02 2009 @@ -195,7 +195,7 @@ heapify(result) _heappushpop = heappushpop for elem in it: - heappushpop(result, elem) + _heappushpop(result, elem) result.sort(reverse=True) return result Modified: python/branches/io-c/Lib/http/client.py ============================================================================== --- python/branches/io-c/Lib/http/client.py (original) +++ python/branches/io-c/Lib/http/client.py Sun Feb 8 21:39:02 2009 @@ -265,14 +265,14 @@ # accepts iso-8859-1. def __init__(self, sock, debuglevel=0, strict=0, method=None): - # XXX If the response includes a content-length header, we + # If the response includes a content-length header, we # need to make sure that the client doesn't read more than the # specified number of bytes. If it does, it will block until # the server times out and closes the connection. (The only - # applies to HTTP/1.1 connections.) Since some clients access - # self.fp directly rather than calling read(), this is a little - # tricky. - self.fp = sock.makefile("rb", 0) + # applies to HTTP/1.1 connections.) This will happen if a self.fp.read() + # is done (without a size) whether self.fp is buffered or not. + # So, no self.fp.read() by clients unless they know what they are doing. + self.fp = sock.makefile("rb") self.debuglevel = debuglevel self.strict = strict self._method = method Modified: python/branches/io-c/Lib/importlib/NOTES ============================================================================== --- python/branches/io-c/Lib/importlib/NOTES (original) +++ python/branches/io-c/Lib/importlib/NOTES Sun Feb 8 21:39:02 2009 @@ -1,39 +1,6 @@ to do ///// -* Use test.loader_tests - - + builtin - + frozen - + extension - + source - -* Reorganize support code. - - + Separate general support code and importer-specific (e.g. source) support - code. - - Create support modules for each subdirectory (as needed). - + Add a file loader mock that returns monotonically increasing mtime. - - Use in source/test_reload. - - Use in source/test_load_module_mixed. - -* API simplification? - - + read_source -> get_data/source_path - + read_bytecode -> get_data/bytecode_path - + write_bytecode -> complete set of bytes for bytecode instead of - individual arguments. - -* Create meta_path importer for sys.path. - -* OPTIMIZE! - - + Write benchmark suite. - + Fast path common cases. - - - Absolute name from sys.path. - - Relative name from sys.path. - * Implement PEP 302 protocol for loaders (should just be a matter of testing). + Built-in. @@ -41,7 +8,7 @@ + Extension. + Source/bytecode. -* Public API to expose (w/ docs!) +* Public API left to expose (w/ docs!) + abc @@ -53,6 +20,8 @@ * load_module + - (?) Importer(Finder, Loader) + - ResourceLoader(Loader) * get_data @@ -67,19 +36,16 @@ * source_path * bytecode_path - * write_bytecode + * write_bytecode (not abstract) + util - - get_module decorator (new name) - - check_name decorator (new name) - - resolve_name + - get_module decorator (rename: module_for_loader) + - set___package__ decorator + machinery - (?) Chained path hook/finder - - BuiltinImporter - - FrozenImporter - (?) FileFinder - Extensions importers @@ -91,4 +57,19 @@ * SourceFinder * (?) Loader + - PathFinder + +* Write benchmark suite. + +* OPTIMIZE! + + + Fast path absolute name. + + Fast path pulling from sys.modules. + * Bootstrap importlib as implementation of builtins.__import__ + +* Replace standard library modules. + + + imp + + py_compile + + compileall Modified: python/branches/io-c/Lib/importlib/__init__.py ============================================================================== --- python/branches/io-c/Lib/importlib/__init__.py (original) +++ python/branches/io-c/Lib/importlib/__init__.py Sun Feb 8 21:39:02 2009 @@ -29,7 +29,7 @@ """Set __import__ to an instance of Import.""" global original__import__ original__import__ = __import__ - __builtins__['__import__'] = Import() + __builtins__['__import__'] = _bootstrap._import def _reset__import__(): @@ -114,7 +114,7 @@ # Public API ######################################################### -__import__ = _bootstrap.Import().__call__ +__import__ = _bootstrap._import def import_module(name, package=None): @@ -125,17 +125,15 @@ relative import to an absolute import. """ + level = 0 if name.startswith('.'): if not package: raise TypeError("relative imports require the 'package' argument") - level = 0 for character in name: if character != '.': break level += 1 - name = Import._resolve_name(name[level:], package, level) - __import__(name) - return sys.modules[name] + return _bootstrap._gcd_import(name[level:], package, level) # XXX This should go away once the public API is done. Modified: python/branches/io-c/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/io-c/Lib/importlib/_bootstrap.py (original) +++ python/branches/io-c/Lib/importlib/_bootstrap.py Sun Feb 8 21:39:02 2009 @@ -90,6 +90,26 @@ self.obj.close() +def wrap(new, old): + """Simple substitute for functools.wraps.""" + for replace in ['__module__', '__name__', '__doc__']: + setattr(new, replace, getattr(old, replace)) + new.__dict__.update(old.__dict__) + + +def set___package__(fxn): + """Set __package__ on the returned module.""" + def wrapper(*args, **kwargs): + module = fxn(*args, **kwargs) + if not hasattr(module, '__package__') or module.__package__ is None: + module.__package__ = module.__name__ + if not hasattr(module, '__path__'): + module.__package__ = module.__package__.rpartition('.')[0] + return module + wrap(wrapper, fxn) + return wrapper + + class BuiltinImporter: """Meta path loader for built-in modules. @@ -111,11 +131,13 @@ return cls if imp.is_builtin(fullname) else None @classmethod + @set___package__ def load_module(cls, fullname): """Load a built-in module.""" if fullname not in sys.builtin_module_names: raise ImportError("{0} is not a built-in module".format(fullname)) - return imp.init_builtin(fullname) + module = imp.init_builtin(fullname) + return module class FrozenImporter: @@ -133,11 +155,13 @@ return cls if imp.is_frozen(fullname) else None @classmethod + @set___package__ def load_module(cls, fullname): """Load a frozen module.""" if cls.find_module(fullname) is None: raise ImportError("{0} is not a frozen module".format(fullname)) - return imp.init_frozen(fullname) + module = imp.init_frozen(fullname) + return module class ChainedImporter(object): @@ -197,9 +221,7 @@ if self._name != name: raise ImportError("loader cannot handle %s" % name) return method(self, name, *args, **kwargs) - inner.__name__ = method.__name__ - inner.__doc__ = method.__doc__ - inner.__dict__.update(method.__dict__) + wrap(inner, method) return inner @@ -224,6 +246,7 @@ raise ValueError("extension modules cannot be packages") @check_name + @set___package__ def load_module(self, fullname): """Load an extension module.""" assert self._name == fullname @@ -301,6 +324,7 @@ elif hasattr(module, attr): delattr(module, attr) raise + wrap(decorated, fxn) return decorated @@ -336,13 +360,15 @@ else: return None - def _source_path(self): + @check_name + def source_path(self, fullname): """Return the path to an existing source file for the module, or None if one cannot be found.""" # Not a property so that it is easy to override. return self._find_path(imp.PY_SOURCE) - def _bytecode_path(self): + @check_name + def bytecode_path(self, fullname): """Return the path to a bytecode file, or None if one does not exist.""" # Not a property for easy overriding. @@ -352,18 +378,17 @@ @get_module def load_module(self, module): """Load a Python source or bytecode module.""" - source_path = self._source_path() - bytecode_path = self._bytecode_path() + name = module.__name__ + source_path = self.source_path(name) + bytecode_path = self.bytecode_path(name) code_object = self.get_code(module.__name__) module.__file__ = source_path if source_path else bytecode_path module.__loader__ = self if self._is_pkg: module.__path__ = [module.__file__.rsplit(path_sep, 1)[0]] - module.__package__ = module.__name__ - elif '.' in module.__name__: - module.__package__ = module.__name__.rsplit('.', 1)[0] - else: - module.__package__ = None + module.__package__ = module.__name__ + if not hasattr(module, '__path__'): + module.__package__ = module.__package__.rpartition('.')[0] exec(code_object, module.__dict__) return module @@ -371,7 +396,7 @@ def source_mtime(self, name): """Return the modification time of the source for the specified module.""" - source_path = self._source_path() + source_path = self.source_path(name) if not source_path: return None return int(_os.stat(source_path).st_mtime) @@ -384,7 +409,7 @@ laoder cannot handle the specified module. """ - source_path = self._source_path() + source_path = self._source_path(name) if source_path is None: return None import tokenize @@ -395,57 +420,20 @@ return open(source_path, encoding=encoding).read() @check_name - def read_source(self, fullname): - """Return the source for the specified module as bytes along with the - path where the source came from. - - The returned path is used by 'compile' for error messages. - - """ - source_path = self._source_path() - if source_path is None: - return None - with closing(_io.FileIO(source_path, 'r')) as bytes_file: - return bytes_file.read(), source_path - - @check_name - def read_bytecode(self, name): - """Return the magic number, timestamp, and the module bytecode for the - module. - - Raises ImportError (just like get_source) if the laoder cannot handle - the module. Returns None if there is no bytecode. - - """ - path = self._bytecode_path() - if path is None: - return None - file = _io.FileIO(path, 'r') - try: - with closing(file) as bytecode_file: - data = bytecode_file.read() - return data[:4], marshal._r_long(data[4:8]), data[8:] - except AttributeError: - return None - - @check_name - def write_bytecode(self, name, magic, timestamp, data): - """Write out 'data' for the specified module using the specific - timestamp, returning a boolean + def write_bytecode(self, name, data): + """Write out 'data' for the specified module, returning a boolean signifying if the write-out actually occurred. Raises ImportError (just like get_source) if the specified module cannot be handled by the loader. """ - bytecode_path = self._bytecode_path() + bytecode_path = self.bytecode_path(name) if not bytecode_path: bytecode_path = self._base_path + suffix_list(imp.PY_COMPILED)[0] file = _io.FileIO(bytecode_path, 'w') try: with closing(file) as bytecode_file: - bytecode_file.write(magic) - bytecode_file.write(marshal._w_long(timestamp)) bytecode_file.write(data) return True except IOError as exc: @@ -454,39 +442,19 @@ else: raise - # XXX Take an optional argument to flag whether to write bytecode? @check_name def get_code(self, name): - """Return the code object for the module. - - 'self' must implement: - - * read_bytecode(name:str) -> (int, int, bytes) or None - Return the magic number, timestamp, and bytecode for the - module. None is returned if not bytecode is available. - - * source_mtime(name:str) -> int - Return the last modification time for the source of the module. - Returns None if their is no source. - - * read_source(name:str) -> (bytes, str) - Return the source code for the module and the path to use in - the call to 'compile'. Not called if source_mtime returned - None. - - * write_bytecode(name:str, magic:bytes, timestamp:int, data:str) - Write out bytecode for the module with the specified magic - number and timestamp. Not called if sys.dont_write_bytecode is - True. - - """ + """Return the code object for the module.""" # XXX Care enough to make sure this call does not happen if the magic # number is bad? source_timestamp = self.source_mtime(name) # Try to use bytecode if it is available. - bytecode_tuple = self.read_bytecode(name) - if bytecode_tuple: - magic, pyc_timestamp, bytecode = bytecode_tuple + bytecode_path = self.bytecode_path(name) + if bytecode_path: + data = self.get_data(bytecode_path) + magic = data[:4] + pyc_timestamp = marshal._r_long(data[4:8]) + bytecode = data[8:] try: # Verify that the magic number is valid. if imp.get_magic() != magic: @@ -511,7 +479,8 @@ raise ImportError("no source or bytecode available to create code " "object for {0!r}".format(name)) # Use the source. - source, source_path = self.read_source(name) + source_path = self.source_path(name) + source = self.get_data(source_path) # Convert to universal newlines. line_endings = b'\n' for index, c in enumerate(source): @@ -530,8 +499,10 @@ code_object = compile(source, source_path, 'exec', dont_inherit=True) # Generate bytecode and write it out. if not sys.dont_write_bytecode: - data = marshal.dumps(code_object) - self.write_bytecode(name, imp.get_magic(), source_timestamp, data) + data = bytearray(imp.get_magic()) + data.extend(marshal._w_long(source_timestamp)) + data.extend(marshal.dumps(code_object)) + self.write_bytecode(name, data) return code_object def get_data(self, path): @@ -635,319 +606,209 @@ super(PyFileImporter, self).__init__(path_entry) -class ImportLockContext(object): - - """Context manager for the import lock.""" - - def __enter__(self): - """Acquire the import lock.""" - imp.acquire_lock() - - def __exit__(self, exc_type, exc_value, exc_traceback): - """Release the import lock regardless of any raised exceptions.""" - imp.release_lock() - +class PathFinder: -class Import(object): + """Meta path finder for sys.(path|path_hooks|path_importer_cache).""" - """Class that implements the __import__ interface. + _default_hook = staticmethod(chaining_fs_path_hook(ExtensionFileImporter, + PyFileImporter)) - Backwards compatibility is maintained by extending sys.meta_path - interally (for handling built-in and frozen modules) and providing a - default path hooks entry for extension modules, .py, and .pyc - files. Both are controlled during instance initialization. - - """ + # The list of implicit hooks cannot be a class attribute because of + # bootstrapping issues for accessing imp. + @classmethod + def _implicit_hooks(cls): + """Return a list of the implicit path hooks.""" + return [cls._default_hook, imp.NullImporter] - def __init__(self, default_path_hook=None, - extended_meta_path=None): - """Store a default path hook entry and a sequence to internally extend - sys.meta_path by (passing in None uses default importers).""" - if extended_meta_path is None: - self.extended_meta_path = BuiltinImporter, FrozenImporter - else: - self.extended_meta_path = extended_meta_path - self.default_path_hook = default_path_hook - if self.default_path_hook is None: - # Create a handler to deal with extension modules, .py, and .pyc - # files. Built-in and frozen modules are handled by sys.meta_path - # entries. - importers = [ExtensionFileImporter, PyFileImporter] - self.default_path_hook = chaining_fs_path_hook(*importers) - - def _search_meta_path(self, name, path=None): - """Check the importers on sys.meta_path for a loader along with the - extended meta path sequence stored within this instance. + @classmethod + def _path_hooks(cls, path): + """Search sys.path_hooks for a finder for 'path'. - The extended sys.meta_path entries are searched after the entries on - sys.meta_path. + Guaranteed to return a finder for the path as NullImporter is the + default importer for any path that does not have an explicit finder. """ - for entry in (tuple(sys.meta_path) + self.extended_meta_path): - loader = entry.find_module(name, path) - if loader: - return loader + for hook in sys.path_hooks + cls._implicit_hooks(): + try: + return hook(path) + except ImportError: + continue else: - raise ImportError("No module named %s" % name) + # This point should never be reached thanks to NullImporter. + raise SystemError("no hook could find an importer for " + "{0}".format(path)) - def _sys_path_importer(self, path_entry): - """Return the importer for the specified path, from - sys.path_importer_cache if possible. + @classmethod + def _path_importer_cache(cls, path): + """Get the finder for the path from sys.path_importer_cache. - If None is stored in sys.path_importer_cache then use the default path - hook. + If the path is not in the cache, find the appropriate finder and cache + it. If None is cached, get the default finder and cache that + (if applicable). + + Because of NullImporter, some finder should be returned. The only + explicit fail case is if None is cached but the path cannot be used for + the default hook, for which ImportError is raised. """ try: - # See if an importer is cached. - importer = sys.path_importer_cache[path_entry] - # If None was returned, use default importer factory. - if importer is None: - return self.default_path_hook(path_entry) - else: - return importer + finder = sys.path_importer_cache[path] except KeyError: - # No cached importer found; try to get a new one from - # sys.path_hooks or imp.NullImporter. - for importer_factory in (sys.path_hooks + [imp.NullImporter]): - try: - importer = importer_factory(path_entry) - sys.path_importer_cache[path_entry] = importer - return importer - except ImportError: - continue - else: - # No importer factory on sys.path_hooks works; use the default - # importer factory and store None in sys.path_importer_cache. - try: - importer = self.default_path_hook(path_entry) - sys.path_importer_cache[path_entry] = None - return importer - except ImportError: - raise ImportError("no importer found for %s" % path_entry) - - def _search_std_path(self, name, path=None): - """Check sys.path or 'path' (depending if 'path' is set) for the - named module and return its loader.""" - if path: - search_paths = path + finder = cls._path_hooks(path) + sys.path_importer_cache[path] = finder else: - search_paths = sys.path - for entry in search_paths: + if finder is None: + # Raises ImportError on failure. + finder = cls._default_hook(path) + sys.path_importer_cache[path] = finder + return finder + + @classmethod + def find_module(cls, fullname, path=None): + """Find the module on sys.path or 'path'.""" + if not path: + path = sys.path + for entry in path: try: - importer = self._sys_path_importer(entry) + finder = cls._path_importer_cache(entry) except ImportError: continue - loader = importer.find_module(name) + loader = finder.find_module(fullname) if loader: return loader else: - raise ImportError("No module named %s" % name) + return None - def module_from_cache(self, name): - """Try to return the named module from sys.modules. - Return False if the module is not in the cache. - """ - if name in sys.modules: - return sys.modules[name] - else: - return False +class ImportLockContext(object): - def post_import(self, module): - """Perform any desired post-import processing on the module.""" - return module + """Context manager for the import lock.""" - def _import_module(self, name, path=None): - """Import the specified module with no handling of parent modules. + def __enter__(self): + """Acquire the import lock.""" + imp.acquire_lock() - If None is set for a value in sys.modules (to signify that a relative - import was attempted and failed) then ImportError is raised. + def __exit__(self, exc_type, exc_value, exc_traceback): + """Release the import lock regardless of any raised exceptions.""" + imp.release_lock() - """ - cached_module = self.module_from_cache(name) - if cached_module is not False: - if cached_module is None: - raise ImportError("relative import redirect") - else: - return cached_module - try: - # Attempt to find a loader on sys.meta_path. - loader = self._search_meta_path(name, path) - except ImportError: - # sys.meta_path search failed. Attempt to find a loader on - # sys.path. If this fails then module cannot be found. - loader = self._search_std_path(name, path) - # A loader was found. It is the loader's responsibility to have put an - # entry in sys.modules. - module = self.post_import(loader.load_module(name)) - # 'module' could be something like None. - if not hasattr(module, '__name__'): - return module - # Set __package__. - if not hasattr(module, '__package__') or module.__package__ is None: - if hasattr(module, '__path__'): - module.__package__ = module.__name__ - elif '.' in module.__name__: - pkg_name = module.__name__.rsplit('.', 1)[0] - module.__package__ = pkg_name - else: - module.__package__ = None - return module +def _gcd_import(name, package=None, level=0): + """Import and return the module based on its name, the package the call is + being made from, and the level adjustment. + + This function represents the greatest common denominator of functionality + between import_module and __import__. This includes settting __package__ if + the loader did not. - def _import_full_module(self, name): - """Import a module and set it on its parent if needed.""" - path_list = None - parent_name = name.rsplit('.', 1)[0] - parent = None - if parent_name != name: - parent = sys.modules[parent_name] + """ + if package: + if not hasattr(package, 'rindex'): + raise ValueError("__package__ not set to a string") + elif package not in sys.modules: + msg = ("Parent module {0!r} not loaded, cannot perform relative " + "import") + raise SystemError(msg.format(package)) + if not name and level == 0: + raise ValueError("Empty module name") + if level > 0: + dot = len(package) + for x in range(level, 1, -1): try: - path_list = parent.__path__ - except AttributeError: - pass - self._import_module(name, path_list) - module = sys.modules[name] - if parent: - tail = name.rsplit('.', 1)[-1] - setattr(parent, tail, module) - - def _find_package(self, name, has_path): - """Return the package that the caller is in or None.""" - if has_path: - return name - elif '.' in name: - return name.rsplit('.', 1)[0] + dot = package.rindex('.', 0, dot) + except ValueError: + raise ValueError("attempted relative import beyond " + "top-level package") + if name: + name = "{0}.{1}".format(package[:dot], name) else: - return None - - @staticmethod - def _resolve_name(name, package, level): - """Return the absolute name of the module to be imported.""" - level -= 1 + name = package[:dot] + with ImportLockContext(): try: - if package.count('.') < level: - raise ValueError("attempted relative import beyond top-level " - "package") - except AttributeError: - raise ValueError("__package__ not set to a string") - base = package.rsplit('.', level)[0] - if name: - return "{0}.{1}".format(base, name) + return sys.modules[name] + except KeyError: + pass + parent = name.rpartition('.')[0] + path = None + if parent: + if parent not in sys.modules: + _gcd_import(parent) + # Backwards-compatibility; be nicer to skip the dict lookup. + parent_module = sys.modules[parent] + path = parent_module.__path__ + meta_path = (sys.meta_path + + [BuiltinImporter, FrozenImporter, PathFinder]) + for finder in meta_path: + loader = finder.find_module(name, path) + if loader is not None: + loader.load_module(name) + break else: - return base - - def _return_module(self, absolute_name, relative_name, fromlist): - """Return the proper module based on what module was requested (and its - absolute module name), who is requesting it, and whether any specific - attributes were specified. - - The semantics of this method revolve around 'fromlist'. When it is - empty, the module up to the first dot is to be returned. When the - module being requested is an absolute name this is simple (and - relative_name is an empty string). But if the requested module was - a relative import (as signaled by relative_name having a non-false - value), then the name up to the first dot in the relative name resolved - to an absolute name is to be returned. - - When fromlist is not empty and the module being imported is a package, - then the values - in fromlist need to be checked for. If a value is not a pre-existing - attribute a relative import is attempted. If it fails then suppressed - the failure silently. + raise ImportError("No module named {0}".format(name)) + # Backwards-compatibility; be nicer to skip the dict lookup. + module = sys.modules[name] + if parent: + # Set the module as an attribute on its parent. + setattr(parent_module, name.rpartition('.')[2], module) + # Set __package__ if the loader did not. + if not hasattr(module, '__package__') or module.__package__ is None: + # Watch out for what comes out of sys.modules to not be a module, + # e.g. an int. + try: + module.__package__ = module.__name__ + if not hasattr(module, '__path__'): + module.__package__ = module.__package__.rpartition('.')[0] + except AttributeError: + pass + return module - """ - if not fromlist: - if relative_name: - absolute_base = absolute_name.rpartition(relative_name)[0] - relative_head = relative_name.split('.', 1)[0] - to_return = absolute_base + relative_head - else: - to_return = absolute_name.split('.', 1)[0] - return sys.modules[to_return] - # When fromlist is not empty, return the actual module specified in - # the import. - else: - module = sys.modules[absolute_name] - if hasattr(module, '__path__') and hasattr(module, '__name__'): - # When fromlist has a value and the imported module is a - # package, then if a name in fromlist is not found as an - # attribute on module, try a relative import to find it. - # Failure is fine and the exception is suppressed. - check_for = list(fromlist) - if '*' in check_for and hasattr(module, '__all__'): - check_for.extend(module.__all__) - for item in check_for: - if item == '*': - continue - if not hasattr(module, item): - resolved_name = self._resolve_name(item, - module.__name__, 1) - try: - self._import_full_module(resolved_name) - except ImportError: - pass - return module - def __call__(self, name, globals={}, locals={}, fromlist=[], level=0): - """Import a module. +def _import(name, globals={}, locals={}, fromlist=[], level=0): + """Import a module. - The 'name' argument is the name of the module to be imported (e.g., - 'foo' in ``import foo`` or ``from foo import ...``). + The 'globals' argument is used to infer where the import is occuring from + to handle relative imports. The 'locals' argument is ignored. The + 'fromlist' argument specifies what should exist as attributes on the module + being imported (e.g. ``from module import ``). The 'level' + argument represents the package location to import from in a relative + import (e.g. ``from ..pkg import mod`` would have a 'level' of 2). - 'globals' and 'locals' are the global and local namespace dictionaries - of the module where the import statement appears. 'globals' is used to - introspect the __path__ and __name__ attributes of the module making - the call. 'local's is ignored. - - 'fromlist' lists any specific objects that are to eventually be put - into the namespace (e.g., ``from for.bar import baz`` would have 'baz' - in the fromlist, and this includes '*'). An entry of '*' will lead to - a check for __all__ being defined on the module. If it is defined then - the values in __all__ will be checked to make sure that all values are - attributes on the module, attempting a module import relative to 'name' - to set that attribute. - - When 'name' is a dotted name, there are two different situations to - consider for the return value. One is when the fromlist is empty. - In this situation the import statement imports and returns the name up - to the first dot. All subsequent names are imported but set as - attributes as needed on parent modules. When fromlist is not empty - then the module represented by the full dotted name is returned. - - 'level' represents possible relative imports. - A value of 0 is for absolute module names. Any positive value - represents the number of dots listed in the relative import statement - (e.g. has a value of 2 for ``from .. import foo``). + """ + if level == 0: + module = _gcd_import(name) + else: + # __package__ is not guaranteed to be defined. + try: + package = globals['__package__'] + except KeyError: + package = globals['__name__'] + if '__path__' not in globals: + package = package.rpartition('.')[0] + module = _gcd_import(name, package, level) + # The hell that is fromlist ... + if not fromlist: + # Return up to the first dot in 'name'. This is complicated by the fact + # that 'name' may be relative. + if level == 0: + return sys.modules[name.partition('.')[0]] + elif not name: + return module + else: + cut_off = len(name) - len(name.partition('.')[0]) + return sys.modules[module.__name__[:-cut_off]] + else: + # If a package was imported, try to import stuff from fromlist. + if hasattr(module, '__path__'): + if '*' in fromlist and hasattr(module, '__all__'): + fromlist.remove('*') + fromlist.extend(module.__all__) + for x in (y for y in fromlist if not hasattr(module,y)): + try: + _gcd_import('{0}.{1}'.format(module.__name__, x)) + except ImportError: + pass + return module - """ - if not name and level < 1: - raise ValueError("Empty module name") - is_pkg = True if '__path__' in globals else False - caller_name = globals.get('__name__') - package = globals.get('__package__') - if caller_name and not package: - package = self._find_package(caller_name, '__path__' in globals) - if package and package not in sys.modules: - if not hasattr(package, 'rsplit'): - raise ValueError("__package__ not set to a string") - msg = ("Parent module {0!r} not loaded, " - "cannot perform relative import") - raise SystemError(msg.format(package)) - with ImportLockContext(): - if level: - imported_name = self._resolve_name(name, package, level) - else: - imported_name = name - parent_name = imported_name.rsplit('.', 1)[0] - if parent_name != imported_name and parent_name not in sys.modules: - self.__call__(parent_name, level=0) - # This call will also handle setting the attribute on the - # package. - self._import_full_module(imported_name) - relative_name = '' if imported_name == name else name - return self._return_module(imported_name, relative_name, fromlist) # XXX Eventually replace with a proper __all__ value (i.e., don't expose os # replacements but do expose _ExtensionFileLoader, etc. for testing). Modified: python/branches/io-c/Lib/importlib/machinery.py ============================================================================== --- python/branches/io-c/Lib/importlib/machinery.py (original) +++ python/branches/io-c/Lib/importlib/machinery.py Sun Feb 8 21:39:02 2009 @@ -2,3 +2,4 @@ from ._bootstrap import BuiltinImporter from ._bootstrap import FrozenImporter +from ._bootstrap import PathFinder Modified: python/branches/io-c/Lib/importlib/test/__init__.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/__init__.py (original) +++ python/branches/io-c/Lib/importlib/test/__init__.py Sun Feb 8 21:39:02 2009 @@ -9,7 +9,8 @@ if name.startswith('.'): continue path = os.path.join(directory, name) - if os.path.isfile(path) and name.startswith('test_'): + if (os.path.isfile(path) and name.startswith('test_') and + name.endswith('.py')): submodule_name = os.path.splitext(name)[0] module_name = "{0}.{1}".format(package, submodule_name) __import__(module_name, level=0) @@ -20,6 +21,8 @@ __import__(package_name, level=0) package_tests = getattr(sys.modules[package_name], 'test_suite')() suite.addTest(package_tests) + else: + continue return suite Modified: python/branches/io-c/Lib/importlib/test/builtin/test_finder.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/builtin/test_finder.py (original) +++ python/branches/io-c/Lib/importlib/test/builtin/test_finder.py Sun Feb 8 21:39:02 2009 @@ -1,11 +1,11 @@ from importlib import machinery -from .. import finder_tests -from .. import support +from .. import abc +from .. import util import sys import unittest -class FinderTests(finder_tests.FinderTests): +class FinderTests(abc.FinderTests): """Test find_module() for built-in modules.""" @@ -14,7 +14,7 @@ def test_module(self): # Common case. - with support.uncache(self.name): + with util.uncache(self.name): self.assert_(machinery.BuiltinImporter.find_module(self.name)) def test_package(self): @@ -40,7 +40,7 @@ def test_ignore_path(self): # The value for 'path' should always trigger a failed import. - with support.uncache(self.name): + with util.uncache(self.name): loader = machinery.BuiltinImporter.find_module(self.name, ['pkg']) self.assert_(loader is None) Modified: python/branches/io-c/Lib/importlib/test/builtin/test_loader.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/builtin/test_loader.py (original) +++ python/branches/io-c/Lib/importlib/test/builtin/test_loader.py Sun Feb 8 21:39:02 2009 @@ -1,20 +1,21 @@ import importlib from importlib import machinery -from .. import support +from .. import abc +from .. import util import sys import types import unittest -class LoaderTests(unittest.TestCase): +class LoaderTests(abc.LoaderTests): """Test load_module() for built-in modules.""" assert 'errno' in sys.builtin_module_names name = 'errno' - verification = {'__name__': 'errno', '__package__': None} + verification = {'__name__': 'errno', '__package__': ''} def verify(self, module): """Verify that the module matches against what it should have.""" @@ -26,13 +27,32 @@ load_module = staticmethod(lambda name: machinery.BuiltinImporter.load_module(name)) - def test_load_module(self): + def test_module(self): # Common case. - with support.uncache(self.name): + with util.uncache(self.name): module = self.load_module(self.name) self.verify(module) - def test_nonexistent(self): + def test_package(self): + # Built-in modules cannot be a package. + pass + + def test_lacking_parent(self): + # Built-in modules cannot be a package. + pass + + def test_state_after_failure(self): + # Not way to force an imoprt failure. + pass + + def test_module_reuse(self): + # Test that the same module is used in a reload. + with util.uncache(self.name): + module1 = self.load_module(self.name) + module2 = self.load_module(self.name) + self.assert_(module1 is module2) + + def test_unloadable(self): name = 'dssdsdfff' assert name not in sys.builtin_module_names self.assertRaises(ImportError, self.load_module, name) Modified: python/branches/io-c/Lib/importlib/test/extension/test_case_sensitivity.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/extension/test_case_sensitivity.py (original) +++ python/branches/io-c/Lib/importlib/test/extension/test_case_sensitivity.py Sun Feb 8 21:39:02 2009 @@ -1,29 +1,29 @@ import sys -from test import support as test_support +from test import support import unittest import importlib -from .. import support -from . import test_path_hook +from .. import util +from . import util as ext_util - at support.case_insensitive_tests + at util.case_insensitive_tests class ExtensionModuleCaseSensitivityTest(unittest.TestCase): def find_module(self): - good_name = test_path_hook.NAME + good_name = ext_util.NAME bad_name = good_name.upper() assert good_name != bad_name - finder = importlib.ExtensionFileImporter(test_path_hook.PATH) + finder = importlib.ExtensionFileImporter(ext_util.PATH) return finder.find_module(bad_name) def test_case_sensitive(self): - with test_support.EnvironmentVarGuard() as env: + with support.EnvironmentVarGuard() as env: env.unset('PYTHONCASEOK') loader = self.find_module() self.assert_(loader is None) def test_case_insensitivity(self): - with test_support.EnvironmentVarGuard() as env: + with support.EnvironmentVarGuard() as env: env.set('PYTHONCASEOK', '1') loader = self.find_module() self.assert_(hasattr(loader, 'load_module')) @@ -32,7 +32,7 @@ def test_main(): - test_support.run_unittest(ExtensionModuleCaseSensitivityTest) + support.run_unittest(ExtensionModuleCaseSensitivityTest) if __name__ == '__main__': Modified: python/branches/io-c/Lib/importlib/test/extension/test_finder.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/extension/test_finder.py (original) +++ python/branches/io-c/Lib/importlib/test/extension/test_finder.py Sun Feb 8 21:39:02 2009 @@ -1,19 +1,19 @@ import importlib -from .. import finder_tests -from . import test_path_hook +from .. import abc +from . import util import unittest -class FinderTests(finder_tests.FinderTests): +class FinderTests(abc.FinderTests): """Test the finder for extension modules.""" def find_module(self, fullname): - importer = importlib.ExtensionFileImporter(test_path_hook.PATH) + importer = importlib.ExtensionFileImporter(util.PATH) return importer.find_module(fullname) def test_module(self): - self.assert_(self.find_module(test_path_hook.NAME)) + self.assert_(self.find_module(util.NAME)) def test_package(self): # Extension modules cannot be an __init__ for a package. Modified: python/branches/io-c/Lib/importlib/test/extension/test_loader.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/extension/test_loader.py (original) +++ python/branches/io-c/Lib/importlib/test/extension/test_loader.py Sun Feb 8 21:39:02 2009 @@ -1,30 +1,49 @@ import importlib -from . import test_path_hook -from .. import support +from . import util as ext_util +from .. import abc +from .. import util import sys import unittest -class LoaderTests(unittest.TestCase): +class LoaderTests(abc.LoaderTests): """Test load_module() for extension modules.""" def load_module(self, fullname): - loader = importlib._ExtensionFileLoader(test_path_hook.NAME, - test_path_hook.FILEPATH, - False) + loader = importlib._ExtensionFileLoader(ext_util.NAME, + ext_util.FILEPATH, False) return loader.load_module(fullname) - def test_success(self): - with support.uncache(test_path_hook.NAME): - module = self.load_module(test_path_hook.NAME) - for attr, value in [('__name__', test_path_hook.NAME), - ('__file__', test_path_hook.FILEPATH)]: + def test_module(self): + with util.uncache(ext_util.NAME): + module = self.load_module(ext_util.NAME) + for attr, value in [('__name__', ext_util.NAME), + ('__file__', ext_util.FILEPATH), + ('__package__', '')]: self.assertEqual(getattr(module, attr), value) - self.assert_(test_path_hook.NAME in sys.modules) + self.assert_(ext_util.NAME in sys.modules) - def test_failure(self): + def test_package(self): + # Extensions are not found in packages. + pass + + def test_lacking_parent(self): + # Extensions are not found in packages. + pass + + def test_module_reuse(self): + with util.uncache(ext_util.NAME): + module1 = self.load_module(ext_util.NAME) + module2 = self.load_module(ext_util.NAME) + self.assert_(module1 is module2) + + def test_state_after_failure(self): + # No easy way to trigger a failure after a successful import. + pass + + def test_unloadable(self): self.assertRaises(ImportError, self.load_module, 'asdfjkl;') Modified: python/branches/io-c/Lib/importlib/test/extension/test_path_hook.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/extension/test_path_hook.py (original) +++ python/branches/io-c/Lib/importlib/test/extension/test_path_hook.py Sun Feb 8 21:39:02 2009 @@ -1,31 +1,12 @@ import importlib +from . import util import collections import imp -from os import path import sys import unittest -PATH = None -EXT = None -FILENAME = None -NAME = '_testcapi' -_file_exts = [x[0] for x in imp.get_suffixes() if x[2] == imp.C_EXTENSION] -try: - for PATH in sys.path: - for EXT in _file_exts: - FILENAME = NAME + EXT - FILEPATH = path.join(PATH, FILENAME) - if path.exists(path.join(PATH, FILENAME)): - raise StopIteration - else: - PATH = EXT = FILENAME = FILEPATH = None -except StopIteration: - pass -del _file_exts - - class PathHookTests(unittest.TestCase): """Test the path hook for extension modules.""" @@ -38,7 +19,7 @@ def test_success(self): # Path hook should handle a directory where a known extension module # exists. - self.assert_(hasattr(self.hook(PATH), 'find_module')) + self.assert_(hasattr(self.hook(util.PATH), 'find_module')) def test_main(): Deleted: python/branches/io-c/Lib/importlib/test/finder_tests.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/finder_tests.py Sun Feb 8 21:39:02 2009 +++ (empty file) @@ -1,39 +0,0 @@ -import abc -import unittest - - -class FinderTests(unittest.TestCase, metaclass=abc.ABCMeta): - - """Basic tests for a finder to pass.""" - - @abc.abstractmethod - def test_module(self): - # Test importing a top-level module. - pass - - @abc.abstractmethod - def test_package(self): - # Test importing a package. - pass - - @abc.abstractmethod - def test_module_in_package(self): - # Test importing a module contained within a package. - # A value for 'path' should be used if for a meta_path finder. - pass - - @abc.abstractmethod - def test_package_in_package(self): - # Test importing a subpackage. - # A value for 'path' should be used if for a meta_path finder. - pass - - @abc.abstractmethod - def test_package_over_module(self): - # Test that packages are chosen over modules. - pass - - @abc.abstractmethod - def test_failure(self): - # Test trying to find a module that cannot be handled. - pass Deleted: python/branches/io-c/Lib/importlib/test/frozen/support.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/frozen/support.py Sun Feb 8 21:39:02 2009 +++ (empty file) @@ -1,24 +0,0 @@ -import sys - - -class Null: - - """Just absorb what is given.""" - - def __getattr__(self): - return lambda *args, **kwargs: None - - -class SilenceStdout: - - """Silence sys.stdout.""" - - def setUp(self): - """Substitute sys.stdout with something that does not print to the - screen thanks to what bytecode is frozen.""" - sys.stdout = Null() - super().setUp() - - def tearDown(self): - sys.stdout = sys.__stdout__ - super().tearDown() Modified: python/branches/io-c/Lib/importlib/test/frozen/test_finder.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/frozen/test_finder.py (original) +++ python/branches/io-c/Lib/importlib/test/frozen/test_finder.py Sun Feb 8 21:39:02 2009 @@ -1,10 +1,10 @@ from ... import machinery -from .. import finder_tests +from .. import abc import unittest -class FinderTests(finder_tests.FinderTests): +class FinderTests(abc.FinderTests): """Test finding frozen modules.""" Modified: python/branches/io-c/Lib/importlib/test/frozen/test_loader.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/frozen/test_loader.py (original) +++ python/branches/io-c/Lib/importlib/test/frozen/test_loader.py Sun Feb 8 21:39:02 2009 @@ -1,26 +1,59 @@ from importlib import machinery -from ..builtin import test_loader +from .. import abc +from .. import util -class LoaderTests(test_loader.LoaderTests): +class LoaderTests(abc.LoaderTests): - name = '__phello__' - load_module = staticmethod(lambda name: - machinery.FrozenImporter.load_module(name)) - verification = {'__name__': '__phello__', '__file__': '', - '__package__': None, '__path__': ['__phello__']} - - -class SubmoduleLoaderTests(LoaderTests): - - name = '__phello__.spam' - verification = {'__name__': '__phello__.spam', '__file__': '', - '__package__': None} + def test_module(self): + with util.uncache('__hello__'): + module = machinery.FrozenImporter.load_module('__hello__') + check = {'__name__': '__hello__', '__file__': '', + '__package__': ''} + for attr, value in check.items(): + self.assertEqual(getattr(module, attr), value) + + def test_package(self): + with util.uncache('__phello__'): + module = machinery.FrozenImporter.load_module('__phello__') + check = {'__name__': '__phello__', '__file__': '', + '__package__': '__phello__', '__path__': ['__phello__']} + for attr, value in check.items(): + attr_value = getattr(module, attr) + self.assertEqual(attr_value, value, + "for __phello__.%s, %r != %r" % + (attr, attr_value, value)) + + def test_lacking_parent(self): + with util.uncache('__phello__', '__phello__.spam'): + module = machinery.FrozenImporter.load_module('__phello__.spam') + check = {'__name__': '__phello__.spam', '__file__': '', + '__package__': '__phello__'} + for attr, value in check.items(): + attr_value = getattr(module, attr) + self.assertEqual(attr_value, value, + "for __phello__.spam.%s, %r != %r" % + (attr, attr_value, value)) + + def test_module_reuse(self): + with util.uncache('__hello__'): + module1 = machinery.FrozenImporter.load_module('__hello__') + module2 = machinery.FrozenImporter.load_module('__hello__') + self.assert_(module1 is module2) + + def test_state_after_failure(self): + # No way to trigger an error in a frozen module. + pass + + def test_unloadable(self): + assert machinery.FrozenImporter.find_module('_not_real') is None + self.assertRaises(ImportError, machinery.FrozenImporter.load_module, + '_not_real') def test_main(): from test.support import run_unittest - run_unittest(LoaderTests, SubmoduleLoaderTests) + run_unittest(LoaderTests) if __name__ == '__main__': Modified: python/branches/io-c/Lib/importlib/test/import_/test___package__.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/import_/test___package__.py (original) +++ python/branches/io-c/Lib/importlib/test/import_/test___package__.py Sun Feb 8 21:39:02 2009 @@ -5,7 +5,8 @@ """ import unittest -from .. import support +from .. import util +from . import util as import_util class Using__package__(unittest.TestCase): @@ -34,19 +35,20 @@ def test_using___package__(self): # [__package__] - with support.mock_modules('pkg.__init__', 'pkg.fake') as importer: - with support.import_state(meta_path=[importer]): - support.import_('pkg.fake') - module = support.import_('', globals={'__package__': 'pkg.fake'}, - fromlist=['attr'], level=2) + with util.mock_modules('pkg.__init__', 'pkg.fake') as importer: + with util.import_state(meta_path=[importer]): + import_util.import_('pkg.fake') + module = import_util.import_('', + globals={'__package__': 'pkg.fake'}, + fromlist=['attr'], level=2) self.assertEquals(module.__name__, 'pkg') def test_using___name__(self): # [__name__] - with support.mock_modules('pkg.__init__', 'pkg.fake') as importer: - with support.import_state(meta_path=[importer]): - support.import_('pkg.fake') - module = support.import_('', + with util.mock_modules('pkg.__init__', 'pkg.fake') as importer: + with util.import_state(meta_path=[importer]): + import_util.import_('pkg.fake') + module = import_util.import_('', globals={'__name__': 'pkg.fake', '__path__': []}, fromlist=['attr'], level=2) @@ -54,12 +56,12 @@ def test_bad__package__(self): globals = {'__package__': ''} - self.assertRaises(SystemError, support.import_,'', globals, {}, + self.assertRaises(SystemError, import_util.import_,'', globals, {}, ['relimport'], 1) def test_bunk__package__(self): globals = {'__package__': 42} - self.assertRaises(ValueError, support.import_, '', globals, {}, + self.assertRaises(ValueError, import_util.import_, '', globals, {}, ['relimport'], 1) @@ -77,26 +79,26 @@ # [top-level] def test_top_level(self): - with support.mock_modules('top_level') as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules('top_level') as mock: + with util.import_state(meta_path=[mock]): del mock['top_level'].__package__ - module = support.import_('top_level') - self.assert_(module.__package__ is None) + module = import_util.import_('top_level') + self.assertEqual(module.__package__, '') # [package] def test_package(self): - with support.mock_modules('pkg.__init__') as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules('pkg.__init__') as mock: + with util.import_state(meta_path=[mock]): del mock['pkg'].__package__ - module = support.import_('pkg') + module = import_util.import_('pkg') self.assertEqual(module.__package__, 'pkg') # [submodule] def test_submodule(self): - with support.mock_modules('pkg.__init__', 'pkg.mod') as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules('pkg.__init__', 'pkg.mod') as mock: + with util.import_state(meta_path=[mock]): del mock['pkg.mod'].__package__ - pkg = support.import_('pkg.mod') + pkg = import_util.import_('pkg.mod') module = getattr(pkg, 'mod') self.assertEqual(module.__package__, 'pkg') Modified: python/branches/io-c/Lib/importlib/test/import_/test_caching.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/import_/test_caching.py (original) +++ python/branches/io-c/Lib/importlib/test/import_/test_caching.py Sun Feb 8 21:39:02 2009 @@ -1,6 +1,6 @@ """Test that sys.modules is used properly by import.""" -from ..support import import_, mock_modules, importlib_only, import_state - +from .. import util +from . import util as import_util import sys from types import MethodType import unittest @@ -24,11 +24,11 @@ # [use cache] module_to_use = "some module found!" sys.modules['some_module'] = module_to_use - module = import_('some_module') + module = import_util.import_('some_module') self.assertEqual(id(module_to_use), id(module)) def create_mock(self, *names, return_=None): - mock = mock_modules(*names) + mock = util.mock_modules(*names) original_load = mock.load_module def load_module(self, fullname): original_load(fullname) @@ -38,33 +38,34 @@ # __import__ inconsistent between loaders and built-in import when it comes # to when to use the module in sys.modules and when not to. - @importlib_only + @import_util.importlib_only def test_using_cache_after_loader(self): # [from cache on return] with self.create_mock('module') as mock: - with import_state(meta_path=[mock]): - module = import_('module') + with util.import_state(meta_path=[mock]): + module = import_util.import_('module') self.assertEquals(id(module), id(sys.modules['module'])) # See test_using_cache_after_loader() for reasoning. - @importlib_only + @import_util.importlib_only def test_using_cache_for_assigning_to_attribute(self): # [from cache to attribute] with self.create_mock('pkg.__init__', 'pkg.module') as importer: - with import_state(meta_path=[importer]): - module = import_('pkg.module') + with util.import_state(meta_path=[importer]): + module = import_util.import_('pkg.module') self.assert_(hasattr(module, 'module')) self.assert_(id(module.module), id(sys.modules['pkg.module'])) # See test_using_cache_after_loader() for reasoning. - @importlib_only + @import_util.importlib_only def test_using_cache_for_fromlist(self): # [from cache for fromlist] with self.create_mock('pkg.__init__', 'pkg.module') as importer: - with import_state(meta_path=[importer]): - module = import_('pkg', fromlist=['module']) + with util.import_state(meta_path=[importer]): + module = import_util.import_('pkg', fromlist=['module']) self.assert_(hasattr(module, 'module')) - self.assertEquals(id(module.module), id(sys.modules['pkg.module'])) + self.assertEquals(id(module.module), + id(sys.modules['pkg.module'])) def test_main(): Modified: python/branches/io-c/Lib/importlib/test/import_/test_fromlist.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/import_/test_fromlist.py (original) +++ python/branches/io-c/Lib/importlib/test/import_/test_fromlist.py Sun Feb 8 21:39:02 2009 @@ -1,6 +1,6 @@ """Test that the semantics relating to the 'fromlist' argument are correct.""" -from ..support import import_, mock_modules, import_state - +from .. import util +from . import util as import_util import unittest class ReturnValue(unittest.TestCase): @@ -16,16 +16,16 @@ def test_return_from_import(self): # [import return] - with mock_modules('pkg.__init__', 'pkg.module') as importer: - with import_state(meta_path=[importer]): - module = import_('pkg.module') + with util.mock_modules('pkg.__init__', 'pkg.module') as importer: + with util.import_state(meta_path=[importer]): + module = import_util.import_('pkg.module') self.assertEquals(module.__name__, 'pkg') def test_return_from_from_import(self): # [from return] - with mock_modules('pkg.__init__', 'pkg.module')as importer: - with import_state(meta_path=[importer]): - module = import_('pkg.module', fromlist=['attr']) + with util.mock_modules('pkg.__init__', 'pkg.module')as importer: + with util.import_state(meta_path=[importer]): + module = import_util.import_('pkg.module', fromlist=['attr']) self.assertEquals(module.__name__, 'pkg.module') @@ -48,59 +48,59 @@ def test_object(self): # [object case] - with mock_modules('module') as importer: - with import_state(meta_path=[importer]): - module = import_('module', fromlist=['attr']) + with util.mock_modules('module') as importer: + with util.import_state(meta_path=[importer]): + module = import_util.import_('module', fromlist=['attr']) self.assertEquals(module.__name__, 'module') def test_unexistent_object(self): # [bad object] - with mock_modules('module') as importer: - with import_state(meta_path=[importer]): - module = import_('module', fromlist=['non_existent']) + with util.mock_modules('module') as importer: + with util.import_state(meta_path=[importer]): + module = import_util.import_('module', fromlist=['non_existent']) self.assertEquals(module.__name__, 'module') self.assert_(not hasattr(module, 'non_existent')) def test_module_from_package(self): # [module] - with mock_modules('pkg.__init__', 'pkg.module') as importer: - with import_state(meta_path=[importer]): - module = import_('pkg', fromlist=['module']) + with util.mock_modules('pkg.__init__', 'pkg.module') as importer: + with util.import_state(meta_path=[importer]): + module = import_util.import_('pkg', fromlist=['module']) self.assertEquals(module.__name__, 'pkg') self.assert_(hasattr(module, 'module')) self.assertEquals(module.module.__name__, 'pkg.module') def test_no_module_from_package(self): # [no module] - with mock_modules('pkg.__init__') as importer: - with import_state(meta_path=[importer]): - module = import_('pkg', fromlist='non_existent') + with util.mock_modules('pkg.__init__') as importer: + with util.import_state(meta_path=[importer]): + module = import_util.import_('pkg', fromlist='non_existent') self.assertEquals(module.__name__, 'pkg') self.assert_(not hasattr(module, 'non_existent')) def test_empty_string(self): - with mock_modules('pkg.__init__', 'pkg.mod') as importer: - with import_state(meta_path=[importer]): - module = import_('pkg.mod', fromlist=['']) + with util.mock_modules('pkg.__init__', 'pkg.mod') as importer: + with util.import_state(meta_path=[importer]): + module = import_util.import_('pkg.mod', fromlist=['']) self.assertEquals(module.__name__, 'pkg.mod') def test_using_star(self): # [using *] - with mock_modules('pkg.__init__', 'pkg.module') as mock: - with import_state(meta_path=[mock]): + with util.mock_modules('pkg.__init__', 'pkg.module') as mock: + with util.import_state(meta_path=[mock]): mock['pkg'].__all__ = ['module'] - module = import_('pkg', fromlist=['*']) + module = import_util.import_('pkg', fromlist=['*']) self.assertEquals(module.__name__, 'pkg') self.assert_(hasattr(module, 'module')) self.assertEqual(module.module.__name__, 'pkg.module') def test_star_with_others(self): # [using * with others] - context = mock_modules('pkg.__init__', 'pkg.module1', 'pkg.module2') + context = util.mock_modules('pkg.__init__', 'pkg.module1', 'pkg.module2') with context as mock: - with import_state(meta_path=[mock]): + with util.import_state(meta_path=[mock]): mock['pkg'].__all__ = ['module1'] - module = import_('pkg', fromlist=['module2', '*']) + module = import_util.import_('pkg', fromlist=['module2', '*']) self.assertEquals(module.__name__, 'pkg') self.assert_(hasattr(module, 'module1')) self.assert_(hasattr(module, 'module2')) Modified: python/branches/io-c/Lib/importlib/test/import_/test_meta_path.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/import_/test_meta_path.py (original) +++ python/branches/io-c/Lib/importlib/test/import_/test_meta_path.py Sun Feb 8 21:39:02 2009 @@ -1,5 +1,5 @@ -from ..support import import_state, mock_modules, import_ - +from .. import util +from . import util as import_util from contextlib import nested from types import MethodType import unittest @@ -16,24 +16,25 @@ def test_first_called(self): # [first called] mod = 'top_level' - first = mock_modules(mod) - second = mock_modules(mod) - with nested(mock_modules(mod), mock_modules(mod)) as (first, second): + first = util.mock_modules(mod) + second = util.mock_modules(mod) + context = nested(util.mock_modules(mod), util.mock_modules(mod)) + with context as (first, second): first.modules[mod] = 42 second.modules[mod] = -13 - with import_state(meta_path=[first, second]): - self.assertEquals(import_(mod), 42) + with util.import_state(meta_path=[first, second]): + self.assertEquals(import_util.import_(mod), 42) def test_continuing(self): # [continuing] mod_name = 'for_real' - first = mock_modules('nonexistent') - second = mock_modules(mod_name) + first = util.mock_modules('nonexistent') + second = util.mock_modules(mod_name) with nested(first, second): first.find_module = lambda self, fullname, path=None: None second.modules[mod_name] = 42 - with import_state(meta_path=[first, second]): - self.assertEquals(import_(mod_name), 42) + with util.import_state(meta_path=[first, second]): + self.assertEquals(import_util.import_(mod_name), 42) class CallSignature(unittest.TestCase): @@ -54,11 +55,11 @@ # [no path] mod_name = 'top_level' assert '.' not in mod_name - with mock_modules(mod_name) as importer: + with util.mock_modules(mod_name) as importer: log, wrapped_call = self.log(importer.find_module) importer.find_module = MethodType(wrapped_call, importer) - with import_state(meta_path=[importer]): - import_(mod_name) + with util.import_state(meta_path=[importer]): + import_util.import_(mod_name) assert len(log) == 1 args = log[0][0] kwargs = log[0][1] @@ -74,12 +75,12 @@ mod_name = pkg_name + '.module' path = [42] assert '.' in mod_name - with mock_modules(pkg_name+'.__init__', mod_name) as importer: + with util.mock_modules(pkg_name+'.__init__', mod_name) as importer: importer.modules[pkg_name].__path__ = path log, wrapped_call = self.log(importer.find_module) importer.find_module = MethodType(wrapped_call, importer) - with import_state(meta_path=[importer]): - import_(mod_name) + with util.import_state(meta_path=[importer]): + import_util.import_(mod_name) assert len(log) == 2 args = log[1][0] kwargs = log[1][1] Modified: python/branches/io-c/Lib/importlib/test/import_/test_packages.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/import_/test_packages.py (original) +++ python/branches/io-c/Lib/importlib/test/import_/test_packages.py Sun Feb 8 21:39:02 2009 @@ -1,7 +1,8 @@ +from .. import util +from . import util as import_util import sys import unittest import importlib -from .. import support class ParentModuleTests(unittest.TestCase): @@ -9,15 +10,16 @@ """Importing a submodule should import the parent modules.""" def test_import_parent(self): - with support.mock_modules('pkg.__init__', 'pkg.module') as mock: - with support.import_state(meta_path=[mock]): - module = support.import_('pkg.module') + with util.mock_modules('pkg.__init__', 'pkg.module') as mock: + with util.import_state(meta_path=[mock]): + module = import_util.import_('pkg.module') self.assert_('pkg' in sys.modules) def test_bad_parent(self): - with support.mock_modules('pkg.module') as mock: - with support.import_state(meta_path=[mock]): - self.assertRaises(ImportError, support.import_, 'pkg.module') + with util.mock_modules('pkg.module') as mock: + with util.import_state(meta_path=[mock]): + self.assertRaises(ImportError, + import_util.import_, 'pkg.module') def test_main(): Modified: python/branches/io-c/Lib/importlib/test/import_/test_path.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/import_/test_path.py (original) +++ python/branches/io-c/Lib/importlib/test/import_/test_path.py Sun Feb 8 21:39:02 2009 @@ -1,158 +1,106 @@ -from ..support import (mock_modules, import_state, import_, mock_path_hook, - importlib_only, uncache) - +from importlib import machinery +from .. import util +from . import util as import_util from contextlib import nested -from imp import new_module +import imp +import os import sys +from test import support from types import MethodType import unittest -class BaseTests(unittest.TestCase): +class FinderTests(unittest.TestCase): - """When sys.meta_path cannot find the desired module, sys.path is - consulted. For each entry on the sequence [order], sys.path_importer_cache - is checked to see if it contains a key for the entry [cache check]. If an - importer is found then it is consulted before trying the next entry in - sys.path [cache use]. The 'path' argument to find_module() is never used - when trying to find a module [path not used]. - - If an entry from sys.path is not in sys.path_importer_cache, sys.path_hooks - is called in turn [hooks order]. If a path hook cannot handle an entry, - ImportError is raised [hook failure]. Otherwise the resulting object is - cached in sys.path_importer_cache and then consulted [hook success]. If no - hook is found, None is set in sys.path_importer_cache and the default - importer is tried [no hook]. - - For use of __path__ in a package, the above is all true, just substitute - "sys.path" for "__path__". - - """ - - def order_test(self, to_import, entry, search_path, path=[]): - # [order] - log = [] - class LogFindModule(mock_modules): - def find_module(self, fullname): - log.append(self) - return super().find_module(fullname) - - assert len(search_path) == 2 - misser = LogFindModule(search_path[0]) - hitter = LogFindModule(to_import) - with nested(misser, hitter): - cache = dict(zip(search_path, (misser, hitter))) - with import_state(path=path, path_importer_cache=cache): - import_(to_import) - self.assertEquals(log[0], misser) - self.assertEquals(log[1], hitter) - - @importlib_only # __import__ uses PyDict_GetItem(), bypassing log. - def cache_use_test(self, to_import, entry, path=[]): - # [cache check], [cache use] - log = [] - class LoggingDict(dict): - def __getitem__(self, item): - log.append(item) - return super(LoggingDict, self).__getitem__(item) - - with mock_modules(to_import) as importer: - cache = LoggingDict() - cache[entry] = importer - with import_state(path=[entry], path_importer_cache=cache): - module = import_(to_import, fromlist=['a']) - self.assert_(module is importer[to_import]) - self.assertEquals(len(cache), 1) - self.assertEquals([entry], log) - - def hooks_order_test(self, to_import, entry, path=[]): - # [hooks order], [hooks failure], [hook success] - log = [] - def logging_hook(entry): - log.append(entry) - raise ImportError - with mock_modules(to_import) as importer: - hitter = mock_path_hook(entry, importer=importer) - path_hooks = [logging_hook, logging_hook, hitter] - with import_state(path_hooks=path_hooks, path=path): - import_(to_import) - self.assertEquals(sys.path_importer_cache[entry], importer) - self.assertEquals(len(log), 2) - - # [no hook] XXX Worry about after deciding how to handle the default hook. - - def path_argument_test(self, to_import): - # [path not used] - class BadImporter: - """Class to help detect TypeError from calling find_module() with - an improper number of arguments.""" - def find_module(name): - raise ImportError + """Tests for SysPathImporter.""" + def test_failure(self): + # Test None returned upon not finding a suitable finder. + def mock_implicit_hooks(): + return [] + # XXX Not blackbox. + original_hooks = machinery.PathFinder._implicit_hooks + machinery.PathFinder._implicit_hooks = staticmethod(mock_implicit_hooks) try: - import_(to_import) - except ImportError: - pass - - -class PathTests(BaseTests): - - """Tests for sys.path.""" - - def test_order(self): - self.order_test('hit', 'second', ['first', 'second'], - ['first', 'second']) - - def test_cache_use(self): - entry = "found!" - self.cache_use_test('hit', entry, [entry]) - - def test_hooks_order(self): - entry = "found!" - self.hooks_order_test('hit', entry, [entry]) - - def test_path_argument(self): - name = 'total junk' - with uncache(name): - self.path_argument_test(name) - - -class __path__Tests(BaseTests): - - """Tests for __path__.""" - - def run_test(self, test, entry, path, *args): - with mock_modules('pkg.__init__') as importer: - importer['pkg'].__path__ = path - importer.load_module('pkg') - test('pkg.hit', entry, *args) - - - @importlib_only # XXX Unknown reason why this fails. - def test_order(self): - self.run_test(self.order_test, 'second', ('first', 'second'), ['first', - 'second']) - - def test_cache_use(self): - location = "I'm here!" - self.run_test(self.cache_use_test, location, [location]) - - def test_hooks_order(self): - location = "I'm here!" - self.run_test(self.hooks_order_test, location, [location]) - - def test_path_argument(self): - module = new_module('pkg') - module.__path__ = ['random __path__'] - name = 'pkg.whatever' - sys.modules['pkg'] = module - with uncache('pkg', name): - self.path_argument_test(name) + with util.import_state(): + self.assert_(machinery.PathFinder.find_module('XXX') is None) + finally: + machinery.PathFinder._implicit_hooks = original_hooks + + def test_sys_path(self): + # Test that sys.path is used when 'path' is None. + # Implicitly tests that sys.path_importer_cache is used. + module = '' + path = '' + importer = util.mock_modules(module) + with util.import_state(path_importer_cache={path: importer}, + path=[path]): + loader = machinery.PathFinder.find_module(module) + self.assert_(loader is importer) + + def test_path(self): + # Test that 'path' is used when set. + # Implicitly tests that sys.path_importer_cache is used. + module = '' + path = '' + importer = util.mock_modules(module) + with util.import_state(path_importer_cache={path: importer}): + loader = machinery.PathFinder.find_module(module, [path]) + self.assert_(loader is importer) + + def test_path_importer_cache_has_None(self): + # Test that the default hook is used when sys.path_importer_cache + # contains None for a path. + module = '' + importer = util.mock_modules(module) + path = '' + # XXX Not blackbox. + original_hook = machinery.PathFinder._default_hook + mock_hook = import_util.mock_path_hook(path, importer=importer) + machinery.PathFinder._default_hook = staticmethod(mock_hook) + try: + with util.import_state(path_importer_cache={path: None}): + loader = machinery.PathFinder.find_module(module, path=[path]) + self.assert_(loader is importer) + finally: + machinery.PathFinder._default_hook = original_hook + + def test_path_hooks(self): + # Test that sys.path_hooks is used. + # Test that sys.path_importer_cache is set. + module = '' + path = '' + importer = util.mock_modules(module) + hook = import_util.mock_path_hook(path, importer=importer) + with util.import_state(path_hooks=[hook]): + loader = machinery.PathFinder.find_module(module, [path]) + self.assert_(loader is importer) + self.assert_(path in sys.path_importer_cache) + self.assert_(sys.path_importer_cache[path] is importer) + + def test_implicit_hooks(self): + # Test that the implicit path hooks are used. + existing_path = os.path.dirname(support.TESTFN) + bad_path = '' + module = '' + assert not os.path.exists(bad_path) + with util.import_state(): + nothing = machinery.PathFinder.find_module(module, + path=[existing_path]) + self.assert_(nothing is None) + self.assert_(existing_path in sys.path_importer_cache) + self.assert_(not isinstance(sys.path_importer_cache[existing_path], + imp.NullImporter)) + nothing = machinery.PathFinder.find_module(module, path=[bad_path]) + self.assert_(nothing is None) + self.assert_(bad_path in sys.path_importer_cache) + self.assert_(isinstance(sys.path_importer_cache[bad_path], + imp.NullImporter)) def test_main(): from test.support import run_unittest - run_unittest(PathTests, __path__Tests) + run_unittest(PathTests, __path__Tests, FinderTests) if __name__ == '__main__': test_main() Modified: python/branches/io-c/Lib/importlib/test/import_/test_relative_imports.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/import_/test_relative_imports.py (original) +++ python/branches/io-c/Lib/importlib/test/import_/test_relative_imports.py Sun Feb 8 21:39:02 2009 @@ -1,7 +1,6 @@ """Test relative imports (PEP 328).""" - -from ..support import uncache, import_, mock_modules, import_state - +from .. import util +from . import util as import_util import sys import unittest @@ -65,10 +64,10 @@ uncache_names.append(name) else: uncache_names.append(name[:-len('.__init__')]) - with mock_modules(*create) as importer: - with import_state(meta_path=[importer]): + with util.mock_modules(*create) as importer: + with util.import_state(meta_path=[importer]): for global_ in globals_: - with uncache(*uncache_names): + with util.uncache(*uncache_names): callback(global_) @@ -77,8 +76,8 @@ create = 'pkg.__init__', 'pkg.mod2' globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.mod1'} def callback(global_): - import_('pkg') # For __import__(). - module = import_('', global_, fromlist=['mod2'], level=1) + import_util.import_('pkg') # For __import__(). + module = import_util.import_('', global_, fromlist=['mod2'], level=1) self.assertEqual(module.__name__, 'pkg') self.assert_(hasattr(module, 'mod2')) self.assertEqual(module.mod2.attr, 'pkg.mod2') @@ -89,8 +88,9 @@ create = 'pkg.__init__', 'pkg.mod2' globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.mod1'} def callback(global_): - import_('pkg') # For __import__(). - module = import_('mod2', global_, fromlist=['attr'], level=1) + import_util.import_('pkg') # For __import__(). + module = import_util.import_('mod2', global_, fromlist=['attr'], + level=1) self.assertEqual(module.__name__, 'pkg.mod2') self.assertEqual(module.attr, 'pkg.mod2') self.relative_import_test(create, globals_, callback) @@ -101,8 +101,8 @@ globals_ = ({'__package__': 'pkg'}, {'__name__': 'pkg', '__path__': ['blah']}) def callback(global_): - import_('pkg') # For __import__(). - module = import_('', global_, fromlist=['module'], + import_util.import_('pkg') # For __import__(). + module = import_util.import_('', global_, fromlist=['module'], level=1) self.assertEqual(module.__name__, 'pkg') self.assert_(hasattr(module, 'module')) @@ -114,8 +114,8 @@ create = 'pkg.__init__', 'pkg.module' globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.module'} def callback(global_): - import_('pkg') # For __import__(). - module = import_('', global_, fromlist=['attr'], level=1) + import_util.import_('pkg') # For __import__(). + module = import_util.import_('', global_, fromlist=['attr'], level=1) self.assertEqual(module.__name__, 'pkg') self.relative_import_test(create, globals_, callback) @@ -126,7 +126,8 @@ globals_ = ({'__package__': 'pkg.subpkg1'}, {'__name__': 'pkg.subpkg1', '__path__': ['blah']}) def callback(global_): - module = import_('', global_, fromlist=['subpkg2'], level=2) + module = import_util.import_('', global_, fromlist=['subpkg2'], + level=2) self.assertEqual(module.__name__, 'pkg') self.assert_(hasattr(module, 'subpkg2')) self.assertEqual(module.subpkg2.attr, 'pkg.subpkg2.__init__') @@ -141,8 +142,8 @@ {'__name__': 'pkg.pkg1.pkg2.pkg3.pkg4.pkg5', '__path__': ['blah']}) def callback(global_): - import_(globals_[0]['__package__']) - module = import_('', global_, fromlist=['attr'], level=6) + import_util.import_(globals_[0]['__package__']) + module = import_util.import_('', global_, fromlist=['attr'], level=6) self.assertEqual(module.__name__, 'pkg') self.relative_import_test(create, globals_, callback) @@ -152,8 +153,8 @@ globals_ = ({'__package__': 'pkg'}, {'__name__': 'pkg', '__path__': ['blah']}) def callback(global_): - import_('pkg') - self.assertRaises(ValueError, import_, '', global_, + import_util.import_('pkg') + self.assertRaises(ValueError, import_util.import_, '', global_, fromlist=['top_level'], level=2) self.relative_import_test(create, globals_, callback) @@ -162,14 +163,14 @@ create = ['top_level', 'pkg.__init__', 'pkg.module'] globals_ = {'__package__': 'pkg'}, {'__name__': 'pkg.module'} def callback(global_): - import_('pkg') - self.assertRaises(ValueError, import_, '', global_, + import_util.import_('pkg') + self.assertRaises(ValueError, import_util.import_, '', global_, fromlist=['top_level'], level=2) self.relative_import_test(create, globals_, callback) def test_empty_name_w_level_0(self): # [empty name] - self.assertRaises(ValueError, import_, '') + self.assertRaises(ValueError, import_util.import_, '') def test_import_from_different_package(self): # Test importing from a different package than the caller. @@ -183,8 +184,9 @@ '__runpy_pkg__.uncle.cousin.nephew'] globals_ = {'__package__': '__runpy_pkg__.__runpy_pkg__'} def callback(global_): - import_('__runpy_pkg__.__runpy_pkg__') - module = import_('uncle.cousin', globals_, {}, fromlist=['nephew'], + import_util.import_('__runpy_pkg__.__runpy_pkg__') + module = import_util.import_('uncle.cousin', globals_, {}, + fromlist=['nephew'], level=2) self.assertEqual(module.__name__, '__runpy_pkg__.uncle.cousin') self.relative_import_test(create, globals_, callback) Deleted: python/branches/io-c/Lib/importlib/test/loader_tests.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/loader_tests.py Sun Feb 8 21:39:02 2009 +++ (empty file) @@ -1,61 +0,0 @@ -import abc -import unittest - - -class LoaderTests(unittest.TestCase, metaclass=abc.ABCMeta): - - @abc.abstractmethod - def test_module(self): - """A module should load without issue. - - After the loader returns the module should be in sys.modules. - - Attributes to verify: - - * __file__ - * __loader__ - * __name__ - * No __path__ - - """ - pass - - @abc.abstractmethod - def test_package(self): - """Loading a package should work. - - After the loader returns the module should be in sys.modules. - - Attributes to verify: - - * __file__ - * __loader__ - * __name__ - * __path__ - - """ - pass - - @abc.abstractmethod - def test_lacking_parent(self): - """A loader should not be dependent on it's parent package being - imported.""" - pass - - @abc.abstractmethod - def test_module_reuse(self): - """If a module is already in sys.modules, it should be reused.""" - pass - - @abc.abstractmethod - def test_state_after_failure(self): - """If a module is already in sys.modules and a reload fails - (e.g. a SyntaxError), the module should be in the state it was before - the reload began.""" - pass - - @abc.abstractmethod - def test_unloadable(self): - """Test ImportError is raised when the loader is asked to load a module - it can't.""" - pass Modified: python/branches/io-c/Lib/importlib/test/source/test_case_sensitivity.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/source/test_case_sensitivity.py (original) +++ python/branches/io-c/Lib/importlib/test/source/test_case_sensitivity.py Sun Feb 8 21:39:02 2009 @@ -1,13 +1,14 @@ """Test case-sensitivity (PEP 235).""" import importlib -from .. import support +from .. import util +from . import util as source_util import os import sys from test import support as test_support import unittest - at support.case_insensitive_tests + at util.case_insensitive_tests class CaseSensitivityTest(unittest.TestCase): """PEP 235 dictates that on case-preserving, case-insensitive file systems @@ -25,7 +26,8 @@ """Look for a module with matching and non-matching sensitivity.""" sensitive_pkg = 'sensitive.{0}'.format(self.name) insensitive_pkg = 'insensitive.{0}'.format(self.name.lower()) - with support.create_modules(insensitive_pkg, sensitive_pkg) as mapping: + context = source_util.create_modules(insensitive_pkg, sensitive_pkg) + with context as mapping: sensitive_path = os.path.join(mapping['.root'], 'sensitive') insensitive_path = os.path.join(mapping['.root'], 'insensitive') return self.find(sensitive_path), self.find(insensitive_path) Modified: python/branches/io-c/Lib/importlib/test/source/test_finder.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/source/test_finder.py (original) +++ python/branches/io-c/Lib/importlib/test/source/test_finder.py Sun Feb 8 21:39:02 2009 @@ -1,13 +1,13 @@ import importlib -from .. import finder_tests -from .. import support +from .. import abc +from . import util as source_util import os import py_compile import unittest import warnings -class FinderTests(finder_tests.FinderTests): +class FinderTests(abc.FinderTests): """For a top-level module, it should just be found directly in the directory being searched. This is true for a directory with source @@ -45,7 +45,7 @@ """ if create is None: create = {test} - with support.create_modules(*create) as mapping: + with source_util.create_modules(*create) as mapping: if compile_: for name in compile_: py_compile.compile(mapping[name]) @@ -76,14 +76,14 @@ # [sub module] def test_module_in_package(self): - with support.create_modules('pkg.__init__', 'pkg.sub') as mapping: + with source_util.create_modules('pkg.__init__', 'pkg.sub') as mapping: pkg_dir = os.path.dirname(mapping['pkg.__init__']) loader = self.import_(pkg_dir, 'pkg.sub') self.assert_(hasattr(loader, 'load_module')) # [sub package] def test_package_in_package(self): - context = support.create_modules('pkg.__init__', 'pkg.sub.__init__') + context = source_util.create_modules('pkg.__init__', 'pkg.sub.__init__') with context as mapping: pkg_dir = os.path.dirname(mapping['pkg.__init__']) loader = self.import_(pkg_dir, 'pkg.sub') @@ -91,7 +91,7 @@ # [sub empty] def test_empty_sub_directory(self): - context = support.create_modules('pkg.__init__', 'pkg.sub.__init__') + context = source_util.create_modules('pkg.__init__', 'pkg.sub.__init__') with warnings.catch_warnings(): warnings.simplefilter("error", ImportWarning) with context as mapping: @@ -109,7 +109,7 @@ def test_failure(self): - with support.create_modules('blah') as mapping: + with source_util.create_modules('blah') as mapping: nothing = self.import_(mapping['.root'], 'sdfsadsadf') self.assert_(nothing is None) Modified: python/branches/io-c/Lib/importlib/test/source/test_loader.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/source/test_loader.py (original) +++ python/branches/io-c/Lib/importlib/test/source/test_loader.py Sun Feb 8 21:39:02 2009 @@ -1,5 +1,6 @@ import importlib -from .. import support +from .. import abc +from . import util as source_util import imp import os @@ -16,15 +17,84 @@ """ # [basic] - def test_basic(self): - with support.create_modules('_temp') as mapping: + def test_module(self): + with source_util.create_modules('_temp') as mapping: loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) - loader.load_module('_temp') + module = loader.load_module('_temp') self.assert_('_temp' in sys.modules) + check = {'__name__': '_temp', '__file__': mapping['_temp'], + '__package__': ''} + for attr, value in check.items(): + self.assertEqual(getattr(module, attr), value) + + def test_package(self): + with source_util.create_modules('_pkg.__init__') as mapping: + loader = importlib._PyFileLoader('_pkg', mapping['_pkg.__init__'], + True) + module = loader.load_module('_pkg') + self.assert_('_pkg' in sys.modules) + check = {'__name__': '_pkg', '__file__': mapping['_pkg.__init__'], + '__path__': [os.path.dirname(mapping['_pkg.__init__'])], + '__package__': '_pkg'} + for attr, value in check.items(): + self.assertEqual(getattr(module, attr), value) + + + def test_lacking_parent(self): + with source_util.create_modules('_pkg.__init__', '_pkg.mod')as mapping: + loader = importlib._PyFileLoader('_pkg.mod', mapping['_pkg.mod'], + False) + module = loader.load_module('_pkg.mod') + self.assert_('_pkg.mod' in sys.modules) + check = {'__name__': '_pkg.mod', '__file__': mapping['_pkg.mod'], + '__package__': '_pkg'} + for attr, value in check.items(): + self.assertEqual(getattr(module, attr), value) + + def fake_mtime(self, fxn): + """Fake mtime to always be higher than expected.""" + return lambda name: fxn(name) + 1 + + def test_module_reuse(self): + with source_util.create_modules('_temp') as mapping: + loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + module = loader.load_module('_temp') + module_id = id(module) + module_dict_id = id(module.__dict__) + with open(mapping['_temp'], 'w') as file: + file.write("testing_var = 42\n") + # For filesystems where the mtime is only to a second granularity, + # everything that has happened above can be too fast; + # force an mtime on the source that is guaranteed to be different + # than the original mtime. + loader.source_mtime = self.fake_mtime(loader.source_mtime) + module = loader.load_module('_temp') + self.assert_('testing_var' in module.__dict__, + "'testing_var' not in " + "{0}".format(list(module.__dict__.keys()))) + self.assertEqual(module, sys.modules['_temp']) + self.assertEqual(id(module), module_id) + self.assertEqual(id(module.__dict__), module_dict_id) + + def test_state_after_failure(self): + # A failed reload should leave the original module intact. + attributes = ('__file__', '__path__', '__package__') + value = '' + name = '_temp' + with source_util.create_modules(name) as mapping: + orig_module = imp.new_module(name) + for attr in attributes: + setattr(orig_module, attr, value) + with open(mapping[name], 'w') as file: + file.write('+++ bad syntax +++') + loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + self.assertRaises(SyntaxError, loader.load_module, name) + for attr in attributes: + self.assertEqual(getattr(orig_module, attr), value) # [syntax error] def test_bad_syntax(self): - with support.create_modules('_temp') as mapping: + with source_util.create_modules('_temp') as mapping: with open(mapping['_temp'], 'w') as file: file.write('=') loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) @@ -39,12 +109,12 @@ def tearDown(self): sys.dont_write_bytecode = False - @support.writes_bytecode + @source_util.writes_bytecode def run_test(self, assertion): - with support.create_modules('_temp') as mapping: + with source_util.create_modules('_temp') as mapping: loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) loader.load_module('_temp') - bytecode_path = support.bytecode_path(mapping['_temp']) + bytecode_path = source_util.bytecode_path(mapping['_temp']) assertion(bytecode_path) def test_bytecode_written(self): @@ -67,10 +137,10 @@ # [bad magic] def test_bad_magic(self): - with support.create_modules('_temp') as mapping: + with source_util.create_modules('_temp') as mapping: py_compile.compile(mapping['_temp']) os.unlink(mapping['_temp']) - bytecode_path = support.bytecode_path(mapping['_temp']) + bytecode_path = source_util.bytecode_path(mapping['_temp']) with open(bytecode_path, 'r+b') as file: file.seek(0) file.write(b'\x00\x00\x00\x00') @@ -94,7 +164,7 @@ def run_test(self, test, *create, pkg=False): create += (test,) - with support.create_modules(*create) as mapping: + with source_util.create_modules(*create) as mapping: for name in create: py_compile.compile(mapping[name]) if pkg: @@ -147,11 +217,11 @@ self.assert_(module_name in sys.modules) # [bad magic] - @support.writes_bytecode + @source_util.writes_bytecode def test_bad_magic(self): - with support.create_modules('_temp') as mapping: + with source_util.create_modules('_temp') as mapping: py_compile.compile(mapping['_temp']) - bytecode_path = support.bytecode_path(mapping['_temp']) + bytecode_path = source_util.bytecode_path(mapping['_temp']) with open(bytecode_path, 'r+b') as bytecode_file: bytecode_file.seek(0) bytecode_file.write(b'\x00\x00\x00\x00') @@ -160,12 +230,12 @@ self.assertEqual(bytecode_file.read(4), imp.get_magic()) # [bad timestamp] - @support.writes_bytecode + @source_util.writes_bytecode def test_bad_bytecode(self): zeros = b'\x00\x00\x00\x00' - with support.create_modules('_temp') as mapping: + with source_util.create_modules('_temp') as mapping: py_compile.compile(mapping['_temp']) - bytecode_path = support.bytecode_path(mapping['_temp']) + bytecode_path = source_util.bytecode_path(mapping['_temp']) with open(bytecode_path, 'r+b') as bytecode_file: bytecode_file.seek(4) bytecode_file.write(zeros) @@ -178,8 +248,8 @@ # [bad marshal] def test_bad_marshal(self): - with support.create_modules('_temp') as mapping: - bytecode_path = support.bytecode_path(mapping['_temp']) + with source_util.create_modules('_temp') as mapping: + bytecode_path = source_util.bytecode_path(mapping['_temp']) source_mtime = os.path.getmtime(mapping['_temp']) source_timestamp = importlib._w_long(source_mtime) with open(bytecode_path, 'wb') as bytecode_file: Modified: python/branches/io-c/Lib/importlib/test/source/test_path_hook.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/source/test_path_hook.py (original) +++ python/branches/io-c/Lib/importlib/test/source/test_path_hook.py Sun Feb 8 21:39:02 2009 @@ -1,5 +1,5 @@ import importlib -from .. import support +from . import util as source_util import unittest @@ -9,7 +9,7 @@ def test_success(self): # XXX Only work on existing directories? - with support.create_modules('dummy') as mapping: + with source_util.create_modules('dummy') as mapping: self.assert_(hasattr(importlib.FileImporter(mapping['.root']), 'find_module')) Deleted: python/branches/io-c/Lib/importlib/test/source/test_reload.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/source/test_reload.py Sun Feb 8 21:39:02 2009 +++ (empty file) @@ -1,71 +0,0 @@ -"""Test reload support. - -Reload support requires two things. One is that if module is loaded that -already exists in sys.modules then it is reused. And two, if a reload fails the -pre-existing module is left in a sane state. - -""" -import imp -import sys -import types -import unittest -import importlib -from .. import support - - -class ReloadTests(unittest.TestCase): - - name = '_temp' - - def load_module(self, mapping): - return importlib._PyFileLoader(self.name, mapping[self.name], False) - - def fake_mtime(self, fxn): - """Fake mtime to always be higher than expected.""" - return lambda name: fxn(name) + 1 - - def test_module_reuse(self): - with support.create_modules(self.name) as mapping: - loader = self.load_module(mapping) - module = loader.load_module(self.name) - module_id = id(module) - module_dict_id = id(module.__dict__) - with open(mapping[self.name], 'w') as file: - file.write("testing_var = 42\n") - # For filesystems where the mtime is only to a second granularity, - # everything that has happened above can be too fast; - # force an mtime on the source that is guaranteed to be different - # than the original mtime. - loader.source_mtime = self.fake_mtime(loader.source_mtime) - module = loader.load_module(self.name) - self.assert_('testing_var' in module.__dict__, - "'testing_var' not in " - "{0}".format(list(module.__dict__.keys()))) - self.assertEqual(module, sys.modules[self.name]) - self.assertEqual(id(module), module_id) - self.assertEqual(id(module.__dict__), module_dict_id) - - def test_bad_reload(self): - # A failed reload should leave the original module intact. - attributes = ('__file__', '__path__', '__package__') - value = '' - with support.create_modules(self.name) as mapping: - orig_module = imp.new_module(self.name) - for attr in attributes: - setattr(orig_module, attr, value) - with open(mapping[self.name], 'w') as file: - file.write('+++ bad syntax +++') - loader = self.load_module(mapping) - self.assertRaises(SyntaxError, loader.load_module, self.name) - for attr in attributes: - self.assertEqual(getattr(orig_module, attr), value) - - - -def test_main(): - from test.support import run_unittest - run_unittest(ReloadTests) - - -if __name__ == '__main__': - test_main() Modified: python/branches/io-c/Lib/importlib/test/source/test_source_encoding.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/source/test_source_encoding.py (original) +++ python/branches/io-c/Lib/importlib/test/source/test_source_encoding.py Sun Feb 8 21:39:02 2009 @@ -1,5 +1,5 @@ import importlib -from .. import support +from . import util as source_util import codecs import re @@ -32,7 +32,7 @@ module_name = '_temp' def run_test(self, source): - with support.create_modules(self.module_name) as mapping: + with source_util.create_modules(self.module_name) as mapping: with open(mapping[self.module_name], 'wb')as file: file.write(source) loader = importlib._PyFileLoader(self.module_name, @@ -93,7 +93,7 @@ module_name = '_temp' source_lines = [b"a = 42", b"b = -13", b''] source = line_ending.join(source_lines) - with support.create_modules(module_name) as mapping: + with source_util.create_modules(module_name) as mapping: with open(mapping[module_name], 'wb') as file: file.write(source) loader = importlib._PyFileLoader(module_name, mapping[module_name], Deleted: python/branches/io-c/Lib/importlib/test/support.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/support.py Sun Feb 8 21:39:02 2009 +++ (empty file) @@ -1,233 +0,0 @@ -from importlib import Import - -from contextlib import contextmanager -from functools import update_wrapper -import imp -import os.path -from test.support import unlink -import sys -from tempfile import gettempdir - - -using___import__ = False - -def import_(*args, **kwargs): - """Delegate to allow for injecting different implementations of import.""" - if using___import__: - return __import__(*args, **kwargs) - return Import()(*args, **kwargs) - -def importlib_only(fxn): - """Decorator to mark which tests are not supported by the current - implementation of __import__().""" - def inner(*args, **kwargs): - if using___import__: - return - else: - return fxn(*args, **kwargs) - update_wrapper(inner, fxn) - return inner - -def writes_bytecode(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: - return fxn - - -def case_insensitive_tests(class_): - """Class decorator that nullifies tests that require a case-insensitive - file system.""" - if sys.platform not in ('win32', 'darwin', 'cygwin'): - return object() - else: - return class_ - - - at contextmanager -def uncache(*names): - """Uncache a module from sys.modules. - - A basic sanity check is performed to prevent uncaching modules that either - cannot/shouldn't be uncached. - - """ - for name in names: - if name in ('sys', 'marshal', 'imp'): - raise ValueError( - "cannot uncache {0} as it will break _importlib".format(name)) - try: - del sys.modules[name] - except KeyError: - pass - try: - yield - finally: - for name in names: - try: - del sys.modules[name] - except KeyError: - pass - - at contextmanager -def import_state(**kwargs): - """Context manager to manage the various importers and stored state in the - sys module. - - The 'modules' attribute is not supported as the interpreter state stores a - pointer to the dict that the interpreter uses internally; - reassigning to sys.modules does not have the desired effect. - - """ - originals = {} - try: - for attr, default in (('meta_path', []), ('path', []), - ('path_hooks', []), - ('path_importer_cache', {})): - originals[attr] = getattr(sys, attr) - if attr in kwargs: - new_value = kwargs[attr] - del kwargs[attr] - else: - new_value = default - setattr(sys, attr, new_value) - if len(kwargs): - raise ValueError( - 'unrecognized arguments: {0}'.format(kwargs.keys())) - yield - finally: - for attr, value in originals.items(): - setattr(sys, attr, value) - - - at contextmanager -def create_modules(*names): - """Temporarily create each named module with an attribute (named 'attr') - that contains the name passed into the context manager that caused the - creation of the module. - - All files are created in a temporary directory specified by - tempfile.gettempdir(). This directory is inserted at the beginning of - sys.path. When the context manager exits all created files (source and - bytecode) are explicitly deleted. - - No magic is performed when creating packages! This means that if you create - a module within a package you must also create the package's __init__ as - well. - - """ - source = 'attr = {0!r}' - created_paths = [] - mapping = {} - try: - temp_dir = gettempdir() - mapping['.root'] = temp_dir - import_names = set() - for name in names: - if not name.endswith('__init__'): - import_name = name - else: - import_name = name[:-len('.__init__')] - import_names.add(import_name) - if import_name in sys.modules: - del sys.modules[import_name] - name_parts = name.split('.') - file_path = temp_dir - for directory in name_parts[:-1]: - file_path = os.path.join(file_path, directory) - if not os.path.exists(file_path): - os.mkdir(file_path) - created_paths.append(file_path) - file_path = os.path.join(file_path, name_parts[-1] + '.py') - with open(file_path, 'w') as file: - file.write(source.format(name)) - created_paths.append(file_path) - mapping[name] = file_path - uncache_manager = uncache(*import_names) - uncache_manager.__enter__() - state_manager = import_state(path=[temp_dir]) - state_manager.__enter__() - yield mapping - finally: - state_manager.__exit__(None, None, None) - uncache_manager.__exit__(None, None, None) - # Reverse the order for path removal to unroll directory creation. - for path in reversed(created_paths): - if file_path.endswith('.py'): - unlink(path) - unlink(path + 'c') - unlink(path + 'o') - else: - os.rmdir(path) - - -class mock_modules: - - """A mock importer/loader.""" - - def __init__(self, *names): - self.modules = {} - for name in names: - if not name.endswith('.__init__'): - import_name = name - else: - import_name = name[:-len('.__init__')] - if '.' not in name: - package = None - elif import_name == name: - package = name.rsplit('.', 1)[0] - else: - package = import_name - module = imp.new_module(import_name) - module.__loader__ = self - module.__file__ = '' - module.__package__ = package - module.attr = name - if import_name != name: - module.__path__ = [''] - self.modules[import_name] = module - - def __getitem__(self, name): - return self.modules[name] - - def find_module(self, fullname, path=None): - if fullname not in self.modules: - return None - else: - return self - - def load_module(self, fullname): - if fullname not in self.modules: - raise ImportError - else: - sys.modules[fullname] = self.modules[fullname] - return self.modules[fullname] - - def __enter__(self): - self._uncache = uncache(*self.modules.keys()) - self._uncache.__enter__() - return self - - def __exit__(self, *exc_info): - self._uncache.__exit__(None, None, None) - - -def mock_path_hook(*entries, importer): - """A mock sys.path_hooks entry.""" - def hook(entry): - if entry not in entries: - raise ImportError - return importer - return hook - - -def bytecode_path(source_path): - for suffix, _, type_ in imp.get_suffixes(): - if type_ == imp.PY_COMPILED: - bc_suffix = suffix - break - else: - raise ValueError("no bytecode suffix is defined") - return os.path.splitext(source_path)[0] + bc_suffix Modified: python/branches/io-c/Lib/importlib/test/test_api.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/test_api.py (original) +++ python/branches/io-c/Lib/importlib/test/test_api.py Sun Feb 8 21:39:02 2009 @@ -1,6 +1,8 @@ -import unittest +from . import util +import imp import importlib -from . import support +import sys +import unittest class ImportModuleTests(unittest.TestCase): @@ -9,8 +11,8 @@ def test_module_import(self): # Test importing a top-level module. - with support.mock_modules('top_level') as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules('top_level') as mock: + with util.import_state(meta_path=[mock]): module = importlib.import_module('top_level') self.assertEqual(module.__name__, 'top_level') @@ -19,8 +21,8 @@ pkg_name = 'pkg' pkg_long_name = '{0}.__init__'.format(pkg_name) name = '{0}.mod'.format(pkg_name) - with support.mock_modules(pkg_long_name, name) as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules(pkg_long_name, name) as mock: + with util.import_state(meta_path=[mock]): module = importlib.import_module(name) self.assertEqual(module.__name__, name) @@ -31,8 +33,9 @@ module_name = 'mod' absolute_name = '{0}.{1}'.format(pkg_name, module_name) relative_name = '.{0}'.format(module_name) - with support.mock_modules(pkg_long_name, absolute_name) as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules(pkg_long_name, absolute_name) as mock: + with util.import_state(meta_path=[mock]): + importlib.import_module(pkg_name) module = importlib.import_module(relative_name, pkg_name) self.assertEqual(module.__name__, absolute_name) @@ -42,8 +45,9 @@ pkg_name = 'pkg' pkg_long_name = '{0}.__init__'.format(pkg_name) name = '{0}.mod'.format(pkg_name) - with support.mock_modules(pkg_long_name, name) as mock: - with support.import_state(meta_path=[mock]): + with util.mock_modules(pkg_long_name, name) as mock: + with util.import_state(meta_path=[mock]): + importlib.import_module(pkg_name) module = importlib.import_module(name, pkg_name) self.assertEqual(module.__name__, name) Modified: python/branches/io-c/Lib/posixpath.py ============================================================================== --- python/branches/io-c/Lib/posixpath.py (original) +++ python/branches/io-c/Lib/posixpath.py Sun Feb 8 21:39:02 2009 @@ -403,12 +403,12 @@ until we either arrive at something that isn't a symlink, or encounter a path we've seen before (meaning that there's a loop). """ - paths_seen = [] + paths_seen = set() while islink(path): if path in paths_seen: # Already seen this path, so we must have a symlink loop return None - paths_seen.append(path) + paths_seen.add(path) # Resolve where the link points to resolved = os.readlink(path) if not isabs(resolved): Modified: python/branches/io-c/Lib/runpy.py ============================================================================== --- python/branches/io-c/Lib/runpy.py (original) +++ python/branches/io-c/Lib/runpy.py Sun Feb 8 21:39:02 2009 @@ -80,13 +80,19 @@ if loader is None: raise ImportError("No module named %s" % mod_name) if loader.is_package(mod_name): - raise ImportError(("%s is a package and cannot " + - "be directly executed") % mod_name) + if mod_name == "__main__" or mod_name.endswith(".__main__"): + raise ImportError(("Cannot use package as __main__ module")) + try: + pkg_main_name = mod_name + ".__main__" + return _get_module_details(pkg_main_name) + except ImportError as e: + raise ImportError(("%s; %r is a package and cannot " + + "be directly executed") %(e, mod_name)) code = loader.get_code(mod_name) if code is None: raise ImportError("No code object available for %s" % mod_name) filename = _get_filename(loader, mod_name) - return loader, code, filename + return mod_name, loader, code, filename # XXX ncoghlan: Should this be documented and made public? @@ -101,12 +107,12 @@ __loader__ """ try: - loader, code, fname = _get_module_details(mod_name) + mod_name, loader, code, fname = _get_module_details(mod_name) except ImportError as exc: # Try to provide a good error message # for directories, zip files and the -m switch if set_argv0: - # For -m switch, just disply the exception + # For -m switch, just display the exception info = str(exc) else: # For directories/zipfiles, let the user @@ -127,7 +133,7 @@ Returns the resulting top level namespace dictionary """ - loader, code, fname = _get_module_details(mod_name) + mod_name, loader, code, fname = _get_module_details(mod_name) if run_name is None: run_name = mod_name pkg_name = mod_name.rpartition('.')[0] Modified: python/branches/io-c/Lib/shelve.py ============================================================================== --- python/branches/io-c/Lib/shelve.py (original) +++ python/branches/io-c/Lib/shelve.py Sun Feb 8 21:39:02 2009 @@ -84,7 +84,7 @@ keyencoding="utf-8"): self.dict = dict if protocol is None: - protocol = 2 + protocol = 3 self._protocol = protocol self.writeback = writeback self.cache = {} Modified: python/branches/io-c/Lib/shutil.py ============================================================================== --- python/branches/io-c/Lib/shutil.py (original) +++ python/branches/io-c/Lib/shutil.py Sun Feb 8 21:39:02 2009 @@ -265,4 +265,10 @@ os.unlink(src) def destinsrc(src, dst): - return abspath(dst).startswith(abspath(src)) + src = abspath(src) + dst = abspath(dst) + if not src.endswith(os.path.sep): + src += os.path.sep + if not dst.endswith(os.path.sep): + dst += os.path.sep + return dst.startswith(src) Modified: python/branches/io-c/Lib/test/regrtest.py ============================================================================== --- python/branches/io-c/Lib/test/regrtest.py (original) +++ python/branches/io-c/Lib/test/regrtest.py Sun Feb 8 21:39:02 2009 @@ -123,6 +123,8 @@ urlfetch - It is okay to download files required on testing. + gui - Run tests that require a running GUI. + To enable all resources except one, use '-uall,-'. For example, to run all the tests except for the bsddb tests, give the option '-uall,-bsddb'. @@ -176,7 +178,7 @@ from test import support RESOURCE_NAMES = ('audio', 'curses', 'largefile', 'network', 'bsddb', - 'decimal', 'compiler', 'subprocess', 'urlfetch') + 'decimal', 'compiler', 'subprocess', 'urlfetch', 'gui') def usage(msg): @@ -1073,6 +1075,8 @@ test_pty test_socketserver test_tcl + test_ttk_guionly + test_ttk_textonly test_timeout test_urllibnet test_multiprocessing @@ -1088,6 +1092,8 @@ test_kqueue test_ossaudiodev test_tcl + test_ttk_guionly + test_ttk_textonly test_zipimport test_zlib """, @@ -1103,6 +1109,8 @@ test_ossaudiodev test_pep277 test_tcl + test_ttk_guionly + test_ttk_textonly test_multiprocessing """, 'netbsd3': @@ -1117,6 +1125,8 @@ test_ossaudiodev test_pep277 test_tcl + test_ttk_guionly + test_ttk_textonly test_multiprocessing """, } Modified: python/branches/io-c/Lib/test/test_builtin.py ============================================================================== --- python/branches/io-c/Lib/test/test_builtin.py (original) +++ python/branches/io-c/Lib/test/test_builtin.py Sun Feb 8 21:39:02 2009 @@ -220,9 +220,7 @@ self.assertRaises((OverflowError, ValueError), chr, 2**32) def test_cmp(self): - # uncomment the following line once cmp has been removed - #self.assert_(not hasattr(builtins, "cmp")) - pass + self.assert_(not hasattr(builtins, "cmp")) def test_compile(self): compile('print(1)\n', '', 'exec') @@ -1068,9 +1066,9 @@ self.assertEqual(round(8), 8) self.assertEqual(round(-8), -8) self.assertEqual(type(round(0)), int) - self.assertEqual(type(round(-8, -1)), float) - self.assertEqual(type(round(-8, 0)), float) - self.assertEqual(type(round(-8, 1)), float) + self.assertEqual(type(round(-8, -1)), int) + self.assertEqual(type(round(-8, 0)), int) + self.assertEqual(type(round(-8, 1)), int) # test new kwargs self.assertEqual(round(number=-8.0, ndigits=-1), -10.0) Modified: python/branches/io-c/Lib/test/test_cmd_line_script.py ============================================================================== --- python/branches/io-c/Lib/test/test_cmd_line_script.py (original) +++ python/branches/io-c/Lib/test/test_cmd_line_script.py Sun Feb 8 21:39:02 2009 @@ -113,7 +113,7 @@ os.unlink(script_name) #if verbose: # zip_file = zipfile.ZipFile(zip_name, 'r') - # print 'Contents of %r:' % zip_name + # print('Contents of %r:' % zip_name) # zip_file.printdir() # zip_file.close() return zip_name, os.path.join(zip_name, script_name_in_zip) @@ -158,6 +158,16 @@ self.assert_(printed_package in data) self.assert_(printed_argv0 in data) + def _check_import_error(self, script_name, expected_msg, + *cmd_line_switches): + run_args = cmd_line_switches + (script_name,) + exit_code, data = _run_python(*run_args) + if verbose: + print('Output from test script %r:' % script_name) + print(data) + print('Expected output: %r' % expected_msg) + self.assert_(expected_msg in data) + def test_basic_script(self): with temp_dir() as script_dir: script_name = _make_test_script(script_dir, 'script') @@ -182,6 +192,11 @@ os.remove(script_name) self._check_script(script_dir, compiled_name, script_dir, '') + def test_directory_error(self): + with temp_dir() as script_dir: + msg = "can't find '__main__.py' in %r" % script_dir + self._check_import_error(script_dir, msg) + def test_zipfile(self): with temp_dir() as script_dir: script_name = _make_test_script(script_dir, '__main__') @@ -195,6 +210,13 @@ zip_name, run_name = _make_test_zip(script_dir, 'test_zip', compiled_name) self._check_script(zip_name, run_name, zip_name, '') + def test_zipfile_error(self): + with temp_dir() as script_dir: + script_name = _make_test_script(script_dir, 'not_main') + zip_name, run_name = _make_test_zip(script_dir, 'test_zip', script_name) + msg = "can't find '__main__.py' in %r" % zip_name + self._check_import_error(zip_name, msg) + def test_module_in_package(self): with temp_dir() as script_dir: pkg_dir = os.path.join(script_dir, 'test_pkg') @@ -215,6 +237,47 @@ launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg.test_pkg.script', zip_name) self._check_script(launch_name, run_name, run_name, 'test_pkg.test_pkg') + def test_package(self): + with temp_dir() as script_dir: + pkg_dir = os.path.join(script_dir, 'test_pkg') + _make_test_pkg(pkg_dir) + script_name = _make_test_script(pkg_dir, '__main__') + launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg') + self._check_script(launch_name, script_name, + script_name, 'test_pkg') + + def test_package_compiled(self): + with temp_dir() as script_dir: + pkg_dir = os.path.join(script_dir, 'test_pkg') + _make_test_pkg(pkg_dir) + script_name = _make_test_script(pkg_dir, '__main__') + compiled_name = _compile_test_script(script_name) + os.remove(script_name) + launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg') + self._check_script(launch_name, compiled_name, + compiled_name, 'test_pkg') + + def test_package_error(self): + with temp_dir() as script_dir: + pkg_dir = os.path.join(script_dir, 'test_pkg') + _make_test_pkg(pkg_dir) + msg = ("'test_pkg' is a package and cannot " + "be directly executed") + launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg') + self._check_import_error(launch_name, msg) + + def test_package_recursion(self): + with temp_dir() as script_dir: + pkg_dir = os.path.join(script_dir, 'test_pkg') + _make_test_pkg(pkg_dir) + main_dir = os.path.join(pkg_dir, '__main__') + _make_test_pkg(main_dir) + msg = ("Cannot use package as __main__ module; " + "'test_pkg' is a package and cannot " + "be directly executed") + launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg') + self._check_import_error(launch_name, msg) + def test_main(): test.support.run_unittest(CmdLineTest) Modified: python/branches/io-c/Lib/test/test_collections.py ============================================================================== --- python/branches/io-c/Lib/test/test_collections.py (original) +++ python/branches/io-c/Lib/test/test_collections.py Sun Feb 8 21:39:02 2009 @@ -160,7 +160,24 @@ self.assertEqual(p, q) self.assertEqual(p._fields, q._fields) -class TestOneTrickPonyABCs(unittest.TestCase): +class ABCTestCase(unittest.TestCase): + + def validate_abstract_methods(self, abc, *names): + methodstubs = dict.fromkeys(names, lambda s, *args: 0) + + # everything should work will all required methods are present + C = type('C', (abc,), methodstubs) + C() + + # instantiation should fail if a required method is missing + for name in names: + stubs = methodstubs.copy() + del stubs[name] + C = type('C', (abc,), stubs) + self.assertRaises(TypeError, C, name) + + +class TestOneTrickPonyABCs(ABCTestCase): def test_Hashable(self): # Check some non-hashables @@ -185,6 +202,7 @@ return super().__hash__() self.assertEqual(hash(H()), 0) self.failIf(issubclass(int, H)) + self.validate_abstract_methods(Hashable, '__hash__') def test_Iterable(self): # Check some non-iterables @@ -208,6 +226,7 @@ return super().__iter__() self.assertEqual(list(I()), []) self.failIf(issubclass(str, I)) + self.validate_abstract_methods(Iterable, '__iter__') def test_Iterator(self): non_samples = [None, 42, 3.14, 1j, b"", "", (), [], {}, set()] @@ -225,6 +244,7 @@ for x in samples: self.failUnless(isinstance(x, Iterator), repr(x)) self.failUnless(issubclass(type(x), Iterator), repr(type(x))) + self.validate_abstract_methods(Iterator, '__next__') def test_Sized(self): non_samples = [None, 42, 3.14, 1j, @@ -241,6 +261,7 @@ for x in samples: self.failUnless(isinstance(x, Sized), repr(x)) self.failUnless(issubclass(type(x), Sized), repr(type(x))) + self.validate_abstract_methods(Sized, '__len__') def test_Container(self): non_samples = [None, 42, 3.14, 1j, @@ -257,6 +278,7 @@ for x in samples: self.failUnless(isinstance(x, Container), repr(x)) self.failUnless(issubclass(type(x), Container), repr(type(x))) + self.validate_abstract_methods(Container, '__contains__') def test_Callable(self): non_samples = [None, 42, 3.14, 1j, @@ -275,6 +297,7 @@ for x in samples: self.failUnless(isinstance(x, Callable), repr(x)) self.failUnless(issubclass(type(x), Callable), repr(type(x))) + self.validate_abstract_methods(Callable, '__call__') def test_direct_subclassing(self): for B in Hashable, Iterable, Iterator, Sized, Container, Callable: @@ -292,7 +315,7 @@ self.failUnless(issubclass(C, B)) -class TestCollectionABCs(unittest.TestCase): +class TestCollectionABCs(ABCTestCase): # XXX For now, we only test some virtual inheritance properties. # We should also test the proper behavior of the collection ABCs @@ -302,6 +325,7 @@ for sample in [set, frozenset]: self.failUnless(isinstance(sample(), Set)) self.failUnless(issubclass(sample, Set)) + self.validate_abstract_methods(Set, '__contains__', '__iter__', '__len__') def test_hash_Set(self): class OneTwoThreeSet(Set): @@ -323,22 +347,57 @@ self.failUnless(issubclass(set, MutableSet)) self.failIf(isinstance(frozenset(), MutableSet)) self.failIf(issubclass(frozenset, MutableSet)) + self.validate_abstract_methods(MutableSet, '__contains__', '__iter__', '__len__', + 'add', 'discard') + + def test_issue_4920(self): + # MutableSet.pop() method did not work + class MySet(collections.MutableSet): + __slots__=['__s'] + def __init__(self,items=None): + if items is None: + items=[] + self.__s=set(items) + def __contains__(self,v): + return v in self.__s + def __iter__(self): + return iter(self.__s) + def __len__(self): + return len(self.__s) + def add(self,v): + result=v not in self.__s + self.__s.add(v) + return result + def discard(self,v): + result=v in self.__s + self.__s.discard(v) + return result + def __repr__(self): + return "MySet(%s)" % repr(list(self)) + s = MySet([5,43,2,1]) + self.assertEqual(s.pop(), 1) def test_Mapping(self): for sample in [dict]: self.failUnless(isinstance(sample(), Mapping)) self.failUnless(issubclass(sample, Mapping)) + self.validate_abstract_methods(Mapping, '__contains__', '__iter__', '__len__', + '__getitem__') def test_MutableMapping(self): for sample in [dict]: self.failUnless(isinstance(sample(), MutableMapping)) self.failUnless(issubclass(sample, MutableMapping)) + self.validate_abstract_methods(MutableMapping, '__contains__', '__iter__', '__len__', + '__getitem__', '__setitem__', '__delitem__') def test_Sequence(self): for sample in [tuple, list, bytes, str]: self.failUnless(isinstance(sample(), Sequence)) self.failUnless(issubclass(sample, Sequence)) self.failUnless(issubclass(str, Sequence)) + self.validate_abstract_methods(Sequence, '__contains__', '__iter__', '__len__', + '__getitem__') def test_ByteString(self): for sample in [bytes, bytearray]: @@ -358,6 +417,8 @@ self.failUnless(isinstance(sample(), MutableSequence)) self.failUnless(issubclass(sample, MutableSequence)) self.failIf(issubclass(str, MutableSequence)) + self.validate_abstract_methods(MutableSequence, '__contains__', '__iter__', + '__len__', '__getitem__', '__setitem__', '__delitem__', 'insert') class TestCounter(unittest.TestCase): Modified: python/branches/io-c/Lib/test/test_decimal.py ============================================================================== --- python/branches/io-c/Lib/test/test_decimal.py (original) +++ python/branches/io-c/Lib/test/test_decimal.py Sun Feb 8 21:39:02 2009 @@ -30,6 +30,7 @@ import pickle, copy import unittest from decimal import * +import numbers from test.support import (TestSkipped, run_unittest, run_doctest, is_resource_enabled) import random @@ -1388,6 +1389,12 @@ class DecimalPythonAPItests(unittest.TestCase): + def test_abc(self): + self.assert_(issubclass(Decimal, numbers.Number)) + self.assert_(not issubclass(Decimal, numbers.Real)) + self.assert_(isinstance(Decimal(0), numbers.Number)) + self.assert_(not isinstance(Decimal(0), numbers.Real)) + def test_pickle(self): d = Decimal('-3.141590000') p = pickle.dumps(d) Modified: python/branches/io-c/Lib/test/test_descr.py ============================================================================== --- python/branches/io-c/Lib/test/test_descr.py (original) +++ python/branches/io-c/Lib/test/test_descr.py Sun Feb 8 21:39:02 2009 @@ -3885,7 +3885,7 @@ # Testing method-wrapper objects... # did not support any reflection before 2.5 - return # XXX should methods really support __eq__? + # XXX should methods really support __eq__? l = [] self.assertEqual(l.__add__, l.__add__) Modified: python/branches/io-c/Lib/test/test_funcattrs.py ============================================================================== --- python/branches/io-c/Lib/test/test_funcattrs.py (original) +++ python/branches/io-c/Lib/test/test_funcattrs.py Sun Feb 8 21:39:02 2009 @@ -224,10 +224,41 @@ del self.b.__doc__ self.assertEqual(self.b.__doc__, None) +def cell(value): + """Create a cell containing the given value.""" + def f(): + print(a) + a = value + return f.__closure__[0] + +def empty_cell(empty=True): + """Create an empty cell.""" + def f(): + print(a) + # the intent of the following line is simply "if False:"; it's + # spelt this way to avoid the danger that a future optimization + # might simply remove an "if False:" code block. + if not empty: + a = 1729 + return f.__closure__[0] + +class CellTest(unittest.TestCase): + def test_comparison(self): + # These tests are here simply to exercise the comparison code; + # their presence should not be interpreted as providing any + # guarantees about the semantics (or even existence) of cell + # comparisons in future versions of CPython. + self.assert_(cell(2) < cell(3)) + self.assert_(empty_cell() < cell('saturday')) + self.assert_(empty_cell() == empty_cell()) + self.assert_(cell(-36) == cell(-36.0)) + self.assert_(cell(True) > empty_cell()) + + def test_main(): support.run_unittest(FunctionPropertiesTest, ImplicitReferencesTest, ArbitraryFunctionAttrTest, FunctionDictsTest, - FunctionDocstringTest) + FunctionDocstringTest, CellTest) if __name__ == "__main__": test_main() Modified: python/branches/io-c/Lib/test/test_hash.py ============================================================================== --- python/branches/io-c/Lib/test/test_hash.py (original) +++ python/branches/io-c/Lib/test/test_hash.py Sun Feb 8 21:39:02 2009 @@ -33,6 +33,7 @@ # for 64-bit platforms self.same_hash(int(2**31), float(2**31)) self.same_hash(int(-2**63), float(-2**63)) + self.same_hash(int(2**63), float(2**63)) def test_coerced_floats(self): self.same_hash(int(1.23e300), float(1.23e300)) Modified: python/branches/io-c/Lib/test/test_iterlen.py ============================================================================== --- python/branches/io-c/Lib/test/test_iterlen.py (original) +++ python/branches/io-c/Lib/test/test_iterlen.py Sun Feb 8 21:39:02 2009 @@ -195,6 +195,39 @@ d.extend(range(20)) self.assertEqual(len(it), 0) +## -- Check to make sure exceptions are not suppressed by __length_hint__() + + +class BadLen(object): + def __iter__(self): return iter(range(10)) + def __len__(self): + raise RuntimeError('hello') + +class BadLengthHint(object): + def __iter__(self): return iter(range(10)) + def __length_hint__(self): + raise RuntimeError('hello') + +class NoneLengthHint(object): + def __iter__(self): return iter(range(10)) + def __length_hint__(self): + return None + +class TestLengthHintExceptions(unittest.TestCase): + + def test_issue1242657(self): + self.assertRaises(RuntimeError, list, BadLen()) + self.assertRaises(RuntimeError, list, BadLengthHint()) + self.assertRaises(RuntimeError, [].extend, BadLen()) + self.assertRaises(RuntimeError, [].extend, BadLengthHint()) + b = bytearray(range(10)) + self.assertRaises(RuntimeError, b.extend, BadLen()) + self.assertRaises(RuntimeError, b.extend, BadLengthHint()) + + def test_invalid_hint(self): + # Make sure an invalid result doesn't muck-up the works + self.assertEqual(list(NoneLengthHint()), list(range(10))) + def test_main(): unittests = [ @@ -210,6 +243,7 @@ TestSet, TestList, TestListReversed, + TestLengthHintExceptions, ] support.run_unittest(*unittests) Modified: python/branches/io-c/Lib/test/test_itertools.py ============================================================================== --- python/branches/io-c/Lib/test/test_itertools.py (original) +++ python/branches/io-c/Lib/test/test_itertools.py Sun Feb 8 21:39:02 2009 @@ -1371,8 +1371,8 @@ ... return map(function, count(start)) >>> def nth(iterable, n): -... "Returns the nth item or empty list" -... return list(islice(iterable, n, n+1)) +... "Returns the nth item or None" +... return next(islice(iterable, n, None), None) >>> def quantify(iterable, pred=bool): ... "Count how many times the predicate is true" @@ -1469,7 +1469,10 @@ [0, 2, 4, 6] >>> nth('abcde', 3) -['d'] +'d' + +>>> nth('abcde', 9) is None +True >>> quantify(range(99), lambda x: x%2==0) 50 Modified: python/branches/io-c/Lib/test/test_long.py ============================================================================== --- python/branches/io-c/Lib/test/test_long.py (original) +++ python/branches/io-c/Lib/test/test_long.py Sun Feb 8 21:39:02 2009 @@ -896,6 +896,81 @@ self.assertEqual((a+1).bit_length(), i+1) self.assertEqual((-a-1).bit_length(), i+1) + def test_round(self): + # check round-half-even algorithm. For round to nearest ten; + # rounding map is invariant under adding multiples of 20 + test_dict = {0:0, 1:0, 2:0, 3:0, 4:0, 5:0, + 6:10, 7:10, 8:10, 9:10, 10:10, 11:10, 12:10, 13:10, 14:10, + 15:20, 16:20, 17:20, 18:20, 19:20} + for offset in range(-520, 520, 20): + for k, v in test_dict.items(): + got = round(k+offset, -1) + expected = v+offset + self.assertEqual(got, expected) + self.assert_(type(got) is int) + + # larger second argument + self.assertEqual(round(-150, -2), -200) + self.assertEqual(round(-149, -2), -100) + self.assertEqual(round(-51, -2), -100) + self.assertEqual(round(-50, -2), 0) + self.assertEqual(round(-49, -2), 0) + self.assertEqual(round(-1, -2), 0) + self.assertEqual(round(0, -2), 0) + self.assertEqual(round(1, -2), 0) + self.assertEqual(round(49, -2), 0) + self.assertEqual(round(50, -2), 0) + self.assertEqual(round(51, -2), 100) + self.assertEqual(round(149, -2), 100) + self.assertEqual(round(150, -2), 200) + self.assertEqual(round(250, -2), 200) + self.assertEqual(round(251, -2), 300) + self.assertEqual(round(172500, -3), 172000) + self.assertEqual(round(173500, -3), 174000) + self.assertEqual(round(31415926535, -1), 31415926540) + self.assertEqual(round(31415926535, -2), 31415926500) + self.assertEqual(round(31415926535, -3), 31415927000) + self.assertEqual(round(31415926535, -4), 31415930000) + self.assertEqual(round(31415926535, -5), 31415900000) + self.assertEqual(round(31415926535, -6), 31416000000) + self.assertEqual(round(31415926535, -7), 31420000000) + self.assertEqual(round(31415926535, -8), 31400000000) + self.assertEqual(round(31415926535, -9), 31000000000) + self.assertEqual(round(31415926535, -10), 30000000000) + self.assertEqual(round(31415926535, -11), 0) + self.assertEqual(round(31415926535, -12), 0) + self.assertEqual(round(31415926535, -999), 0) + + # should get correct results even for huge inputs + for k in range(10, 100): + got = round(10**k + 324678, -3) + expect = 10**k + 325000 + self.assertEqual(got, expect) + self.assert_(type(got) is int) + + # nonnegative second argument: round(x, n) should just return x + for n in range(5): + for i in range(100): + x = random.randrange(-10000, 10000) + got = round(x, n) + self.assertEqual(got, x) + self.assert_(type(got) is int) + for huge_n in 2**31-1, 2**31, 2**63-1, 2**63, 2**100, 10**100: + self.assertEqual(round(8979323, huge_n), 8979323) + + # omitted second argument + for i in range(100): + x = random.randrange(-10000, 10000) + got = round(x) + self.assertEqual(got, x) + self.assert_(type(got) is int) + + # bad second argument + bad_exponents = ('brian', 2.0, 0j, None) + for e in bad_exponents: + self.assertRaises(TypeError, round, 3, e) + + def test_main(): support.run_unittest(LongTest) Modified: python/branches/io-c/Lib/test/test_os.py ============================================================================== --- python/branches/io-c/Lib/test/test_os.py (original) +++ python/branches/io-c/Lib/test/test_os.py Sun Feb 8 21:39:02 2009 @@ -3,6 +3,7 @@ # portable than they had been thought to be. import os +import errno import unittest import warnings import sys @@ -277,7 +278,6 @@ result = os.statvfs(self.fname) except OSError as e: # On AtheOS, glibc always returns ENOSYS - import errno if e.errno == errno.ENOSYS: return @@ -601,7 +601,13 @@ locals()["test_"+f] = get_single(f) def check(self, f, *args): - self.assertRaises(OSError, f, support.make_bad_fd(), *args) + try: + f(support.make_bad_fd(), *args) + except OSError as e: + self.assertEqual(e.errno, errno.EBADF) + else: + self.fail("%r didn't raise a OSError with a bad file descriptor" + % f) def test_isatty(self): if hasattr(os, "isatty"): Modified: python/branches/io-c/Lib/test/test_parser.py ============================================================================== --- python/branches/io-c/Lib/test/test_parser.py (original) +++ python/branches/io-c/Lib/test/test_parser.py Sun Feb 8 21:39:02 2009 @@ -2,6 +2,7 @@ import os import unittest import sys +import operator from test import support # @@ -496,12 +497,81 @@ file=sys.stderr) self.assertRaises(MemoryError, parser.expr, e) +class STObjectTestCase(unittest.TestCase): + """Test operations on ST objects themselves""" + + def test_comparisons(self): + # ST objects should support order and equality comparisons + st1 = parser.expr('2 + 3') + st2 = parser.suite('x = 2; y = x + 3') + st3 = parser.expr('list(x**3 for x in range(20))') + st1_copy = parser.expr('2 + 3') + st2_copy = parser.suite('x = 2; y = x + 3') + st3_copy = parser.expr('list(x**3 for x in range(20))') + + # exercise fast path for object identity + self.assertEquals(st1 == st1, True) + self.assertEquals(st2 == st2, True) + self.assertEquals(st3 == st3, True) + # slow path equality + self.assertEqual(st1, st1_copy) + self.assertEqual(st2, st2_copy) + self.assertEqual(st3, st3_copy) + self.assertEquals(st1 == st2, False) + self.assertEquals(st1 == st3, False) + self.assertEquals(st2 == st3, False) + self.assertEquals(st1 != st1, False) + self.assertEquals(st2 != st2, False) + self.assertEquals(st3 != st3, False) + self.assertEquals(st1 != st1_copy, False) + self.assertEquals(st2 != st2_copy, False) + self.assertEquals(st3 != st3_copy, False) + self.assertEquals(st2 != st1, True) + self.assertEquals(st1 != st3, True) + self.assertEquals(st3 != st2, True) + # we don't particularly care what the ordering is; just that + # it's usable and self-consistent + self.assertEquals(st1 < st2, not (st2 <= st1)) + self.assertEquals(st1 < st3, not (st3 <= st1)) + self.assertEquals(st2 < st3, not (st3 <= st2)) + self.assertEquals(st1 < st2, st2 > st1) + self.assertEquals(st1 < st3, st3 > st1) + self.assertEquals(st2 < st3, st3 > st2) + self.assertEquals(st1 <= st2, st2 >= st1) + self.assertEquals(st3 <= st1, st1 >= st3) + self.assertEquals(st2 <= st3, st3 >= st2) + # transitivity + bottom = min(st1, st2, st3) + top = max(st1, st2, st3) + mid = sorted([st1, st2, st3])[1] + self.assert_(bottom < mid) + self.assert_(bottom < top) + self.assert_(mid < top) + self.assert_(bottom <= mid) + self.assert_(bottom <= top) + self.assert_(mid <= top) + self.assert_(bottom <= bottom) + self.assert_(mid <= mid) + self.assert_(top <= top) + # interaction with other types + self.assertEquals(st1 == 1588.602459, False) + self.assertEquals('spanish armada' != st2, True) + self.assertRaises(TypeError, operator.ge, st3, None) + self.assertRaises(TypeError, operator.le, False, st1) + self.assertRaises(TypeError, operator.lt, st1, 1815) + self.assertRaises(TypeError, operator.gt, b'waterloo', st2) + + + # XXX tests for pickling and unpickling of ST objects should go here + + def test_main(): support.run_unittest( RoundtripLegalSyntaxTestCase, IllegalSyntaxTestCase, CompileTestCase, ParserStackLimitTestCase, + STObjectTestCase, ) Modified: python/branches/io-c/Lib/test/test_shutil.py ============================================================================== --- python/branches/io-c/Lib/test/test_shutil.py (original) +++ python/branches/io-c/Lib/test/test_shutil.py Sun Feb 8 21:39:02 2009 @@ -340,7 +340,29 @@ dst = os.path.join(self.src_dir, "bar") self.assertRaises(shutil.Error, shutil.move, self.src_dir, dst) + def test_destinsrc_false_negative(self): + os.mkdir(TESTFN) + try: + for src, dst in [('srcdir', 'srcdir/dest')]: + src = os.path.join(TESTFN, src) + dst = os.path.join(TESTFN, dst) + self.assert_(shutil.destinsrc(src, dst), + msg='destinsrc() wrongly concluded that ' + 'dst (%s) is not in src (%s)' % (dst, src)) + finally: + shutil.rmtree(TESTFN, ignore_errors=True) + def test_destinsrc_false_positive(self): + os.mkdir(TESTFN) + try: + for src, dst in [('srcdir', 'src/dest'), ('srcdir', 'srcdir.new')]: + src = os.path.join(TESTFN, src) + dst = os.path.join(TESTFN, dst) + self.failIf(shutil.destinsrc(src, dst), + msg='destinsrc() wrongly concluded that ' + 'dst (%s) is in src (%s)' % (dst, src)) + finally: + shutil.rmtree(TESTFN, ignore_errors=True) def test_main(): support.run_unittest(TestShutil, TestMove) Modified: python/branches/io-c/Lib/test/test_socket.py ============================================================================== --- python/branches/io-c/Lib/test/test_socket.py (original) +++ python/branches/io-c/Lib/test/test_socket.py Sun Feb 8 21:39:02 2009 @@ -366,6 +366,9 @@ eq(socket.getservbyport(port, 'tcp'), service) if udpport is not None: eq(socket.getservbyport(udpport, 'udp'), service) + # Make sure getservbyport does not accept out of range ports. + self.assertRaises(OverflowError, socket.getservbyport, -1) + self.assertRaises(OverflowError, socket.getservbyport, 65536) def testDefaultTimeout(self): # Testing default timeout @@ -466,15 +469,23 @@ # XXX The following don't test module-level functionality... - def testSockName(self): - # Testing getsockname(). Use a temporary socket to elicit an unused - # ephemeral port that we can use later in the test. + def _get_unused_port(self, bind_address='0.0.0.0'): + """Use a temporary socket to elicit an unused ephemeral port. + + Args: + bind_address: Hostname or IP address to search for a port on. + + Returns: A most likely to be unused port. + """ tempsock = socket.socket() - tempsock.bind(("0.0.0.0", 0)) - (host, port) = tempsock.getsockname() + tempsock.bind((bind_address, 0)) + host, port = tempsock.getsockname() tempsock.close() - del tempsock + return port + def testSockName(self): + # Testing getsockname() + port = self._get_unused_port() sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.bind(("0.0.0.0", port)) name = sock.getsockname() @@ -514,6 +525,19 @@ self.assertEqual(sock.proto, 0) sock.close() + def test_getsockaddrarg(self): + host = '0.0.0.0' + port = self._get_unused_port(bind_address=host) + big_port = port + 65536 + neg_port = port - 65536 + sock = socket.socket() + try: + self.assertRaises(OverflowError, sock.bind, (host, big_port)) + self.assertRaises(OverflowError, sock.bind, (host, neg_port)) + sock.bind((host, port)) + finally: + sock.close() + def test_sock_ioctl(self): if os.name != "nt": return Modified: python/branches/io-c/Lib/test/test_sys.py ============================================================================== --- python/branches/io-c/Lib/test/test_sys.py (original) +++ python/branches/io-c/Lib/test/test_sys.py Sun Feb 8 21:39:02 2009 @@ -298,13 +298,25 @@ self.assert_(isinstance(sys.prefix, str)) self.assert_(isinstance(sys.version, str)) vi = sys.version_info - self.assert_(isinstance(vi, tuple)) + self.assert_(isinstance(vi[:], tuple)) self.assertEqual(len(vi), 5) self.assert_(isinstance(vi[0], int)) self.assert_(isinstance(vi[1], int)) self.assert_(isinstance(vi[2], int)) self.assert_(vi[3] in ("alpha", "beta", "candidate", "final")) self.assert_(isinstance(vi[4], int)) + self.assert_(isinstance(vi.major, int)) + self.assert_(isinstance(vi.minor, int)) + self.assert_(isinstance(vi.micro, int)) + self.assert_(vi.releaselevel in + ("alpha", "beta", "candidate", "final")) + self.assert_(isinstance(vi.serial, int)) + self.assertEqual(vi[0], vi.major) + self.assertEqual(vi[1], vi.minor) + self.assertEqual(vi[2], vi.micro) + self.assertEqual(vi[3], vi.releaselevel) + self.assertEqual(vi[4], vi.serial) + self.assert_(vi > (1,0,0)) def test_43581(self): # Can't use sys.stdout, as this is a StringIO object when Modified: python/branches/io-c/Lib/test/test_tcl.py ============================================================================== --- python/branches/io-c/Lib/test/test_tcl.py (original) +++ python/branches/io-c/Lib/test/test_tcl.py Sun Feb 8 21:39:02 2009 @@ -2,10 +2,19 @@ import unittest import os +import _tkinter from test import support from tkinter import Tcl from _tkinter import TclError + +class TkinterTest(unittest.TestCase): + + def testFlattenLen(self): + # flatten() + self.assertRaises(TypeError, _tkinter._flatten, True) + + class TclTest(unittest.TestCase): def setUp(self): @@ -151,7 +160,7 @@ os.environ['DISPLAY'] = old_display def test_main(): - support.run_unittest(TclTest) + support.run_unittest(TclTest, TkinterTest) if __name__ == "__main__": test_main() Modified: python/branches/io-c/Lib/test/test_urllib.py ============================================================================== --- python/branches/io-c/Lib/test/test_urllib.py (original) +++ python/branches/io-c/Lib/test/test_urllib.py Sun Feb 8 21:39:02 2009 @@ -146,7 +146,8 @@ def fakehttp(self, fakedata): class FakeSocket(io.BytesIO): def sendall(self, str): pass - def makefile(self, mode, name): return self + def makefile(self, *args, **kwds): + return self def read(self, amt=None): if self.closed: return b"" return io.BytesIO.read(self, amt) Modified: python/branches/io-c/Lib/test/test_urllib2net.py ============================================================================== --- python/branches/io-c/Lib/test/test_urllib2net.py (original) +++ python/branches/io-c/Lib/test/test_urllib2net.py Sun Feb 8 21:39:02 2009 @@ -195,7 +195,7 @@ def test_http_basic(self): self.assertTrue(socket.getdefaulttimeout() is None) u = _urlopen_with_retry("http://www.python.org") - self.assertTrue(u.fp._sock.gettimeout() is None) + self.assertTrue(u.fp.raw._sock.gettimeout() is None) def test_http_default_timeout(self): self.assertTrue(socket.getdefaulttimeout() is None) @@ -204,7 +204,7 @@ u = _urlopen_with_retry("http://www.python.org") finally: socket.setdefaulttimeout(None) - self.assertEqual(u.fp._sock.gettimeout(), 60) + self.assertEqual(u.fp.raw._sock.gettimeout(), 60) def test_http_no_timeout(self): self.assertTrue(socket.getdefaulttimeout() is None) @@ -213,11 +213,11 @@ u = _urlopen_with_retry("http://www.python.org", timeout=None) finally: socket.setdefaulttimeout(None) - self.assertTrue(u.fp._sock.gettimeout() is None) + self.assertTrue(u.fp.raw._sock.gettimeout() is None) def test_http_timeout(self): u = _urlopen_with_retry("http://www.python.org", timeout=120) - self.assertEqual(u.fp._sock.gettimeout(), 120) + self.assertEqual(u.fp.raw._sock.gettimeout(), 120) FTP_HOST = "ftp://ftp.mirror.nl/pub/mirror/gnu/" Modified: python/branches/io-c/Lib/test/test_zipimport.py ============================================================================== --- python/branches/io-c/Lib/test/test_zipimport.py (original) +++ python/branches/io-c/Lib/test/test_zipimport.py Sun Feb 8 21:39:02 2009 @@ -212,7 +212,7 @@ self.assertEquals(zi.archive, TEMP_ZIP) self.assertEquals(zi.is_package(TESTPACK), True) mod = zi.load_module(TESTPACK) - self.assertEquals(zi._get_filename(TESTPACK), mod.__file__) + self.assertEquals(zi.get_filename(TESTPACK), mod.__file__) self.assertEquals(zi.is_package(packdir + '__init__'), False) self.assertEquals(zi.is_package(packdir + TESTPACK2), True) @@ -224,11 +224,11 @@ mod = sys.modules[mod_name] self.assertEquals(zi.get_source(TESTPACK), None) self.assertEquals(zi.get_source(mod_path), None) - self.assertEquals(zi._get_filename(mod_path), mod.__file__) + self.assertEquals(zi.get_filename(mod_path), mod.__file__) # To pass in the module name instead of the path, we must use the right importer loader = mod.__loader__ self.assertEquals(loader.get_source(mod_name), None) - self.assertEquals(loader._get_filename(mod_name), mod.__file__) + self.assertEquals(loader.get_filename(mod_name), mod.__file__) # test prefix and archivepath members zi2 = zipimport.zipimporter(TEMP_ZIP + os.sep + TESTPACK) @@ -257,7 +257,7 @@ self.assertEquals(zi.prefix, packdir) self.assertEquals(zi.is_package(TESTPACK2), True) mod = zi.load_module(TESTPACK2) - self.assertEquals(zi._get_filename(TESTPACK2), mod.__file__) + self.assertEquals(zi.get_filename(TESTPACK2), mod.__file__) self.assertEquals(zi.is_package(TESTPACK2 + os.sep + '__init__'), False) self.assertEquals(zi.is_package(TESTPACK2 + os.sep + TESTMOD), False) @@ -268,11 +268,11 @@ mod = sys.modules[mod_name] self.assertEquals(zi.get_source(TESTPACK2), None) self.assertEquals(zi.get_source(mod_path), None) - self.assertEquals(zi._get_filename(mod_path), mod.__file__) + self.assertEquals(zi.get_filename(mod_path), mod.__file__) # To pass in the module name instead of the path, we must use the right importer loader = mod.__loader__ self.assertEquals(loader.get_source(mod_name), None) - self.assertEquals(loader._get_filename(mod_name), mod.__file__) + self.assertEquals(loader.get_filename(mod_name), mod.__file__) finally: z.close() os.remove(TEMP_ZIP) Modified: python/branches/io-c/Lib/trace.py ============================================================================== --- python/branches/io-c/Lib/trace.py (original) +++ python/branches/io-c/Lib/trace.py Sun Feb 8 21:39:02 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/io-c/Lib/xmlrpc/client.py ============================================================================== --- python/branches/io-c/Lib/xmlrpc/client.py (original) +++ python/branches/io-c/Lib/xmlrpc/client.py Sun Feb 8 21:39:02 2009 @@ -1129,7 +1129,7 @@ self.verbose = verbose - return self._parse_response(resp, None) + return self.parse_response(resp) ## # Create parser. @@ -1212,29 +1212,12 @@ # @return Response tuple and target method. def parse_response(self, file): - # compatibility interface - return self._parse_response(file, None) - - ## - # Parse response (alternate interface). This is similar to the - # parse_response method, but also provides direct access to the - # underlying socket object (where available). - # - # @param file Stream. - # @param sock Socket handle (or None, if the socket object - # could not be accessed). - # @return Response tuple and target method. - - def _parse_response(self, file, sock): # read response from input file/socket, and parse it p, u = self.getparser() while 1: - if sock: - response = sock.recv(1024) - else: - response = file.read(1024) + response = file.read(1024) if not response: break if self.verbose: Modified: python/branches/io-c/Makefile.pre.in ============================================================================== --- python/branches/io-c/Makefile.pre.in (original) +++ python/branches/io-c/Makefile.pre.in Sun Feb 8 21:39:02 2009 @@ -841,6 +841,9 @@ lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \ ctypes ctypes/test ctypes/macholib idlelib idlelib/Icons \ distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \ + importlib importlib/test importlib/test/builtin \ + importlib/test/extension importlib/test/frozen \ + importlib/test/import_ importlib/test/source \ setuptools setuptools/command setuptools/tests setuptools.egg-info \ multiprocessing multiprocessing/dummy \ curses $(MACHDEPS) Modified: python/branches/io-c/Misc/ACKS ============================================================================== --- python/branches/io-c/Misc/ACKS (original) +++ python/branches/io-c/Misc/ACKS Sun Feb 8 21:39:02 2009 @@ -714,6 +714,7 @@ Roger Upole Michael Urman Hector Urtubia +Andi Vajda Atul Varma Dmitry Vasiliev Alexandre Vassalotti Modified: python/branches/io-c/Misc/NEWS ============================================================================== --- python/branches/io-c/Misc/NEWS (original) +++ python/branches/io-c/Misc/NEWS Sun Feb 8 21:39:02 2009 @@ -12,6 +12,19 @@ Core and Builtins ----------------- +- Issue #5182: Removed memoryview.__str__. + +- Issue #1717: Removed builtin cmp() function, dropped tp_compare + slot, the C API functions PyObject_Compare and PyUnicode_Compare and + the type definition cmpfunc. The tp_compare slot has been renamed + to tp_reserved, and is reserved for future usage. + +- Issue 1242657: the __len__() and __length_hint__() calls in several tools + were suppressing all exceptions. These include list() and bytearray(). + +- Issue #4707: round(x, n) now returns an integer if x is an integer. + Previously it returned a float. + - Issue #4753: By enabling a configure option named '--with-computed-gotos' on compilers that support it (notably: gcc, SunPro, icc), the bytecode evaluation loop is compiled with a new dispatch mechanism which gives @@ -144,6 +157,44 @@ Library ------- +- Issue #4512 (part 2): Promote ``ZipImporter._get_filename()`` to be a + public documented method ``ZipImporter.get_filename()``. + +- Issue #4195: The ``runpy`` module (and the ``-m`` switch) now support + the execution of packages by looking for and executing a ``__main__`` + submodule when a package name is supplied. Initial patch by Andi + Vajda. + +- Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will + not be used again (this requires Tcl/Tk 8.3.1), also fix a memory leak in + Tkapp_Call when calling from a thread different than the one that created + the Tcl interpreter. Patch by Robert Hancock. + +- Issue #4285: Change sys.version_info to be a named tuple. Patch by + Ross Light. + +- Issue #1520877: Now distutils.sysconfig reads $AR from the + environment/Makefile. Patch by Douglas Greiman. + +- Issue #1276768: The verbose option was not used in the code of + distutils.file_util and distutils.dir_util. + +- Issue #5132: Fixed trouble building extensions under Solaris with + --enabled-shared activated. Initial patch by Dave Peterson. + +- Issue #1581476: Always use the Tcl global namespace when calling into Tcl. + +- The shelve module now defaults to pickle protocol 3. + +- Fix a bug in the trace module where a bytes object from co_lnotab had its + items being passed through ord(). + +- Issue #2047: shutil.move() could believe that its destination path was + inside its source path if it began with the same letters (e.g. "src" vs. + "src.new"). + +- Added the ttk module. See issue #2983: Ttk support for Tkinter. + - Removed isSequenceType(), isMappingType, and isNumberType() from the operator module; use the abstract base classes instead. Also removed the repeat() function; use mul() instead. @@ -346,15 +397,26 @@ - Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on biarch systems. Try to rely on ldconfig only, without using objdump and gcc. +- Issue #5104: The socket module now raises OverflowError when 16-bit port and + protocol numbers are supplied outside the allowed 0-65536 range on bind() + and getservbyport(). + Tools/Demos ----------- +- Issue #4704: remove use of cmp() in pybench, bump its version number to 2.1, + and make it 2.6-compatible. + +- Ttk demos added in Demo/tkinter/ttk/ + - Issue #4677: add two list comprehension tests to pybench. Build ----- +- Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. + - Issue #4895: Use _strdup on Windows CE. - Issue #4472: "configure --enable-shared" now works on OSX @@ -419,6 +481,12 @@ buffer. +Tests +----- + +- Issue #5083: New 'gui' resource for regrtest. + + Docs ---- Modified: python/branches/io-c/Modules/_bytesio.c ============================================================================== --- python/branches/io-c/Modules/_bytesio.c (original) +++ python/branches/io-c/Modules/_bytesio.c Sun Feb 8 21:39:02 2009 @@ -702,7 +702,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/_collectionsmodule.c ============================================================================== --- python/branches/io-c/Modules/_collectionsmodule.c (original) +++ python/branches/io-c/Modules/_collectionsmodule.c Sun Feb 8 21:39:02 2009 @@ -848,7 +848,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ deque_repr, /* tp_repr */ 0, /* tp_as_number */ &deque_as_sequence, /* tp_as_sequence */ @@ -978,7 +978,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1061,7 +1061,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1318,7 +1318,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)defdict_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/_csv.c ============================================================================== --- python/branches/io-c/Modules/_csv.c (original) +++ python/branches/io-c/Modules/_csv.c Sun Feb 8 21:39:02 2009 @@ -443,7 +443,7 @@ (printfunc)0, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ - (cmpfunc)0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -864,7 +864,7 @@ (printfunc)0, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)0, /*tp_setattr*/ - (cmpfunc)0, /*tp_compare*/ + 0, /*tp_reserved*/ (reprfunc)0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1286,7 +1286,7 @@ (printfunc)0, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)0, /*tp_setattr*/ - (cmpfunc)0, /*tp_compare*/ + 0, /*tp_reserved*/ (reprfunc)0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/_ctypes/_ctypes.c ============================================================================== --- python/branches/io-c/Modules/_ctypes/_ctypes.c (original) +++ python/branches/io-c/Modules/_ctypes/_ctypes.c Sun Feb 8 21:39:02 2009 @@ -179,7 +179,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -713,7 +713,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &CDataType_as_sequence, /* tp_as_sequence */ @@ -755,7 +755,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &CDataType_as_sequence, /* tp_as_sequence */ @@ -988,7 +988,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &CDataType_as_sequence, /* tp_as_sequence */ @@ -1390,7 +1390,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &CDataType_as_sequence, /* tp_as_sequence */ @@ -2059,7 +2059,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &CDataType_as_sequence, /* tp_as_sequence */ @@ -2277,7 +2277,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &CDataType_as_sequence, /* tp_as_sequence */ @@ -2560,7 +2560,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3889,7 +3889,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)CFuncPtr_repr, /* tp_repr */ &CFuncPtr_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -4032,7 +4032,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -4074,7 +4074,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -4383,7 +4383,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &Array_as_sequence, /* tp_as_sequence */ @@ -4615,7 +4615,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)&Simple_repr, /* tp_repr */ &Simple_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -4992,7 +4992,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ &Pointer_as_number, /* tp_as_number */ &Pointer_as_sequence, /* tp_as_sequence */ @@ -5086,7 +5086,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/_ctypes/callbacks.c ============================================================================== --- python/branches/io-c/Modules/_ctypes/callbacks.c (original) +++ python/branches/io-c/Modules/_ctypes/callbacks.c Sun Feb 8 21:39:02 2009 @@ -50,7 +50,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/_ctypes/callproc.c ============================================================================== --- python/branches/io-c/Modules/_ctypes/callproc.c (original) +++ python/branches/io-c/Modules/_ctypes/callproc.c Sun Feb 8 21:39:02 2009 @@ -512,7 +512,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)PyCArg_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/_ctypes/cfield.c ============================================================================== --- python/branches/io-c/Modules/_ctypes/cfield.c (original) +++ python/branches/io-c/Modules/_ctypes/cfield.c Sun Feb 8 21:39:02 2009 @@ -289,7 +289,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)CField_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/_ctypes/libffi_msvc/ffi.c ============================================================================== --- python/branches/io-c/Modules/_ctypes/libffi_msvc/ffi.c (original) +++ python/branches/io-c/Modules/_ctypes/libffi_msvc/ffi.c Sun Feb 8 21:39:02 2009 @@ -148,27 +148,12 @@ } #ifdef _WIN32 -/*@-declundef@*/ -/*@-exportheader@*/ -extern int -ffi_call_SYSV(void (*)(char *, extended_cif *), - /*@out@*/ extended_cif *, - unsigned, unsigned, - /*@out@*/ unsigned *, - void (*fn)()); -/*@=declundef@*/ -/*@=exportheader@*/ - -/*@-declundef@*/ -/*@-exportheader@*/ extern int -ffi_call_STDCALL(void (*)(char *, extended_cif *), - /*@out@*/ extended_cif *, - unsigned, unsigned, - /*@out@*/ unsigned *, - void (*fn)()); -/*@=declundef@*/ -/*@=exportheader@*/ +ffi_call_x86(void (*)(char *, extended_cif *), + /*@out@*/ extended_cif *, + unsigned, unsigned, + /*@out@*/ unsigned *, + void (*fn)()); #endif #ifdef _WIN64 @@ -209,17 +194,9 @@ { #if !defined(_WIN64) case FFI_SYSV: - /*@-usedef@*/ - return ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, - cif->flags, ecif.rvalue, fn); - /*@=usedef@*/ - break; - case FFI_STDCALL: - /*@-usedef@*/ - return ffi_call_STDCALL(ffi_prep_args, &ecif, cif->bytes, - cif->flags, ecif.rvalue, fn); - /*@=usedef@*/ + return ffi_call_x86(ffi_prep_args, &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn); break; #else case FFI_SYSV: Deleted: python/branches/io-c/Modules/_ctypes/libffi_msvc/win32.S ============================================================================== --- python/branches/io-c/Modules/_ctypes/libffi_msvc/win32.S Sun Feb 8 21:39:02 2009 +++ (empty file) @@ -1,243 +0,0 @@ -/* ----------------------------------------------------------------------- - win32.S - Copyright (c) 1996, 1998, 2001, 2002 Red Hat, Inc. - Copyright (c) 2001 John Beniton - Copyright (c) 2002 Ranjit Mathew - - - X86 Foreign Function Interface - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - ``Software''), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR - OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - -.text - -.globl ffi_prep_args - - # This assumes we are using gas. - .balign 16 -.globl _ffi_call_SYSV - -_ffi_call_SYSV: - pushl %ebp - movl %esp,%ebp - - #THe: save previous %esi, and store the current stack pointer in %esi - pushl %esi - movl %esp,%esi - - # Make room for all of the new args. - movl 16(%ebp),%ecx - subl %ecx,%esp - - movl %esp,%eax - - # Place all of the ffi_prep_args in position - pushl 12(%ebp) - pushl %eax - call *8(%ebp) - - # Return stack to previous state and call the function - addl $8,%esp - - # FIXME: Align the stack to a 128-bit boundary to avoid - # potential performance hits. - - call *28(%ebp) - - # Remove the space we pushed for the args - movl 16(%ebp),%ecx - addl %ecx,%esp - - sub %esp,%esi # calculate stack pointer difference - - # Load %ecx with the return type code - movl 20(%ebp),%ecx - - # If the return value pointer is NULL, assume no return value. - cmpl $0,24(%ebp) - jne retint - - # Even if there is no space for the return value, we are - # obliged to handle floating-point values. - cmpl $FFI_TYPE_FLOAT,%ecx - jne noretval - fstp %st(0) - - jmp epilogue - -retint: - cmpl $FFI_TYPE_INT,%ecx - jne retfloat - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - movl %eax,0(%ecx) - jmp epilogue - -retfloat: - cmpl $FFI_TYPE_FLOAT,%ecx - jne retdouble - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - fstps (%ecx) - jmp epilogue - -retdouble: - cmpl $FFI_TYPE_DOUBLE,%ecx - jne retlongdouble - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - fstpl (%ecx) - jmp epilogue - -retlongdouble: - cmpl $FFI_TYPE_LONGDOUBLE,%ecx - jne retint64 - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - fstpt (%ecx) - jmp epilogue - -retint64: - cmpl $FFI_TYPE_SINT64,%ecx - jne retstruct - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - movl %eax,0(%ecx) - movl %edx,4(%ecx) - -retstruct: - # Nothing to do! - -noretval: -epilogue: - movl %esi,%eax # return the stack pointer detlta in %eax - popl %esi # restore previous %esi - movl %ebp,%esp - popl %ebp - ret - -.ffi_call_SYSV_end: - - # This assumes we are using gas. - .balign 16 -.globl _ffi_call_STDCALL - -_ffi_call_STDCALL: - pushl %ebp - movl %esp,%ebp - - #THe: save previous %esi, and store the current stack pointer in %esi - pushl %esi - movl %esp,%esi - - # Make room for all of the new args. - movl 16(%ebp),%ecx - subl %ecx,%esp - - movl %esp,%eax - - # Place all of the ffi_prep_args in position - pushl 12(%ebp) - pushl %eax - call *8(%ebp) - - # Return stack to previous state and call the function - addl $8,%esp - - # FIXME: Align the stack to a 128-bit boundary to avoid - # potential performance hits. - - call *28(%ebp) - - sub %esp,%esi # difference in stack - - # stdcall functions pop arguments off the stack themselves - - # Load %ecx with the return type code - movl 20(%ebp),%ecx - - # If the return value pointer is NULL, assume no return value. - cmpl $0,24(%ebp) - jne sc_retint - - # Even if there is no space for the return value, we are - # obliged to handle floating-point values. - cmpl $FFI_TYPE_FLOAT,%ecx - jne sc_noretval - fstp %st(0) - - jmp sc_epilogue - -sc_retint: - cmpl $FFI_TYPE_INT,%ecx - jne sc_retfloat - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - movl %eax,0(%ecx) - jmp sc_epilogue - -sc_retfloat: - cmpl $FFI_TYPE_FLOAT,%ecx - jne sc_retdouble - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - fstps (%ecx) - jmp sc_epilogue - -sc_retdouble: - cmpl $FFI_TYPE_DOUBLE,%ecx - jne sc_retlongdouble - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - fstpl (%ecx) - jmp sc_epilogue - -sc_retlongdouble: - cmpl $FFI_TYPE_LONGDOUBLE,%ecx - jne sc_retint64 - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - fstpt (%ecx) - jmp sc_epilogue - -sc_retint64: - cmpl $FFI_TYPE_SINT64,%ecx - jne sc_retstruct - # Load %ecx with the pointer to storage for the return value - movl 24(%ebp),%ecx - movl %eax,0(%ecx) - movl %edx,4(%ecx) - -sc_retstruct: - # Nothing to do! - -sc_noretval: -sc_epilogue: - movl %esi,%eax # return the stack difference - popl %esi # restore previous %esi value - movl %ebp,%esp - popl %ebp - ret - -.ffi_call_STDCALL_end: Modified: python/branches/io-c/Modules/_ctypes/libffi_msvc/win32.c ============================================================================== --- python/branches/io-c/Modules/_ctypes/libffi_msvc/win32.c (original) +++ python/branches/io-c/Modules/_ctypes/libffi_msvc/win32.c Sun Feb 8 21:39:02 2009 @@ -29,21 +29,21 @@ /* theller: almost verbatim translation from gas syntax to MSVC inline assembler code. */ -/* theller: ffi_call_SYSV and ffi_call_STDCALL now return an integer - the - difference of the stack pointer before and after the function call. If - everything is ok, zero is returned. If stdcall functions are passed the - wrong number of arguments, the difference will be nonzero. */ +/* theller: ffi_call_x86 now returns an integer - the difference of the stack + pointer before and after the function call. If everything is ok, zero is + returned. If stdcall functions are passed the wrong number of arguments, + the difference will be nonzero. */ #include #include __declspec(naked) int -ffi_call_SYSV(void (* prepfunc)(char *, extended_cif *), /* 8 */ - extended_cif *ecif, /* 12 */ - unsigned bytes, /* 16 */ - unsigned flags, /* 20 */ - unsigned *rvalue, /* 24 */ - void (*fn)()) /* 28 */ +ffi_call_x86(void (* prepfunc)(char *, extended_cif *), /* 8 */ + extended_cif *ecif, /* 12 */ + unsigned bytes, /* 16 */ + unsigned flags, /* 20 */ + unsigned *rvalue, /* 24 */ + void (*fn)()) /* 28 */ { _asm { push ebp @@ -69,125 +69,20 @@ // FIXME: Align the stack to a 128-bit boundary to avoid // potential performance hits. call [ebp + 28] -// Remove the space we pushed for the args - mov ecx, [ebp + 16] - add esp, ecx - -// XXX ASSERT THAT ESP IS THE SAME NOW THAN BEFORE! - sub esi, esp - -// Load %ecx with the return type code - mov ecx, [ebp + 20] - -// If the return value pointer is NULL, assume no return value. -/* - Intel asm is weird. We have to explicitely specify 'DWORD PTR' in the nexr instruction, - otherwise only one BYTE will be compared (instead of a DWORD)! - */ - cmp DWORD PTR [ebp + 24], 0 - jne sc_retint - -// Even if there is no space for the return value, we are -// obliged to handle floating-point values. - cmp ecx, FFI_TYPE_FLOAT - jne sc_noretval -// fstp %st(0) - fstp st(0) - - jmp sc_epilogue - -sc_retint: - cmp ecx, FFI_TYPE_INT - jne sc_retfloat -// # Load %ecx with the pointer to storage for the return value - mov ecx, [ebp + 24] - mov [ecx + 0], eax - jmp sc_epilogue - -sc_retfloat: - cmp ecx, FFI_TYPE_FLOAT - jne sc_retdouble -// Load %ecx with the pointer to storage for the return value - mov ecx, [ebp+24] -// fstps (%ecx) - fstp DWORD PTR [ecx] - jmp sc_epilogue -sc_retdouble: - cmp ecx, FFI_TYPE_DOUBLE - jne sc_retlongdouble -// movl 24(%ebp),%ecx - mov ecx, [ebp+24] - fstp QWORD PTR [ecx] - jmp sc_epilogue - - jmp sc_retlongdouble // avoid warning about unused label -sc_retlongdouble: - cmp ecx, FFI_TYPE_LONGDOUBLE - jne sc_retint64 -// Load %ecx with the pointer to storage for the return value - mov ecx, [ebp+24] -// fstpt (%ecx) - fstp QWORD PTR [ecx] /* XXX ??? */ - jmp sc_epilogue - -sc_retint64: - cmp ecx, FFI_TYPE_SINT64 - jne sc_retstruct -// Load %ecx with the pointer to storage for the return value - mov ecx, [ebp+24] - mov [ecx+0], eax - mov [ecx+4], edx - -sc_retstruct: -// Nothing to do! - -sc_noretval: -sc_epilogue: - mov eax, esi - pop esi // NEW restore: must be preserved across function calls - mov esp, ebp - pop ebp - ret - } -} - -__declspec(naked) int -ffi_call_STDCALL(void (* prepfunc)(char *, extended_cif *), /* 8 */ - extended_cif *ecif, /* 12 */ - unsigned bytes, /* 16 */ - unsigned flags, /* 20 */ - unsigned *rvalue, /* 24 */ - void (*fn)()) /* 28 */ -{ - _asm { - push ebp - mov ebp, esp - - push esi // NEW: this register must be preserved across function calls - -// XXX SAVE ESP NOW! - mov esi, esp - -// Make room for all of the new args. - mov ecx, [ebp+16] - sub esp, ecx +// Load ecif->cif->abi + mov ecx, [ebp + 12] + mov ecx, [ecx]ecif.cif + mov ecx, [ecx]ecif.cif.abi - mov eax, esp - -// Place all of the ffi_prep_args in position - push [ebp + 12] // ecif - push eax - call [ebp + 8] // prepfunc - -// Return stack to previous state and call the function - add esp, 8 -// FIXME: Align the stack to a 128-bit boundary to avoid -// potential performance hits. - call [ebp + 28] -// stdcall functions pop arguments off the stack themselves - -// XXX IS ESP NOW THE SAME AS BEFORE? + cmp ecx, FFI_STDCALL + je noclean +// STDCALL: Remove the space we pushed for the args + mov ecx, [ebp + 16] + add esp, ecx +// CDECL: Caller has already cleaned the stack +noclean: +// Check that esp has the same value as before! sub esi, esp // Load %ecx with the return type code Modified: python/branches/io-c/Modules/_ctypes/stgdict.c ============================================================================== --- python/branches/io-c/Modules/_ctypes/stgdict.c (original) +++ python/branches/io-c/Modules/_ctypes/stgdict.c Sun Feb 8 21:39:02 2009 @@ -111,7 +111,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/_curses_panel.c ============================================================================== --- python/branches/io-c/Modules/_curses_panel.c (original) +++ python/branches/io-c/Modules/_curses_panel.c Sun Feb 8 21:39:02 2009 @@ -341,7 +341,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/_cursesmodule.c ============================================================================== --- python/branches/io-c/Modules/_cursesmodule.c (original) +++ python/branches/io-c/Modules/_cursesmodule.c Sun Feb 8 21:39:02 2009 @@ -1662,7 +1662,7 @@ 0, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/_dbmmodule.c ============================================================================== --- python/branches/io-c/Modules/_dbmmodule.c (original) +++ python/branches/io-c/Modules/_dbmmodule.c Sun Feb 8 21:39:02 2009 @@ -337,7 +337,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ &dbm_as_sequence, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/_elementtree.c ============================================================================== --- python/branches/io-c/Modules/_elementtree.c (original) +++ python/branches/io-c/Modules/_elementtree.c Sun Feb 8 21:39:02 2009 @@ -761,7 +761,7 @@ for (i = 0; i < self->extra->length; i++) { PyObject* item = self->extra->children[i]; if (Element_CheckExact(item) && - PyObject_Compare(((ElementObject*)item)->tag, tag) == 0) { + PyObject_RichCompareBool(((ElementObject*)item)->tag, tag, Py_EQ) == 1) { Py_INCREF(item); return item; } @@ -792,7 +792,8 @@ for (i = 0; i < self->extra->length; i++) { ElementObject* item = (ElementObject*) self->extra->children[i]; - if (Element_CheckExact(item) && !PyObject_Compare(item->tag, tag)) { + if (Element_CheckExact(item) && (PyObject_RichCompareBool(item->tag, tag, Py_EQ) == 1)) { + PyObject* text = element_get_text(item); if (text == Py_None) return PyBytes_FromString(""); @@ -830,7 +831,7 @@ for (i = 0; i < self->extra->length; i++) { PyObject* item = self->extra->children[i]; if (Element_CheckExact(item) && - PyObject_Compare(((ElementObject*)item)->tag, tag) == 0) { + PyObject_RichCompareBool(((ElementObject*)item)->tag, tag, Py_EQ) == 1) { if (PyList_Append(out, item) < 0) { Py_DECREF(out); return NULL; @@ -1102,7 +1103,7 @@ for (i = 0; i < self->extra->length; i++) { if (self->extra->children[i] == element) break; - if (PyObject_Compare(self->extra->children[i], element) == 0) + if (PyObject_RichCompareBool(self->extra->children[i], element, Py_EQ) == 1) break; } @@ -1378,7 +1379,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ (setattrfunc)element_setattr, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)element_repr, /* tp_repr */ 0, /* tp_as_number */ &element_as_sequence, /* tp_as_sequence */ @@ -1802,7 +1803,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2558,7 +2559,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/_fileio.c ============================================================================== --- python/branches/io-c/Modules/_fileio.c (original) +++ python/branches/io-c/Modules/_fileio.c Sun Feb 8 21:39:02 2009 @@ -961,7 +961,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)fileio_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/_functoolsmodule.c ============================================================================== --- python/branches/io-c/Modules/_functoolsmodule.c (original) +++ python/branches/io-c/Modules/_functoolsmodule.c Sun Feb 8 21:39:02 2009 @@ -206,7 +206,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/_gdbmmodule.c ============================================================================== --- python/branches/io-c/Modules/_gdbmmodule.c (original) +++ python/branches/io-c/Modules/_gdbmmodule.c Sun Feb 8 21:39:02 2009 @@ -390,7 +390,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ &dbm_as_sequence, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/_hashopenssl.c ============================================================================== --- python/branches/io-c/Modules/_hashopenssl.c (original) +++ python/branches/io-c/Modules/_hashopenssl.c Sun Feb 8 21:39:02 2009 @@ -407,7 +407,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ (reprfunc)EVP_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/_localemodule.c ============================================================================== --- python/branches/io-c/Modules/_localemodule.c (original) +++ python/branches/io-c/Modules/_localemodule.c Sun Feb 8 21:39:02 2009 @@ -272,7 +272,9 @@ #ifdef HAVE_WCSXFRM PyDoc_STRVAR(strxfrm__doc__, -"string -> string. Returns a string that behaves for cmp locale-aware."); +"strxfrm(string) -> string.\n\ +\n\ +Return a string that can be used as a key for locale-aware comparisons."); static PyObject* PyLocale_strxfrm(PyObject* self, PyObject* args) Modified: python/branches/io-c/Modules/_lsprof.c ============================================================================== --- python/branches/io-c/Modules/_lsprof.c (original) +++ python/branches/io-c/Modules/_lsprof.c Sun Feb 8 21:39:02 2009 @@ -820,7 +820,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/_multiprocessing/connection.h ============================================================================== --- python/branches/io-c/Modules/_multiprocessing/connection.h (original) +++ python/branches/io-c/Modules/_multiprocessing/connection.h Sun Feb 8 21:39:02 2009 @@ -487,7 +487,7 @@ /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, - /* tp_compare */ 0, + /* tp_reserved */ 0, /* tp_repr */ (reprfunc)connection_repr, /* tp_as_number */ 0, /* tp_as_sequence */ 0, Modified: python/branches/io-c/Modules/_multiprocessing/semaphore.c ============================================================================== --- python/branches/io-c/Modules/_multiprocessing/semaphore.c (original) +++ python/branches/io-c/Modules/_multiprocessing/semaphore.c Sun Feb 8 21:39:02 2009 @@ -592,7 +592,7 @@ /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, - /* tp_compare */ 0, + /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, Modified: python/branches/io-c/Modules/_pickle.c ============================================================================== --- python/branches/io-c/Modules/_pickle.c (original) +++ python/branches/io-c/Modules/_pickle.c Sun Feb 8 21:39:02 2009 @@ -715,7 +715,7 @@ i = 0; module_name = NULL; while ((j = PyDict_Next(modules_dict, &i, &module_name, &module))) { - if (PyObject_Compare(module_name, main_str) == 0) + if (PyObject_RichCompareBool(module_name, main_str, Py_EQ) == 1) continue; obj = PyObject_GetAttr(module, global_name); @@ -2677,7 +2677,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -4534,7 +4534,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/_randommodule.c ============================================================================== --- python/branches/io-c/Modules/_randommodule.c (original) +++ python/branches/io-c/Modules/_randommodule.c Sun Feb 8 21:39:02 2009 @@ -459,7 +459,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/_sqlite/cache.c ============================================================================== --- python/branches/io-c/Modules/_sqlite/cache.c (original) +++ python/branches/io-c/Modules/_sqlite/cache.c Sun Feb 8 21:39:02 2009 @@ -282,7 +282,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -324,7 +324,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/_sqlite/connection.c ============================================================================== --- python/branches/io-c/Modules/_sqlite/connection.c (original) +++ python/branches/io-c/Modules/_sqlite/connection.c Sun Feb 8 21:39:02 2009 @@ -1350,7 +1350,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/_sqlite/cursor.c ============================================================================== --- python/branches/io-c/Modules/_sqlite/cursor.c (original) +++ python/branches/io-c/Modules/_sqlite/cursor.c Sun Feb 8 21:39:02 2009 @@ -1066,7 +1066,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/_sqlite/prepare_protocol.c ============================================================================== --- python/branches/io-c/Modules/_sqlite/prepare_protocol.c (original) +++ python/branches/io-c/Modules/_sqlite/prepare_protocol.c Sun Feb 8 21:39:02 2009 @@ -42,7 +42,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/_sqlite/row.c ============================================================================== --- python/branches/io-c/Modules/_sqlite/row.c (original) +++ python/branches/io-c/Modules/_sqlite/row.c Sun Feb 8 21:39:02 2009 @@ -210,7 +210,7 @@ (printfunc)pysqlite_row_print, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/_sqlite/statement.c ============================================================================== --- python/branches/io-c/Modules/_sqlite/statement.c (original) +++ python/branches/io-c/Modules/_sqlite/statement.c Sun Feb 8 21:39:02 2009 @@ -464,7 +464,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/_sre.c ============================================================================== --- python/branches/io-c/Modules/_sre.c (original) +++ python/branches/io-c/Modules/_sre.c Sun Feb 8 21:39:02 2009 @@ -2625,7 +2625,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3635,7 +3635,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3819,7 +3819,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/_ssl.c ============================================================================== --- python/branches/io-c/Modules/_ssl.c (original) +++ python/branches/io-c/Modules/_ssl.c Sun Feb 8 21:39:02 2009 @@ -1432,7 +1432,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/_stringio.c ============================================================================== --- python/branches/io-c/Modules/_stringio.c (original) +++ python/branches/io-c/Modules/_stringio.c Sun Feb 8 21:39:02 2009 @@ -322,7 +322,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/_struct.c ============================================================================== --- python/branches/io-c/Modules/_struct.c (original) +++ python/branches/io-c/Modules/_struct.c Sun Feb 8 21:39:02 2009 @@ -1853,7 +1853,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/_testcapimodule.c ============================================================================== --- python/branches/io-c/Modules/_testcapimodule.c (original) +++ python/branches/io-c/Modules/_testcapimodule.c Sun Feb 8 21:39:02 2009 @@ -187,7 +187,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1322,7 +1322,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/_threadmodule.c ============================================================================== --- python/branches/io-c/Modules/_threadmodule.c (original) +++ python/branches/io-c/Modules/_threadmodule.c Sun Feb 8 21:39:02 2009 @@ -129,7 +129,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -358,7 +358,7 @@ /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, - /* tp_compare */ 0, + /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, Modified: python/branches/io-c/Modules/_tkinter.c ============================================================================== --- python/branches/io-c/Modules/_tkinter.c (original) +++ python/branches/io-c/Modules/_tkinter.c Sun Feb 8 21:39:02 2009 @@ -9,9 +9,9 @@ /* TCL/TK VERSION INFO: - Only Tcl/Tk 8.2 and later are supported. Older versions are not - supported. (Use Python 2.2 if you cannot upgrade your Tcl/Tk - libraries.) + Only Tcl/Tk 8.3.1 and later are supported. Older versions are not + supported. Use Python 2.6 or older if you cannot upgrade your + Tcl/Tk libraries. */ /* XXX Further speed-up ideas, involving Tcl 8.0 features: @@ -788,15 +788,59 @@ self->value->typePtr->name, self->value); } -static int -PyTclObject_cmp(PyTclObject *self, PyTclObject *other) +#define TEST_COND(cond) ((cond) ? Py_True : Py_False) + +static PyObject * +PyTclObject_richcompare(PyObject *self, PyObject *other, int op) { - int res; - res = strcmp(Tcl_GetString(self->value), - Tcl_GetString(other->value)); - if (res < 0) return -1; - if (res > 0) return 1; - return 0; + int result; + PyObject *v; + + /* neither argument should be NULL, unless something's gone wrong */ + if (self == NULL || other == NULL) { + PyErr_BadInternalCall(); + return NULL; + } + + /* both arguments should be instances of PyTclObject */ + if (!PyTclObject_Check(self) || !PyTclObject_Check(other)) { + v = Py_NotImplemented; + goto finished; + } + + if (self == other) + /* fast path when self and other are identical */ + result = 0; + else + result = strcmp(Tcl_GetString(((PyTclObject *)self)->value), + Tcl_GetString(((PyTclObject *)other)->value)); + /* Convert return value to a Boolean */ + switch (op) { + case Py_EQ: + v = TEST_COND(result == 0); + break; + case Py_NE: + v = TEST_COND(result != 0); + break; + case Py_LE: + v = TEST_COND(result <= 0); + break; + case Py_GE: + v = TEST_COND(result >= 0); + break; + case Py_LT: + v = TEST_COND(result < 0); + break; + case Py_GT: + v = TEST_COND(result > 0); + break; + default: + PyErr_BadArgument(); + return NULL; + } + finished: + Py_INCREF(v); + return v; } PyDoc_STRVAR(get_typename__doc__, "name of the Tcl type"); @@ -818,45 +862,45 @@ static PyTypeObject PyTclObject_Type = { PyVarObject_HEAD_INIT(NULL, 0) "_tkinter.Tcl_Obj", /*tp_name*/ - sizeof(PyTclObject), /*tp_basicsize*/ - 0, /*tp_itemsize*/ + sizeof(PyTclObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ /* methods */ - (destructor)PyTclObject_dealloc, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - (cmpfunc)PyTclObject_cmp, /*tp_compare*/ + (destructor)PyTclObject_dealloc,/*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_reserved*/ (reprfunc)PyTclObject_repr, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - (reprfunc)PyTclObject_str, /*tp_str*/ - PyObject_GenericGetAttr,/*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - PyTclObject_getsetlist, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - 0, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + (reprfunc)PyTclObject_str, /*tp_str*/ + PyObject_GenericGetAttr, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + PyTclObject_richcompare, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + PyTclObject_getsetlist, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ }; static Tcl_Obj* @@ -1041,7 +1085,7 @@ int flags; PyObject **res; PyObject **exc_type, **exc_value, **exc_tb; - Tcl_Condition done; + Tcl_Condition *done; } Tkapp_CallEvent; void @@ -1164,10 +1208,12 @@ *(e->res) = Tkapp_CallResult(e->self); } LEAVE_PYTHON - done: + + Tkapp_CallDeallocArgs(objv, objStore, objc); +done: /* Wake up calling thread. */ Tcl_MutexLock(&call_mutex); - Tcl_ConditionNotify(&e->done); + Tcl_ConditionNotify(e->done); Tcl_MutexUnlock(&call_mutex); return 1; } @@ -1192,8 +1238,7 @@ int objc, i; PyObject *res = NULL; TkappObject *self = (TkappObject*)selfptr; - /* Could add TCL_EVAL_GLOBAL if wrapped by GlobalCall... */ - int flags = TCL_EVAL_DIRECT; + int flags = TCL_EVAL_DIRECT | TCL_EVAL_GLOBAL; /* If args is a single tuple, replace with contents of tuple */ if (1 == PyTuple_Size(args)){ @@ -1206,6 +1251,7 @@ /* We cannot call the command directly. Instead, we must marshal the parameters to the interpreter thread. */ Tkapp_CallEvent *ev; + Tcl_Condition cond = NULL; PyObject *exc_type, *exc_value, *exc_tb; if (!WaitForMainloop(self)) return NULL; @@ -1217,9 +1263,9 @@ ev->exc_type = &exc_type; ev->exc_value = &exc_value; ev->exc_tb = &exc_tb; - ev->done = (Tcl_Condition)0; + ev->done = &cond; - Tkapp_ThreadSend(self, (Tcl_Event*)ev, &ev->done, &call_mutex); + Tkapp_ThreadSend(self, (Tcl_Event*)ev, &cond, &call_mutex); if (res == NULL) { if (exc_type) @@ -1227,6 +1273,7 @@ else PyErr_SetObject(Tkinter_TclError, exc_value); } + Tcl_ConditionFinalize(&cond); } else #endif @@ -1412,7 +1459,7 @@ PyObject **res; PyObject **exc_type; PyObject **exc_val; - Tcl_Condition cond; + Tcl_Condition *cond; } VarEvent; static int @@ -1456,7 +1503,7 @@ ENTER_PYTHON var_perform(ev); Tcl_MutexLock(&var_mutex); - Tcl_ConditionNotify(&ev->cond); + Tcl_ConditionNotify(ev->cond); Tcl_MutexUnlock(&var_mutex); LEAVE_PYTHON return 1; @@ -1471,6 +1518,7 @@ TkappObject *self = (TkappObject*)selfptr; VarEvent *ev; PyObject *res, *exc_type, *exc_val; + Tcl_Condition cond = NULL; /* The current thread is not the interpreter thread. Marshal the call to the interpreter thread, then wait for @@ -1487,9 +1535,10 @@ ev->res = &res; ev->exc_type = &exc_type; ev->exc_val = &exc_val; - ev->cond = NULL; + ev->cond = &cond; ev->ev.proc = (Tcl_EventProc*)var_proc; - Tkapp_ThreadSend(self, (Tcl_Event*)ev, &ev->cond, &var_mutex); + Tkapp_ThreadSend(self, (Tcl_Event*)ev, &cond, &var_mutex); + Tcl_ConditionFinalize(&cond); if (!res) { PyErr_SetObject(exc_type, exc_val); Py_DECREF(exc_type); @@ -1976,7 +2025,7 @@ int create; int *status; ClientData *data; - Tcl_Condition done; + Tcl_Condition *done; } CommandEvent; static int @@ -1989,7 +2038,7 @@ else *ev->status = Tcl_DeleteCommand(ev->interp, ev->name); Tcl_MutexLock(&command_mutex); - Tcl_ConditionNotify(&ev->done); + Tcl_ConditionNotify(ev->done); Tcl_MutexUnlock(&command_mutex); return 1; } @@ -2025,6 +2074,7 @@ data->func = func; if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) { + Tcl_Condition cond = NULL; CommandEvent *ev = (CommandEvent*)ckalloc(sizeof(CommandEvent)); ev->ev.proc = (Tcl_EventProc*)Tkapp_CommandProc; ev->interp = self->interp; @@ -2032,8 +2082,9 @@ ev->name = cmdName; ev->data = (ClientData)data; ev->status = &err; - ev->done = NULL; - Tkapp_ThreadSend(self, (Tcl_Event*)ev, &ev->done, &command_mutex); + ev->done = &cond; + Tkapp_ThreadSend(self, (Tcl_Event*)ev, &cond, &command_mutex); + Tcl_ConditionFinalize(&cond); } else { ENTER_TCL @@ -2064,6 +2115,7 @@ if (!PyArg_ParseTuple(args, "s:deletecommand", &cmdName)) return NULL; if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) { + Tcl_Condition cond = NULL; CommandEvent *ev; ev = (CommandEvent*)ckalloc(sizeof(CommandEvent)); ev->ev.proc = (Tcl_EventProc*)Tkapp_CommandProc; @@ -2071,9 +2123,10 @@ ev->create = 0; ev->name = cmdName; ev->status = &err; - ev->done = NULL; - Tkapp_ThreadSend(self, (Tcl_Event*)ev, &ev->done, + ev->done = &cond; + Tkapp_ThreadSend(self, (Tcl_Event*)ev, &cond, &command_mutex); + Tcl_ConditionFinalize(&cond); } else { ENTER_TCL @@ -2307,7 +2360,7 @@ 0, /*tp_print */ 0, /*tp_getattr */ 0, /*tp_setattr */ - 0, /*tp_compare */ + 0, /*tp_reserved */ Tktt_Repr, /*tp_repr */ 0, /*tp_as_number */ 0, /*tp_as_sequence */ @@ -2633,7 +2686,7 @@ 0, /*tp_print */ 0, /*tp_getattr */ 0, /*tp_setattr */ - 0, /*tp_compare */ + 0, /*tp_reserved */ 0, /*tp_repr */ 0, /*tp_as_number */ 0, /*tp_as_sequence */ @@ -2750,7 +2803,9 @@ return NULL; context.maxsize = PySequence_Size(item); - if (context.maxsize <= 0) + if (context.maxsize < 0) + return NULL; + if (context.maxsize == 0) return PyTuple_New(0); context.tuple = PyTuple_New(context.maxsize); Modified: python/branches/io-c/Modules/arraymodule.c ============================================================================== --- python/branches/io-c/Modules/arraymodule.c (original) +++ python/branches/io-c/Modules/arraymodule.c Sun Feb 8 21:39:02 2009 @@ -2013,7 +2013,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)array_repr, /* tp_repr */ 0, /* tp_as_number*/ &array_as_sequence, /* tp_as_sequence*/ @@ -2116,7 +2116,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/bz2module.c ============================================================================== --- python/branches/io-c/Modules/bz2module.c (original) +++ python/branches/io-c/Modules/bz2module.c Sun Feb 8 21:39:02 2009 @@ -1339,7 +1339,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1622,7 +1622,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1851,7 +1851,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/cjkcodecs/multibytecodec.c ============================================================================== --- python/branches/io-c/Modules/cjkcodecs/multibytecodec.c (original) +++ python/branches/io-c/Modules/cjkcodecs/multibytecodec.c Sun Feb 8 21:39:02 2009 @@ -705,7 +705,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -990,7 +990,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1199,7 +1199,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1529,7 +1529,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1749,7 +1749,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/datetimemodule.c ============================================================================== --- python/branches/io-c/Modules/datetimemodule.c (original) +++ python/branches/io-c/Modules/datetimemodule.c Sun Feb 8 21:39:02 2009 @@ -1427,7 +1427,7 @@ * Miscellaneous helpers. */ -/* For various reasons, we need to use tp_richcompare instead of tp_compare. +/* For various reasons, we need to use tp_richcompare instead of tp_reserved. * The comparisons here all most naturally compute a cmp()-like result. * This little helper turns that into a bool result for rich comparisons. */ @@ -2138,7 +2138,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)delta_repr, /* tp_repr */ &delta_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2709,7 +2709,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)date_repr, /* tp_repr */ &date_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2963,7 +2963,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3478,7 +3478,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)time_repr, /* tp_repr */ &time_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -4606,7 +4606,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)datetime_repr, /* tp_repr */ &datetime_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/itertoolsmodule.c ============================================================================== --- python/branches/io-c/Modules/itertoolsmodule.c (original) +++ python/branches/io-c/Modules/itertoolsmodule.c Sun Feb 8 21:39:02 2009 @@ -148,7 +148,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -279,7 +279,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -432,7 +432,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -588,7 +588,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -783,7 +783,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -925,7 +925,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1064,7 +1064,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1257,7 +1257,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1388,7 +1388,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1556,7 +1556,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1804,7 +1804,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2027,7 +2027,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2273,7 +2273,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2544,7 +2544,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2700,7 +2700,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2843,7 +2843,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2994,7 +2994,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)count_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3129,7 +3129,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)repeat_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3355,7 +3355,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3400,16 +3400,23 @@ repeat(elem [,n]) --> elem, elem, elem, ... endlessly or up to n times\n\ \n\ Iterators terminating on the shortest input sequence:\n\ -zip_longest(p, q, ...) --> (p[0], q[0]), (p[1], q[1]), ... \n\ +chain(p, q, ...) --> p0, p1, ... plast, q0, q1, ... \n\ +compress(data, selectors) --> (d[0] if s[0]), (d[1] if s[1]), ...\n\ +dropwhile(pred, seq) --> seq[n], seq[n+1], starting when pred fails\n\ +groupby(iterable[, keyfunc]) --> sub-iterators grouped by value of keyfunc(v)\n\ filterfalse(pred, seq) --> elements of seq where pred(elem) is False\n\ islice(seq, [start,] stop [, step]) --> elements from\n\ seq[start:stop:step]\n\ starmap(fun, seq) --> fun(*seq[0]), fun(*seq[1]), ...\n\ tee(it, n=2) --> (it1, it2 , ... itn) splits one iterator into n\n\ -chain(p, q, ...) --> p0, p1, ... plast, q0, q1, ... \n\ takewhile(pred, seq) --> seq[0], seq[1], until pred fails\n\ -dropwhile(pred, seq) --> seq[n], seq[n+1], starting when pred fails\n\ -groupby(iterable[, keyfunc]) --> sub-iterators grouped by value of keyfunc(v)\n\ +zip_longest(p, q, ...) --> (p[0], q[0]), (p[1], q[1]), ... \n\ +\n\ +Combinatoric generators:\n\ +product(p, q, ... [repeat=1]) --> cartesian product\n\ +permutations(p[, r])\n\ +combinations(p[, r])\n\ +combinations_with_replacement(p[, r])\n\ "); Modified: python/branches/io-c/Modules/md5module.c ============================================================================== --- python/branches/io-c/Modules/md5module.c (original) +++ python/branches/io-c/Modules/md5module.c Sun Feb 8 21:39:02 2009 @@ -476,7 +476,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/mmapmodule.c ============================================================================== --- python/branches/io-c/Modules/mmapmodule.c (original) +++ python/branches/io-c/Modules/mmapmodule.c Sun Feb 8 21:39:02 2009 @@ -930,7 +930,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &mmap_as_sequence, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/operator.c ============================================================================== --- python/branches/io-c/Modules/operator.c (original) +++ python/branches/io-c/Modules/operator.c Sun Feb 8 21:39:02 2009 @@ -334,7 +334,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -508,7 +508,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -639,7 +639,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/ossaudiodev.c ============================================================================== --- python/branches/io-c/Modules/ossaudiodev.c (original) +++ python/branches/io-c/Modules/ossaudiodev.c Sun Feb 8 21:39:02 2009 @@ -849,7 +849,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -881,7 +881,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/parsermodule.c ============================================================================== --- python/branches/io-c/Modules/parsermodule.c (original) +++ python/branches/io-c/Modules/parsermodule.c Sun Feb 8 21:39:02 2009 @@ -169,7 +169,7 @@ static void parser_free(PyST_Object *st); -static int parser_compare(PyST_Object *left, PyST_Object *right); +static PyObject* parser_richcompare(PyObject *left, PyObject *right, int op); static PyObject* parser_compilest(PyST_Object *, PyObject *, PyObject *); static PyObject* parser_isexpr(PyST_Object *, PyObject *, PyObject *); static PyObject* parser_issuite(PyST_Object *, PyObject *, PyObject *); @@ -203,7 +203,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - (cmpfunc)parser_compare, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -223,7 +223,7 @@ "Intermediate representation of a Python parse tree.", 0, /* tp_traverse */ 0, /* tp_clear */ - 0, /* tp_richcompare */ + parser_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ @@ -231,6 +231,9 @@ }; /* PyST_Type */ +/* PyST_Type isn't subclassable, so just check ob_type */ +#define PyST_Object_Check(v) ((v)->ob_type == &PyST_Type) + static int parser_compare_nodes(node *left, node *right) { @@ -260,26 +263,69 @@ return (0); } - -/* int parser_compare(PyST_Object* left, PyST_Object* right) +/* parser_richcompare(PyObject* left, PyObject* right, int op) * * Comparison function used by the Python operators ==, !=, <, >, <=, >= * This really just wraps a call to parser_compare_nodes() with some easy * checks and protection code. * */ -static int -parser_compare(PyST_Object *left, PyST_Object *right) + +#define TEST_COND(cond) ((cond) ? Py_True : Py_False) + +static PyObject * +parser_richcompare(PyObject *left, PyObject *right, int op) { - if (left == right) - return (0); + int result; + PyObject *v; - if ((left == 0) || (right == 0)) - return (-1); + /* neither argument should be NULL, unless something's gone wrong */ + if (left == NULL || right == NULL) { + PyErr_BadInternalCall(); + return NULL; + } - return (parser_compare_nodes(left->st_node, right->st_node)); -} + /* both arguments should be instances of PyST_Object */ + if (!PyST_Object_Check(left) || !PyST_Object_Check(right)) { + v = Py_NotImplemented; + goto finished; + } + if (left == right) + /* if arguments are identical, they're equal */ + result = 0; + else + result = parser_compare_nodes(((PyST_Object *)left)->st_node, + ((PyST_Object *)right)->st_node); + + /* Convert return value to a Boolean */ + switch (op) { + case Py_EQ: + v = TEST_COND(result == 0); + break; + case Py_NE: + v = TEST_COND(result != 0); + break; + case Py_LE: + v = TEST_COND(result <= 0); + break; + case Py_GE: + v = TEST_COND(result >= 0); + break; + case Py_LT: + v = TEST_COND(result < 0); + break; + case Py_GT: + v = TEST_COND(result > 0); + break; + default: + PyErr_BadArgument(); + return NULL; + } + finished: + Py_INCREF(v); + return v; +} /* parser_newstobject(node* st) * Modified: python/branches/io-c/Modules/pyexpat.c ============================================================================== --- python/branches/io-c/Modules/pyexpat.c (original) +++ python/branches/io-c/Modules/pyexpat.c Sun Feb 8 21:39:02 2009 @@ -1622,7 +1622,7 @@ (printfunc)0, /*tp_print*/ 0, /*tp_getattr*/ (setattrfunc)xmlparse_setattr, /*tp_setattr*/ - (cmpfunc)0, /*tp_compare*/ + 0, /*tp_reserved*/ (reprfunc)0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/selectmodule.c ============================================================================== --- python/branches/io-c/Modules/selectmodule.c (original) +++ python/branches/io-c/Modules/selectmodule.c Sun Feb 8 21:39:02 2009 @@ -639,7 +639,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1097,7 +1097,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1310,7 +1310,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)kqueue_event_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1665,7 +1665,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/sha1module.c ============================================================================== --- python/branches/io-c/Modules/sha1module.c (original) +++ python/branches/io-c/Modules/sha1module.c Sun Feb 8 21:39:02 2009 @@ -452,7 +452,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/sha256module.c ============================================================================== --- python/branches/io-c/Modules/sha256module.c (original) +++ python/branches/io-c/Modules/sha256module.c Sun Feb 8 21:39:02 2009 @@ -545,7 +545,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -579,7 +579,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/sha512module.c ============================================================================== --- python/branches/io-c/Modules/sha512module.c (original) +++ python/branches/io-c/Modules/sha512module.c Sun Feb 8 21:39:02 2009 @@ -611,7 +611,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -645,7 +645,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/socketmodule.c ============================================================================== --- python/branches/io-c/Modules/socketmodule.c (original) +++ python/branches/io-c/Modules/socketmodule.c Sun Feb 8 21:39:02 2009 @@ -1223,6 +1223,12 @@ PyMem_Free(host); if (result < 0) return 0; + if (port < 0 || port > 0xffff) { + PyErr_SetString( + PyExc_OverflowError, + "getsockaddrarg: port must be 0-65535."); + return 0; + } addr->sin_family = AF_INET; addr->sin_port = htons((short)port); *len_ret = sizeof *addr; @@ -1255,6 +1261,12 @@ PyMem_Free(host); if (result < 0) return 0; + if (port < 0 || port > 0xffff) { + PyErr_SetString( + PyExc_OverflowError, + "getsockaddrarg: port must be 0-65535."); + return 0; + } addr->sin6_family = s->sock_family; addr->sin6_port = htons((short)port); addr->sin6_flowinfo = flowinfo; @@ -1381,6 +1393,12 @@ "Hardware address must be 8 bytes or less"); return 0; } + if (protoNumber < 0 || protoNumber > 0xffff) { + PyErr_SetString( + PyExc_OverflowError, + "getsockaddrarg: protoNumber must be 0-65535."); + return 0; + } addr = (struct sockaddr_ll*)addr_ret; addr->sll_family = AF_PACKET; addr->sll_protocol = htons((short)protoNumber); @@ -2860,7 +2878,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)sock_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3271,13 +3289,19 @@ static PyObject * socket_getservbyport(PyObject *self, PyObject *args) { - unsigned short port; + int port; char *proto=NULL; struct servent *sp; - if (!PyArg_ParseTuple(args, "H|s:getservbyport", &port, &proto)) + if (!PyArg_ParseTuple(args, "i|s:getservbyport", &port, &proto)) + return NULL; + if (port < 0 || port > 0xffff) { + PyErr_SetString( + PyExc_OverflowError, + "getservbyport: port must be 0-65535."); return NULL; + } Py_BEGIN_ALLOW_THREADS - sp = getservbyport(htons(port), proto); + sp = getservbyport(htons((short)port), proto); Py_END_ALLOW_THREADS if (sp == NULL) { PyErr_SetString(socket_error, "port/proto not found"); Modified: python/branches/io-c/Modules/unicodedata.c ============================================================================== --- python/branches/io-c/Modules/unicodedata.c (original) +++ python/branches/io-c/Modules/unicodedata.c Sun Feb 8 21:39:02 2009 @@ -1144,7 +1144,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/xxmodule.c ============================================================================== --- python/branches/io-c/Modules/xxmodule.c (original) +++ python/branches/io-c/Modules/xxmodule.c Sun Feb 8 21:39:02 2009 @@ -106,7 +106,7 @@ 0, /*tp_print*/ (getattrfunc)0, /*tp_getattr*/ (setattrfunc)Xxo_setattr, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -224,7 +224,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -279,7 +279,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Modules/xxsubtype.c ============================================================================== --- python/branches/io-c/Modules/xxsubtype.c (original) +++ python/branches/io-c/Modules/xxsubtype.c Sun Feb 8 21:39:02 2009 @@ -109,7 +109,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -200,7 +200,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/zipimport.c ============================================================================== --- python/branches/io-c/Modules/zipimport.c (original) +++ python/branches/io-c/Modules/zipimport.c Sun Feb 8 21:39:02 2009 @@ -363,7 +363,7 @@ char *fullname, *modpath; int ispackage; - if (!PyArg_ParseTuple(args, "s:zipimporter._get_filename", + if (!PyArg_ParseTuple(args, "s:zipimporter.get_filename", &fullname)) return NULL; @@ -543,7 +543,7 @@ PyDoc_STRVAR(doc_get_filename, -"_get_filename(fullname) -> filename string.\n\ +"get_filename(fullname) -> filename string.\n\ \n\ Return the filename for the specified module."); @@ -558,7 +558,7 @@ doc_get_code}, {"get_source", zipimporter_get_source, METH_VARARGS, doc_get_source}, - {"_get_filename", zipimporter_get_filename, METH_VARARGS, + {"get_filename", zipimporter_get_filename, METH_VARARGS, doc_get_filename}, {"is_package", zipimporter_is_package, METH_VARARGS, doc_is_package}, @@ -597,7 +597,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)zipimporter_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Modules/zlibmodule.c ============================================================================== --- python/branches/io-c/Modules/zlibmodule.c (original) +++ python/branches/io-c/Modules/zlibmodule.c Sun Feb 8 21:39:02 2009 @@ -982,7 +982,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1013,7 +1013,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Objects/abstract.c ============================================================================== --- python/branches/io-c/Objects/abstract.c (original) +++ python/branches/io-c/Objects/abstract.c Sun Feb 8 21:39:02 2009 @@ -27,22 +27,6 @@ /* Operations on any object */ -int -PyObject_Cmp(PyObject *o1, PyObject *o2, int *result) -{ - int r; - - if (o1 == NULL || o2 == NULL) { - null_error(); - return -1; - } - r = PyObject_Compare(o1, o2); - if (PyErr_Occurred()) - return -1; - *result = r; - return 0; -} - PyObject * PyObject_Type(PyObject *o) { @@ -83,8 +67,8 @@ /* The length hint function returns a non-negative value from o.__len__() or o.__length_hint__(). If those methods aren't found or return a negative - value, then the defaultvalue is returned. This function never fails. - Accordingly, it will mask exceptions raised in either method. + value, then the defaultvalue is returned. If one of the calls fails, + this function returns -1. */ Py_ssize_t @@ -98,29 +82,32 @@ rv = PyObject_Size(o); if (rv >= 0) return rv; - if (PyErr_Occurred()) + if (PyErr_Occurred()) { + if (!PyErr_ExceptionMatches(PyExc_TypeError) && + !PyErr_ExceptionMatches(PyExc_AttributeError)) + return -1; PyErr_Clear(); + } /* cache a hashed version of the attribute string */ if (hintstrobj == NULL) { hintstrobj = PyUnicode_InternFromString("__length_hint__"); if (hintstrobj == NULL) - goto defaultcase; + return -1; } /* try o.__length_hint__() */ ro = PyObject_CallMethodObjArgs(o, hintstrobj, NULL); - if (ro == NULL) - goto defaultcase; - rv = PyLong_AsSsize_t(ro); - Py_DECREF(ro); - if (rv >= 0) - return rv; - -defaultcase: - if (PyErr_Occurred()) + if (ro == NULL) { + if (!PyErr_ExceptionMatches(PyExc_TypeError) && + !PyErr_ExceptionMatches(PyExc_AttributeError)) + return -1; PyErr_Clear(); - return defaultvalue; + return defaultvalue; + } + rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue; + Py_DECREF(ro); + return rv; } PyObject * @@ -1758,7 +1745,7 @@ { PyObject *it; /* iter(v) */ Py_ssize_t n; /* guess for result tuple size */ - PyObject *result; + PyObject *result = NULL; Py_ssize_t j; if (v == NULL) @@ -1783,6 +1770,8 @@ /* Guess result size and allocate space. */ n = _PyObject_LengthHint(v, 10); + if (n == -1) + goto Fail; result = PyTuple_New(n); if (result == NULL) goto Fail; Modified: python/branches/io-c/Objects/boolobject.c ============================================================================== --- python/branches/io-c/Objects/boolobject.c (original) +++ python/branches/io-c/Objects/boolobject.c Sun Feb 8 21:39:02 2009 @@ -139,7 +139,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ bool_repr, /* tp_repr */ &bool_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/bytearrayobject.c ============================================================================== --- python/branches/io-c/Objects/bytearrayobject.c (original) +++ python/branches/io-c/Objects/bytearrayobject.c Sun Feb 8 21:39:02 2009 @@ -2616,6 +2616,10 @@ /* Try to determine the length of the argument. 32 is abitrary. */ buf_size = _PyObject_LengthHint(arg, 32); + if (buf_size == -1) { + Py_DECREF(it); + return NULL; + } bytes_obj = PyByteArray_FromStringAndSize(NULL, buf_size); if (bytes_obj == NULL) @@ -3182,7 +3186,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)bytes_repr, /* tp_repr */ 0, /* tp_as_number */ &bytes_as_sequence, /* tp_as_sequence */ @@ -3291,7 +3295,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/bytesobject.c ============================================================================== --- python/branches/io-c/Objects/bytesobject.c (original) +++ python/branches/io-c/Objects/bytesobject.c Sun Feb 8 21:39:02 2009 @@ -3089,7 +3089,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)string_repr, /* tp_repr */ 0, /* tp_as_number */ &string_as_sequence, /* tp_as_sequence */ @@ -3423,7 +3423,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/cellobject.c ============================================================================== --- python/branches/io-c/Objects/cellobject.c (original) +++ python/branches/io-c/Objects/cellobject.c Sun Feb 8 21:39:02 2009 @@ -51,16 +51,56 @@ PyObject_GC_Del(op); } -static int -cell_compare(PyCellObject *a, PyCellObject *b) +#define TEST_COND(cond) ((cond) ? Py_True : Py_False) + +static PyObject * +cell_richcompare(PyObject *a, PyObject *b, int op) { - if (a->ob_ref == NULL) { - if (b->ob_ref == NULL) - return 0; - return -1; - } else if (b->ob_ref == NULL) - return 1; - return PyObject_Compare(a->ob_ref, b->ob_ref); + int result; + PyObject *v; + + /* neither argument should be NULL, unless something's gone wrong */ + assert(a != NULL && b != NULL); + + /* both arguments should be instances of PyCellObject */ + if (!PyCell_Check(a) || !PyCell_Check(b)) { + v = Py_NotImplemented; + Py_INCREF(v); + return v; + } + + /* compare cells by contents; empty cells come before anything else */ + a = ((PyCellObject *)a)->ob_ref; + b = ((PyCellObject *)b)->ob_ref; + if (a != NULL && b != NULL) + return PyObject_RichCompare(a, b, op); + + result = (b == NULL) - (a == NULL); + switch (op) { + case Py_EQ: + v = TEST_COND(result == 0); + break; + case Py_NE: + v = TEST_COND(result != 0); + break; + case Py_LE: + v = TEST_COND(result <= 0); + break; + case Py_GE: + v = TEST_COND(result >= 0); + break; + case Py_LT: + v = TEST_COND(result < 0); + break; + case Py_GT: + v = TEST_COND(result > 0); + break; + default: + PyErr_BadArgument(); + return NULL; + } + Py_INCREF(v); + return v; } static PyObject * @@ -114,7 +154,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - (cmpfunc)cell_compare, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)cell_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -129,7 +169,7 @@ 0, /* tp_doc */ (traverseproc)cell_traverse, /* tp_traverse */ (inquiry)cell_clear, /* tp_clear */ - 0, /* tp_richcompare */ + cell_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ Modified: python/branches/io-c/Objects/classobject.c ============================================================================== --- python/branches/io-c/Objects/classobject.c (original) +++ python/branches/io-c/Objects/classobject.c Sun Feb 8 21:39:02 2009 @@ -348,7 +348,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)method_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -614,7 +614,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)instancemethod_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/cobject.c ============================================================================== --- python/branches/io-c/Objects/cobject.c (original) +++ python/branches/io-c/Objects/cobject.c Sun Feb 8 21:39:02 2009 @@ -137,7 +137,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Objects/codeobject.c ============================================================================== --- python/branches/io-c/Objects/codeobject.c (original) +++ python/branches/io-c/Objects/codeobject.c Sun Feb 8 21:39:02 2009 @@ -399,7 +399,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)code_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/complexobject.c ============================================================================== --- python/branches/io-c/Objects/complexobject.c (original) +++ python/branches/io-c/Objects/complexobject.c Sun Feb 8 21:39:02 2009 @@ -1087,7 +1087,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)complex_repr, /* tp_repr */ &complex_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/descrobject.c ============================================================================== --- python/branches/io-c/Objects/descrobject.c (original) +++ python/branches/io-c/Objects/descrobject.c Sun Feb 8 21:39:02 2009 @@ -392,7 +392,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)method_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -430,7 +430,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)method_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -467,7 +467,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)member_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -504,7 +504,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)getset_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -541,7 +541,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)wrapperdescr_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -774,12 +774,6 @@ return 0; } -static int -proxy_compare(proxyobject *v, PyObject *w) -{ - return PyObject_Compare(v->dict, w); -} - static PyObject * proxy_richcompare(proxyobject *v, PyObject *w, int op) { @@ -796,7 +790,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - (cmpfunc)proxy_compare, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &proxy_as_sequence, /* tp_as_sequence */ @@ -844,12 +838,17 @@ /* This has no reason to be in this file except that adding new files is a bit of a pain */ +/* forward */ +static PyTypeObject wrappertype; + typedef struct { PyObject_HEAD PyWrapperDescrObject *descr; PyObject *self; } wrapperobject; +#define Wrapper_Check(v) (Py_TYPE(v) == &wrappertype) + static void wrapper_dealloc(wrapperobject *wp) { @@ -861,13 +860,60 @@ Py_TRASHCAN_SAFE_END(wp) } -static int -wrapper_compare(wrapperobject *a, wrapperobject *b) +#define TEST_COND(cond) ((cond) ? Py_True : Py_False) + +static PyObject * +wrapper_richcompare(PyObject *a, PyObject *b, int op) { - if (a->descr == b->descr) - return PyObject_Compare(a->self, b->self); - else - return (a->descr < b->descr) ? -1 : 1; + int result; + PyObject *v; + PyWrapperDescrObject *a_descr, *b_descr; + + assert(a != NULL && b != NULL); + + /* both arguments should be wrapperobjects */ + if (!Wrapper_Check(a) || !Wrapper_Check(b)) { + v = Py_NotImplemented; + Py_INCREF(v); + return v; + } + + /* compare by descriptor address; if the descriptors are the same, + compare by the objects they're bound to */ + a_descr = ((wrapperobject *)a)->descr; + b_descr = ((wrapperobject *)b)->descr; + if (a_descr == b_descr) { + a = ((wrapperobject *)a)->self; + b = ((wrapperobject *)b)->self; + return PyObject_RichCompare(a, b, op); + } + + result = a_descr - b_descr; + switch (op) { + case Py_EQ: + v = TEST_COND(result == 0); + break; + case Py_NE: + v = TEST_COND(result != 0); + break; + case Py_LE: + v = TEST_COND(result <= 0); + break; + case Py_GE: + v = TEST_COND(result >= 0); + break; + case Py_LT: + v = TEST_COND(result < 0); + break; + case Py_GT: + v = TEST_COND(result > 0); + break; + default: + PyErr_BadArgument(); + return NULL; + } + Py_INCREF(v); + return v; } static long @@ -977,7 +1023,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - (cmpfunc)wrapper_compare, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)wrapper_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -992,7 +1038,7 @@ 0, /* tp_doc */ wrapper_traverse, /* tp_traverse */ 0, /* tp_clear */ - 0, /* tp_richcompare */ + wrapper_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ @@ -1309,7 +1355,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/dictobject.c ============================================================================== --- python/branches/io-c/Objects/dictobject.c (original) +++ python/branches/io-c/Objects/dictobject.c Sun Feb 8 21:39:02 2009 @@ -2032,7 +2032,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)dict_repr, /* tp_repr */ 0, /* tp_as_number */ &dict_as_sequence, /* tp_as_sequence */ @@ -2226,7 +2226,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2298,7 +2298,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2384,7 +2384,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2699,7 +2699,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ &dictviews_as_number, /* tp_as_number */ &dictkeys_as_sequence, /* tp_as_sequence */ @@ -2783,7 +2783,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ &dictviews_as_number, /* tp_as_number */ &dictitems_as_sequence, /* tp_as_sequence */ @@ -2848,7 +2848,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ &dictvalues_as_sequence, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/enumobject.c ============================================================================== --- python/branches/io-c/Objects/enumobject.c (original) +++ python/branches/io-c/Objects/enumobject.c Sun Feb 8 21:39:02 2009 @@ -176,7 +176,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -326,7 +326,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/exceptions.c ============================================================================== --- python/branches/io-c/Objects/exceptions.c (original) +++ python/branches/io-c/Objects/exceptions.c Sun Feb 8 21:39:02 2009 @@ -320,7 +320,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /* tp_compare; */ + 0, /* tp_reserved; */ (reprfunc)BaseException_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Objects/fileobject.c ============================================================================== --- python/branches/io-c/Objects/fileobject.c (original) +++ python/branches/io-c/Objects/fileobject.c Sun Feb 8 21:39:02 2009 @@ -490,7 +490,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)stdprinter_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/floatobject.c ============================================================================== --- python/branches/io-c/Objects/floatobject.c (original) +++ python/branches/io-c/Objects/floatobject.c Sun Feb 8 21:39:02 2009 @@ -1819,7 +1819,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)float_repr, /* tp_repr */ &float_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/frameobject.c ============================================================================== --- python/branches/io-c/Objects/frameobject.c (original) +++ python/branches/io-c/Objects/frameobject.c Sun Feb 8 21:39:02 2009 @@ -546,7 +546,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/funcobject.c ============================================================================== --- python/branches/io-c/Objects/funcobject.c (original) +++ python/branches/io-c/Objects/funcobject.c Sun Feb 8 21:39:02 2009 @@ -659,7 +659,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)func_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -805,7 +805,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -952,7 +952,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/genobject.c ============================================================================== --- python/branches/io-c/Objects/genobject.c (original) +++ python/branches/io-c/Objects/genobject.c Sun Feb 8 21:39:02 2009 @@ -333,7 +333,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)gen_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/iterobject.c ============================================================================== --- python/branches/io-c/Objects/iterobject.c (original) +++ python/branches/io-c/Objects/iterobject.c Sun Feb 8 21:39:02 2009 @@ -103,7 +103,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -207,7 +207,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/listobject.c ============================================================================== --- python/branches/io-c/Objects/listobject.c (original) +++ python/branches/io-c/Objects/listobject.c Sun Feb 8 21:39:02 2009 @@ -802,6 +802,10 @@ /* Guess a result list size. */ n = _PyObject_LengthHint(b, 8); + if (n == -1) { + Py_DECREF(it); + return NULL; + } m = Py_SIZE(self); mn = m + n; if (mn >= m) { @@ -1784,7 +1788,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2565,7 +2569,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)list_repr, /* tp_repr */ 0, /* tp_as_number */ &list_as_sequence, /* tp_as_sequence */ @@ -2631,7 +2635,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2753,7 +2757,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/longobject.c ============================================================================== --- python/branches/io-c/Objects/longobject.c (original) +++ python/branches/io-c/Objects/longobject.c Sun Feb 8 21:39:02 2009 @@ -3643,32 +3643,140 @@ PyUnicode_GET_SIZE(format_spec)); } - static PyObject * long_round(PyObject *self, PyObject *args) { -#define UNDEF_NDIGITS (-0x7fffffff) /* Unlikely ndigits value */ - int ndigits = UNDEF_NDIGITS; - double x; - PyObject *res; - - if (!PyArg_ParseTuple(args, "|i", &ndigits)) - return NULL; + PyObject *o_ndigits=NULL, *temp; + PyLongObject *pow=NULL, *q=NULL, *r=NULL, *ndigits=NULL, *one; + int errcode; + digit q_mod_4; + + /* Notes on the algorithm: to round to the nearest 10**n (n positive), + the straightforward method is: + + (1) divide by 10**n + (2) round to nearest integer (round to even in case of tie) + (3) multiply result by 10**n. + + But the rounding step involves examining the fractional part of the + quotient to see whether it's greater than 0.5 or not. Since we + want to do the whole calculation in integer arithmetic, it's + simpler to do: + + (1) divide by (10**n)/2 + (2) round to nearest multiple of 2 (multiple of 4 in case of tie) + (3) multiply result by (10**n)/2. + + Then all we need to know about the fractional part of the quotient + arising in step (2) is whether it's zero or not. + + Doing both a multiplication and division is wasteful, and is easily + avoided if we just figure out how much to adjust the original input + by to do the rounding. + + Here's the whole algorithm expressed in Python. + + def round(self, ndigits = None): + """round(int, int) -> int""" + if ndigits is None or ndigits >= 0: + return self + pow = 10**-ndigits >> 1 + q, r = divmod(self, pow) + self -= r + if (q & 1 != 0): + if (q & 2 == r == 0): + self -= pow + else: + self += pow + return self - if (ndigits == UNDEF_NDIGITS) + */ + if (!PyArg_ParseTuple(args, "|O", &o_ndigits)) + return NULL; + if (o_ndigits == NULL) return long_long(self); - /* If called with two args, defer to float.__round__(). */ - x = PyLong_AsDouble(self); - if (x == -1.0 && PyErr_Occurred()) + ndigits = (PyLongObject *)PyNumber_Index(o_ndigits); + if (ndigits == NULL) return NULL; - self = PyFloat_FromDouble(x); - if (self == NULL) - return NULL; - res = PyObject_CallMethod(self, "__round__", "i", ndigits); + + if (Py_SIZE(ndigits) >= 0) { + Py_DECREF(ndigits); + return long_long(self); + } + + Py_INCREF(self); /* to keep refcounting simple */ + /* we now own references to self, ndigits */ + + /* pow = 10 ** -ndigits >> 1 */ + pow = (PyLongObject *)PyLong_FromLong(10L); + if (pow == NULL) + goto error; + temp = long_neg(ndigits); + Py_DECREF(ndigits); + ndigits = (PyLongObject *)temp; + if (ndigits == NULL) + goto error; + temp = long_pow((PyObject *)pow, (PyObject *)ndigits, Py_None); + Py_DECREF(pow); + pow = (PyLongObject *)temp; + if (pow == NULL) + goto error; + assert(PyLong_Check(pow)); /* check long_pow returned a long */ + one = (PyLongObject *)PyLong_FromLong(1L); + if (one == NULL) + goto error; + temp = long_rshift(pow, one); + Py_DECREF(one); + Py_DECREF(pow); + pow = (PyLongObject *)temp; + if (pow == NULL) + goto error; + + /* q, r = divmod(self, pow) */ + errcode = l_divmod((PyLongObject *)self, pow, &q, &r); + if (errcode == -1) + goto error; + + /* self -= r */ + temp = long_sub((PyLongObject *)self, r); Py_DECREF(self); - return res; -#undef UNDEF_NDIGITS + self = temp; + if (self == NULL) + goto error; + + /* get value of quotient modulo 4 */ + if (Py_SIZE(q) == 0) + q_mod_4 = 0; + else if (Py_SIZE(q) > 0) + q_mod_4 = q->ob_digit[0] & 3; + else + q_mod_4 = (PyLong_BASE-q->ob_digit[0]) & 3; + + if ((q_mod_4 & 1) == 1) { + /* q is odd; round self up or down by adding or subtracting pow */ + if (q_mod_4 == 1 && Py_SIZE(r) == 0) + temp = (PyObject *)long_sub((PyLongObject *)self, pow); + else + temp = (PyObject *)long_add((PyLongObject *)self, pow); + Py_DECREF(self); + self = temp; + if (self == NULL) + goto error; + } + Py_DECREF(q); + Py_DECREF(r); + Py_DECREF(pow); + Py_DECREF(ndigits); + return self; + + error: + Py_XDECREF(q); + Py_XDECREF(r); + Py_XDECREF(pow); + Py_XDECREF(self); + Py_XDECREF(ndigits); + return NULL; } static PyObject * @@ -3773,8 +3881,8 @@ {"__ceil__", (PyCFunction)long_long, METH_NOARGS, "Ceiling of an Integral returns itself."}, {"__round__", (PyCFunction)long_round, METH_VARARGS, - "Rounding an Integral returns itself.\n" - "Rounding with an ndigits arguments defers to float.__round__."}, + "Rounding an Integral returns itself.\n" + "Rounding with an ndigits argument also returns an integer."}, {"__getnewargs__", (PyCFunction)long_getnewargs, METH_NOARGS}, {"__format__", (PyCFunction)long__format__, METH_VARARGS}, {"__sizeof__", (PyCFunction)long_sizeof, METH_NOARGS, @@ -3859,7 +3967,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ long_repr, /* tp_repr */ &long_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/memoryobject.c ============================================================================== --- python/branches/io-c/Objects/memoryobject.c (original) +++ python/branches/io-c/Objects/memoryobject.c Sun Feb 8 21:39:02 2009 @@ -498,22 +498,6 @@ return PyUnicode_FromFormat("", self); } - -static PyObject * -memory_str(PyMemoryViewObject *self) -{ - Py_buffer view; - PyObject *res; - - if (PyObject_GetBuffer((PyObject *)self, &view, PyBUF_FULL) < 0) - return NULL; - - res = PyBytes_FromStringAndSize(NULL, view.len); - PyBuffer_ToContiguous(PyBytes_AS_STRING(res), &view, view.len, 'C'); - PyBuffer_Release(&view); - return res; -} - /* Sequence methods */ static Py_ssize_t memory_length(PyMemoryViewObject *self) @@ -805,14 +789,14 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)memory_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ &memory_as_mapping, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ - (reprfunc)memory_str, /* tp_str */ + 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ &memory_as_buffer, /* tp_as_buffer */ Modified: python/branches/io-c/Objects/methodobject.c ============================================================================== --- python/branches/io-c/Objects/methodobject.c (original) +++ python/branches/io-c/Objects/methodobject.c Sun Feb 8 21:39:02 2009 @@ -254,7 +254,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)meth_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/moduleobject.c ============================================================================== --- python/branches/io-c/Objects/moduleobject.c (original) +++ python/branches/io-c/Objects/moduleobject.c Sun Feb 8 21:39:02 2009 @@ -379,7 +379,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)module_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/object.c ============================================================================== --- python/branches/io-c/Objects/object.c (original) +++ python/branches/io-c/Objects/object.c Sun Feb 8 21:39:02 2009 @@ -500,35 +500,19 @@ return PyBytes_FromObject(v); } -/* The new comparison philosophy is: we completely separate three-way - comparison from rich comparison. That is, PyObject_Compare() and - PyObject_Cmp() *just* use the tp_compare slot. And PyObject_RichCompare() - and PyObject_RichCompareBool() *just* use the tp_richcompare slot. +/* For Python 3.0.1 and later, the old three-way comparison has been + completely removed in favour of rich comparisons. PyObject_Compare() and + PyObject_Cmp() are gone, and the builtin cmp function no longer exists. + The old tp_compare slot has been renamed to tp_reserved, and should no + longer be used. Use tp_richcompare instead. See (*) below for practical amendments. - IOW, only cmp() uses tp_compare; the comparison operators (==, !=, <=, <, - >=, >) only use tp_richcompare. Note that list.sort() only uses <. + tp_richcompare gets called with a first argument of the appropriate type + and a second object of an arbitrary type. We never do any kind of + coercion. - (And yes, eventually we'll rip out cmp() and tp_compare.) - - The calling conventions are different: tp_compare only gets called with two - objects of the appropriate type; tp_richcompare gets called with a first - argument of the appropriate type and a second object of an arbitrary type. - We never do any kind of coercion. - - The return conventions are also different. - - The tp_compare slot should return a C int, as follows: - - -1 if a < b or if an exception occurred - 0 if a == b - +1 if a > b - - No other return values are allowed. PyObject_Compare() has the same - calling convention. - - The tp_richcompare slot should return an object, as follows: + The tp_richcompare slot should return an object, as follows: NULL if an exception occurred NotImplemented if the requested comparison is not implemented @@ -544,73 +528,8 @@ comparing the object pointer (i.e. falling back to the base object implementation). - - If three-way comparison is not implemented, it falls back on rich - comparison (but not the other way around!). - */ -/* Forward */ -static PyObject *do_richcompare(PyObject *v, PyObject *w, int op); - -/* Perform a three-way comparison, raising TypeError if three-way comparison - is not supported. */ -static int -do_compare(PyObject *v, PyObject *w) -{ - cmpfunc f; - int ok; - - if (v->ob_type == w->ob_type && - (f = v->ob_type->tp_compare) != NULL) { - return (*f)(v, w); - } - - /* Now try three-way compare before giving up. This is intentionally - elaborate; if you have a it will raise TypeError if it detects two - objects that aren't ordered with respect to each other. */ - ok = PyObject_RichCompareBool(v, w, Py_LT); - if (ok < 0) - return -1; /* Error */ - if (ok) - return -1; /* Less than */ - ok = PyObject_RichCompareBool(v, w, Py_GT); - if (ok < 0) - return -1; /* Error */ - if (ok) - return 1; /* Greater than */ - ok = PyObject_RichCompareBool(v, w, Py_EQ); - if (ok < 0) - return -1; /* Error */ - if (ok) - return 0; /* Equal */ - - /* Give up */ - PyErr_Format(PyExc_TypeError, - "unorderable types: '%.100s' != '%.100s'", - v->ob_type->tp_name, - w->ob_type->tp_name); - return -1; -} - -/* Perform a three-way comparison. This wraps do_compare() with a check for - NULL arguments and a recursion check. */ -int -PyObject_Compare(PyObject *v, PyObject *w) -{ - int res; - - if (v == NULL || w == NULL) { - if (!PyErr_Occurred()) - PyErr_BadInternalCall(); - return -1; - } - if (Py_EnterRecursiveCall(" in cmp")) - return -1; - res = do_compare(v, w); - Py_LeaveRecursiveCall(); - return res < 0 ? -1 : res; -} - /* Map rich comparison operators to their swapped version, e.g. LT <--> GT */ int _Py_SwappedOp[] = {Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE}; @@ -715,44 +634,6 @@ return ok; } -/* Turn the result of a three-way comparison into the result expected by a - rich comparison. */ -PyObject * -Py_CmpToRich(int op, int cmp) -{ - PyObject *res; - int ok; - - if (PyErr_Occurred()) - return NULL; - switch (op) { - case Py_LT: - ok = cmp < 0; - break; - case Py_LE: - ok = cmp <= 0; - break; - case Py_EQ: - ok = cmp == 0; - break; - case Py_NE: - ok = cmp != 0; - break; - case Py_GT: - ok = cmp > 0; - break; - case Py_GE: - ok = cmp >= 0; - break; - default: - PyErr_BadArgument(); - return NULL; - } - res = ok ? Py_True : Py_False; - Py_INCREF(res); - return res; -} - /* Set of hash utility functions to help maintaining the invariant that if a==b then hash(a)==hash(b) @@ -774,7 +655,7 @@ fractpart = modf(v, &intpart); if (fractpart == 0.0) { /* This must return the same hash as an equal int or long. */ - if (intpart > LONG_MAX || -intpart > LONG_MAX) { + if (intpart > LONG_MAX/2 || -intpart > LONG_MAX/2) { /* Convert to long and use its hash. */ PyObject *plong; /* converted to Python long */ if (Py_IS_INFINITY(intpart)) @@ -1552,7 +1433,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ none_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -1583,7 +1464,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ NotImplemented_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Objects/rangeobject.c ============================================================================== --- python/branches/io-c/Objects/rangeobject.c (original) +++ python/branches/io-c/Objects/rangeobject.c Sun Feb 8 21:39:02 2009 @@ -123,7 +123,7 @@ Algorithm is equal to that of get_len_of_range(), but it operates on PyObjects (which are assumed to be PyLong or PyInt objects). ---------------------------------------------------------------*/ - int cmp_result, cmp_call; + int cmp_result; PyObject *lo, *hi; PyObject *step = NULL; PyObject *diff = NULL; @@ -134,13 +134,12 @@ PyObject *zero = PyLong_FromLong(0); if (zero == NULL) return NULL; - cmp_call = PyObject_Cmp(r->step, zero, &cmp_result); + cmp_result = PyObject_RichCompareBool(r->step, zero, Py_GT); Py_DECREF(zero); - if (cmp_call == -1) + if (cmp_result == -1) return NULL; - assert(cmp_result != 0); - if (cmp_result > 0) { + if (cmp_result == 1) { lo = r->start; hi = r->stop; step = r->step; @@ -154,7 +153,7 @@ } /* if (lo >= hi), return length of 0. */ - if (PyObject_Compare(lo, hi) >= 0) { + if (PyObject_RichCompareBool(lo, hi, Py_GE) == 1) { Py_XDECREF(step); return PyLong_FromLong(0); } @@ -290,7 +289,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)range_repr, /* tp_repr */ 0, /* tp_as_number */ &range_as_sequence, /* tp_as_sequence */ @@ -386,7 +385,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -538,7 +537,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/setobject.c ============================================================================== --- python/branches/io-c/Objects/setobject.c (original) +++ python/branches/io-c/Objects/setobject.c Sun Feb 8 21:39:02 2009 @@ -876,7 +876,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1824,13 +1824,6 @@ return Py_NotImplemented; } -static int -set_nocmp(PyObject *self, PyObject *other) -{ - PyErr_SetString(PyExc_TypeError, "cannot compare sets using cmp()"); - return -1; -} - static PyObject * set_add(PySetObject *so, PyObject *key) { @@ -2111,7 +2104,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - set_nocmp, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)set_repr, /* tp_repr */ &set_as_number, /* tp_as_number */ &set_as_sequence, /* tp_as_sequence */ @@ -2208,7 +2201,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - set_nocmp, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)set_repr, /* tp_repr */ &frozenset_as_number, /* tp_as_number */ &set_as_sequence, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/sliceobject.c ============================================================================== --- python/branches/io-c/Objects/sliceobject.c (original) +++ python/branches/io-c/Objects/sliceobject.c Sun Feb 8 21:39:02 2009 @@ -31,7 +31,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ ellipsis_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -352,7 +352,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)slice_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/stringlib/string_format.h ============================================================================== --- python/branches/io-c/Objects/stringlib/string_format.h (original) +++ python/branches/io-c/Objects/stringlib/string_format.h Sun Feb 8 21:39:02 2009 @@ -1064,7 +1064,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1197,7 +1197,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/structseq.c ============================================================================== --- python/branches/io-c/Objects/structseq.c (original) +++ python/branches/io-c/Objects/structseq.c Sun Feb 8 21:39:02 2009 @@ -440,7 +440,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)structseq_repr, /* tp_repr */ 0, /* tp_as_number */ &structseq_as_sequence, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/tupleobject.c ============================================================================== --- python/branches/io-c/Objects/tupleobject.c (original) +++ python/branches/io-c/Objects/tupleobject.c Sun Feb 8 21:39:02 2009 @@ -727,7 +727,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)tuplerepr, /* tp_repr */ 0, /* tp_as_number */ &tuple_as_sequence, /* tp_as_sequence */ @@ -930,7 +930,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/typeobject.c ============================================================================== --- python/branches/io-c/Objects/typeobject.c (original) +++ python/branches/io-c/Objects/typeobject.c Sun Feb 8 21:39:02 2009 @@ -2584,7 +2584,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)type_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2897,7 +2897,7 @@ slots_a = ((PyHeapTypeObject *)a)->ht_slots; slots_b = ((PyHeapTypeObject *)b)->ht_slots; if (slots_a && slots_b) { - if (PyObject_Compare(slots_a, slots_b) != 0) + if (PyObject_RichCompareBool(slots_a, slots_b, Py_EQ) != 1) return 0; size += sizeof(PyObject *) * PyTuple_GET_SIZE(slots_a); } @@ -3357,7 +3357,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ object_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -3662,7 +3662,7 @@ type->tp_setattr = base->tp_setattr; type->tp_setattro = base->tp_setattro; } - /* tp_compare see tp_richcompare */ + /* tp_reserved is ignored */ COPYSLOT(tp_repr); /* tp_hash see tp_richcompare */ COPYSLOT(tp_call); @@ -3670,12 +3670,10 @@ { /* Copy comparison-related slots only when not overriding them anywhere */ - if (type->tp_compare == NULL && - type->tp_richcompare == NULL && + if (type->tp_richcompare == NULL && type->tp_hash == NULL && !overrides_hash(type)) { - type->tp_compare = base->tp_compare; type->tp_richcompare = base->tp_richcompare; type->tp_hash = base->tp_hash; } @@ -3888,6 +3886,21 @@ goto error; } + /* Warn for a type that implements tp_compare (now known as + tp_reserved) but not tp_richcompare. */ + if (type->tp_reserved && !type->tp_richcompare) { + int error; + char msg[240]; + PyOS_snprintf(msg, sizeof(msg), + "Type %.100s defines tp_reserved (formerly " + "tp_compare) but not tp_richcompare. " + "Comparisons may not behave as intended.", + type->tp_name); + error = PyErr_WarnEx(PyExc_DeprecationWarning, msg, 1); + if (error == -1) + goto error; + } + /* All done -- set the ready flag */ assert(type->tp_dict != NULL); type->tp_flags = @@ -6252,7 +6265,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ super_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Objects/unicodeobject.c ============================================================================== --- python/branches/io-c/Objects/unicodeobject.c (original) +++ python/branches/io-c/Objects/unicodeobject.c Sun Feb 8 21:39:02 2009 @@ -12,8 +12,8 @@ -------------------------------------------------------------------- The original string type implementation is: - Copyright (c) 1999 by Secret Labs AB - Copyright (c) 1999 by Fredrik Lundh + Copyright (c) 1999 by Secret Labs AB + Copyright (c) 1999 by Fredrik Lundh By obtaining, using, and/or copying this software and/or its associated documentation, you agree that you have read, understood, @@ -125,59 +125,59 @@ /* Fast detection of the most frequent whitespace characters */ const unsigned char _Py_ascii_whitespace[] = { - 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, /* case 0x0009: * HORIZONTAL TABULATION */ /* case 0x000A: * LINE FEED */ /* case 0x000B: * VERTICAL TABULATION */ /* case 0x000C: * FORM FEED */ /* case 0x000D: * CARRIAGE RETURN */ - 0, 1, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, /* case 0x001C: * FILE SEPARATOR */ /* case 0x001D: * GROUP SEPARATOR */ /* case 0x001E: * RECORD SEPARATOR */ /* case 0x001F: * UNIT SEPARATOR */ - 0, 0, 0, 0, 1, 1, 1, 1, + 0, 0, 0, 0, 1, 1, 1, 1, /* case 0x0020: * SPACE */ - 1, 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, 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, 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, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 + 1, 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, 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, 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, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 }; /* Same for linebreaks */ static unsigned char ascii_linebreak[] = { - 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x000A, * LINE FEED */ /* 0x000D, * CARRIAGE RETURN */ - 0, 0, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x001C, * FILE SEPARATOR */ /* 0x001D, * GROUP SEPARATOR */ /* 0x001E, * RECORD SEPARATOR */ - 0, 0, 0, 0, 1, 1, 1, 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, 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, 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, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 + 0, 0, 0, 0, 1, 1, 1, 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, 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, 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, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -185,11 +185,11 @@ PyUnicode_GetMax(void) { #ifdef Py_UNICODE_WIDE - return 0x10FFFF; + return 0x10FFFF; #else - /* This is actually an illegal character, so it should - not be passed to unichr. */ - return 0xFFFF; + /* This is actually an illegal character, so it should + not be passed to unichr. */ + return 0xFFFF; #endif } @@ -207,9 +207,9 @@ #define BLOOM(mask, ch) ((mask & (1 << ((ch) & 0x1F)))) -#define BLOOM_LINEBREAK(ch) \ - ((ch) < 128U ? ascii_linebreak[(ch)] : \ - (BLOOM(bloom_linebreak, (ch)) && Py_UNICODE_ISLINEBREAK(ch))) +#define BLOOM_LINEBREAK(ch) \ + ((ch) < 128U ? ascii_linebreak[(ch)] : \ + (BLOOM(bloom_linebreak, (ch)) && Py_UNICODE_ISLINEBREAK(ch))) Py_LOCAL_INLINE(BLOOM_MASK) make_bloom_mask(Py_UNICODE* ptr, Py_ssize_t len) { @@ -236,29 +236,29 @@ return 0; } -#define BLOOM_MEMBER(mask, chr, set, setlen)\ +#define BLOOM_MEMBER(mask, chr, set, setlen) \ BLOOM(mask, chr) && unicode_member(chr, set, setlen) /* --- Unicode Object ----------------------------------------------------- */ static int unicode_resize(register PyUnicodeObject *unicode, - Py_ssize_t length) + Py_ssize_t length) { void *oldstr; /* Shortcut if there's nothing much to do. */ if (unicode->length == length) - goto reset; + goto reset; /* Resizing shared object (unicode_empty or single character objects) in-place is not allowed. Use PyUnicode_Resize() instead ! */ - if (unicode == unicode_empty || - (unicode->length == 1 && - unicode->str[0] < 256U && - unicode_latin1[unicode->str[0]] == unicode)) { + if (unicode == unicode_empty || + (unicode->length == 1 && + unicode->str[0] < 256U && + unicode_latin1[unicode->str[0]] == unicode)) { PyErr_SetString(PyExc_SystemError, "can't resize shared str objects"); return -1; @@ -271,16 +271,16 @@ oldstr = unicode->str; unicode->str = PyObject_REALLOC(unicode->str, - sizeof(Py_UNICODE) * (length + 1)); + sizeof(Py_UNICODE) * (length + 1)); if (!unicode->str) { - unicode->str = (Py_UNICODE *)oldstr; + unicode->str = (Py_UNICODE *)oldstr; PyErr_NoMemory(); return -1; } unicode->str[length] = 0; unicode->length = length; - reset: + reset: /* Reset the object caches */ if (unicode->defenc) { Py_DECREF(unicode->defenc); @@ -296,7 +296,7 @@ relies on that. XXX This allocator could further be enhanced by assuring that the - free list never reduces its size below 1. + free list never reduces its size below 1. */ @@ -321,33 +321,33 @@ unicode = free_list; free_list = *(PyUnicodeObject **)unicode; numfree--; - if (unicode->str) { - /* Keep-Alive optimization: we only upsize the buffer, - never downsize it. */ - if ((unicode->length < length) && + if (unicode->str) { + /* Keep-Alive optimization: we only upsize the buffer, + never downsize it. */ + if ((unicode->length < length) && unicode_resize(unicode, length) < 0) { - PyObject_DEL(unicode->str); - unicode->str = NULL; - } - } + PyObject_DEL(unicode->str); + unicode->str = NULL; + } + } else { - size_t new_size = sizeof(Py_UNICODE) * ((size_t)length + 1); - unicode->str = (Py_UNICODE*) PyObject_MALLOC(new_size); + size_t new_size = sizeof(Py_UNICODE) * ((size_t)length + 1); + unicode->str = (Py_UNICODE*) PyObject_MALLOC(new_size); } PyObject_INIT(unicode, &PyUnicode_Type); } else { - size_t new_size; + size_t new_size; unicode = PyObject_New(PyUnicodeObject, &PyUnicode_Type); if (unicode == NULL) return NULL; - new_size = sizeof(Py_UNICODE) * ((size_t)length + 1); - unicode->str = (Py_UNICODE*) PyObject_MALLOC(new_size); + new_size = sizeof(Py_UNICODE) * ((size_t)length + 1); + unicode->str = (Py_UNICODE*) PyObject_MALLOC(new_size); } if (!unicode->str) { - PyErr_NoMemory(); - goto onError; + PyErr_NoMemory(); + goto onError; } /* Initialize the first element to guard against cases where * the caller fails before initializing str -- unicode_resize() @@ -364,7 +364,7 @@ unicode->defenc = NULL; return unicode; - onError: + onError: /* XXX UNREF/NEWREF interface should be more symmetrical */ _Py_DEC_REFTOTAL; _Py_ForgetReference((PyObject *)unicode); @@ -376,45 +376,45 @@ void unicode_dealloc(register PyUnicodeObject *unicode) { switch (PyUnicode_CHECK_INTERNED(unicode)) { - case SSTATE_NOT_INTERNED: - break; + case SSTATE_NOT_INTERNED: + break; - case SSTATE_INTERNED_MORTAL: - /* revive dead object temporarily for DelItem */ - Py_REFCNT(unicode) = 3; - if (PyDict_DelItem(interned, (PyObject *)unicode) != 0) - Py_FatalError( - "deletion of interned string failed"); - break; + case SSTATE_INTERNED_MORTAL: + /* revive dead object temporarily for DelItem */ + Py_REFCNT(unicode) = 3; + if (PyDict_DelItem(interned, (PyObject *)unicode) != 0) + Py_FatalError( + "deletion of interned string failed"); + break; - case SSTATE_INTERNED_IMMORTAL: - Py_FatalError("Immortal interned string died."); + case SSTATE_INTERNED_IMMORTAL: + Py_FatalError("Immortal interned string died."); - default: - Py_FatalError("Inconsistent interned string state."); + default: + Py_FatalError("Inconsistent interned string state."); } if (PyUnicode_CheckExact(unicode) && - numfree < PyUnicode_MAXFREELIST) { + numfree < PyUnicode_MAXFREELIST) { /* Keep-Alive optimization */ - if (unicode->length >= KEEPALIVE_SIZE_LIMIT) { - PyObject_DEL(unicode->str); - unicode->str = NULL; - unicode->length = 0; - } - if (unicode->defenc) { - Py_DECREF(unicode->defenc); - unicode->defenc = NULL; - } - /* Add to free list */ + if (unicode->length >= KEEPALIVE_SIZE_LIMIT) { + PyObject_DEL(unicode->str); + unicode->str = NULL; + unicode->length = 0; + } + if (unicode->defenc) { + Py_DECREF(unicode->defenc); + unicode->defenc = NULL; + } + /* Add to free list */ *(PyUnicodeObject **)unicode = free_list; free_list = unicode; numfree++; } else { - PyObject_DEL(unicode->str); - Py_XDECREF(unicode->defenc); - Py_TYPE(unicode)->tp_free((PyObject *)unicode); + PyObject_DEL(unicode->str); + Py_XDECREF(unicode->defenc); + Py_TYPE(unicode)->tp_free((PyObject *)unicode); } } @@ -425,28 +425,28 @@ /* Argument checks */ if (unicode == NULL) { - PyErr_BadInternalCall(); - return -1; + PyErr_BadInternalCall(); + return -1; } v = *unicode; if (v == NULL || !PyUnicode_Check(v) || Py_REFCNT(v) != 1 || length < 0) { - PyErr_BadInternalCall(); - return -1; + PyErr_BadInternalCall(); + return -1; } /* Resizing unicode_empty and single character objects is not possible since these are being shared. We simply return a fresh copy with the same Unicode content. */ if (v->length != length && - (v == unicode_empty || v->length == 1)) { - PyUnicodeObject *w = _PyUnicode_New(length); - if (w == NULL) - return -1; - Py_UNICODE_COPY(w->str, v->str, - length < v->length ? length : v->length); - Py_DECREF(*unicode); - *unicode = w; - return 0; + (v == unicode_empty || v->length == 1)) { + PyUnicodeObject *w = _PyUnicode_New(length); + if (w == NULL) + return -1; + Py_UNICODE_COPY(w->str, v->str, + length < v->length ? length : v->length); + Py_DECREF(*unicode); + *unicode = w; + return 0; } /* Note that we don't have to modify *unicode for unshared Unicode @@ -460,7 +460,7 @@ } PyObject *PyUnicode_FromUnicode(const Py_UNICODE *u, - Py_ssize_t size) + Py_ssize_t size) { PyUnicodeObject *unicode; @@ -468,26 +468,26 @@ some optimizations which share commonly used objects. */ if (u != NULL) { - /* Optimization for empty strings */ - if (size == 0 && unicode_empty != NULL) { - Py_INCREF(unicode_empty); - return (PyObject *)unicode_empty; - } - - /* Single character Unicode objects in the Latin-1 range are - shared when using this constructor */ - if (size == 1 && *u < 256) { - unicode = unicode_latin1[*u]; - if (!unicode) { - unicode = _PyUnicode_New(1); - if (!unicode) - return NULL; - unicode->str[0] = *u; - unicode_latin1[*u] = unicode; - } - Py_INCREF(unicode); - return (PyObject *)unicode; - } + /* Optimization for empty strings */ + if (size == 0 && unicode_empty != NULL) { + Py_INCREF(unicode_empty); + return (PyObject *)unicode_empty; + } + + /* Single character Unicode objects in the Latin-1 range are + shared when using this constructor */ + if (size == 1 && *u < 256) { + unicode = unicode_latin1[*u]; + if (!unicode) { + unicode = _PyUnicode_New(1); + if (!unicode) + return NULL; + unicode->str[0] = *u; + unicode_latin1[*u] = unicode; + } + Py_INCREF(unicode); + return (PyObject *)unicode; + } } unicode = _PyUnicode_New(size); @@ -496,7 +496,7 @@ /* Copy the Unicode data into the new object */ if (u != NULL) - Py_UNICODE_COPY(unicode->str, u, size); + Py_UNICODE_COPY(unicode->str, u, size); return (PyObject *)unicode; } @@ -505,11 +505,11 @@ { PyUnicodeObject *unicode; - if (size < 0) { - PyErr_SetString(PyExc_SystemError, - "Negative size passed to PyUnicode_FromStringAndSize"); - return NULL; - } + if (size < 0) { + PyErr_SetString(PyExc_SystemError, + "Negative size passed to PyUnicode_FromStringAndSize"); + return NULL; + } /* If the Unicode data is known at construction time, we can apply some optimizations which share commonly used objects. @@ -517,26 +517,26 @@ UTF-8 decoder at the end. */ if (u != NULL) { - /* Optimization for empty strings */ - if (size == 0 && unicode_empty != NULL) { - Py_INCREF(unicode_empty); - return (PyObject *)unicode_empty; - } + /* Optimization for empty strings */ + if (size == 0 && unicode_empty != NULL) { + Py_INCREF(unicode_empty); + return (PyObject *)unicode_empty; + } - /* Single characters are shared when using this constructor. + /* Single characters are shared when using this constructor. Restrict to ASCII, since the input must be UTF-8. */ - if (size == 1 && Py_CHARMASK(*u) < 128) { - unicode = unicode_latin1[Py_CHARMASK(*u)]; - if (!unicode) { - unicode = _PyUnicode_New(1); - if (!unicode) - return NULL; - unicode->str[0] = Py_CHARMASK(*u); - unicode_latin1[Py_CHARMASK(*u)] = unicode; - } - Py_INCREF(unicode); - return (PyObject *)unicode; - } + if (size == 1 && Py_CHARMASK(*u) < 128) { + unicode = unicode_latin1[Py_CHARMASK(*u)]; + if (!unicode) { + unicode = _PyUnicode_New(1); + if (!unicode) + return NULL; + unicode->str[0] = Py_CHARMASK(*u); + unicode_latin1[Py_CHARMASK(*u)] = unicode; + } + Py_INCREF(unicode); + return (PyObject *)unicode; + } return PyUnicode_DecodeUTF8(u, size, NULL); } @@ -562,15 +562,15 @@ #ifdef HAVE_WCHAR_H PyObject *PyUnicode_FromWideChar(register const wchar_t *w, - Py_ssize_t size) + Py_ssize_t size) { PyUnicodeObject *unicode; if (w == NULL) { if (size == 0) return PyUnicode_FromStringAndSize(NULL, 0); - PyErr_BadInternalCall(); - return NULL; + PyErr_BadInternalCall(); + return NULL; } if (size == -1) { @@ -586,11 +586,11 @@ memcpy(unicode->str, w, size * sizeof(wchar_t)); #else { - register Py_UNICODE *u; - register Py_ssize_t i; - u = PyUnicode_AS_UNICODE(unicode); - for (i = size; i > 0; i--) - *u++ = *w++; + register Py_UNICODE *u; + register Py_ssize_t i; + u = PyUnicode_AS_UNICODE(unicode); + for (i = size; i > 0; i--) + *u++ = *w++; } #endif @@ -600,23 +600,23 @@ static void makefmt(char *fmt, int longflag, int size_tflag, int zeropad, int width, int precision, char c) { - *fmt++ = '%'; - if (width) { - if (zeropad) - *fmt++ = '0'; - fmt += sprintf(fmt, "%d", width); - } - if (precision) - fmt += sprintf(fmt, ".%d", precision); - if (longflag) - *fmt++ = 'l'; - else if (size_tflag) { - char *f = PY_FORMAT_SIZE_T; - while (*f) - *fmt++ = *f++; - } - *fmt++ = c; - *fmt = '\0'; + *fmt++ = '%'; + if (width) { + if (zeropad) + *fmt++ = '0'; + fmt += sprintf(fmt, "%d", width); + } + if (precision) + fmt += sprintf(fmt, ".%d", precision); + if (longflag) + *fmt++ = 'l'; + else if (size_tflag) { + char *f = PY_FORMAT_SIZE_T; + while (*f) + *fmt++ = *f++; + } + *fmt++ = c; + *fmt = '\0'; } #define appendstring(string) {for (copy = string;*copy;) *s++ = *copy++;} @@ -624,387 +624,387 @@ PyObject * PyUnicode_FromFormatV(const char *format, va_list vargs) { - va_list count; - Py_ssize_t callcount = 0; - PyObject **callresults = NULL; - PyObject **callresult = NULL; - Py_ssize_t n = 0; - int width = 0; - int precision = 0; - int zeropad; - const char* f; - Py_UNICODE *s; - PyObject *string; - /* used by sprintf */ - char buffer[21]; - /* use abuffer instead of buffer, if we need more space - * (which can happen if there's a format specifier with width). */ - char *abuffer = NULL; - char *realbuffer; - Py_ssize_t abuffersize = 0; - char fmt[60]; /* should be enough for %0width.precisionld */ - const char *copy; + va_list count; + Py_ssize_t callcount = 0; + PyObject **callresults = NULL; + PyObject **callresult = NULL; + Py_ssize_t n = 0; + int width = 0; + int precision = 0; + int zeropad; + const char* f; + Py_UNICODE *s; + PyObject *string; + /* used by sprintf */ + char buffer[21]; + /* use abuffer instead of buffer, if we need more space + * (which can happen if there's a format specifier with width). */ + char *abuffer = NULL; + char *realbuffer; + Py_ssize_t abuffersize = 0; + char fmt[60]; /* should be enough for %0width.precisionld */ + const char *copy; #ifdef VA_LIST_IS_ARRAY - Py_MEMCPY(count, vargs, sizeof(va_list)); + Py_MEMCPY(count, vargs, sizeof(va_list)); #else #ifdef __va_copy - __va_copy(count, vargs); + __va_copy(count, vargs); #else - count = vargs; + 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) */ - for (f = format; *f; f++) { - if (*f == '%' && (*(f+1)=='S' || *(f+1)=='R' || *(f+1)=='A')) - ++callcount; - } - /* step 2: allocate memory for the results of - * PyObject_Str()/PyObject_Repr() calls */ - if (callcount) { - callresults = PyObject_Malloc(sizeof(PyObject *)*callcount); - if (!callresults) { - PyErr_NoMemory(); - return NULL; - } - callresult = callresults; - } - /* step 3: figure out how large a buffer we need */ - for (f = format; *f; f++) { - if (*f == '%') { - const char* p = f; - width = 0; - while (ISDIGIT((unsigned)*f)) - width = (width*10) + *f++ - '0'; - while (*++f && *f != '%' && !ISALPHA((unsigned)*f)) - ; - - /* skip the 'l' or 'z' in {%ld, %zd, %lu, %zu} since - * they don't affect the amount of space we reserve. - */ - if ((*f == 'l' || *f == 'z') && - (f[1] == 'd' || f[1] == 'u')) - ++f; - - switch (*f) { - case 'c': - (void)va_arg(count, int); - /* fall through... */ - case '%': - n++; - break; - case 'd': case 'u': case 'i': case 'x': - (void) va_arg(count, int); - /* 20 bytes is enough to hold a 64-bit - integer. Decimal takes the most space. - This isn't enough for octal. - If a width is specified we need more - (which we allocate later). */ - if (width < 20) - width = 20; - n += width; - if (abuffersize < width) - abuffersize = width; - break; - 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++; - } - } - break; - } - case 'U': - { - PyObject *obj = va_arg(count, PyObject *); - assert(obj && PyUnicode_Check(obj)); - n += PyUnicode_GET_SIZE(obj); - break; - } - case 'V': - { - PyObject *obj = va_arg(count, PyObject *); - const char *str = va_arg(count, const char *); - assert(obj || str); - assert(!obj || PyUnicode_Check(obj)); - if (obj) - n += PyUnicode_GET_SIZE(obj); - else - n += strlen(str); - break; - } - case 'S': - { - PyObject *obj = va_arg(count, PyObject *); - PyObject *str; - assert(obj); - str = PyObject_Str(obj); - if (!str) - goto fail; - n += PyUnicode_GET_SIZE(str); - /* Remember the str and switch to the next slot */ - *callresult++ = str; - break; - } - case 'R': - { - PyObject *obj = va_arg(count, PyObject *); - PyObject *repr; - assert(obj); - repr = PyObject_Repr(obj); - if (!repr) - goto fail; - n += PyUnicode_GET_SIZE(repr); - /* Remember the repr and switch to the next slot */ - *callresult++ = repr; - break; - } - case 'A': - { - PyObject *obj = va_arg(count, PyObject *); - PyObject *ascii; - assert(obj); - ascii = PyObject_ASCII(obj); - if (!ascii) - goto fail; - n += PyUnicode_GET_SIZE(ascii); - /* Remember the repr and switch to the next slot */ - *callresult++ = ascii; - break; - } - case 'p': - (void) va_arg(count, int); - /* maximum 64-bit pointer representation: - * 0xffffffffffffffff - * so 19 characters is enough. - * XXX I count 18 -- what's the extra for? - */ - n += 19; - break; - default: - /* if we stumble upon an unknown - formatting code, copy the rest of - the format string to the output - string. (we cannot just skip the - code, since there's no way to know - what's in the argument list) */ - n += strlen(p); - goto expand; - } - } else - n++; - } - expand: - if (abuffersize > 20) { - abuffer = PyObject_Malloc(abuffersize); - if (!abuffer) { - PyErr_NoMemory(); - goto fail; - } - realbuffer = abuffer; - } - else - realbuffer = buffer; - /* step 4: fill the buffer */ - /* Since we've analyzed how much space we need for the worst case, - we don't have to resize the string. - There can be no errors beyond this point. */ - string = PyUnicode_FromUnicode(NULL, n); - if (!string) - goto fail; - - s = PyUnicode_AS_UNICODE(string); - callresult = callresults; - - for (f = format; *f; f++) { - if (*f == '%') { - const char* p = f++; - int longflag = 0; - int size_tflag = 0; - zeropad = (*f == '0'); - /* parse the width.precision part */ - width = 0; - while (ISDIGIT((unsigned)*f)) - width = (width*10) + *f++ - '0'; - precision = 0; - if (*f == '.') { - f++; - while (ISDIGIT((unsigned)*f)) - precision = (precision*10) + *f++ - '0'; - } - /* handle the long flag, but only for %ld and %lu. - others can be added when necessary. */ - if (*f == 'l' && (f[1] == 'd' || f[1] == 'u')) { - longflag = 1; - ++f; - } - /* handle the size_t flag. */ - if (*f == 'z' && (f[1] == 'd' || f[1] == 'u')) { - size_tflag = 1; - ++f; - } - - switch (*f) { - case 'c': - *s++ = va_arg(vargs, int); - break; - case 'd': - makefmt(fmt, longflag, size_tflag, zeropad, width, precision, 'd'); - if (longflag) - sprintf(realbuffer, fmt, va_arg(vargs, long)); - else if (size_tflag) - sprintf(realbuffer, fmt, va_arg(vargs, Py_ssize_t)); - else - sprintf(realbuffer, fmt, va_arg(vargs, int)); - appendstring(realbuffer); - break; - case 'u': - makefmt(fmt, longflag, size_tflag, zeropad, width, precision, 'u'); - if (longflag) - sprintf(realbuffer, fmt, va_arg(vargs, unsigned long)); - else if (size_tflag) - sprintf(realbuffer, fmt, va_arg(vargs, size_t)); - else - sprintf(realbuffer, fmt, va_arg(vargs, unsigned int)); - appendstring(realbuffer); - break; - case 'i': - makefmt(fmt, 0, 0, zeropad, width, precision, 'i'); - sprintf(realbuffer, fmt, va_arg(vargs, int)); - appendstring(realbuffer); - break; - case 'x': - makefmt(fmt, 0, 0, zeropad, width, precision, 'x'); - sprintf(realbuffer, fmt, va_arg(vargs, int)); - appendstring(realbuffer); - 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); - break; - } - case 'U': - { - PyObject *obj = va_arg(vargs, PyObject *); - Py_ssize_t size = PyUnicode_GET_SIZE(obj); - Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(obj), size); - s += size; - break; - } - case 'V': - { - PyObject *obj = va_arg(vargs, PyObject *); - const char *str = va_arg(vargs, const char *); - if (obj) { - Py_ssize_t size = PyUnicode_GET_SIZE(obj); - Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(obj), size); - s += size; - } else { - appendstring(str); - } - break; - } - case 'S': - case 'R': - { - Py_UNICODE *ucopy; - Py_ssize_t usize; - Py_ssize_t upos; - /* unused, since we already have the result */ - (void) va_arg(vargs, PyObject *); - ucopy = PyUnicode_AS_UNICODE(*callresult); - usize = PyUnicode_GET_SIZE(*callresult); - for (upos = 0; upos forget it */ - Py_DECREF(*callresult); - /* switch to next unicode()/repr() result */ - ++callresult; - break; - } - case 'p': - sprintf(buffer, "%p", va_arg(vargs, void*)); - /* %p is ill-defined: ensure leading 0x. */ - if (buffer[1] == 'X') - buffer[1] = 'x'; - else if (buffer[1] != 'x') { - memmove(buffer+2, buffer, strlen(buffer)+1); - buffer[0] = '0'; - buffer[1] = 'x'; - } - appendstring(buffer); - break; - case '%': - *s++ = '%'; - break; - default: - appendstring(p); - goto end; - } - } else - *s++ = *f; - } - - end: - if (callresults) - PyObject_Free(callresults); - if (abuffer) - PyObject_Free(abuffer); - PyUnicode_Resize(&string, s - PyUnicode_AS_UNICODE(string)); - return string; - fail: - if (callresults) { - PyObject **callresult2 = callresults; - while (callresult2 < callresult) { - Py_DECREF(*callresult2); - ++callresult2; - } - PyObject_Free(callresults); - } - if (abuffer) - PyObject_Free(abuffer); - return NULL; + /* 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) */ + for (f = format; *f; f++) { + if (*f == '%' && (*(f+1)=='S' || *(f+1)=='R' || *(f+1)=='A')) + ++callcount; + } + /* step 2: allocate memory for the results of + * PyObject_Str()/PyObject_Repr() calls */ + if (callcount) { + callresults = PyObject_Malloc(sizeof(PyObject *)*callcount); + if (!callresults) { + PyErr_NoMemory(); + return NULL; + } + callresult = callresults; + } + /* step 3: figure out how large a buffer we need */ + for (f = format; *f; f++) { + if (*f == '%') { + const char* p = f; + width = 0; + while (ISDIGIT((unsigned)*f)) + width = (width*10) + *f++ - '0'; + while (*++f && *f != '%' && !ISALPHA((unsigned)*f)) + ; + + /* skip the 'l' or 'z' in {%ld, %zd, %lu, %zu} since + * they don't affect the amount of space we reserve. + */ + if ((*f == 'l' || *f == 'z') && + (f[1] == 'd' || f[1] == 'u')) + ++f; + + switch (*f) { + case 'c': + (void)va_arg(count, int); + /* fall through... */ + case '%': + n++; + break; + case 'd': case 'u': case 'i': case 'x': + (void) va_arg(count, int); + /* 20 bytes is enough to hold a 64-bit + integer. Decimal takes the most space. + This isn't enough for octal. + If a width is specified we need more + (which we allocate later). */ + if (width < 20) + width = 20; + n += width; + if (abuffersize < width) + abuffersize = width; + break; + 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++; + } + } + break; + } + case 'U': + { + PyObject *obj = va_arg(count, PyObject *); + assert(obj && PyUnicode_Check(obj)); + n += PyUnicode_GET_SIZE(obj); + break; + } + case 'V': + { + PyObject *obj = va_arg(count, PyObject *); + const char *str = va_arg(count, const char *); + assert(obj || str); + assert(!obj || PyUnicode_Check(obj)); + if (obj) + n += PyUnicode_GET_SIZE(obj); + else + n += strlen(str); + break; + } + case 'S': + { + PyObject *obj = va_arg(count, PyObject *); + PyObject *str; + assert(obj); + str = PyObject_Str(obj); + if (!str) + goto fail; + n += PyUnicode_GET_SIZE(str); + /* Remember the str and switch to the next slot */ + *callresult++ = str; + break; + } + case 'R': + { + PyObject *obj = va_arg(count, PyObject *); + PyObject *repr; + assert(obj); + repr = PyObject_Repr(obj); + if (!repr) + goto fail; + n += PyUnicode_GET_SIZE(repr); + /* Remember the repr and switch to the next slot */ + *callresult++ = repr; + break; + } + case 'A': + { + PyObject *obj = va_arg(count, PyObject *); + PyObject *ascii; + assert(obj); + ascii = PyObject_ASCII(obj); + if (!ascii) + goto fail; + n += PyUnicode_GET_SIZE(ascii); + /* Remember the repr and switch to the next slot */ + *callresult++ = ascii; + break; + } + case 'p': + (void) va_arg(count, int); + /* maximum 64-bit pointer representation: + * 0xffffffffffffffff + * so 19 characters is enough. + * XXX I count 18 -- what's the extra for? + */ + n += 19; + break; + default: + /* if we stumble upon an unknown + formatting code, copy the rest of + the format string to the output + string. (we cannot just skip the + code, since there's no way to know + what's in the argument list) */ + n += strlen(p); + goto expand; + } + } else + n++; + } + expand: + if (abuffersize > 20) { + abuffer = PyObject_Malloc(abuffersize); + if (!abuffer) { + PyErr_NoMemory(); + goto fail; + } + realbuffer = abuffer; + } + else + realbuffer = buffer; + /* step 4: fill the buffer */ + /* Since we've analyzed how much space we need for the worst case, + we don't have to resize the string. + There can be no errors beyond this point. */ + string = PyUnicode_FromUnicode(NULL, n); + if (!string) + goto fail; + + s = PyUnicode_AS_UNICODE(string); + callresult = callresults; + + for (f = format; *f; f++) { + if (*f == '%') { + const char* p = f++; + int longflag = 0; + int size_tflag = 0; + zeropad = (*f == '0'); + /* parse the width.precision part */ + width = 0; + while (ISDIGIT((unsigned)*f)) + width = (width*10) + *f++ - '0'; + precision = 0; + if (*f == '.') { + f++; + while (ISDIGIT((unsigned)*f)) + precision = (precision*10) + *f++ - '0'; + } + /* handle the long flag, but only for %ld and %lu. + others can be added when necessary. */ + if (*f == 'l' && (f[1] == 'd' || f[1] == 'u')) { + longflag = 1; + ++f; + } + /* handle the size_t flag. */ + if (*f == 'z' && (f[1] == 'd' || f[1] == 'u')) { + size_tflag = 1; + ++f; + } + + switch (*f) { + case 'c': + *s++ = va_arg(vargs, int); + break; + case 'd': + makefmt(fmt, longflag, size_tflag, zeropad, width, precision, 'd'); + if (longflag) + sprintf(realbuffer, fmt, va_arg(vargs, long)); + else if (size_tflag) + sprintf(realbuffer, fmt, va_arg(vargs, Py_ssize_t)); + else + sprintf(realbuffer, fmt, va_arg(vargs, int)); + appendstring(realbuffer); + break; + case 'u': + makefmt(fmt, longflag, size_tflag, zeropad, width, precision, 'u'); + if (longflag) + sprintf(realbuffer, fmt, va_arg(vargs, unsigned long)); + else if (size_tflag) + sprintf(realbuffer, fmt, va_arg(vargs, size_t)); + else + sprintf(realbuffer, fmt, va_arg(vargs, unsigned int)); + appendstring(realbuffer); + break; + case 'i': + makefmt(fmt, 0, 0, zeropad, width, precision, 'i'); + sprintf(realbuffer, fmt, va_arg(vargs, int)); + appendstring(realbuffer); + break; + case 'x': + makefmt(fmt, 0, 0, zeropad, width, precision, 'x'); + sprintf(realbuffer, fmt, va_arg(vargs, int)); + appendstring(realbuffer); + 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); + break; + } + case 'U': + { + PyObject *obj = va_arg(vargs, PyObject *); + Py_ssize_t size = PyUnicode_GET_SIZE(obj); + Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(obj), size); + s += size; + break; + } + case 'V': + { + PyObject *obj = va_arg(vargs, PyObject *); + const char *str = va_arg(vargs, const char *); + if (obj) { + Py_ssize_t size = PyUnicode_GET_SIZE(obj); + Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(obj), size); + s += size; + } else { + appendstring(str); + } + break; + } + case 'S': + case 'R': + { + Py_UNICODE *ucopy; + Py_ssize_t usize; + Py_ssize_t upos; + /* unused, since we already have the result */ + (void) va_arg(vargs, PyObject *); + ucopy = PyUnicode_AS_UNICODE(*callresult); + usize = PyUnicode_GET_SIZE(*callresult); + for (upos = 0; upos forget it */ + Py_DECREF(*callresult); + /* switch to next unicode()/repr() result */ + ++callresult; + break; + } + case 'p': + sprintf(buffer, "%p", va_arg(vargs, void*)); + /* %p is ill-defined: ensure leading 0x. */ + if (buffer[1] == 'X') + buffer[1] = 'x'; + else if (buffer[1] != 'x') { + memmove(buffer+2, buffer, strlen(buffer)+1); + buffer[0] = '0'; + buffer[1] = 'x'; + } + appendstring(buffer); + break; + case '%': + *s++ = '%'; + break; + default: + appendstring(p); + goto end; + } + } else + *s++ = *f; + } + + end: + if (callresults) + PyObject_Free(callresults); + if (abuffer) + PyObject_Free(abuffer); + PyUnicode_Resize(&string, s - PyUnicode_AS_UNICODE(string)); + return string; + fail: + if (callresults) { + PyObject **callresult2 = callresults; + while (callresult2 < callresult) { + Py_DECREF(*callresult2); + ++callresult2; + } + PyObject_Free(callresults); + } + if (abuffer) + PyObject_Free(abuffer); + return NULL; } #undef appendstring @@ -1012,48 +1012,48 @@ PyObject * PyUnicode_FromFormat(const char *format, ...) { - PyObject* ret; - va_list vargs; + PyObject* ret; + va_list vargs; #ifdef HAVE_STDARG_PROTOTYPES - va_start(vargs, format); + va_start(vargs, format); #else - va_start(vargs); + va_start(vargs); #endif - ret = PyUnicode_FromFormatV(format, vargs); - va_end(vargs); - return ret; + ret = PyUnicode_FromFormatV(format, vargs); + va_end(vargs); + return ret; } Py_ssize_t PyUnicode_AsWideChar(PyUnicodeObject *unicode, - wchar_t *w, - Py_ssize_t size) + wchar_t *w, + Py_ssize_t size) { if (unicode == NULL) { - PyErr_BadInternalCall(); - return -1; + PyErr_BadInternalCall(); + return -1; } /* If possible, try to copy the 0-termination as well */ if (size > PyUnicode_GET_SIZE(unicode)) - size = PyUnicode_GET_SIZE(unicode) + 1; + size = PyUnicode_GET_SIZE(unicode) + 1; #ifdef HAVE_USABLE_WCHAR_T memcpy(w, unicode->str, size * sizeof(wchar_t)); #else { - register Py_UNICODE *u; - register Py_ssize_t i; - u = PyUnicode_AS_UNICODE(unicode); - for (i = size; i > 0; i--) - *w++ = *u++; + register Py_UNICODE *u; + register Py_ssize_t i; + u = PyUnicode_AS_UNICODE(unicode); + for (i = size; i > 0; i--) + *w++ = *u++; } #endif if (size > PyUnicode_GET_SIZE(unicode)) return PyUnicode_GET_SIZE(unicode); else - return size; + return size; } #endif @@ -1063,9 +1063,9 @@ Py_UNICODE s[2]; if (ordinal < 0 || ordinal > 0x10ffff) { - PyErr_SetString(PyExc_ValueError, - "chr() arg not in range(0x110000)"); - return NULL; + PyErr_SetString(PyExc_ValueError, + "chr() arg not in range(0x110000)"); + return NULL; } #ifndef Py_UNICODE_WIDE @@ -1084,16 +1084,16 @@ PyObject *PyUnicode_FromObject(register PyObject *obj) { /* XXX Perhaps we should make this API an alias of - PyObject_Str() instead ?! */ + PyObject_Str() instead ?! */ if (PyUnicode_CheckExact(obj)) { - Py_INCREF(obj); - return obj; + Py_INCREF(obj); + return obj; } if (PyUnicode_Check(obj)) { - /* For a Unicode subtype that's not a Unicode object, - return a true Unicode object with the same data. */ - return PyUnicode_FromUnicode(PyUnicode_AS_UNICODE(obj), - PyUnicode_GET_SIZE(obj)); + /* For a Unicode subtype that's not a Unicode object, + return a true Unicode object with the same data. */ + return PyUnicode_FromUnicode(PyUnicode_AS_UNICODE(obj), + PyUnicode_GET_SIZE(obj)); } PyErr_Format(PyExc_TypeError, "Can't convert '%.100s' object to str implicitly", @@ -1102,23 +1102,23 @@ } PyObject *PyUnicode_FromEncodedObject(register PyObject *obj, - const char *encoding, - const char *errors) + const char *encoding, + const char *errors) { const char *s = NULL; Py_ssize_t len; PyObject *v; if (obj == NULL) { - PyErr_BadInternalCall(); - return NULL; + PyErr_BadInternalCall(); + return NULL; } if (PyUnicode_Check(obj)) { - PyErr_SetString(PyExc_TypeError, - "decoding str is not supported"); - return NULL; - } + PyErr_SetString(PyExc_TypeError, + "decoding str is not supported"); + return NULL; + } /* Coerce object */ if (PyBytes_Check(obj)) { @@ -1130,34 +1130,34 @@ len = PyByteArray_GET_SIZE(obj); } else if (PyObject_AsCharBuffer(obj, &s, &len)) { - /* Overwrite the error message with something more useful in - case of a TypeError. */ - if (PyErr_ExceptionMatches(PyExc_TypeError)) + /* Overwrite the error message with something more useful in + case of a TypeError. */ + if (PyErr_ExceptionMatches(PyExc_TypeError)) PyErr_Format(PyExc_TypeError, - "coercing to str: need string or buffer, " - "%.80s found", - Py_TYPE(obj)->tp_name); - goto onError; + "coercing to str: need string or buffer, " + "%.80s found", + Py_TYPE(obj)->tp_name); + goto onError; } /* Convert to Unicode */ if (len == 0) { - Py_INCREF(unicode_empty); - v = (PyObject *)unicode_empty; + Py_INCREF(unicode_empty); + v = (PyObject *)unicode_empty; } else - v = PyUnicode_Decode(s, len, encoding, errors); + v = PyUnicode_Decode(s, len, encoding, errors); return v; - onError: + onError: return NULL; } PyObject *PyUnicode_Decode(const char *s, - Py_ssize_t size, - const char *encoding, - const char *errors) + Py_ssize_t size, + const char *encoding, + const char *errors) { PyObject *buffer = NULL, *unicode; Py_buffer info; @@ -1223,7 +1223,7 @@ Py_DECREF(buffer); return unicode; - onError: + onError: Py_XDECREF(buffer); return NULL; } @@ -1240,7 +1240,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Decode via the codec registry */ v = PyCodec_Decode(unicode, encoding, errors); @@ -1248,7 +1248,7 @@ goto onError; return v; - onError: + onError: return NULL; } @@ -1264,7 +1264,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Decode via the codec registry */ v = PyCodec_Decode(unicode, encoding, errors); @@ -1279,20 +1279,20 @@ } return v; - onError: + onError: return NULL; } PyObject *PyUnicode_Encode(const Py_UNICODE *s, - Py_ssize_t size, - const char *encoding, - const char *errors) + Py_ssize_t size, + const char *encoding, + const char *errors) { PyObject *v, *unicode; unicode = PyUnicode_FromUnicode(s, size); if (unicode == NULL) - return NULL; + return NULL; v = PyUnicode_AsEncodedString(unicode, encoding, errors); Py_DECREF(unicode); return v; @@ -1310,7 +1310,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Encode via the codec registry */ v = PyCodec_Encode(unicode, encoding, errors); @@ -1318,7 +1318,7 @@ goto onError; return v; - onError: + onError: return NULL; } @@ -1334,20 +1334,20 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Shortcuts for common default encodings */ if (errors == NULL) { - if (strcmp(encoding, "utf-8") == 0) - return PyUnicode_AsUTF8String(unicode); - else if (strcmp(encoding, "latin-1") == 0) - return PyUnicode_AsLatin1String(unicode); + if (strcmp(encoding, "utf-8") == 0) + return PyUnicode_AsUTF8String(unicode); + else if (strcmp(encoding, "latin-1") == 0) + return PyUnicode_AsLatin1String(unicode); #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) - else if (strcmp(encoding, "mbcs") == 0) - return PyUnicode_AsMBCSString(unicode); + else if (strcmp(encoding, "mbcs") == 0) + return PyUnicode_AsMBCSString(unicode); #endif - else if (strcmp(encoding, "ascii") == 0) - return PyUnicode_AsASCIIString(unicode); + else if (strcmp(encoding, "ascii") == 0) + return PyUnicode_AsASCIIString(unicode); /* During bootstrap, we may need to find the encodings package, to load the file system encoding, and require the file system encoding in order to load the encodings @@ -1360,7 +1360,7 @@ else if (Py_FileSystemDefaultEncoding && strcmp(encoding, Py_FileSystemDefaultEncoding) == 0 && !PyThreadState_GET()->interp->codecs_initialized) - return PyUnicode_AsASCIIString(unicode); + return PyUnicode_AsASCIIString(unicode); } /* Encode via the codec registry */ @@ -1408,7 +1408,7 @@ } if (encoding == NULL) - encoding = PyUnicode_GetDefaultEncoding(); + encoding = PyUnicode_GetDefaultEncoding(); /* Encode via the codec registry */ v = PyCodec_Encode(unicode, encoding, errors); @@ -1423,12 +1423,12 @@ } return v; - onError: + onError: return NULL; } PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode, - const char *errors) + const char *errors) { PyObject *v = ((PyUnicodeObject *)unicode)->defenc; if (v) @@ -1507,7 +1507,7 @@ } return PyUnicode_AS_UNICODE(unicode); - onError: + onError: return NULL; } @@ -1519,7 +1519,7 @@ } return PyUnicode_GET_SIZE(unicode); - onError: + onError: return -1; } @@ -1548,10 +1548,10 @@ static int unicode_decode_call_errorhandler(const char *errors, PyObject **errorHandler, - const char *encoding, const char *reason, - const char **input, const char **inend, Py_ssize_t *startinpos, - Py_ssize_t *endinpos, PyObject **exceptionObject, const char **inptr, - PyUnicodeObject **output, Py_ssize_t *outpos, Py_UNICODE **outptr) + const char *encoding, const char *reason, + const char **input, const char **inend, Py_ssize_t *startinpos, + Py_ssize_t *endinpos, PyObject **exceptionObject, const char **inptr, + PyUnicodeObject **output, Py_ssize_t *outpos, Py_UNICODE **outptr) { static char *argparse = "O!n;decoding error handler must return (str, int) tuple"; @@ -1567,35 +1567,35 @@ int res = -1; if (*errorHandler == NULL) { - *errorHandler = PyCodec_LookupError(errors); - if (*errorHandler == NULL) - goto onError; + *errorHandler = PyCodec_LookupError(errors); + if (*errorHandler == NULL) + goto onError; } if (*exceptionObject == NULL) { - *exceptionObject = PyUnicodeDecodeError_Create( - encoding, *input, *inend-*input, *startinpos, *endinpos, reason); - if (*exceptionObject == NULL) - goto onError; + *exceptionObject = PyUnicodeDecodeError_Create( + encoding, *input, *inend-*input, *startinpos, *endinpos, reason); + if (*exceptionObject == NULL) + goto onError; } else { - if (PyUnicodeDecodeError_SetStart(*exceptionObject, *startinpos)) - goto onError; - if (PyUnicodeDecodeError_SetEnd(*exceptionObject, *endinpos)) - goto onError; - if (PyUnicodeDecodeError_SetReason(*exceptionObject, reason)) - goto onError; + if (PyUnicodeDecodeError_SetStart(*exceptionObject, *startinpos)) + goto onError; + if (PyUnicodeDecodeError_SetEnd(*exceptionObject, *endinpos)) + goto onError; + if (PyUnicodeDecodeError_SetReason(*exceptionObject, reason)) + goto onError; } restuple = PyObject_CallFunctionObjArgs(*errorHandler, *exceptionObject, NULL); if (restuple == NULL) - goto onError; + goto onError; if (!PyTuple_Check(restuple)) { - PyErr_Format(PyExc_TypeError, &argparse[4]); - goto onError; + PyErr_Format(PyExc_TypeError, &argparse[4]); + goto onError; } if (!PyArg_ParseTuple(restuple, argparse, &PyUnicode_Type, &repunicode, &newpos)) - goto onError; + goto onError; /* Copy back the bytes variables, which might have been modified by the callback */ @@ -1603,7 +1603,7 @@ if (!inputobj) goto onError; if (!PyBytes_Check(inputobj)) { - PyErr_Format(PyExc_TypeError, "exception attribute object must be bytes"); + PyErr_Format(PyExc_TypeError, "exception attribute object must be bytes"); } *input = PyBytes_AS_STRING(inputobj); insize = PyBytes_GET_SIZE(inputobj); @@ -1613,10 +1613,10 @@ Py_DECREF(inputobj); if (newpos<0) - newpos = insize+newpos; + newpos = insize+newpos; if (newpos<0 || newpos>insize) { - PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", newpos); - goto onError; + PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", newpos); + goto onError; } /* need more space? (at least enough for what we @@ -1627,11 +1627,11 @@ repsize = PyUnicode_GET_SIZE(repunicode); requiredsize = *outpos + repsize + insize-newpos; if (requiredsize > outsize) { - if (requiredsize<2*outsize) - requiredsize = 2*outsize; - if (_PyUnicode_Resize(output, requiredsize) < 0) - goto onError; - *outptr = PyUnicode_AS_UNICODE(*output) + *outpos; + if (requiredsize<2*outsize) + requiredsize = 2*outsize; + if (_PyUnicode_Resize(output, requiredsize) < 0) + goto onError; + *outptr = PyUnicode_AS_UNICODE(*output) + *outpos; } *endinpos = newpos; *inptr = *input + newpos; @@ -1642,7 +1642,7 @@ /* we made it! */ res = 0; - onError: + onError: Py_XDECREF(restuple); return res; } @@ -1655,10 +1655,10 @@ 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) */ + 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, @@ -1675,17 +1675,17 @@ utf7_special[0] is 1, we can safely make that one comparison true */ -#define SPECIAL(c, encodeO, encodeWS) \ +#define SPECIAL(c, encodeO, encodeWS) \ ((c) > 127 || (c) <= 0 || utf7_special[(c)] == 1 || \ - (encodeWS && (utf7_special[(c)] == 2)) || \ + (encodeWS && (utf7_special[(c)] == 2)) || \ (encodeO && (utf7_special[(c)] == 3))) -#define B64(n) \ +#define B64(n) \ ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(n) & 0x3f]) -#define B64CHAR(c) \ +#define B64CHAR(c) \ (ISALNUM(c) || (c) == '+' || (c) == '/') -#define UB64(c) \ - ((c) == '+' ? 62 : (c) == '/' ? 63 : (c) >= 'a' ? \ +#define UB64(c) \ + ((c) == '+' ? 62 : (c) == '/' ? 63 : (c) >= 'a' ? \ (c) - 71 : (c) >= 'A' ? (c) - 65 : (c) + 4 ) #define ENCODE(out, ch, bits) \ @@ -1714,16 +1714,16 @@ } PyObject *PyUnicode_DecodeUTF7(const char *s, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { return PyUnicode_DecodeUTF7Stateful(s, size, errors, NULL); } PyObject *PyUnicode_DecodeUTF7Stateful(const char *s, - Py_ssize_t size, - const char *errors, - Py_ssize_t *consumed) + Py_ssize_t size, + const char *errors, + Py_ssize_t *consumed) { const char *starts = s; Py_ssize_t startinpos; @@ -1754,7 +1754,7 @@ while (s < e) { Py_UNICODE ch; - restart: + restart: ch = (unsigned char) *s; if (inShift) { @@ -1788,7 +1788,7 @@ } } else if (SPECIAL(ch,0,0)) { errmsg = "unexpected special character"; - goto utf7Error; + goto utf7Error; } else { *p++ = ch; } @@ -1822,28 +1822,28 @@ s++; } continue; - utf7Error: + utf7Error: outpos = p-PyUnicode_AS_UNICODE(unicode); endinpos = s-starts; if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "utf7", errmsg, - &starts, &e, &startinpos, &endinpos, &exc, &s, - &unicode, &outpos, &p)) - goto onError; + errors, &errorHandler, + "utf7", errmsg, + &starts, &e, &startinpos, &endinpos, &exc, &s, + &unicode, &outpos, &p)) + 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)) + errors, &errorHandler, + "utf7", "unterminated shift sequence", + &starts, &e, &startinpos, &endinpos, &exc, &s, + &unicode, &outpos, &p)) goto onError; if (s < e) - goto restart; + goto restart; } if (consumed) { if(inShift) @@ -1859,7 +1859,7 @@ Py_XDECREF(exc); return (PyObject *)unicode; -onError: + onError: Py_XDECREF(errorHandler); Py_XDECREF(exc); Py_DECREF(unicode); @@ -1868,10 +1868,10 @@ PyObject *PyUnicode_EncodeUTF7(const Py_UNICODE *s, - Py_ssize_t size, - int encodeSetO, - int encodeWhiteSpace, - const char *errors) + Py_ssize_t size, + int encodeSetO, + int encodeWhiteSpace, + const char *errors) { PyObject *v; /* It might be possible to tighten this worst case */ @@ -1884,7 +1884,7 @@ char * start; if (size == 0) - return PyBytes_FromStringAndSize(NULL, 0); + return PyBytes_FromStringAndSize(NULL, 0); if (cbAllocated / 5 != size) return PyErr_NoMemory(); @@ -1995,8 +1995,8 @@ }; PyObject *PyUnicode_DecodeUTF8(const char *s, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { return PyUnicode_DecodeUTF8Stateful(s, size, errors, NULL); } @@ -2015,9 +2015,9 @@ #endif PyObject *PyUnicode_DecodeUTF8Stateful(const char *s, - Py_ssize_t size, - const char *errors, - Py_ssize_t *consumed) + Py_ssize_t size, + const char *errors, + Py_ssize_t *consumed) { const char *starts = s; int n; @@ -2099,72 +2099,72 @@ n = utf8_code_length[ch]; if (s + n > e) { - if (consumed) - break; - else { - errmsg = "unexpected end of data"; - startinpos = s-starts; - endinpos = size; - goto utf8Error; - } - } + if (consumed) + break; + else { + errmsg = "unexpected end of data"; + startinpos = s-starts; + endinpos = size; + goto utf8Error; + } + } switch (n) { case 0: errmsg = "unexpected code byte"; - startinpos = s-starts; - endinpos = startinpos+1; - goto utf8Error; + startinpos = s-starts; + endinpos = startinpos+1; + goto utf8Error; case 1: errmsg = "internal error"; - startinpos = s-starts; - endinpos = startinpos+1; - goto utf8Error; + startinpos = s-starts; + endinpos = startinpos+1; + goto utf8Error; case 2: if ((s[1] & 0xc0) != 0x80) { errmsg = "invalid data"; - startinpos = s-starts; - endinpos = startinpos+2; - goto utf8Error; - } + startinpos = s-starts; + endinpos = startinpos+2; + goto utf8Error; + } ch = ((s[0] & 0x1f) << 6) + (s[1] & 0x3f); if (ch < 0x80) { - startinpos = s-starts; - endinpos = startinpos+2; + startinpos = s-starts; + endinpos = startinpos+2; errmsg = "illegal encoding"; - goto utf8Error; - } - else - *p++ = (Py_UNICODE)ch; + goto utf8Error; + } + else + *p++ = (Py_UNICODE)ch; break; case 3: if ((s[1] & 0xc0) != 0x80 || (s[2] & 0xc0) != 0x80) { errmsg = "invalid data"; - startinpos = s-starts; - endinpos = startinpos+3; - goto utf8Error; - } + startinpos = s-starts; + endinpos = startinpos+3; + 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; + /* 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. - */ + XXX For wide builds (UCS-4) we should probably try + to recombine the surrogates into a single code + unit. + */ errmsg = "illegal encoding"; - startinpos = s-starts; - endinpos = startinpos+3; - goto utf8Error; - } - else - *p++ = (Py_UNICODE)ch; + startinpos = s-starts; + endinpos = startinpos+3; + goto utf8Error; + } + else + *p++ = (Py_UNICODE)ch; break; case 4: @@ -2172,25 +2172,25 @@ (s[2] & 0xc0) != 0x80 || (s[3] & 0xc0) != 0x80) { errmsg = "invalid data"; - startinpos = s-starts; - endinpos = startinpos+4; - goto utf8Error; - } + startinpos = s-starts; + endinpos = startinpos+4; + goto utf8Error; + } ch = ((s[0] & 0x7) << 18) + ((s[1] & 0x3f) << 12) + - ((s[2] & 0x3f) << 6) + (s[3] & 0x3f); + ((s[2] & 0x3f) << 6) + (s[3] & 0x3f); /* validate and convert to UTF-16 */ if ((ch < 0x10000) /* minimum value allowed for 4 - byte encoding */ + byte encoding */ || (ch > 0x10ffff)) /* maximum value allowed for - UTF-16 */ - { + UTF-16 */ + { errmsg = "illegal encoding"; - startinpos = s-starts; - endinpos = startinpos+4; - goto utf8Error; - } + startinpos = s-starts; + endinpos = startinpos+4; + goto utf8Error; + } #ifdef Py_UNICODE_WIDE - *p++ = (Py_UNICODE)ch; + *p++ = (Py_UNICODE)ch; #else /* compute and append the two surrogates: */ @@ -2208,25 +2208,25 @@ default: /* Other sizes are only needed for UCS-4 */ errmsg = "unsupported Unicode code range"; - startinpos = s-starts; - endinpos = startinpos+n; - goto utf8Error; + startinpos = s-starts; + endinpos = startinpos+n; + goto utf8Error; } s += n; - continue; + continue; - utf8Error: - outpos = p-PyUnicode_AS_UNICODE(unicode); - if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "utf8", errmsg, - &starts, &e, &startinpos, &endinpos, &exc, &s, - &unicode, &outpos, &p)) - goto onError; - aligned_end = (const char *) ((size_t) e & ~LONG_PTR_MASK); + utf8Error: + outpos = p-PyUnicode_AS_UNICODE(unicode); + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "utf8", errmsg, + &starts, &e, &startinpos, &endinpos, &exc, &s, + &unicode, &outpos, &p)) + goto onError; + aligned_end = (const char *) ((size_t) e & ~LONG_PTR_MASK); } if (consumed) - *consumed = s-starts; + *consumed = s-starts; /* Adjust length */ if (_PyUnicode_Resize(&unicode, p - unicode->str) < 0) @@ -2236,7 +2236,7 @@ Py_XDECREF(exc); return (PyObject *)unicode; -onError: + onError: Py_XDECREF(errorHandler); Py_XDECREF(exc); Py_DECREF(unicode); @@ -2253,8 +2253,8 @@ */ PyObject * PyUnicode_EncodeUTF8(const Py_UNICODE *s, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { #define MAX_SHORT_UNICHARS 300 /* largest size we'll do on the stack */ @@ -2319,8 +2319,8 @@ *p++ = (char)(0x80 | ((ch >> 6) & 0x3f)); *p++ = (char)(0x80 | (ch & 0x3f)); continue; - } -encodeUCS4: + } + encodeUCS4: /* Encode UCS4 Unicode ordinals */ *p++ = (char)(0xf0 | (ch >> 18)); *p++ = (char)(0x80 | ((ch >> 12) & 0x3f)); @@ -2353,27 +2353,27 @@ return NULL; } return PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - NULL); + PyUnicode_GET_SIZE(unicode), + NULL); } /* --- UTF-32 Codec ------------------------------------------------------- */ PyObject * PyUnicode_DecodeUTF32(const char *s, - Py_ssize_t size, - const char *errors, - int *byteorder) + Py_ssize_t size, + const char *errors, + int *byteorder) { return PyUnicode_DecodeUTF32Stateful(s, size, errors, byteorder, NULL); } PyObject * PyUnicode_DecodeUTF32Stateful(const char *s, - Py_ssize_t size, - const char *errors, - int *byteorder, - Py_ssize_t *consumed) + Py_ssize_t size, + const char *errors, + int *byteorder, + Py_ssize_t *consumed) { const char *starts = s; Py_ssize_t startinpos; @@ -2401,8 +2401,8 @@ codepoints => count how much extra space we need. */ #ifndef Py_UNICODE_WIDE for (i = pairs = 0; i < size/4; i++) - if (((Py_UCS4 *)s)[i] >= 0x10000) - pairs++; + if (((Py_UCS4 *)s)[i] >= 0x10000) + pairs++; #endif /* This might be one to much, because of a BOM */ @@ -2427,27 +2427,27 @@ if (bo == 0) { if (size >= 4) { const Py_UCS4 bom = (q[iorder[3]] << 24) | (q[iorder[2]] << 16) | - (q[iorder[1]] << 8) | q[iorder[0]]; + (q[iorder[1]] << 8) | q[iorder[0]]; #ifdef BYTEORDER_IS_LITTLE_ENDIAN - if (bom == 0x0000FEFF) { - q += 4; - bo = -1; - } - else if (bom == 0xFFFE0000) { - q += 4; - bo = 1; - } + if (bom == 0x0000FEFF) { + q += 4; + bo = -1; + } + else if (bom == 0xFFFE0000) { + q += 4; + bo = 1; + } #else - if (bom == 0x0000FEFF) { - q += 4; - bo = 1; - } - else if (bom == 0xFFFE0000) { - q += 4; - bo = -1; - } + if (bom == 0x0000FEFF) { + q += 4; + bo = 1; + } + else if (bom == 0xFFFE0000) { + q += 4; + bo = -1; + } #endif - } + } } if (bo == -1) { @@ -2466,54 +2466,54 @@ } while (q < e) { - Py_UCS4 ch; - /* remaining bytes at the end? (size should be divisible by 4) */ - if (e-q<4) { - if (consumed) - break; - errmsg = "truncated data"; - startinpos = ((const char *)q)-starts; - endinpos = ((const char *)e)-starts; - goto utf32Error; - /* The remaining input chars are ignored if the callback - chooses to skip the input */ - } - ch = (q[iorder[3]] << 24) | (q[iorder[2]] << 16) | - (q[iorder[1]] << 8) | q[iorder[0]]; - - if (ch >= 0x110000) - { - errmsg = "codepoint not in range(0x110000)"; - startinpos = ((const char *)q)-starts; - endinpos = startinpos+4; - goto utf32Error; - } + Py_UCS4 ch; + /* remaining bytes at the end? (size should be divisible by 4) */ + if (e-q<4) { + if (consumed) + break; + errmsg = "truncated data"; + startinpos = ((const char *)q)-starts; + endinpos = ((const char *)e)-starts; + goto utf32Error; + /* The remaining input chars are ignored if the callback + chooses to skip the input */ + } + ch = (q[iorder[3]] << 24) | (q[iorder[2]] << 16) | + (q[iorder[1]] << 8) | q[iorder[0]]; + + if (ch >= 0x110000) + { + errmsg = "codepoint not in range(0x110000)"; + startinpos = ((const char *)q)-starts; + endinpos = startinpos+4; + goto utf32Error; + } #ifndef Py_UNICODE_WIDE - if (ch >= 0x10000) - { - *p++ = 0xD800 | ((ch-0x10000) >> 10); - *p++ = 0xDC00 | ((ch-0x10000) & 0x3FF); - } - else -#endif - *p++ = ch; - q += 4; - continue; - utf32Error: - outpos = p-PyUnicode_AS_UNICODE(unicode); - if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "utf32", errmsg, - &starts, (const char **)&e, &startinpos, &endinpos, &exc, (const char **)&q, - &unicode, &outpos, &p)) - goto onError; + if (ch >= 0x10000) + { + *p++ = 0xD800 | ((ch-0x10000) >> 10); + *p++ = 0xDC00 | ((ch-0x10000) & 0x3FF); + } + else +#endif + *p++ = ch; + q += 4; + continue; + utf32Error: + outpos = p-PyUnicode_AS_UNICODE(unicode); + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "utf32", errmsg, + &starts, (const char **)&e, &startinpos, &endinpos, &exc, (const char **)&q, + &unicode, &outpos, &p)) + goto onError; } if (byteorder) *byteorder = bo; if (consumed) - *consumed = (const char *)q-starts; + *consumed = (const char *)q-starts; /* Adjust length */ if (_PyUnicode_Resize(&unicode, p - unicode->str) < 0) @@ -2523,7 +2523,7 @@ Py_XDECREF(exc); return (PyObject *)unicode; -onError: + onError: Py_DECREF(unicode); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -2532,9 +2532,9 @@ PyObject * PyUnicode_EncodeUTF32(const Py_UNICODE *s, - Py_ssize_t size, - const char *errors, - int byteorder) + Py_ssize_t size, + const char *errors, + int byteorder) { PyObject *v; unsigned char *p; @@ -2551,34 +2551,34 @@ int iorder[] = {3, 2, 1, 0}; #endif -#define STORECHAR(CH) \ - do { \ - p[iorder[3]] = ((CH) >> 24) & 0xff; \ - p[iorder[2]] = ((CH) >> 16) & 0xff; \ - p[iorder[1]] = ((CH) >> 8) & 0xff; \ - p[iorder[0]] = (CH) & 0xff; \ - p += 4; \ +#define STORECHAR(CH) \ + do { \ + p[iorder[3]] = ((CH) >> 24) & 0xff; \ + p[iorder[2]] = ((CH) >> 16) & 0xff; \ + p[iorder[1]] = ((CH) >> 8) & 0xff; \ + p[iorder[0]] = (CH) & 0xff; \ + p += 4; \ } while(0) /* In narrow builds we can output surrogate pairs as one codepoint, so we need less space. */ #ifndef Py_UNICODE_WIDE for (i = pairs = 0; i < size-1; i++) - if (0xD800 <= s[i] && s[i] <= 0xDBFF && - 0xDC00 <= s[i+1] && s[i+1] <= 0xDFFF) - pairs++; + if (0xD800 <= s[i] && s[i] <= 0xDBFF && + 0xDC00 <= s[i+1] && s[i+1] <= 0xDFFF) + pairs++; #endif nsize = (size - pairs + (byteorder == 0)); bytesize = nsize * 4; if (bytesize / 4 != nsize) - return PyErr_NoMemory(); + return PyErr_NoMemory(); v = PyBytes_FromStringAndSize(NULL, bytesize); if (v == NULL) return NULL; p = (unsigned char *)PyBytes_AS_STRING(v); if (byteorder == 0) - STORECHAR(0xFEFF); + STORECHAR(0xFEFF); if (size == 0) goto done; @@ -2598,16 +2598,16 @@ } while (size-- > 0) { - Py_UCS4 ch = *s++; + Py_UCS4 ch = *s++; #ifndef Py_UNICODE_WIDE - if (0xD800 <= ch && ch <= 0xDBFF && size > 0) { - Py_UCS4 ch2 = *s; - if (0xDC00 <= ch2 && ch2 <= 0xDFFF) { - ch = (((ch & 0x3FF)<<10) | (ch2 & 0x3FF)) + 0x10000; - s++; - size--; - } - } + if (0xD800 <= ch && ch <= 0xDBFF && size > 0) { + Py_UCS4 ch2 = *s; + if (0xDC00 <= ch2 && ch2 <= 0xDFFF) { + ch = (((ch & 0x3FF)<<10) | (ch2 & 0x3FF)) + 0x10000; + s++; + size--; + } + } #endif STORECHAR(ch); } @@ -2624,18 +2624,18 @@ return NULL; } return PyUnicode_EncodeUTF32(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - NULL, - 0); + PyUnicode_GET_SIZE(unicode), + NULL, + 0); } /* --- UTF-16 Codec ------------------------------------------------------- */ PyObject * PyUnicode_DecodeUTF16(const char *s, - Py_ssize_t size, - const char *errors, - int *byteorder) + Py_ssize_t size, + const char *errors, + int *byteorder) { return PyUnicode_DecodeUTF16Stateful(s, size, errors, byteorder, NULL); } @@ -2646,7 +2646,7 @@ rare in most input. FAST_CHAR_MASK is used when the input is in native byte ordering, SWAPPED_FAST_CHAR_MASK when the input is in byteswapped ordering. - */ +*/ #if (SIZEOF_LONG == 8) # define FAST_CHAR_MASK 0x8000800080008000L # define SWAPPED_FAST_CHAR_MASK 0x0080008000800080L @@ -2659,10 +2659,10 @@ PyObject * PyUnicode_DecodeUTF16Stateful(const char *s, - Py_ssize_t size, - const char *errors, - int *byteorder, - Py_ssize_t *consumed) + Py_ssize_t size, + const char *errors, + int *byteorder, + Py_ssize_t *consumed) { const char *starts = s; Py_ssize_t startinpos; @@ -2707,25 +2707,25 @@ if (size >= 2) { const Py_UNICODE bom = (q[ihi] << 8) | q[ilo]; #ifdef BYTEORDER_IS_LITTLE_ENDIAN - if (bom == 0xFEFF) { - q += 2; - bo = -1; - } - else if (bom == 0xFFFE) { - q += 2; - bo = 1; - } + if (bom == 0xFEFF) { + q += 2; + bo = -1; + } + else if (bom == 0xFFFE) { + q += 2; + bo = 1; + } #else - if (bom == 0xFEFF) { - q += 2; - bo = 1; - } - else if (bom == 0xFFFE) { - q += 2; - bo = -1; - } + if (bom == 0xFEFF) { + q += 2; + bo = 1; + } + else if (bom == 0xFFFE) { + q += 2; + bo = -1; + } #endif - } + } } if (bo == -1) { @@ -2746,7 +2746,7 @@ aligned_end = (const unsigned char *) ((size_t) e & ~LONG_PTR_MASK); while (q < e) { - Py_UNICODE ch; + Py_UNICODE ch; /* First check for possible aligned read of a C 'long'. Unaligned reads are more expensive, better to defer to another iteration. */ if (!((size_t) q & LONG_PTR_MASK)) { @@ -2818,50 +2818,50 @@ if (q >= e) break; } - ch = (q[ihi] << 8) | q[ilo]; + ch = (q[ihi] << 8) | q[ilo]; + + q += 2; - q += 2; + if (ch < 0xD800 || ch > 0xDFFF) { + *p++ = ch; + continue; + } - if (ch < 0xD800 || ch > 0xDFFF) { - *p++ = ch; - continue; - } - - /* UTF-16 code pair: */ - if (q > e) { - errmsg = "unexpected end of data"; - startinpos = (((const char *)q) - 2) - starts; - endinpos = ((const char *)e) + 1 - starts; - goto utf16Error; - } - if (0xD800 <= ch && ch <= 0xDBFF) { - Py_UNICODE ch2 = (q[ihi] << 8) | q[ilo]; - q += 2; - if (0xDC00 <= ch2 && ch2 <= 0xDFFF) { + /* UTF-16 code pair: */ + if (q > e) { + errmsg = "unexpected end of data"; + startinpos = (((const char *)q) - 2) - starts; + endinpos = ((const char *)e) + 1 - starts; + goto utf16Error; + } + if (0xD800 <= ch && ch <= 0xDBFF) { + Py_UNICODE ch2 = (q[ihi] << 8) | q[ilo]; + q += 2; + if (0xDC00 <= ch2 && ch2 <= 0xDFFF) { #ifndef Py_UNICODE_WIDE - *p++ = ch; - *p++ = ch2; + *p++ = ch; + *p++ = ch2; #else - *p++ = (((ch & 0x3FF)<<10) | (ch2 & 0x3FF)) + 0x10000; + *p++ = (((ch & 0x3FF)<<10) | (ch2 & 0x3FF)) + 0x10000; #endif - continue; - } - else { + continue; + } + else { errmsg = "illegal UTF-16 surrogate"; - startinpos = (((const char *)q)-4)-starts; - endinpos = startinpos+2; - goto utf16Error; - } - - } - errmsg = "illegal encoding"; - startinpos = (((const char *)q)-2)-starts; - endinpos = startinpos+2; - /* Fall through to report the error */ - - utf16Error: - outpos = p - PyUnicode_AS_UNICODE(unicode); - if (unicode_decode_call_errorhandler( + startinpos = (((const char *)q)-4)-starts; + endinpos = startinpos+2; + goto utf16Error; + } + + } + errmsg = "illegal encoding"; + startinpos = (((const char *)q)-2)-starts; + endinpos = startinpos+2; + /* Fall through to report the error */ + + utf16Error: + outpos = p - PyUnicode_AS_UNICODE(unicode); + if (unicode_decode_call_errorhandler( errors, &errorHandler, "utf16", errmsg, @@ -2874,7 +2874,7 @@ &unicode, &outpos, &p)) - goto onError; + goto onError; } /* remaining byte at the end? (size should be even) */ if (e == q) { @@ -2906,7 +2906,7 @@ *byteorder = bo; if (consumed) - *consumed = (const char *)q-starts; + *consumed = (const char *)q-starts; /* Adjust length */ if (_PyUnicode_Resize(&unicode, p - unicode->str) < 0) @@ -2916,7 +2916,7 @@ Py_XDECREF(exc); return (PyObject *)unicode; -onError: + onError: Py_DECREF(unicode); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -2928,9 +2928,9 @@ PyObject * PyUnicode_EncodeUTF16(const Py_UNICODE *s, - Py_ssize_t size, - const char *errors, - int byteorder) + Py_ssize_t size, + const char *errors, + int byteorder) { PyObject *v; unsigned char *p; @@ -2947,33 +2947,33 @@ int ihi = 0, ilo = 1; #endif -#define STORECHAR(CH) \ - do { \ - p[ihi] = ((CH) >> 8) & 0xff; \ - p[ilo] = (CH) & 0xff; \ - p += 2; \ +#define STORECHAR(CH) \ + do { \ + p[ihi] = ((CH) >> 8) & 0xff; \ + p[ilo] = (CH) & 0xff; \ + p += 2; \ } while(0) #ifdef Py_UNICODE_WIDE for (i = pairs = 0; i < size; i++) - if (s[i] >= 0x10000) - pairs++; + if (s[i] >= 0x10000) + pairs++; #endif /* 2 * (size + pairs + (byteorder == 0)) */ if (size > PY_SSIZE_T_MAX || size > PY_SSIZE_T_MAX - pairs - (byteorder == 0)) - return PyErr_NoMemory(); + return PyErr_NoMemory(); nsize = size + pairs + (byteorder == 0); bytesize = nsize * 2; if (bytesize / 2 != nsize) - return PyErr_NoMemory(); + return PyErr_NoMemory(); v = PyBytes_FromStringAndSize(NULL, bytesize); if (v == NULL) return NULL; p = (unsigned char *)PyBytes_AS_STRING(v); if (byteorder == 0) - STORECHAR(0xFEFF); + STORECHAR(0xFEFF); if (size == 0) goto done; @@ -2989,13 +2989,13 @@ } while (size-- > 0) { - Py_UNICODE ch = *s++; - Py_UNICODE ch2 = 0; + Py_UNICODE ch = *s++; + Py_UNICODE ch2 = 0; #ifdef Py_UNICODE_WIDE - if (ch >= 0x10000) { - ch2 = 0xDC00 | ((ch-0x10000) & 0x3FF); - ch = 0xD800 | ((ch-0x10000) >> 10); - } + if (ch >= 0x10000) { + ch2 = 0xDC00 | ((ch-0x10000) & 0x3FF); + ch = 0xD800 | ((ch-0x10000) >> 10); + } #endif STORECHAR(ch); if (ch2) @@ -3014,9 +3014,9 @@ return NULL; } return PyUnicode_EncodeUTF16(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - NULL, - 0); + PyUnicode_GET_SIZE(unicode), + NULL, + 0); } /* --- Unicode Escape Codec ----------------------------------------------- */ @@ -3024,8 +3024,8 @@ static _PyUnicode_Name_CAPI *ucnhash_CAPI = NULL; PyObject *PyUnicode_DecodeUnicodeEscape(const char *s, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { const char *starts = s; Py_ssize_t startinpos; @@ -3073,7 +3073,7 @@ c = '\0'; /* Invalid after \ */ switch (c) { - /* \x escapes */ + /* \x escapes */ case '\n': break; case '\\': *p++ = '\\'; break; case '\'': *p++ = '\''; break; @@ -3086,7 +3086,7 @@ case 'v': *p++ = '\013'; break; /* VT */ case 'a': *p++ = '\007'; break; /* BEL, not classic C */ - /* \OOO (octal) escapes */ + /* \OOO (octal) escapes */ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': x = s[-1] - '0'; @@ -3098,20 +3098,20 @@ *p++ = x; break; - /* hex escapes */ - /* \xXX */ + /* hex escapes */ + /* \xXX */ case 'x': digits = 2; message = "truncated \\xXX escape"; goto hexescape; - /* \uXXXX */ + /* \uXXXX */ case 'u': digits = 4; message = "truncated \\uXXXX escape"; goto hexescape; - /* \UXXXXXXXX */ + /* \UXXXXXXXX */ case 'U': digits = 8; message = "truncated \\UXXXXXXXX escape"; @@ -3121,10 +3121,10 @@ if (s+digits>end) { endinpos = size; if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", "end of string in escape sequence", - &starts, &end, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", "end of string in escape sequence", + &starts, &end, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) goto onError; goto nextByte; } @@ -3133,10 +3133,10 @@ if (!ISXDIGIT(c)) { endinpos = (s+i+1)-starts; if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", message, - &starts, &end, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", message, + &starts, &end, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) goto onError; goto nextByte; } @@ -3172,15 +3172,15 @@ endinpos = s-starts; outpos = p-PyUnicode_AS_UNICODE(v); if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", "illegal Unicode character", - &starts, &end, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", "illegal Unicode character", + &starts, &end, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) goto onError; } break; - /* \N{name} */ + /* \N{name} */ case 'N': message = "malformed \\N character escape"; if (ucnhash_CAPI == NULL) { @@ -3214,10 +3214,10 @@ endinpos = s-starts; outpos = p-PyUnicode_AS_UNICODE(v); if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", message, - &starts, &end, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", message, + &starts, &end, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) goto onError; break; @@ -3228,10 +3228,10 @@ endinpos = s-starts; outpos = p-PyUnicode_AS_UNICODE(v); if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "unicodeescape", message, - &starts, &end, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) + errors, &errorHandler, + "unicodeescape", message, + &starts, &end, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) goto onError; } else { @@ -3240,7 +3240,7 @@ } break; } - nextByte: + nextByte: ; } if (_PyUnicode_Resize(&v, p - PyUnicode_AS_UNICODE(v)) < 0) @@ -3249,7 +3249,7 @@ Py_XDECREF(exc); return (PyObject *)v; -ucnhashError: + ucnhashError: PyErr_SetString( PyExc_UnicodeError, "\\N escapes not supported (can't load unicodedata module)" @@ -3259,7 +3259,7 @@ Py_XDECREF(exc); return NULL; -onError: + onError: Py_XDECREF(v); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -3274,8 +3274,8 @@ */ Py_LOCAL_INLINE(const Py_UNICODE *) findchar(const Py_UNICODE *s, - Py_ssize_t size, - Py_UNICODE ch) + Py_ssize_t size, + Py_UNICODE ch) { /* like wcschr, but doesn't stop at NULL characters */ @@ -3291,7 +3291,7 @@ static const char *hexdigits = "0123456789abcdef"; PyObject *PyUnicode_EncodeUnicodeEscape(const Py_UNICODE *s, - Py_ssize_t size) + Py_ssize_t size) { PyObject *repr; char *p; @@ -3324,12 +3324,12 @@ return PyBytes_FromStringAndSize(NULL, 0); if (size > (PY_SSIZE_T_MAX - 2 - 1) / expandsize) - return PyErr_NoMemory(); + return PyErr_NoMemory(); repr = PyBytes_FromStringAndSize(NULL, - 2 - + expandsize*size - + 1); + 2 + + expandsize*size + + 1); if (repr == NULL) return NULL; @@ -3358,34 +3358,34 @@ *p++ = hexdigits[(ch >> 8) & 0x0000000F]; *p++ = hexdigits[(ch >> 4) & 0x0000000F]; *p++ = hexdigits[ch & 0x0000000F]; - continue; + continue; } #else - /* Map UTF-16 surrogate pairs to '\U00xxxxxx' */ - else if (ch >= 0xD800 && ch < 0xDC00) { - Py_UNICODE ch2; - Py_UCS4 ucs; - - ch2 = *s++; - size--; - if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) { - ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) + 0x00010000; - *p++ = '\\'; - *p++ = 'U'; - *p++ = hexdigits[(ucs >> 28) & 0x0000000F]; - *p++ = hexdigits[(ucs >> 24) & 0x0000000F]; - *p++ = hexdigits[(ucs >> 20) & 0x0000000F]; - *p++ = hexdigits[(ucs >> 16) & 0x0000000F]; - *p++ = hexdigits[(ucs >> 12) & 0x0000000F]; - *p++ = hexdigits[(ucs >> 8) & 0x0000000F]; - *p++ = hexdigits[(ucs >> 4) & 0x0000000F]; - *p++ = hexdigits[ucs & 0x0000000F]; - continue; - } - /* Fall through: isolated surrogates are copied as-is */ - s--; - size++; - } + /* Map UTF-16 surrogate pairs to '\U00xxxxxx' */ + else if (ch >= 0xD800 && ch < 0xDC00) { + Py_UNICODE ch2; + Py_UCS4 ucs; + + ch2 = *s++; + size--; + if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) { + ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) + 0x00010000; + *p++ = '\\'; + *p++ = 'U'; + *p++ = hexdigits[(ucs >> 28) & 0x0000000F]; + *p++ = hexdigits[(ucs >> 24) & 0x0000000F]; + *p++ = hexdigits[(ucs >> 20) & 0x0000000F]; + *p++ = hexdigits[(ucs >> 16) & 0x0000000F]; + *p++ = hexdigits[(ucs >> 12) & 0x0000000F]; + *p++ = hexdigits[(ucs >> 8) & 0x0000000F]; + *p++ = hexdigits[(ucs >> 4) & 0x0000000F]; + *p++ = hexdigits[ucs & 0x0000000F]; + continue; + } + /* Fall through: isolated surrogates are copied as-is */ + s--; + size++; + } #endif /* Map 16-bit characters to '\uxxxx' */ @@ -3446,8 +3446,8 @@ /* --- Raw Unicode Escape Codec ------------------------------------------- */ PyObject *PyUnicode_DecodeRawUnicodeEscape(const char *s, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { const char *starts = s; Py_ssize_t startinpos; @@ -3466,75 +3466,75 @@ handler might have to resize the string) */ v = _PyUnicode_New(size); if (v == NULL) - goto onError; + goto onError; if (size == 0) - return (PyObject *)v; + return (PyObject *)v; p = PyUnicode_AS_UNICODE(v); end = s + size; while (s < end) { - unsigned char c; - Py_UCS4 x; - int i; + unsigned char c; + Py_UCS4 x; + int i; int count; - /* Non-escape characters are interpreted as Unicode ordinals */ - if (*s != '\\') { - *p++ = (unsigned char)*s++; - continue; - } - startinpos = s-starts; - - /* \u-escapes are only interpreted iff the number of leading - backslashes if odd */ - bs = s; - for (;s < end;) { - if (*s != '\\') - break; - *p++ = (unsigned char)*s++; - } - if (((s - bs) & 1) == 0 || - s >= end || - (*s != 'u' && *s != 'U')) { - continue; - } - p--; + /* Non-escape characters are interpreted as Unicode ordinals */ + if (*s != '\\') { + *p++ = (unsigned char)*s++; + continue; + } + startinpos = s-starts; + + /* \u-escapes are only interpreted iff the number of leading + backslashes if odd */ + bs = s; + for (;s < end;) { + if (*s != '\\') + break; + *p++ = (unsigned char)*s++; + } + if (((s - bs) & 1) == 0 || + s >= end || + (*s != 'u' && *s != 'U')) { + continue; + } + p--; count = *s=='u' ? 4 : 8; - s++; + s++; - /* \uXXXX with 4 hex digits, \Uxxxxxxxx with 8 */ - outpos = p-PyUnicode_AS_UNICODE(v); - for (x = 0, i = 0; i < count; ++i, ++s) { - c = (unsigned char)*s; - if (!ISXDIGIT(c)) { - endinpos = s-starts; - if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "rawunicodeescape", "truncated \\uXXXX", - &starts, &end, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) - goto onError; - goto nextByte; - } - x = (x<<4) & ~0xF; - if (c >= '0' && c <= '9') - x += c - '0'; - else if (c >= 'a' && c <= 'f') - x += 10 + c - 'a'; - else - x += 10 + c - 'A'; - } + /* \uXXXX with 4 hex digits, \Uxxxxxxxx with 8 */ + outpos = p-PyUnicode_AS_UNICODE(v); + for (x = 0, i = 0; i < count; ++i, ++s) { + c = (unsigned char)*s; + if (!ISXDIGIT(c)) { + endinpos = s-starts; + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "rawunicodeescape", "truncated \\uXXXX", + &starts, &end, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) + goto onError; + goto nextByte; + } + x = (x<<4) & ~0xF; + if (c >= '0' && c <= '9') + x += c - '0'; + else if (c >= 'a' && c <= 'f') + x += 10 + c - 'a'; + else + x += 10 + c - 'A'; + } if (x <= 0xffff) - /* UCS-2 character */ - *p++ = (Py_UNICODE) x; + /* UCS-2 character */ + *p++ = (Py_UNICODE) x; else if (x <= 0x10ffff) { - /* UCS-4 character. Either store directly, or as - surrogate pair. */ + /* UCS-4 character. Either store directly, or as + surrogate pair. */ #ifdef Py_UNICODE_WIDE - *p++ = (Py_UNICODE) x; + *p++ = (Py_UNICODE) x; #else - x -= 0x10000L; - *p++ = 0xD800 + (Py_UNICODE) (x >> 10); - *p++ = 0xDC00 + (Py_UNICODE) (x & 0x03FF); + x -= 0x10000L; + *p++ = 0xD800 + (Py_UNICODE) (x >> 10); + *p++ = 0xDC00 + (Py_UNICODE) (x & 0x03FF); #endif } else { endinpos = s-starts; @@ -3542,20 +3542,20 @@ if (unicode_decode_call_errorhandler( errors, &errorHandler, "rawunicodeescape", "\\Uxxxxxxxx out of range", - &starts, &end, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) - goto onError; + &starts, &end, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) + goto onError; } - nextByte: - ; + nextByte: + ; } if (_PyUnicode_Resize(&v, p - PyUnicode_AS_UNICODE(v)) < 0) - goto onError; + goto onError; Py_XDECREF(errorHandler); Py_XDECREF(exc); return (PyObject *)v; - onError: + onError: Py_XDECREF(v); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -3563,7 +3563,7 @@ } PyObject *PyUnicode_EncodeRawUnicodeEscape(const Py_UNICODE *s, - Py_ssize_t size) + Py_ssize_t size) { PyObject *repr; char *p; @@ -3574,10 +3574,10 @@ #else const Py_ssize_t expandsize = 6; #endif - + if (size > PY_SSIZE_T_MAX / expandsize) - return PyErr_NoMemory(); - + return PyErr_NoMemory(); + repr = PyBytes_FromStringAndSize(NULL, expandsize * size); if (repr == NULL) return NULL; @@ -3588,8 +3588,8 @@ while (size-- > 0) { Py_UNICODE ch = *s++; #ifdef Py_UNICODE_WIDE - /* Map 32-bit characters to '\Uxxxxxxxx' */ - if (ch >= 0x10000) { + /* Map 32-bit characters to '\Uxxxxxxxx' */ + if (ch >= 0x10000) { *p++ = '\\'; *p++ = 'U'; *p++ = hexdigits[(ch >> 28) & 0xf]; @@ -3603,34 +3603,34 @@ } else #else - /* Map UTF-16 surrogate pairs to '\U00xxxxxx' */ - if (ch >= 0xD800 && ch < 0xDC00) { - Py_UNICODE ch2; - Py_UCS4 ucs; - - ch2 = *s++; - size--; - if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) { - ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) + 0x00010000; - *p++ = '\\'; - *p++ = 'U'; - *p++ = hexdigits[(ucs >> 28) & 0xf]; - *p++ = hexdigits[(ucs >> 24) & 0xf]; - *p++ = hexdigits[(ucs >> 20) & 0xf]; - *p++ = hexdigits[(ucs >> 16) & 0xf]; - *p++ = hexdigits[(ucs >> 12) & 0xf]; - *p++ = hexdigits[(ucs >> 8) & 0xf]; - *p++ = hexdigits[(ucs >> 4) & 0xf]; - *p++ = hexdigits[ucs & 0xf]; - continue; - } - /* Fall through: isolated surrogates are copied as-is */ - s--; - size++; - } + /* Map UTF-16 surrogate pairs to '\U00xxxxxx' */ + if (ch >= 0xD800 && ch < 0xDC00) { + Py_UNICODE ch2; + Py_UCS4 ucs; + + ch2 = *s++; + size--; + if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) { + ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) + 0x00010000; + *p++ = '\\'; + *p++ = 'U'; + *p++ = hexdigits[(ucs >> 28) & 0xf]; + *p++ = hexdigits[(ucs >> 24) & 0xf]; + *p++ = hexdigits[(ucs >> 20) & 0xf]; + *p++ = hexdigits[(ucs >> 16) & 0xf]; + *p++ = hexdigits[(ucs >> 12) & 0xf]; + *p++ = hexdigits[(ucs >> 8) & 0xf]; + *p++ = hexdigits[(ucs >> 4) & 0xf]; + *p++ = hexdigits[ucs & 0xf]; + continue; + } + /* Fall through: isolated surrogates are copied as-is */ + s--; + size++; + } #endif - /* Map 16-bit characters to '\uxxxx' */ - if (ch >= 256) { + /* Map 16-bit characters to '\uxxxx' */ + if (ch >= 256) { *p++ = '\\'; *p++ = 'u'; *p++ = hexdigits[(ch >> 12) & 0xf]; @@ -3638,8 +3638,8 @@ *p++ = hexdigits[(ch >> 4) & 0xf]; *p++ = hexdigits[ch & 15]; } - /* Copy everything else as-is */ - else + /* Copy everything else as-is */ + else *p++ = (char) ch; } size = p - q; @@ -3666,8 +3666,8 @@ /* --- Unicode Internal Codec ------------------------------------------- */ PyObject *_PyUnicode_DecodeUnicodeInternal(const char *s, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { const char *starts = s; Py_ssize_t startinpos; @@ -3687,9 +3687,9 @@ /* XXX overflow detection missing */ v = _PyUnicode_New((size+Py_UNICODE_SIZE-1)/ Py_UNICODE_SIZE); if (v == NULL) - goto onError; + goto onError; if (PyUnicode_GetSize((PyObject *)v) == 0) - return (PyObject *)v; + return (PyObject *)v; p = PyUnicode_AS_UNICODE(v); end = s + size; @@ -3698,12 +3698,12 @@ /* We have to sanity check the raw data, otherwise doom looms for some malformed UCS-4 data. */ if ( - #ifdef Py_UNICODE_WIDE +#ifdef Py_UNICODE_WIDE *p > unimax || *p < 0 || - #endif +#endif end-s < Py_UNICODE_SIZE ) - { + { startinpos = s - starts; if (end-s < Py_UNICODE_SIZE) { endinpos = end-starts; @@ -3734,7 +3734,7 @@ Py_XDECREF(exc); return (PyObject *)v; - onError: + onError: Py_XDECREF(v); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -3744,8 +3744,8 @@ /* --- Latin-1 Codec ------------------------------------------------------ */ PyObject *PyUnicode_DecodeLatin1(const char *s, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { PyUnicodeObject *v; Py_UNICODE *p; @@ -3753,15 +3753,15 @@ /* Latin-1 is equivalent to the first 256 ordinals in Unicode. */ if (size == 1) { - Py_UNICODE r = *(unsigned char*)s; - return PyUnicode_FromUnicode(&r, 1); + Py_UNICODE r = *(unsigned char*)s; + return PyUnicode_FromUnicode(&r, 1); } v = _PyUnicode_New(size); if (v == NULL) - goto onError; + goto onError; if (size == 0) - return (PyObject *)v; + return (PyObject *)v; p = PyUnicode_AS_UNICODE(v); e = s + size; /* Unrolling the copy makes it much faster by reducing the looping @@ -3779,47 +3779,47 @@ *p++ = (unsigned char) *s++; return (PyObject *)v; - onError: + onError: Py_XDECREF(v); return NULL; } /* create or adjust a UnicodeEncodeError */ static void make_encode_exception(PyObject **exceptionObject, - const char *encoding, - const Py_UNICODE *unicode, Py_ssize_t size, - Py_ssize_t startpos, Py_ssize_t endpos, - const char *reason) + const char *encoding, + const Py_UNICODE *unicode, Py_ssize_t size, + Py_ssize_t startpos, Py_ssize_t endpos, + const char *reason) { if (*exceptionObject == NULL) { - *exceptionObject = PyUnicodeEncodeError_Create( - encoding, unicode, size, startpos, endpos, reason); + *exceptionObject = PyUnicodeEncodeError_Create( + encoding, unicode, size, startpos, endpos, reason); } else { - if (PyUnicodeEncodeError_SetStart(*exceptionObject, startpos)) - goto onError; - if (PyUnicodeEncodeError_SetEnd(*exceptionObject, endpos)) - goto onError; - if (PyUnicodeEncodeError_SetReason(*exceptionObject, reason)) - goto onError; - return; - onError: - Py_DECREF(*exceptionObject); - *exceptionObject = NULL; + if (PyUnicodeEncodeError_SetStart(*exceptionObject, startpos)) + goto onError; + if (PyUnicodeEncodeError_SetEnd(*exceptionObject, endpos)) + goto onError; + if (PyUnicodeEncodeError_SetReason(*exceptionObject, reason)) + goto onError; + return; + onError: + Py_DECREF(*exceptionObject); + *exceptionObject = NULL; } } /* raises a UnicodeEncodeError */ static void raise_encode_exception(PyObject **exceptionObject, - const char *encoding, - const Py_UNICODE *unicode, Py_ssize_t size, - Py_ssize_t startpos, Py_ssize_t endpos, - const char *reason) + const char *encoding, + const Py_UNICODE *unicode, Py_ssize_t size, + Py_ssize_t startpos, Py_ssize_t endpos, + const char *reason) { make_encode_exception(exceptionObject, - encoding, unicode, size, startpos, endpos, reason); + encoding, unicode, size, startpos, endpos, reason); if (*exceptionObject != NULL) - PyCodec_StrictErrors(*exceptionObject); + PyCodec_StrictErrors(*exceptionObject); } /* error handling callback helper: @@ -3827,11 +3827,11 @@ put the result into newpos and return the replacement string, which has to be freed by the caller */ 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) { static char *argparse = "O!n;encoding error handler must return (str, int) tuple"; @@ -3839,36 +3839,36 @@ PyObject *resunicode; if (*errorHandler == NULL) { - *errorHandler = PyCodec_LookupError(errors); + *errorHandler = PyCodec_LookupError(errors); if (*errorHandler == NULL) - return NULL; + return NULL; } make_encode_exception(exceptionObject, - encoding, unicode, size, startpos, endpos, reason); + encoding, unicode, size, startpos, endpos, reason); if (*exceptionObject == NULL) - return NULL; + return NULL; restuple = PyObject_CallFunctionObjArgs( - *errorHandler, *exceptionObject, NULL); + *errorHandler, *exceptionObject, NULL); if (restuple == NULL) - return NULL; + return NULL; if (!PyTuple_Check(restuple)) { - PyErr_Format(PyExc_TypeError, &argparse[4]); - Py_DECREF(restuple); - return NULL; + PyErr_Format(PyExc_TypeError, &argparse[4]); + Py_DECREF(restuple); + return NULL; } if (!PyArg_ParseTuple(restuple, argparse, &PyUnicode_Type, - &resunicode, newpos)) { - Py_DECREF(restuple); - return NULL; + &resunicode, newpos)) { + Py_DECREF(restuple); + return NULL; } if (*newpos<0) - *newpos = size+*newpos; + *newpos = size+*newpos; if (*newpos<0 || *newpos>size) { - PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", *newpos); - Py_DECREF(restuple); - return NULL; + PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", *newpos); + Py_DECREF(restuple); + return NULL; } Py_INCREF(resunicode); Py_DECREF(restuple); @@ -3876,9 +3876,9 @@ } static PyObject *unicode_encode_ucs1(const Py_UNICODE *p, - Py_ssize_t size, - const char *errors, - int limit) + Py_ssize_t size, + const char *errors, + int limit) { /* output object */ PyObject *res; @@ -3910,128 +3910,128 @@ ressize = size; while (p=limit)) - ++collend; - /* cache callback name lookup (if not done yet, i.e. it's the first error) */ - if (known_errorHandler==-1) { - if ((errors==NULL) || (!strcmp(errors, "strict"))) - known_errorHandler = 1; - else if (!strcmp(errors, "replace")) - known_errorHandler = 2; - else if (!strcmp(errors, "ignore")) - known_errorHandler = 3; - else if (!strcmp(errors, "xmlcharrefreplace")) - known_errorHandler = 4; - else - known_errorHandler = 0; - } - switch (known_errorHandler) { - case 1: /* strict */ - raise_encode_exception(&exc, encoding, startp, size, collstart-startp, collend-startp, reason); - goto onError; - case 2: /* replace */ - while (collstart++=limit)) + ++collend; + /* cache callback name lookup (if not done yet, i.e. it's the first error) */ + if (known_errorHandler==-1) { + if ((errors==NULL) || (!strcmp(errors, "strict"))) + known_errorHandler = 1; + else if (!strcmp(errors, "replace")) + known_errorHandler = 2; + else if (!strcmp(errors, "ignore")) + known_errorHandler = 3; + else if (!strcmp(errors, "xmlcharrefreplace")) + known_errorHandler = 4; + else + known_errorHandler = 0; + } + switch (known_errorHandler) { + case 1: /* strict */ + raise_encode_exception(&exc, encoding, startp, size, collstart-startp, collend-startp, reason); + goto onError; + case 2: /* replace */ + while (collstart++ ressize) { - if (requiredsize<2*ressize) - requiredsize = 2*ressize; - if (_PyBytes_Resize(&res, requiredsize)) - goto onError; - str = PyBytes_AS_STRING(res) + respos; - ressize = requiredsize; - } - /* generate replacement (temporarily (mis)uses p) */ - for (p = collstart; p < collend; ++p) { - str += sprintf(str, "&#%d;", (int)*p); - } - p = collend; - break; - default: - repunicode = unicode_encode_call_errorhandler(errors, &errorHandler, - encoding, reason, startp, size, &exc, - collstart-startp, collend-startp, &newpos); - if (repunicode == NULL) - 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) */ - respos = str - PyBytes_AS_STRING(res); - repsize = PyUnicode_GET_SIZE(repunicode); - requiredsize = respos+repsize+(endp-collend); - if (requiredsize > ressize) { - if (requiredsize<2*ressize) - requiredsize = 2*ressize; - if (_PyBytes_Resize(&res, requiredsize)) { - Py_DECREF(repunicode); - goto onError; - } - str = PyBytes_AS_STRING(res) + respos; - ressize = requiredsize; - } - /* check if there is anything unencodable in the replacement - and copy it to the output */ - for (uni2 = PyUnicode_AS_UNICODE(repunicode);repsize-->0; ++uni2, ++str) { - c = *uni2; - if (c >= limit) { - raise_encode_exception(&exc, encoding, startp, size, - unicodepos, unicodepos+1, reason); - Py_DECREF(repunicode); - goto onError; - } - *str = (char)c; - } - p = startp + newpos; - Py_DECREF(repunicode); - } - } + else if (*p<100000) + repsize += 2+5+1; + else if (*p<1000000) + repsize += 2+6+1; + else + repsize += 2+7+1; +#endif + } + requiredsize = respos+repsize+(endp-collend); + if (requiredsize > ressize) { + if (requiredsize<2*ressize) + requiredsize = 2*ressize; + if (_PyBytes_Resize(&res, requiredsize)) + goto onError; + str = PyBytes_AS_STRING(res) + respos; + ressize = requiredsize; + } + /* generate replacement (temporarily (mis)uses p) */ + for (p = collstart; p < collend; ++p) { + str += sprintf(str, "&#%d;", (int)*p); + } + p = collend; + break; + default: + repunicode = unicode_encode_call_errorhandler(errors, &errorHandler, + encoding, reason, startp, size, &exc, + collstart-startp, collend-startp, &newpos); + if (repunicode == NULL) + 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) */ + respos = str - PyBytes_AS_STRING(res); + repsize = PyUnicode_GET_SIZE(repunicode); + requiredsize = respos+repsize+(endp-collend); + if (requiredsize > ressize) { + if (requiredsize<2*ressize) + requiredsize = 2*ressize; + if (_PyBytes_Resize(&res, requiredsize)) { + Py_DECREF(repunicode); + goto onError; + } + str = PyBytes_AS_STRING(res) + respos; + ressize = requiredsize; + } + /* check if there is anything unencodable in the replacement + and copy it to the output */ + for (uni2 = PyUnicode_AS_UNICODE(repunicode);repsize-->0; ++uni2, ++str) { + c = *uni2; + if (c >= limit) { + raise_encode_exception(&exc, encoding, startp, size, + unicodepos, unicodepos+1, reason); + Py_DECREF(repunicode); + goto onError; + } + *str = (char)c; + } + p = startp + newpos; + Py_DECREF(repunicode); + } + } } /* Resize if we allocated to much */ size = str - PyBytes_AS_STRING(res); @@ -4053,8 +4053,8 @@ } PyObject *PyUnicode_EncodeLatin1(const Py_UNICODE *p, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { return unicode_encode_ucs1(p, size, errors, 256); } @@ -4062,19 +4062,19 @@ PyObject *PyUnicode_AsLatin1String(PyObject *unicode) { if (!PyUnicode_Check(unicode)) { - PyErr_BadArgument(); - return NULL; + PyErr_BadArgument(); + return NULL; } return PyUnicode_EncodeLatin1(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - NULL); + PyUnicode_GET_SIZE(unicode), + NULL); } /* --- 7-bit ASCII Codec -------------------------------------------------- */ PyObject *PyUnicode_DecodeASCII(const char *s, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { const char *starts = s; PyUnicodeObject *v; @@ -4088,43 +4088,43 @@ /* ASCII is equivalent to the first 128 ordinals in Unicode. */ if (size == 1 && *(unsigned char*)s < 128) { - Py_UNICODE r = *(unsigned char*)s; - return PyUnicode_FromUnicode(&r, 1); + Py_UNICODE r = *(unsigned char*)s; + return PyUnicode_FromUnicode(&r, 1); } v = _PyUnicode_New(size); if (v == NULL) - goto onError; + goto onError; if (size == 0) - return (PyObject *)v; + return (PyObject *)v; p = PyUnicode_AS_UNICODE(v); e = s + size; while (s < e) { - register unsigned char c = (unsigned char)*s; - if (c < 128) { - *p++ = c; - ++s; - } - else { - startinpos = s-starts; - endinpos = startinpos + 1; - outpos = p - (Py_UNICODE *)PyUnicode_AS_UNICODE(v); - if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "ascii", "ordinal not in range(128)", - &starts, &e, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) - goto onError; - } + register unsigned char c = (unsigned char)*s; + if (c < 128) { + *p++ = c; + ++s; + } + else { + startinpos = s-starts; + endinpos = startinpos + 1; + outpos = p - (Py_UNICODE *)PyUnicode_AS_UNICODE(v); + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "ascii", "ordinal not in range(128)", + &starts, &e, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) + goto onError; + } } if (p - PyUnicode_AS_UNICODE(v) < PyUnicode_GET_SIZE(v)) - if (_PyUnicode_Resize(&v, p - PyUnicode_AS_UNICODE(v)) < 0) - goto onError; + if (_PyUnicode_Resize(&v, p - PyUnicode_AS_UNICODE(v)) < 0) + goto onError; Py_XDECREF(errorHandler); Py_XDECREF(exc); return (PyObject *)v; - onError: + onError: Py_XDECREF(v); Py_XDECREF(errorHandler); Py_XDECREF(exc); @@ -4132,8 +4132,8 @@ } PyObject *PyUnicode_EncodeASCII(const Py_UNICODE *p, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { return unicode_encode_ucs1(p, size, errors, 128); } @@ -4141,12 +4141,12 @@ PyObject *PyUnicode_AsASCIIString(PyObject *unicode) { if (!PyUnicode_Check(unicode)) { - PyErr_BadArgument(); - return NULL; + PyErr_BadArgument(); + return NULL; } return PyUnicode_EncodeASCII(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - NULL); + PyUnicode_GET_SIZE(unicode), + NULL); } #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) @@ -4160,15 +4160,15 @@ /* XXX This code is limited to "true" double-byte encodings, as a) it assumes an incomplete character consists of a single byte, and b) IsDBCSLeadByte (probably) does not work for non-DBCS multi-byte - encodings, see IsDBCSLeadByteEx documentation. */ + encodings, see IsDBCSLeadByteEx documentation. */ static int is_dbcs_lead_byte(const char *s, int offset) { const char *curr = s + offset; if (IsDBCSLeadByte(*curr)) { - const char *prev = CharPrev(s, curr); - return (prev == curr) || !IsDBCSLeadByte(*prev) || (curr - prev == 2); + const char *prev = CharPrev(s, curr); + return (prev == curr) || !IsDBCSLeadByte(*prev) || (curr - prev == 2); } return 0; } @@ -4178,9 +4178,9 @@ * trailing lead-byte too. Returns consumed size if succeed, -1 otherwise. */ static int decode_mbcs(PyUnicodeObject **v, - const char *s, /* MBCS string */ - int size, /* sizeof MBCS string */ - int final) + const char *s, /* MBCS string */ + int size, /* sizeof MBCS string */ + int final) { Py_UNICODE *p; Py_ssize_t n = 0; @@ -4190,74 +4190,74 @@ /* Skip trailing lead-byte unless 'final' is set */ if (!final && size >= 1 && is_dbcs_lead_byte(s, size - 1)) - --size; + --size; /* First get the size of the result */ if (size > 0) { - usize = MultiByteToWideChar(CP_ACP, 0, s, size, NULL, 0); - if (usize == 0) { - PyErr_SetFromWindowsErrWithFilename(0, NULL); - return -1; - } + usize = MultiByteToWideChar(CP_ACP, 0, s, size, NULL, 0); + if (usize == 0) { + PyErr_SetFromWindowsErrWithFilename(0, NULL); + return -1; + } } if (*v == NULL) { - /* Create unicode object */ - *v = _PyUnicode_New(usize); - if (*v == NULL) - return -1; + /* Create unicode object */ + *v = _PyUnicode_New(usize); + if (*v == NULL) + return -1; } else { - /* Extend unicode object */ - n = PyUnicode_GET_SIZE(*v); - if (_PyUnicode_Resize(v, n + usize) < 0) - return -1; + /* Extend unicode object */ + n = PyUnicode_GET_SIZE(*v); + if (_PyUnicode_Resize(v, n + usize) < 0) + return -1; } /* Do the conversion */ if (size > 0) { - p = PyUnicode_AS_UNICODE(*v) + n; - if (0 == MultiByteToWideChar(CP_ACP, 0, s, size, p, usize)) { - PyErr_SetFromWindowsErrWithFilename(0, NULL); - return -1; - } + p = PyUnicode_AS_UNICODE(*v) + n; + if (0 == MultiByteToWideChar(CP_ACP, 0, s, size, p, usize)) { + PyErr_SetFromWindowsErrWithFilename(0, NULL); + return -1; + } } return size; } PyObject *PyUnicode_DecodeMBCSStateful(const char *s, - Py_ssize_t size, - const char *errors, - Py_ssize_t *consumed) + Py_ssize_t size, + const char *errors, + Py_ssize_t *consumed) { PyUnicodeObject *v = NULL; int done; if (consumed) - *consumed = 0; + *consumed = 0; #ifdef NEED_RETRY retry: if (size > INT_MAX) - done = decode_mbcs(&v, s, INT_MAX, 0); + done = decode_mbcs(&v, s, INT_MAX, 0); else #endif - done = decode_mbcs(&v, s, (int)size, !consumed); + done = decode_mbcs(&v, s, (int)size, !consumed); if (done < 0) { Py_XDECREF(v); - return NULL; + return NULL; } if (consumed) - *consumed += done; + *consumed += done; #ifdef NEED_RETRY if (size > INT_MAX) { - s += done; - size -= done; - goto retry; + s += done; + size -= done; + goto retry; } #endif @@ -4265,8 +4265,8 @@ } PyObject *PyUnicode_DecodeMBCS(const char *s, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { return PyUnicode_DecodeMBCSStateful(s, size, errors, NULL); } @@ -4276,8 +4276,8 @@ * Returns 0 if succeed, -1 otherwise. */ static int encode_mbcs(PyObject **repr, - const Py_UNICODE *p, /* unicode */ - int size) /* size of unicode */ + const Py_UNICODE *p, /* unicode */ + int size) /* size of unicode */ { int mbcssize = 0; Py_ssize_t n = 0; @@ -4286,63 +4286,63 @@ /* First get the size of the result */ if (size > 0) { - mbcssize = WideCharToMultiByte(CP_ACP, 0, p, size, NULL, 0, NULL, NULL); - if (mbcssize == 0) { - PyErr_SetFromWindowsErrWithFilename(0, NULL); - return -1; - } + mbcssize = WideCharToMultiByte(CP_ACP, 0, p, size, NULL, 0, NULL, NULL); + if (mbcssize == 0) { + PyErr_SetFromWindowsErrWithFilename(0, NULL); + return -1; + } } if (*repr == NULL) { - /* Create string object */ - *repr = PyBytes_FromStringAndSize(NULL, mbcssize); - if (*repr == NULL) - return -1; + /* Create string object */ + *repr = PyBytes_FromStringAndSize(NULL, mbcssize); + if (*repr == NULL) + return -1; } else { - /* Extend string object */ - n = PyBytes_Size(*repr); - if (_PyBytes_Resize(repr, n + mbcssize) < 0) - return -1; + /* Extend string object */ + n = PyBytes_Size(*repr); + if (_PyBytes_Resize(repr, n + mbcssize) < 0) + return -1; } /* Do the conversion */ if (size > 0) { - char *s = PyBytes_AS_STRING(*repr) + n; - if (0 == WideCharToMultiByte(CP_ACP, 0, p, size, s, mbcssize, NULL, NULL)) { - PyErr_SetFromWindowsErrWithFilename(0, NULL); - return -1; - } + char *s = PyBytes_AS_STRING(*repr) + n; + if (0 == WideCharToMultiByte(CP_ACP, 0, p, size, s, mbcssize, NULL, NULL)) { + PyErr_SetFromWindowsErrWithFilename(0, NULL); + return -1; + } } return 0; } PyObject *PyUnicode_EncodeMBCS(const Py_UNICODE *p, - Py_ssize_t size, - const char *errors) + Py_ssize_t size, + const char *errors) { PyObject *repr = NULL; int ret; #ifdef NEED_RETRY - retry: + retry: if (size > INT_MAX) - ret = encode_mbcs(&repr, p, INT_MAX); + ret = encode_mbcs(&repr, p, INT_MAX); else #endif - ret = encode_mbcs(&repr, p, (int)size); + ret = encode_mbcs(&repr, p, (int)size); if (ret < 0) { - Py_XDECREF(repr); - return NULL; + Py_XDECREF(repr); + return NULL; } #ifdef NEED_RETRY if (size > INT_MAX) { - p += INT_MAX; - size -= INT_MAX; - goto retry; + p += INT_MAX; + size -= INT_MAX; + goto retry; } #endif @@ -4356,8 +4356,8 @@ return NULL; } return PyUnicode_EncodeMBCS(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - NULL); + PyUnicode_GET_SIZE(unicode), + NULL); } #undef NEED_RETRY @@ -4367,9 +4367,9 @@ /* --- Character Mapping Codec -------------------------------------------- */ PyObject *PyUnicode_DecodeCharmap(const char *s, - Py_ssize_t size, - PyObject *mapping, - const char *errors) + Py_ssize_t size, + PyObject *mapping, + const char *errors) { const char *starts = s; Py_ssize_t startinpos; @@ -4386,141 +4386,141 @@ /* Default to Latin-1 */ if (mapping == NULL) - return PyUnicode_DecodeLatin1(s, size, errors); + return PyUnicode_DecodeLatin1(s, size, errors); v = _PyUnicode_New(size); if (v == NULL) - goto onError; + goto onError; if (size == 0) - return (PyObject *)v; + return (PyObject *)v; p = PyUnicode_AS_UNICODE(v); e = s + size; if (PyUnicode_CheckExact(mapping)) { - mapstring = PyUnicode_AS_UNICODE(mapping); - maplen = PyUnicode_GET_SIZE(mapping); - while (s < e) { - unsigned char ch = *s; - Py_UNICODE x = 0xfffe; /* illegal value */ - - if (ch < maplen) - x = mapstring[ch]; - - if (x == 0xfffe) { - /* undefined mapping */ - outpos = p-PyUnicode_AS_UNICODE(v); - startinpos = s-starts; - endinpos = startinpos+1; - if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "charmap", "character maps to ", - &starts, &e, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) { - goto onError; - } - continue; - } - *p++ = x; - ++s; - } + mapstring = PyUnicode_AS_UNICODE(mapping); + maplen = PyUnicode_GET_SIZE(mapping); + while (s < e) { + unsigned char ch = *s; + Py_UNICODE x = 0xfffe; /* illegal value */ + + if (ch < maplen) + x = mapstring[ch]; + + if (x == 0xfffe) { + /* undefined mapping */ + outpos = p-PyUnicode_AS_UNICODE(v); + startinpos = s-starts; + endinpos = startinpos+1; + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "charmap", "character maps to ", + &starts, &e, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) { + goto onError; + } + continue; + } + *p++ = x; + ++s; + } } else { - while (s < e) { - unsigned char ch = *s; - PyObject *w, *x; - - /* Get mapping (char ordinal -> integer, Unicode char or None) */ - w = PyLong_FromLong((long)ch); - if (w == NULL) - goto onError; - x = PyObject_GetItem(mapping, w); - Py_DECREF(w); - if (x == NULL) { - if (PyErr_ExceptionMatches(PyExc_LookupError)) { - /* No mapping found means: mapping is undefined. */ - PyErr_Clear(); - x = Py_None; - Py_INCREF(x); - } else - goto onError; - } - - /* Apply mapping */ - if (PyLong_Check(x)) { - long value = PyLong_AS_LONG(x); - if (value < 0 || value > 65535) { - PyErr_SetString(PyExc_TypeError, - "character mapping must be in range(65536)"); - Py_DECREF(x); - goto onError; - } - *p++ = (Py_UNICODE)value; - } - else if (x == Py_None) { - /* undefined mapping */ - outpos = p-PyUnicode_AS_UNICODE(v); - startinpos = s-starts; - endinpos = startinpos+1; - if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "charmap", "character maps to ", - &starts, &e, &startinpos, &endinpos, &exc, &s, - &v, &outpos, &p)) { - Py_DECREF(x); - goto onError; - } - Py_DECREF(x); - continue; - } - else if (PyUnicode_Check(x)) { - Py_ssize_t targetsize = PyUnicode_GET_SIZE(x); - - if (targetsize == 1) - /* 1-1 mapping */ - *p++ = *PyUnicode_AS_UNICODE(x); - - else if (targetsize > 1) { - /* 1-n mapping */ - if (targetsize > extrachars) { - /* resize first */ - Py_ssize_t oldpos = p - PyUnicode_AS_UNICODE(v); - Py_ssize_t needed = (targetsize - extrachars) + \ - (targetsize << 2); - extrachars += needed; - /* XXX overflow detection missing */ - if (_PyUnicode_Resize(&v, - PyUnicode_GET_SIZE(v) + needed) < 0) { - Py_DECREF(x); - goto onError; - } - p = PyUnicode_AS_UNICODE(v) + oldpos; - } - Py_UNICODE_COPY(p, - PyUnicode_AS_UNICODE(x), - targetsize); - p += targetsize; - extrachars -= targetsize; - } - /* 1-0 mapping: skip the character */ - } - else { - /* wrong return value */ - PyErr_SetString(PyExc_TypeError, - "character mapping must return integer, None or str"); - Py_DECREF(x); - goto onError; - } - Py_DECREF(x); - ++s; - } + while (s < e) { + unsigned char ch = *s; + PyObject *w, *x; + + /* Get mapping (char ordinal -> integer, Unicode char or None) */ + w = PyLong_FromLong((long)ch); + if (w == NULL) + goto onError; + x = PyObject_GetItem(mapping, w); + Py_DECREF(w); + if (x == NULL) { + if (PyErr_ExceptionMatches(PyExc_LookupError)) { + /* No mapping found means: mapping is undefined. */ + PyErr_Clear(); + x = Py_None; + Py_INCREF(x); + } else + goto onError; + } + + /* Apply mapping */ + if (PyLong_Check(x)) { + long value = PyLong_AS_LONG(x); + if (value < 0 || value > 65535) { + PyErr_SetString(PyExc_TypeError, + "character mapping must be in range(65536)"); + Py_DECREF(x); + goto onError; + } + *p++ = (Py_UNICODE)value; + } + else if (x == Py_None) { + /* undefined mapping */ + outpos = p-PyUnicode_AS_UNICODE(v); + startinpos = s-starts; + endinpos = startinpos+1; + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "charmap", "character maps to ", + &starts, &e, &startinpos, &endinpos, &exc, &s, + &v, &outpos, &p)) { + Py_DECREF(x); + goto onError; + } + Py_DECREF(x); + continue; + } + else if (PyUnicode_Check(x)) { + Py_ssize_t targetsize = PyUnicode_GET_SIZE(x); + + if (targetsize == 1) + /* 1-1 mapping */ + *p++ = *PyUnicode_AS_UNICODE(x); + + else if (targetsize > 1) { + /* 1-n mapping */ + if (targetsize > extrachars) { + /* resize first */ + Py_ssize_t oldpos = p - PyUnicode_AS_UNICODE(v); + Py_ssize_t needed = (targetsize - extrachars) + \ + (targetsize << 2); + extrachars += needed; + /* XXX overflow detection missing */ + if (_PyUnicode_Resize(&v, + PyUnicode_GET_SIZE(v) + needed) < 0) { + Py_DECREF(x); + goto onError; + } + p = PyUnicode_AS_UNICODE(v) + oldpos; + } + Py_UNICODE_COPY(p, + PyUnicode_AS_UNICODE(x), + targetsize); + p += targetsize; + extrachars -= targetsize; + } + /* 1-0 mapping: skip the character */ + } + else { + /* wrong return value */ + PyErr_SetString(PyExc_TypeError, + "character mapping must return integer, None or str"); + Py_DECREF(x); + goto onError; + } + Py_DECREF(x); + ++s; + } } if (p - PyUnicode_AS_UNICODE(v) < PyUnicode_GET_SIZE(v)) - if (_PyUnicode_Resize(&v, p - PyUnicode_AS_UNICODE(v)) < 0) - goto onError; + if (_PyUnicode_Resize(&v, p - PyUnicode_AS_UNICODE(v)) < 0) + goto onError; Py_XDECREF(errorHandler); Py_XDECREF(exc); return (PyObject *)v; - onError: + onError: Py_XDECREF(errorHandler); Py_XDECREF(exc); Py_XDECREF(v); @@ -4530,74 +4530,74 @@ /* Charmap encoding: the lookup table */ struct encoding_map{ - PyObject_HEAD - unsigned char level1[32]; - int count2, count3; - unsigned char level23[1]; + PyObject_HEAD + unsigned char level1[32]; + int count2, count3; + unsigned char level23[1]; }; static PyObject* encoding_map_size(PyObject *obj, PyObject* args) { struct encoding_map *map = (struct encoding_map*)obj; - return PyLong_FromLong(sizeof(*map) - 1 + 16*map->count2 + - 128*map->count3); + return PyLong_FromLong(sizeof(*map) - 1 + 16*map->count2 + + 128*map->count3); } static PyMethodDef encoding_map_methods[] = { - {"size", encoding_map_size, METH_NOARGS, - PyDoc_STR("Return the size (in bytes) of this object") }, - { 0 } + {"size", encoding_map_size, METH_NOARGS, + PyDoc_STR("Return the size (in bytes) of this object") }, + { 0 } }; static void encoding_map_dealloc(PyObject* o) { - PyObject_FREE(o); + PyObject_FREE(o); } static PyTypeObject EncodingMapType = { - PyVarObject_HEAD_INIT(NULL, 0) - "EncodingMap", /*tp_name*/ - sizeof(struct encoding_map), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - /* methods */ - encoding_map_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*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - encoding_map_methods, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - 0, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ + PyVarObject_HEAD_INIT(NULL, 0) + "EncodingMap", /*tp_name*/ + sizeof(struct encoding_map), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + /* methods */ + encoding_map_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_reserved*/ + 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*/ + Py_TPFLAGS_DEFAULT, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + encoding_map_methods, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ }; PyObject* @@ -4629,10 +4629,10 @@ for (i = 1; i < 256; i++) { int l1, l2; if (decode[i] == 0 - #ifdef Py_UNICODE_WIDE +#ifdef Py_UNICODE_WIDE || decode[i] > 0xFFFF - #endif - ) { +#endif + ) { need_dict = 1; break; } @@ -4644,7 +4644,7 @@ if (level1[l1] == 0xFF) level1[l1] = count2++; if (level2[l2] == 0xFF) - level2[l2] = count3++; + level2[l2] = count3++; } if (count2 >= 0xFF || count3 >= 0xFF) @@ -4718,7 +4718,7 @@ #ifdef Py_UNICODE_WIDE if (c > 0xFFFF) { - return -1; + return -1; } #endif if (c == 0) @@ -4750,57 +4750,57 @@ PyObject *x; if (w == NULL) - return NULL; + return NULL; x = PyObject_GetItem(mapping, w); Py_DECREF(w); if (x == NULL) { - if (PyErr_ExceptionMatches(PyExc_LookupError)) { - /* No mapping found means: mapping is undefined. */ - PyErr_Clear(); - x = Py_None; - Py_INCREF(x); - return x; - } else - return NULL; + if (PyErr_ExceptionMatches(PyExc_LookupError)) { + /* No mapping found means: mapping is undefined. */ + PyErr_Clear(); + x = Py_None; + Py_INCREF(x); + return x; + } else + return NULL; } else if (x == Py_None) - return x; + return x; else if (PyLong_Check(x)) { - long value = PyLong_AS_LONG(x); - if (value < 0 || value > 255) { - PyErr_SetString(PyExc_TypeError, - "character mapping must be in range(256)"); - Py_DECREF(x); - return NULL; - } - return x; + long value = PyLong_AS_LONG(x); + if (value < 0 || value > 255) { + PyErr_SetString(PyExc_TypeError, + "character mapping must be in range(256)"); + Py_DECREF(x); + return NULL; + } + return x; } else if (PyBytes_Check(x)) - return x; + return x; else { - /* wrong return value */ - PyErr_Format(PyExc_TypeError, - "character mapping must return integer, bytes or None, not %.400s", - x->ob_type->tp_name); - Py_DECREF(x); - return NULL; + /* wrong return value */ + PyErr_Format(PyExc_TypeError, + "character mapping must return integer, bytes or None, not %.400s", + x->ob_type->tp_name); + Py_DECREF(x); + return NULL; } } static int charmapencode_resize(PyObject **outobj, Py_ssize_t *outpos, Py_ssize_t requiredsize) { - Py_ssize_t outsize = PyBytes_GET_SIZE(*outobj); - /* exponentially overallocate to minimize reallocations */ - if (requiredsize < 2*outsize) - requiredsize = 2*outsize; - if (_PyBytes_Resize(outobj, requiredsize)) - return -1; - return 0; + Py_ssize_t outsize = PyBytes_GET_SIZE(*outobj); + /* exponentially overallocate to minimize reallocations */ + if (requiredsize < 2*outsize) + requiredsize = 2*outsize; + if (_PyBytes_Resize(outobj, requiredsize)) + return -1; + return 0; } -typedef enum charmapencode_result { - enc_SUCCESS, enc_FAILED, enc_EXCEPTION +typedef enum charmapencode_result { + enc_SUCCESS, enc_FAILED, enc_EXCEPTION }charmapencode_result; /* lookup the character, put the result in the output string and adjust various state variables. Resize the output bytes object if not enough @@ -4810,7 +4810,7 @@ reallocation error occurred. The caller must decref the result */ static charmapencode_result charmapencode_output(Py_UNICODE c, PyObject *mapping, - PyObject **outobj, Py_ssize_t *outpos) + PyObject **outobj, Py_ssize_t *outpos) { PyObject *rep; char *outstart; @@ -4818,47 +4818,47 @@ if (Py_TYPE(mapping) == &EncodingMapType) { int res = encoding_map_lookup(c, mapping); - Py_ssize_t requiredsize = *outpos+1; + Py_ssize_t requiredsize = *outpos+1; if (res == -1) return enc_FAILED; - if (outsize0; ++uni2) { - x = charmapencode_output(*uni2, mapping, res, respos); - if (x==enc_EXCEPTION) { - return -1; - } - else if (x==enc_FAILED) { - Py_DECREF(repunicode); - raise_encode_exception(exceptionObject, encoding, p, size, collstartpos, collendpos, reason); - return -1; - } - } - *inpos = newpos; - Py_DECREF(repunicode); + case 1: /* strict */ + raise_encode_exception(exceptionObject, encoding, p, size, collstartpos, collendpos, reason); + return -1; + case 2: /* replace */ + for (collpos = collstartpos; collpos0; ++uni2) { + x = charmapencode_output(*uni2, mapping, res, respos); + if (x==enc_EXCEPTION) { + return -1; + } + else if (x==enc_FAILED) { + Py_DECREF(repunicode); + raise_encode_exception(exceptionObject, encoding, p, size, collstartpos, collendpos, reason); + return -1; + } + } + *inpos = newpos; + Py_DECREF(repunicode); } return 0; } PyObject *PyUnicode_EncodeCharmap(const Py_UNICODE *p, - Py_ssize_t size, - PyObject *mapping, - const char *errors) + Py_ssize_t size, + PyObject *mapping, + const char *errors) { /* output object */ PyObject *res = NULL; @@ -5002,7 +5002,7 @@ /* Default to Latin-1 */ if (mapping == NULL) - return PyUnicode_EncodeLatin1(p, size, errors); + return PyUnicode_EncodeLatin1(p, size, errors); /* allocate enough for a simple encoding without replacements, if we need more, we'll resize */ @@ -5010,24 +5010,24 @@ if (res == NULL) goto onError; if (size == 0) - return res; + return res; while (inpos adjust input position */ - ++inpos; + /* try to encode it */ + charmapencode_result x = charmapencode_output(p[inpos], mapping, &res, &respos); + if (x==enc_EXCEPTION) /* error */ + goto onError; + if (x==enc_FAILED) { /* unencodable character */ + if (charmap_encoding_error(p, size, &inpos, mapping, + &exc, + &known_errorHandler, &errorHandler, errors, + &res, &respos)) { + goto onError; + } + } + else + /* done with this character => adjust input position */ + ++inpos; } /* Resize if we allocated to much */ @@ -5039,7 +5039,7 @@ Py_XDECREF(errorHandler); return res; - onError: + onError: Py_XDECREF(res); Py_XDECREF(exc); Py_XDECREF(errorHandler); @@ -5047,52 +5047,52 @@ } PyObject *PyUnicode_AsCharmapString(PyObject *unicode, - PyObject *mapping) + PyObject *mapping) { if (!PyUnicode_Check(unicode) || mapping == NULL) { - PyErr_BadArgument(); - return NULL; + PyErr_BadArgument(); + return NULL; } return PyUnicode_EncodeCharmap(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - mapping, - NULL); + PyUnicode_GET_SIZE(unicode), + mapping, + NULL); } /* create or adjust a UnicodeTranslateError */ static void make_translate_exception(PyObject **exceptionObject, - const Py_UNICODE *unicode, Py_ssize_t size, - Py_ssize_t startpos, Py_ssize_t endpos, - const char *reason) + const Py_UNICODE *unicode, Py_ssize_t size, + Py_ssize_t startpos, Py_ssize_t endpos, + const char *reason) { if (*exceptionObject == NULL) { - *exceptionObject = PyUnicodeTranslateError_Create( - unicode, size, startpos, endpos, reason); + *exceptionObject = PyUnicodeTranslateError_Create( + unicode, size, startpos, endpos, reason); } else { - if (PyUnicodeTranslateError_SetStart(*exceptionObject, startpos)) - goto onError; - if (PyUnicodeTranslateError_SetEnd(*exceptionObject, endpos)) - goto onError; - if (PyUnicodeTranslateError_SetReason(*exceptionObject, reason)) - goto onError; - return; - onError: - Py_DECREF(*exceptionObject); - *exceptionObject = NULL; + if (PyUnicodeTranslateError_SetStart(*exceptionObject, startpos)) + goto onError; + if (PyUnicodeTranslateError_SetEnd(*exceptionObject, endpos)) + goto onError; + if (PyUnicodeTranslateError_SetReason(*exceptionObject, reason)) + goto onError; + return; + onError: + Py_DECREF(*exceptionObject); + *exceptionObject = NULL; } } /* raises a UnicodeTranslateError */ static void raise_translate_exception(PyObject **exceptionObject, - const Py_UNICODE *unicode, Py_ssize_t size, - Py_ssize_t startpos, Py_ssize_t endpos, - const char *reason) + const Py_UNICODE *unicode, Py_ssize_t size, + Py_ssize_t startpos, Py_ssize_t endpos, + const char *reason) { make_translate_exception(exceptionObject, - unicode, size, startpos, endpos, reason); + unicode, size, startpos, endpos, reason); if (*exceptionObject != NULL) - PyCodec_StrictErrors(*exceptionObject); + PyCodec_StrictErrors(*exceptionObject); } /* error handling callback helper: @@ -5100,11 +5100,11 @@ put the result into newpos and return the replacement string, which has to be freed by the caller */ static PyObject *unicode_translate_call_errorhandler(const char *errors, - PyObject **errorHandler, - 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 *reason, + const Py_UNICODE *unicode, Py_ssize_t size, PyObject **exceptionObject, + Py_ssize_t startpos, Py_ssize_t endpos, + Py_ssize_t *newpos) { static char *argparse = "O!n;translating error handler must return (str, int) tuple"; @@ -5113,38 +5113,38 @@ PyObject *resunicode; if (*errorHandler == NULL) { - *errorHandler = PyCodec_LookupError(errors); + *errorHandler = PyCodec_LookupError(errors); if (*errorHandler == NULL) - return NULL; + return NULL; } make_translate_exception(exceptionObject, - unicode, size, startpos, endpos, reason); + unicode, size, startpos, endpos, reason); if (*exceptionObject == NULL) - return NULL; + return NULL; restuple = PyObject_CallFunctionObjArgs( - *errorHandler, *exceptionObject, NULL); + *errorHandler, *exceptionObject, NULL); if (restuple == NULL) - return NULL; + return NULL; if (!PyTuple_Check(restuple)) { - PyErr_Format(PyExc_TypeError, &argparse[4]); - Py_DECREF(restuple); - return NULL; + PyErr_Format(PyExc_TypeError, &argparse[4]); + Py_DECREF(restuple); + return NULL; } if (!PyArg_ParseTuple(restuple, argparse, &PyUnicode_Type, - &resunicode, &i_newpos)) { - Py_DECREF(restuple); - return NULL; + &resunicode, &i_newpos)) { + Py_DECREF(restuple); + return NULL; } if (i_newpos<0) - *newpos = size+i_newpos; + *newpos = size+i_newpos; else *newpos = i_newpos; if (*newpos<0 || *newpos>size) { - PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", *newpos); - Py_DECREF(restuple); - return NULL; + PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", *newpos); + Py_DECREF(restuple); + return NULL; } Py_INCREF(resunicode); Py_DECREF(restuple); @@ -5161,63 +5161,63 @@ PyObject *x; if (w == NULL) - return -1; + return -1; x = PyObject_GetItem(mapping, w); Py_DECREF(w); if (x == NULL) { - if (PyErr_ExceptionMatches(PyExc_LookupError)) { - /* No mapping found means: use 1:1 mapping. */ - PyErr_Clear(); - *result = NULL; - return 0; - } else - return -1; + if (PyErr_ExceptionMatches(PyExc_LookupError)) { + /* No mapping found means: use 1:1 mapping. */ + PyErr_Clear(); + *result = NULL; + return 0; + } else + return -1; } else if (x == Py_None) { - *result = x; - return 0; + *result = x; + return 0; } else if (PyLong_Check(x)) { - long value = PyLong_AS_LONG(x); - long max = PyUnicode_GetMax(); - if (value < 0 || value > max) { - PyErr_Format(PyExc_TypeError, + long value = PyLong_AS_LONG(x); + long max = PyUnicode_GetMax(); + if (value < 0 || value > max) { + PyErr_Format(PyExc_TypeError, "character mapping must be in range(0x%x)", max+1); - Py_DECREF(x); - return -1; - } - *result = x; - return 0; + Py_DECREF(x); + return -1; + } + *result = x; + return 0; } else if (PyUnicode_Check(x)) { - *result = x; - return 0; + *result = x; + return 0; } else { - /* wrong return value */ - PyErr_SetString(PyExc_TypeError, - "character mapping must return integer, None or str"); - Py_DECREF(x); - return -1; + /* wrong return value */ + PyErr_SetString(PyExc_TypeError, + "character mapping must return integer, None or str"); + Py_DECREF(x); + return -1; } } /* ensure that *outobj is at least requiredsize characters long, -if not reallocate and adjust various state variables. -Return 0 on success, -1 on error */ + if not reallocate and adjust various state variables. + Return 0 on success, -1 on error */ static int charmaptranslate_makespace(PyObject **outobj, Py_UNICODE **outp, - Py_ssize_t requiredsize) + Py_ssize_t requiredsize) { Py_ssize_t oldsize = PyUnicode_GET_SIZE(*outobj); if (requiredsize > oldsize) { - /* remember old output position */ - Py_ssize_t outpos = *outp-PyUnicode_AS_UNICODE(*outobj); - /* exponentially overallocate to minimize reallocations */ - if (requiredsize < 2 * oldsize) - requiredsize = 2 * oldsize; - if (PyUnicode_Resize(outobj, requiredsize) < 0) - return -1; - *outp = PyUnicode_AS_UNICODE(*outobj) + outpos; + /* remember old output position */ + Py_ssize_t outpos = *outp-PyUnicode_AS_UNICODE(*outobj); + /* exponentially overallocate to minimize reallocations */ + if (requiredsize < 2 * oldsize) + requiredsize = 2 * oldsize; + if (PyUnicode_Resize(outobj, requiredsize) < 0) + return -1; + *outp = PyUnicode_AS_UNICODE(*outobj) + outpos; } return 0; } @@ -5229,47 +5229,47 @@ Return 0 on success, -1 on error. */ static int charmaptranslate_output(const Py_UNICODE *startinp, const Py_UNICODE *curinp, - Py_ssize_t insize, PyObject *mapping, PyObject **outobj, Py_UNICODE **outp, - PyObject **res) + Py_ssize_t insize, PyObject *mapping, PyObject **outobj, Py_UNICODE **outp, + PyObject **res) { if (charmaptranslate_lookup(*curinp, mapping, res)) - return -1; + return -1; if (*res==NULL) { - /* not found => default to 1:1 mapping */ - *(*outp)++ = *curinp; + /* not found => default to 1:1 mapping */ + *(*outp)++ = *curinp; } else if (*res==Py_None) - ; + ; else if (PyLong_Check(*res)) { - /* no overflow check, because we know that the space is enough */ - *(*outp)++ = (Py_UNICODE)PyLong_AS_LONG(*res); + /* no overflow check, because we know that the space is enough */ + *(*outp)++ = (Py_UNICODE)PyLong_AS_LONG(*res); } else if (PyUnicode_Check(*res)) { - Py_ssize_t repsize = PyUnicode_GET_SIZE(*res); - if (repsize==1) { - /* no overflow check, because we know that the space is enough */ - *(*outp)++ = *PyUnicode_AS_UNICODE(*res); - } - else if (repsize!=0) { - /* more than one character */ - Py_ssize_t requiredsize = (*outp-PyUnicode_AS_UNICODE(*outobj)) + - (insize - (curinp-startinp)) + - repsize - 1; - if (charmaptranslate_makespace(outobj, outp, requiredsize)) - return -1; - memcpy(*outp, PyUnicode_AS_UNICODE(*res), sizeof(Py_UNICODE)*repsize); - *outp += repsize; - } + Py_ssize_t repsize = PyUnicode_GET_SIZE(*res); + if (repsize==1) { + /* no overflow check, because we know that the space is enough */ + *(*outp)++ = *PyUnicode_AS_UNICODE(*res); + } + else if (repsize!=0) { + /* more than one character */ + Py_ssize_t requiredsize = (*outp-PyUnicode_AS_UNICODE(*outobj)) + + (insize - (curinp-startinp)) + + repsize - 1; + if (charmaptranslate_makespace(outobj, outp, requiredsize)) + return -1; + memcpy(*outp, PyUnicode_AS_UNICODE(*res), sizeof(Py_UNICODE)*repsize); + *outp += repsize; + } } else - return -1; + return -1; return 0; } PyObject *PyUnicode_TranslateCharmap(const Py_UNICODE *p, - Py_ssize_t size, - PyObject *mapping, - const char *errors) + Py_ssize_t size, + PyObject *mapping, + const char *errors) { /* output object */ PyObject *res = NULL; @@ -5289,119 +5289,119 @@ int known_errorHandler = -1; if (mapping == NULL) { - PyErr_BadArgument(); - return NULL; + PyErr_BadArgument(); + return NULL; } /* allocate enough for a simple 1:1 translation without replacements, if we need more, we'll resize */ res = PyUnicode_FromUnicode(NULL, size); if (res == NULL) - goto onError; + goto onError; if (size == 0) - return res; + return res; str = PyUnicode_AS_UNICODE(res); while (p adjust input pointer */ - ++p; - else { /* untranslatable character */ - PyObject *repunicode = NULL; /* initialize to prevent gcc warning */ - Py_ssize_t repsize; - Py_ssize_t newpos; - Py_UNICODE *uni2; - /* startpos for collecting untranslatable chars */ - const Py_UNICODE *collstart = p; - const Py_UNICODE *collend = p+1; - const Py_UNICODE *coll; - - /* find all untranslatable characters */ - while (collend < endp) { - if (charmaptranslate_lookup(*collend, mapping, &x)) - goto onError; - Py_XDECREF(x); - if (x!=Py_None) - break; - ++collend; - } - /* cache callback name lookup - * (if not done yet, i.e. it's the first error) */ - if (known_errorHandler==-1) { - if ((errors==NULL) || (!strcmp(errors, "strict"))) - known_errorHandler = 1; - else if (!strcmp(errors, "replace")) - known_errorHandler = 2; - else if (!strcmp(errors, "ignore")) - known_errorHandler = 3; - else if (!strcmp(errors, "xmlcharrefreplace")) - known_errorHandler = 4; - else - known_errorHandler = 0; - } - switch (known_errorHandler) { - case 1: /* strict */ - raise_translate_exception(&exc, startp, size, collstart-startp, collend-startp, reason); - goto onError; - case 2: /* replace */ - /* No need to check for space, this is a 1:1 replacement */ - for (coll = collstart; coll0; ++uni2) - *str++ = *uni2; - p = startp + newpos; - Py_DECREF(repunicode); - } - } + /* try to encode it */ + PyObject *x = NULL; + if (charmaptranslate_output(startp, p, size, mapping, &res, &str, &x)) { + Py_XDECREF(x); + goto onError; + } + Py_XDECREF(x); + if (x!=Py_None) /* it worked => adjust input pointer */ + ++p; + else { /* untranslatable character */ + PyObject *repunicode = NULL; /* initialize to prevent gcc warning */ + Py_ssize_t repsize; + Py_ssize_t newpos; + Py_UNICODE *uni2; + /* startpos for collecting untranslatable chars */ + const Py_UNICODE *collstart = p; + const Py_UNICODE *collend = p+1; + const Py_UNICODE *coll; + + /* find all untranslatable characters */ + while (collend < endp) { + if (charmaptranslate_lookup(*collend, mapping, &x)) + goto onError; + Py_XDECREF(x); + if (x!=Py_None) + break; + ++collend; + } + /* cache callback name lookup + * (if not done yet, i.e. it's the first error) */ + if (known_errorHandler==-1) { + if ((errors==NULL) || (!strcmp(errors, "strict"))) + known_errorHandler = 1; + else if (!strcmp(errors, "replace")) + known_errorHandler = 2; + else if (!strcmp(errors, "ignore")) + known_errorHandler = 3; + else if (!strcmp(errors, "xmlcharrefreplace")) + known_errorHandler = 4; + else + known_errorHandler = 0; + } + switch (known_errorHandler) { + case 1: /* strict */ + raise_translate_exception(&exc, startp, size, collstart-startp, collend-startp, reason); + goto onError; + case 2: /* replace */ + /* No need to check for space, this is a 1:1 replacement */ + for (coll = collstart; coll0; ++uni2) + *str++ = *uni2; + p = startp + newpos; + Py_DECREF(repunicode); + } + } } /* Resize if we allocated to much */ respos = str-PyUnicode_AS_UNICODE(res); if (respos= 0) { - *output++ = '0' + decimal; - ++p; - continue; - } - if (0 < ch && ch < 256) { - *output++ = (char)ch; - ++p; - continue; - } - /* All other characters are considered unencodable */ - collstart = p; - collend = p+1; - while (collend < end) { - if ((0 < *collend && *collend < 256) || - !Py_UNICODE_ISSPACE(*collend) || - Py_UNICODE_TODECIMAL(*collend)) - break; - } - /* cache callback name lookup - * (if not done yet, i.e. it's the first error) */ - if (known_errorHandler==-1) { - if ((errors==NULL) || (!strcmp(errors, "strict"))) - known_errorHandler = 1; - else if (!strcmp(errors, "replace")) - known_errorHandler = 2; - else if (!strcmp(errors, "ignore")) - known_errorHandler = 3; - else if (!strcmp(errors, "xmlcharrefreplace")) - known_errorHandler = 4; - else - known_errorHandler = 0; - } - switch (known_errorHandler) { - case 1: /* strict */ - raise_encode_exception(&exc, encoding, s, length, collstart-s, collend-s, reason); - goto onError; - case 2: /* replace */ - for (p = collstart; p < collend; ++p) - *output++ = '?'; - /* fall through */ - case 3: /* ignore */ - p = collend; - break; - case 4: /* xmlcharrefreplace */ - /* generate replacement (temporarily (mis)uses p) */ - for (p = collstart; p < collend; ++p) - output += sprintf(output, "&#%d;", (int)*p); - p = collend; - break; - default: - repunicode = unicode_encode_call_errorhandler(errors, &errorHandler, - encoding, reason, s, length, &exc, - collstart-s, collend-s, &newpos); - if (repunicode == NULL) - goto onError; - /* generate replacement */ - repsize = PyUnicode_GET_SIZE(repunicode); - for (uni2 = PyUnicode_AS_UNICODE(repunicode); repsize-->0; ++uni2) { - Py_UNICODE ch = *uni2; - if (Py_UNICODE_ISSPACE(ch)) - *output++ = ' '; - else { - decimal = Py_UNICODE_TODECIMAL(ch); - if (decimal >= 0) - *output++ = '0' + decimal; - else if (0 < ch && ch < 256) - *output++ = (char)ch; - else { - Py_DECREF(repunicode); - raise_encode_exception(&exc, encoding, - s, length, collstart-s, collend-s, reason); - goto onError; - } - } - } - p = s + newpos; - Py_DECREF(repunicode); - } + register Py_UNICODE ch = *p; + int decimal; + PyObject *repunicode; + Py_ssize_t repsize; + Py_ssize_t newpos; + Py_UNICODE *uni2; + Py_UNICODE *collstart; + Py_UNICODE *collend; + + if (Py_UNICODE_ISSPACE(ch)) { + *output++ = ' '; + ++p; + continue; + } + decimal = Py_UNICODE_TODECIMAL(ch); + if (decimal >= 0) { + *output++ = '0' + decimal; + ++p; + continue; + } + if (0 < ch && ch < 256) { + *output++ = (char)ch; + ++p; + continue; + } + /* All other characters are considered unencodable */ + collstart = p; + collend = p+1; + while (collend < end) { + if ((0 < *collend && *collend < 256) || + !Py_UNICODE_ISSPACE(*collend) || + Py_UNICODE_TODECIMAL(*collend)) + break; + } + /* cache callback name lookup + * (if not done yet, i.e. it's the first error) */ + if (known_errorHandler==-1) { + if ((errors==NULL) || (!strcmp(errors, "strict"))) + known_errorHandler = 1; + else if (!strcmp(errors, "replace")) + known_errorHandler = 2; + else if (!strcmp(errors, "ignore")) + known_errorHandler = 3; + else if (!strcmp(errors, "xmlcharrefreplace")) + known_errorHandler = 4; + else + known_errorHandler = 0; + } + switch (known_errorHandler) { + case 1: /* strict */ + raise_encode_exception(&exc, encoding, s, length, collstart-s, collend-s, reason); + goto onError; + case 2: /* replace */ + for (p = collstart; p < collend; ++p) + *output++ = '?'; + /* fall through */ + case 3: /* ignore */ + p = collend; + break; + case 4: /* xmlcharrefreplace */ + /* generate replacement (temporarily (mis)uses p) */ + for (p = collstart; p < collend; ++p) + output += sprintf(output, "&#%d;", (int)*p); + p = collend; + break; + default: + repunicode = unicode_encode_call_errorhandler(errors, &errorHandler, + encoding, reason, s, length, &exc, + collstart-s, collend-s, &newpos); + if (repunicode == NULL) + goto onError; + /* generate replacement */ + repsize = PyUnicode_GET_SIZE(repunicode); + for (uni2 = PyUnicode_AS_UNICODE(repunicode); repsize-->0; ++uni2) { + Py_UNICODE ch = *uni2; + if (Py_UNICODE_ISSPACE(ch)) + *output++ = ' '; + else { + decimal = Py_UNICODE_TODECIMAL(ch); + if (decimal >= 0) + *output++ = '0' + decimal; + else if (0 < ch && ch < 256) + *output++ = (char)ch; + else { + Py_DECREF(repunicode); + raise_encode_exception(&exc, encoding, + s, length, collstart-s, collend-s, reason); + goto onError; + } + } + } + p = s + newpos; + Py_DECREF(repunicode); + } } /* 0-terminate the output string */ *output++ = '\0'; @@ -5554,7 +5554,7 @@ Py_XDECREF(errorHandler); return 0; - onError: + onError: Py_XDECREF(exc); Py_XDECREF(errorHandler); return -1; @@ -5597,11 +5597,11 @@ str_obj = (PyUnicodeObject*) PyUnicode_FromObject(str); if (!str_obj) - return -1; + return -1; sub_obj = (PyUnicodeObject*) PyUnicode_FromObject(substr); if (!sub_obj) { - Py_DECREF(str_obj); - return -1; + Py_DECREF(str_obj); + return -1; } FIX_START_END(str_obj); @@ -5626,11 +5626,11 @@ str = PyUnicode_FromObject(str); if (!str) - return -2; + return -2; sub = PyUnicode_FromObject(sub); if (!sub) { - Py_DECREF(str); - return -2; + Py_DECREF(str); + return -2; } if (direction > 0) @@ -5654,10 +5654,10 @@ static int tailmatch(PyUnicodeObject *self, - PyUnicodeObject *substring, - Py_ssize_t start, - Py_ssize_t end, - int direction) + PyUnicodeObject *substring, + Py_ssize_t start, + Py_ssize_t end, + int direction) { if (substring->length == 0) return 1; @@ -5666,39 +5666,39 @@ end -= substring->length; if (end < start) - return 0; + return 0; if (direction > 0) { - if (Py_UNICODE_MATCH(self, end, substring)) - return 1; + if (Py_UNICODE_MATCH(self, end, substring)) + return 1; } else { if (Py_UNICODE_MATCH(self, start, substring)) - return 1; + return 1; } return 0; } Py_ssize_t PyUnicode_Tailmatch(PyObject *str, - PyObject *substr, - Py_ssize_t start, - Py_ssize_t end, - int direction) + PyObject *substr, + Py_ssize_t start, + Py_ssize_t end, + int direction) { Py_ssize_t result; str = PyUnicode_FromObject(str); if (str == NULL) - return -1; + return -1; substr = PyUnicode_FromObject(substr); if (substr == NULL) { - Py_DECREF(str); - return -1; + Py_DECREF(str); + return -1; } result = tailmatch((PyUnicodeObject *)str, - (PyUnicodeObject *)substr, - start, end, direction); + (PyUnicodeObject *)substr, + start, end, direction); Py_DECREF(str); Py_DECREF(substr); return result; @@ -5709,24 +5709,24 @@ static PyObject *fixup(PyUnicodeObject *self, - int (*fixfct)(PyUnicodeObject *s)) + int (*fixfct)(PyUnicodeObject *s)) { PyUnicodeObject *u; u = (PyUnicodeObject*) PyUnicode_FromUnicode(NULL, self->length); if (u == NULL) - return NULL; + return NULL; Py_UNICODE_COPY(u->str, self->str, self->length); if (!fixfct(u) && PyUnicode_CheckExact(self)) { - /* fixfct should return TRUE if it modified the buffer. If - FALSE, return a reference to the original buffer instead - (to save space, not time) */ - Py_INCREF(self); - Py_DECREF(u); - return (PyObject*) self; + /* fixfct should return TRUE if it modified the buffer. If + FALSE, return a reference to the original buffer instead + (to save space, not time) */ + Py_INCREF(self); + Py_DECREF(u); + return (PyObject*) self; } return (PyObject*) u; } @@ -5739,13 +5739,13 @@ int status = 0; while (len-- > 0) { - register Py_UNICODE ch; + register Py_UNICODE ch; - ch = Py_UNICODE_TOUPPER(*s); - if (ch != *s) { + ch = Py_UNICODE_TOUPPER(*s); + if (ch != *s) { status = 1; - *s = ch; - } + *s = ch; + } s++; } @@ -5760,13 +5760,13 @@ int status = 0; while (len-- > 0) { - register Py_UNICODE ch; + register Py_UNICODE ch; - ch = Py_UNICODE_TOLOWER(*s); - if (ch != *s) { + ch = Py_UNICODE_TOLOWER(*s); + if (ch != *s) { status = 1; - *s = ch; - } + *s = ch; + } s++; } @@ -5802,10 +5802,10 @@ int status = 0; if (len == 0) - return 0; + return 0; if (Py_UNICODE_ISLOWER(*s)) { - *s = Py_UNICODE_TOUPPER(*s); - status = 1; + *s = Py_UNICODE_TOUPPER(*s); + status = 1; } s++; while (--len > 0) { @@ -5827,31 +5827,31 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1) { - Py_UNICODE ch = Py_UNICODE_TOTITLE(*p); - if (*p != ch) { - *p = ch; - return 1; - } - else - return 0; + Py_UNICODE ch = Py_UNICODE_TOTITLE(*p); + if (*p != ch) { + *p = ch; + return 1; + } + else + return 0; } e = p + PyUnicode_GET_SIZE(self); previous_is_cased = 0; for (; p < e; p++) { - register const Py_UNICODE ch = *p; + register const Py_UNICODE ch = *p; - if (previous_is_cased) - *p = Py_UNICODE_TOLOWER(ch); - else - *p = Py_UNICODE_TOTITLE(ch); - - if (Py_UNICODE_ISLOWER(ch) || - Py_UNICODE_ISUPPER(ch) || - Py_UNICODE_ISTITLE(ch)) - previous_is_cased = 1; - else - previous_is_cased = 0; + if (previous_is_cased) + *p = Py_UNICODE_TOLOWER(ch); + else + *p = Py_UNICODE_TOTITLE(ch); + + if (Py_UNICODE_ISLOWER(ch) || + Py_UNICODE_ISUPPER(ch) || + Py_UNICODE_ISTITLE(ch)) + previous_is_cased = 1; + else + previous_is_cased = 0; } return 1; } @@ -5872,7 +5872,7 @@ fseq = PySequence_Fast(seq, ""); if (fseq == NULL) { - return NULL; + return NULL; } /* NOTE: the following code can't call back into Python code, @@ -5882,18 +5882,18 @@ seqlen = PySequence_Fast_GET_SIZE(fseq); /* If empty sequence, return u"". */ if (seqlen == 0) { - res = _PyUnicode_New(0); /* empty sequence; return u"" */ - goto Done; + res = _PyUnicode_New(0); /* empty sequence; return u"" */ + goto Done; } items = PySequence_Fast_ITEMS(fseq); /* If singleton sequence with an exact Unicode, return that. */ if (seqlen == 1) { - item = items[0]; - if (PyUnicode_CheckExact(item)) { - Py_INCREF(item); - res = (PyUnicodeObject *)item; - goto Done; - } + item = items[0]; + if (PyUnicode_CheckExact(item)) { + Py_INCREF(item); + res = (PyUnicodeObject *)item; + goto Done; + } } else { /* Set up sep and seplen */ @@ -5923,19 +5923,19 @@ for (i = 0; i < seqlen; i++) { const Py_ssize_t old_sz = sz; item = items[i]; - if (!PyUnicode_Check(item)) { - PyErr_Format(PyExc_TypeError, - "sequence item %zd: expected str instance," - " %.80s found", - i, Py_TYPE(item)->tp_name); - goto onError; - } + if (!PyUnicode_Check(item)) { + PyErr_Format(PyExc_TypeError, + "sequence item %zd: expected str instance," + " %.80s found", + i, Py_TYPE(item)->tp_name); + goto onError; + } sz += PyUnicode_GET_SIZE(item); if (i != 0) sz += seplen; if (sz < old_sz || sz > PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, - "join() result is too long for a Python string"); + "join() result is too long for a Python string"); goto onError; } } @@ -5950,20 +5950,20 @@ Py_ssize_t itemlen; item = items[i]; itemlen = PyUnicode_GET_SIZE(item); - /* Copy item, and maybe the separator. */ - if (i) { - Py_UNICODE_COPY(res_p, sep, seplen); - res_p += seplen; - } - Py_UNICODE_COPY(res_p, PyUnicode_AS_UNICODE(item), itemlen); - res_p += itemlen; + /* Copy item, and maybe the separator. */ + if (i) { + Py_UNICODE_COPY(res_p, sep, seplen); + res_p += seplen; + } + Py_UNICODE_COPY(res_p, PyUnicode_AS_UNICODE(item), itemlen); + res_p += itemlen; } - Done: + Done: Py_DECREF(fseq); return (PyObject *)res; - onError: + onError: Py_DECREF(fseq); Py_XDECREF(res); return NULL; @@ -5971,9 +5971,9 @@ static PyUnicodeObject *pad(PyUnicodeObject *self, - Py_ssize_t left, - Py_ssize_t right, - Py_UNICODE fill) + Py_ssize_t left, + Py_ssize_t right, + Py_UNICODE fill) { PyUnicodeObject *u; @@ -6004,21 +6004,21 @@ return u; } -#define SPLIT_APPEND(data, left, right) \ - str = PyUnicode_FromUnicode((data) + (left), (right) - (left)); \ - if (!str) \ - goto onError; \ - if (PyList_Append(list, str)) { \ - Py_DECREF(str); \ - goto onError; \ - } \ - else \ - Py_DECREF(str); +#define SPLIT_APPEND(data, left, right) \ + str = PyUnicode_FromUnicode((data) + (left), (right) - (left)); \ + if (!str) \ + goto onError; \ + if (PyList_Append(list, str)) { \ + Py_DECREF(str); \ + goto onError; \ + } \ + else \ + Py_DECREF(str); static PyObject *split_whitespace(PyUnicodeObject *self, - PyObject *list, - Py_ssize_t maxcount) + PyObject *list, + Py_ssize_t maxcount) { register Py_ssize_t i; register Py_ssize_t j; @@ -6027,33 +6027,33 @@ register const Py_UNICODE *buf = self->str; for (i = j = 0; i < len; ) { - /* find a token */ - while (i < len && Py_UNICODE_ISSPACE(buf[i])) - i++; - j = i; - while (i < len && !Py_UNICODE_ISSPACE(buf[i])) - i++; - if (j < i) { - if (maxcount-- <= 0) - break; - SPLIT_APPEND(buf, j, i); - while (i < len && Py_UNICODE_ISSPACE(buf[i])) - i++; - j = i; - } + /* find a token */ + while (i < len && Py_UNICODE_ISSPACE(buf[i])) + i++; + j = i; + while (i < len && !Py_UNICODE_ISSPACE(buf[i])) + i++; + if (j < i) { + if (maxcount-- <= 0) + break; + SPLIT_APPEND(buf, j, i); + while (i < len && Py_UNICODE_ISSPACE(buf[i])) + i++; + j = i; + } } if (j < len) { - SPLIT_APPEND(buf, j, len); + SPLIT_APPEND(buf, j, len); } return list; - onError: + onError: Py_DECREF(list); return NULL; } PyObject *PyUnicode_Splitlines(PyObject *string, - int keepends) + int keepends) { register Py_ssize_t i; register Py_ssize_t j; @@ -6064,7 +6064,7 @@ string = PyUnicode_FromObject(string); if (string == NULL) - return NULL; + return NULL; data = PyUnicode_AS_UNICODE(string); len = PyUnicode_GET_SIZE(string); @@ -6073,34 +6073,34 @@ goto onError; for (i = j = 0; i < len; ) { - Py_ssize_t eol; + Py_ssize_t eol; - /* Find a line and append it */ - while (i < len && !BLOOM_LINEBREAK(data[i])) - i++; - - /* Skip the line break reading CRLF as one line break */ - eol = i; - if (i < len) { - if (data[i] == '\r' && i + 1 < len && - data[i+1] == '\n') - i += 2; - else - i++; - if (keepends) - eol = i; - } - SPLIT_APPEND(data, j, eol); - j = i; + /* Find a line and append it */ + while (i < len && !BLOOM_LINEBREAK(data[i])) + i++; + + /* Skip the line break reading CRLF as one line break */ + eol = i; + if (i < len) { + if (data[i] == '\r' && i + 1 < len && + data[i+1] == '\n') + i += 2; + else + i++; + if (keepends) + eol = i; + } + SPLIT_APPEND(data, j, eol); + j = i; } if (j < len) { - SPLIT_APPEND(data, j, len); + SPLIT_APPEND(data, j, len); } Py_DECREF(string); return list; - onError: + onError: Py_XDECREF(list); Py_DECREF(string); return NULL; @@ -6108,9 +6108,9 @@ static PyObject *split_char(PyUnicodeObject *self, - PyObject *list, - Py_UNICODE ch, - Py_ssize_t maxcount) + PyObject *list, + Py_UNICODE ch, + Py_ssize_t maxcount) { register Py_ssize_t i; register Py_ssize_t j; @@ -6119,29 +6119,29 @@ register const Py_UNICODE *buf = self->str; for (i = j = 0; i < len; ) { - if (buf[i] == ch) { - if (maxcount-- <= 0) - break; - SPLIT_APPEND(buf, j, i); - i = j = i + 1; - } else - i++; + if (buf[i] == ch) { + if (maxcount-- <= 0) + break; + SPLIT_APPEND(buf, j, i); + i = j = i + 1; + } else + i++; } if (j <= len) { - SPLIT_APPEND(buf, j, len); + SPLIT_APPEND(buf, j, len); } return list; - onError: + onError: Py_DECREF(list); return NULL; } static PyObject *split_substring(PyUnicodeObject *self, - PyObject *list, - PyUnicodeObject *substring, - Py_ssize_t maxcount) + PyObject *list, + PyUnicodeObject *substring, + Py_ssize_t maxcount) { register Py_ssize_t i; register Py_ssize_t j; @@ -6150,28 +6150,28 @@ PyObject *str; for (i = j = 0; i <= len - sublen; ) { - if (Py_UNICODE_MATCH(self, i, substring)) { - if (maxcount-- <= 0) - break; - SPLIT_APPEND(self->str, j, i); - i = j = i + sublen; - } else - i++; + if (Py_UNICODE_MATCH(self, i, substring)) { + if (maxcount-- <= 0) + break; + SPLIT_APPEND(self->str, j, i); + i = j = i + sublen; + } else + i++; } if (j <= len) { - SPLIT_APPEND(self->str, j, len); + SPLIT_APPEND(self->str, j, len); } return list; - onError: + onError: Py_DECREF(list); return NULL; } static PyObject *rsplit_whitespace(PyUnicodeObject *self, - PyObject *list, - Py_ssize_t maxcount) + PyObject *list, + Py_ssize_t maxcount) { register Py_ssize_t i; register Py_ssize_t j; @@ -6180,38 +6180,38 @@ register const Py_UNICODE *buf = self->str; for (i = j = len - 1; i >= 0; ) { - /* find a token */ - while (i >= 0 && Py_UNICODE_ISSPACE(buf[i])) - i--; - j = i; - while (i >= 0 && !Py_UNICODE_ISSPACE(buf[i])) - i--; - if (j > i) { - if (maxcount-- <= 0) - break; - SPLIT_APPEND(buf, i + 1, j + 1); - while (i >= 0 && Py_UNICODE_ISSPACE(buf[i])) - i--; - j = i; - } + /* find a token */ + while (i >= 0 && Py_UNICODE_ISSPACE(buf[i])) + i--; + j = i; + while (i >= 0 && !Py_UNICODE_ISSPACE(buf[i])) + i--; + if (j > i) { + if (maxcount-- <= 0) + break; + SPLIT_APPEND(buf, i + 1, j + 1); + while (i >= 0 && Py_UNICODE_ISSPACE(buf[i])) + i--; + j = i; + } } if (j >= 0) { - SPLIT_APPEND(buf, 0, j + 1); + SPLIT_APPEND(buf, 0, j + 1); } if (PyList_Reverse(list) < 0) goto onError; return list; - onError: + onError: Py_DECREF(list); return NULL; } -static +static PyObject *rsplit_char(PyUnicodeObject *self, - PyObject *list, - Py_UNICODE ch, - Py_ssize_t maxcount) + PyObject *list, + Py_UNICODE ch, + Py_ssize_t maxcount) { register Py_ssize_t i; register Py_ssize_t j; @@ -6220,31 +6220,31 @@ register const Py_UNICODE *buf = self->str; for (i = j = len - 1; i >= 0; ) { - if (buf[i] == ch) { - if (maxcount-- <= 0) - break; - SPLIT_APPEND(buf, i + 1, j + 1); - j = i = i - 1; - } else - i--; + if (buf[i] == ch) { + if (maxcount-- <= 0) + break; + SPLIT_APPEND(buf, i + 1, j + 1); + j = i = i - 1; + } else + i--; } if (j >= -1) { - SPLIT_APPEND(buf, 0, j + 1); + SPLIT_APPEND(buf, 0, j + 1); } if (PyList_Reverse(list) < 0) goto onError; return list; - onError: + onError: Py_DECREF(list); return NULL; } -static +static PyObject *rsplit_substring(PyUnicodeObject *self, - PyObject *list, - PyUnicodeObject *substring, - Py_ssize_t maxcount) + PyObject *list, + PyUnicodeObject *substring, + Py_ssize_t maxcount) { register Py_ssize_t i; register Py_ssize_t j; @@ -6253,23 +6253,23 @@ PyObject *str; for (i = len - sublen, j = len; i >= 0; ) { - if (Py_UNICODE_MATCH(self, i, substring)) { - if (maxcount-- <= 0) - break; - SPLIT_APPEND(self->str, i + sublen, j); - j = i; - i -= sublen; - } else - i--; + if (Py_UNICODE_MATCH(self, i, substring)) { + if (maxcount-- <= 0) + break; + SPLIT_APPEND(self->str, i + sublen, j); + j = i; + i -= sublen; + } else + i--; } if (j >= 0) { - SPLIT_APPEND(self->str, 0, j); + SPLIT_APPEND(self->str, 0, j); } if (PyList_Reverse(list) < 0) goto onError; return list; - onError: + onError: Py_DECREF(list); return NULL; } @@ -6278,8 +6278,8 @@ static PyObject *split(PyUnicodeObject *self, - PyUnicodeObject *substring, - Py_ssize_t maxcount) + PyUnicodeObject *substring, + Py_ssize_t maxcount) { PyObject *list; @@ -6291,24 +6291,24 @@ return NULL; if (substring == NULL) - return split_whitespace(self,list,maxcount); + return split_whitespace(self,list,maxcount); else if (substring->length == 1) - return split_char(self,list,substring->str[0],maxcount); + return split_char(self,list,substring->str[0],maxcount); else if (substring->length == 0) { - Py_DECREF(list); - PyErr_SetString(PyExc_ValueError, "empty separator"); - return NULL; + Py_DECREF(list); + PyErr_SetString(PyExc_ValueError, "empty separator"); + return NULL; } else - return split_substring(self,list,substring,maxcount); + return split_substring(self,list,substring,maxcount); } static PyObject *rsplit(PyUnicodeObject *self, - PyUnicodeObject *substring, - Py_ssize_t maxcount) + PyUnicodeObject *substring, + Py_ssize_t maxcount) { PyObject *list; @@ -6320,30 +6320,30 @@ return NULL; if (substring == NULL) - return rsplit_whitespace(self,list,maxcount); + return rsplit_whitespace(self,list,maxcount); else if (substring->length == 1) - return rsplit_char(self,list,substring->str[0],maxcount); + return rsplit_char(self,list,substring->str[0],maxcount); else if (substring->length == 0) { - Py_DECREF(list); - PyErr_SetString(PyExc_ValueError, "empty separator"); - return NULL; + Py_DECREF(list); + PyErr_SetString(PyExc_ValueError, "empty separator"); + return NULL; } else - return rsplit_substring(self,list,substring,maxcount); + return rsplit_substring(self,list,substring,maxcount); } static PyObject *replace(PyUnicodeObject *self, - PyUnicodeObject *str1, - PyUnicodeObject *str2, - Py_ssize_t maxcount) + PyUnicodeObject *str1, + PyUnicodeObject *str2, + Py_ssize_t maxcount) { PyUnicodeObject *u; if (maxcount < 0) - maxcount = PY_SSIZE_T_MAX; + maxcount = PY_SSIZE_T_MAX; if (str1->length == str2->length) { /* same length */ @@ -6429,7 +6429,7 @@ break; j++; } - if (j > i) { + if (j > i) { if (j > e) break; /* copy unchanged part [i:j] */ @@ -6460,7 +6460,7 @@ } return (PyObject *) u; -nothing: + nothing: /* nothing to replace; return original string (when possible) */ if (PyUnicode_CheckExact(self)) { Py_INCREF(self); @@ -6472,7 +6472,7 @@ /* --- Unicode Object Methods --------------------------------------------- */ PyDoc_STRVAR(title__doc__, -"S.title() -> str\n\ + "S.title() -> str\n\ \n\ Return a titlecased version of S, i.e. words start with title case\n\ characters, all remaining cased characters have lower case."); @@ -6484,7 +6484,7 @@ } PyDoc_STRVAR(capitalize__doc__, -"S.capitalize() -> str\n\ + "S.capitalize() -> str\n\ \n\ Return a capitalized version of S, i.e. make the first character\n\ have upper case."); @@ -6497,7 +6497,7 @@ #if 0 PyDoc_STRVAR(capwords__doc__, -"S.capwords() -> str\n\ + "S.capwords() -> str\n\ \n\ Apply .capitalize() to all words in S and return the result with\n\ normalized whitespace (all whitespace strings are replaced by ' ')."); @@ -6517,7 +6517,7 @@ /* Capitalize each word */ for (i = 0; i < PyList_GET_SIZE(list); i++) { item = fixup((PyUnicodeObject *)PyList_GET_ITEM(list, i), - fixcapitalize); + fixcapitalize); if (item == NULL) goto onError; Py_DECREF(PyList_GET_ITEM(list, i)); @@ -6527,7 +6527,7 @@ /* Join the words to form a new string */ item = PyUnicode_Join(NULL, list); -onError: + onError: Py_DECREF(list); return (PyObject *)item; } @@ -6538,30 +6538,30 @@ static int convert_uc(PyObject *obj, void *addr) { - Py_UNICODE *fillcharloc = (Py_UNICODE *)addr; - PyObject *uniobj; - Py_UNICODE *unistr; - - uniobj = PyUnicode_FromObject(obj); - if (uniobj == NULL) { - PyErr_SetString(PyExc_TypeError, - "The fill character cannot be converted to Unicode"); - return 0; - } - if (PyUnicode_GET_SIZE(uniobj) != 1) { - PyErr_SetString(PyExc_TypeError, - "The fill character must be exactly one character long"); - Py_DECREF(uniobj); - return 0; - } - unistr = PyUnicode_AS_UNICODE(uniobj); - *fillcharloc = unistr[0]; - Py_DECREF(uniobj); - return 1; + Py_UNICODE *fillcharloc = (Py_UNICODE *)addr; + PyObject *uniobj; + Py_UNICODE *unistr; + + uniobj = PyUnicode_FromObject(obj); + if (uniobj == NULL) { + PyErr_SetString(PyExc_TypeError, + "The fill character cannot be converted to Unicode"); + return 0; + } + if (PyUnicode_GET_SIZE(uniobj) != 1) { + PyErr_SetString(PyExc_TypeError, + "The fill character must be exactly one character long"); + Py_DECREF(uniobj); + return 0; + } + unistr = PyUnicode_AS_UNICODE(uniobj); + *fillcharloc = unistr[0]; + Py_DECREF(uniobj); + return 1; } PyDoc_STRVAR(center__doc__, -"S.center(width[, fillchar]) -> str\n\ + "S.center(width[, fillchar]) -> str\n\ \n\ Return S centered in a string of length width. Padding is\n\ done using the specified fill character (default is a space)"); @@ -6622,9 +6622,9 @@ c1 = *s1++; c2 = *s2++; - if (c1 > (1<<11) * 26) - c1 += utf16Fixup[c1>>11]; - if (c2 > (1<<11) * 26) + if (c1 > (1<<11) * 26) + c1 += utf16Fixup[c1>>11]; + if (c2 > (1<<11) * 26) c2 += utf16Fixup[c2>>11]; /* now c1 and c2 are in UTF-32-compatible order */ @@ -6668,7 +6668,7 @@ #endif int PyUnicode_Compare(PyObject *left, - PyObject *right) + PyObject *right) { if (PyUnicode_Check(left) && PyUnicode_Check(right)) return unicode_compare((PyUnicodeObject *)left, @@ -6689,25 +6689,25 @@ id = PyUnicode_AS_UNICODE(uni); /* Compare Unicode string and source character set string */ for (i = 0; id[i] && str[i]; i++) - if (id[i] != str[i]) - return ((int)id[i] < (int)str[i]) ? -1 : 1; + if (id[i] != str[i]) + return ((int)id[i] < (int)str[i]) ? -1 : 1; if (id[i]) - return 1; /* uni is longer */ + return 1; /* uni is longer */ if (str[i]) - return -1; /* str is longer */ + return -1; /* str is longer */ return 0; } -#define TEST_COND(cond) \ - ((cond) ? Py_True : Py_False) +#define TEST_COND(cond) \ + ((cond) ? Py_True : Py_False) PyObject *PyUnicode_RichCompare(PyObject *left, PyObject *right, int op) { int result; - + if (PyUnicode_Check(left) && PyUnicode_Check(right)) { PyObject *v; if (((PyUnicodeObject *) left)->length != @@ -6726,7 +6726,7 @@ else result = unicode_compare((PyUnicodeObject *)left, (PyUnicodeObject *)right); - + /* Convert the return value to a Boolean */ switch (op) { case Py_EQ: @@ -6754,13 +6754,13 @@ Py_INCREF(v); return v; } - + Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } int PyUnicode_Contains(PyObject *container, - PyObject *element) + PyObject *element) { PyObject *str, *sub; int result; @@ -6768,9 +6768,9 @@ /* Coerce the two arguments */ sub = PyUnicode_FromObject(element); if (!sub) { - PyErr_Format(PyExc_TypeError, - "'in ' requires string as left operand, not %s", - element->ob_type->tp_name); + PyErr_Format(PyExc_TypeError, + "'in ' requires string as left operand, not %s", + element->ob_type->tp_name); return -1; } @@ -6791,32 +6791,32 @@ /* Concat to string or Unicode object giving a new Unicode object. */ PyObject *PyUnicode_Concat(PyObject *left, - PyObject *right) + PyObject *right) { PyUnicodeObject *u = NULL, *v = NULL, *w; /* Coerce the two arguments */ u = (PyUnicodeObject *)PyUnicode_FromObject(left); if (u == NULL) - goto onError; + goto onError; v = (PyUnicodeObject *)PyUnicode_FromObject(right); if (v == NULL) - goto onError; + goto onError; /* Shortcuts */ if (v == unicode_empty) { - Py_DECREF(v); - return (PyObject *)u; + Py_DECREF(v); + return (PyObject *)u; } if (u == unicode_empty) { - Py_DECREF(u); - return (PyObject *)v; + Py_DECREF(u); + return (PyObject *)v; } /* Concat the two Unicode strings */ w = _PyUnicode_New(u->length + v->length); if (w == NULL) - goto onError; + goto onError; Py_UNICODE_COPY(w->str, u->str, u->length); Py_UNICODE_COPY(w->str + u->length, v->str, v->length); @@ -6824,7 +6824,7 @@ Py_DECREF(v); return (PyObject *)w; -onError: + onError: Py_XDECREF(u); Py_XDECREF(v); return NULL; @@ -6833,28 +6833,28 @@ void PyUnicode_Append(PyObject **pleft, PyObject *right) { - PyObject *new; - if (*pleft == NULL) - return; - if (right == NULL || !PyUnicode_Check(*pleft)) { - Py_DECREF(*pleft); - *pleft = NULL; - return; - } - new = PyUnicode_Concat(*pleft, right); - Py_DECREF(*pleft); - *pleft = new; + PyObject *new; + if (*pleft == NULL) + return; + if (right == NULL || !PyUnicode_Check(*pleft)) { + Py_DECREF(*pleft); + *pleft = NULL; + return; + } + new = PyUnicode_Concat(*pleft, right); + Py_DECREF(*pleft); + *pleft = new; } void PyUnicode_AppendAndDel(PyObject **pleft, PyObject *right) { - PyUnicode_Append(pleft, right); - Py_XDECREF(right); + PyUnicode_Append(pleft, right); + Py_XDECREF(right); } PyDoc_STRVAR(count__doc__, -"S.count(sub[, start[, end]]) -> int\n\ + "S.count(sub[, start[, end]]) -> int\n\ \n\ Return the number of non-overlapping occurrences of substring sub in\n\ string S[start:end]. Optional arguments start and end are\n\ @@ -6869,13 +6869,13 @@ PyObject *result; if (!PyArg_ParseTuple(args, "O|O&O&:count", &substring, - _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) + _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) return NULL; substring = (PyUnicodeObject *)PyUnicode_FromObject( (PyObject *)substring); if (substring == NULL) - return NULL; + return NULL; FIX_START_END(self); @@ -6890,7 +6890,7 @@ } PyDoc_STRVAR(encode__doc__, -"S.encode([encoding[, errors]]) -> bytes\n\ + "S.encode([encoding[, errors]]) -> bytes\n\ \n\ Encode S using the codec registered for encoding. encoding defaults\n\ to the default encoding. errors may be given to set a different error\n\ @@ -6921,12 +6921,12 @@ } return v; - onError: + onError: return NULL; } PyDoc_STRVAR(expandtabs__doc__, -"S.expandtabs([tabsize]) -> str\n\ + "S.expandtabs([tabsize]) -> str\n\ \n\ Return a copy of S where all tab characters are expanded using spaces.\n\ If tabsize is not given, a tab size of 8 characters is assumed."); @@ -6943,7 +6943,7 @@ int tabsize = 8; if (!PyArg_ParseTuple(args, "|i:expandtabs", &tabsize)) - return NULL; + return NULL; /* First pass: determine size of output string */ i = 0; /* chars up to and including most recent \n or \r */ @@ -6951,27 +6951,27 @@ e = self->str + self->length; /* end of input */ for (p = self->str; p < e; p++) if (*p == '\t') { - if (tabsize > 0) { - incr = tabsize - (j % tabsize); /* cannot overflow */ - if (j > PY_SSIZE_T_MAX - incr) - goto overflow1; - j += incr; + if (tabsize > 0) { + incr = tabsize - (j % tabsize); /* cannot overflow */ + if (j > PY_SSIZE_T_MAX - incr) + goto overflow1; + j += incr; } - } + } else { - if (j > PY_SSIZE_T_MAX - 1) - goto overflow1; + if (j > PY_SSIZE_T_MAX - 1) + goto overflow1; j++; if (*p == '\n' || *p == '\r') { - if (i > PY_SSIZE_T_MAX - j) - goto overflow1; + if (i > PY_SSIZE_T_MAX - j) + goto overflow1; i += j; j = 0; } } if (i > PY_SSIZE_T_MAX - j) - goto overflow1; + goto overflow1; /* Second pass: create output string and fill it */ u = _PyUnicode_New(i + j); @@ -6984,20 +6984,20 @@ for (p = self->str; p < e; p++) if (*p == '\t') { - if (tabsize > 0) { - i = tabsize - (j % tabsize); - j += i; - while (i--) { - if (q >= qe) - goto overflow2; - *q++ = ' '; - } - } - } - else { - if (q >= qe) - goto overflow2; - *q++ = *p; + if (tabsize > 0) { + i = tabsize - (j % tabsize); + j += i; + while (i--) { + if (q >= qe) + goto overflow2; + *q++ = ' '; + } + } + } + else { + if (q >= qe) + goto overflow2; + *q++ = *p; j++; if (*p == '\n' || *p == '\r') j = 0; @@ -7013,7 +7013,7 @@ } PyDoc_STRVAR(find__doc__, -"S.find(sub[, start[, end]]) -> int\n\ + "S.find(sub[, start[, end]]) -> int\n\ \n\ Return the lowest index in S where substring sub is found,\n\ such that sub is contained within s[start:end]. Optional\n\ @@ -7078,7 +7078,7 @@ } PyDoc_STRVAR(index__doc__, -"S.index(sub[, start[, end]]) -> int\n\ + "S.index(sub[, start[, end]]) -> int\n\ \n\ Like S.find() but raise ValueError when the substring is not found."); @@ -7110,7 +7110,7 @@ } PyDoc_STRVAR(islower__doc__, -"S.islower() -> bool\n\ + "S.islower() -> bool\n\ \n\ Return True if all cased characters in S are lowercase and there is\n\ at least one cased character in S, False otherwise."); @@ -7124,27 +7124,27 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1) - return PyBool_FromLong(Py_UNICODE_ISLOWER(*p)); + return PyBool_FromLong(Py_UNICODE_ISLOWER(*p)); /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return PyBool_FromLong(0); + return PyBool_FromLong(0); e = p + PyUnicode_GET_SIZE(self); cased = 0; for (; p < e; p++) { - register const Py_UNICODE ch = *p; + register const Py_UNICODE ch = *p; - if (Py_UNICODE_ISUPPER(ch) || Py_UNICODE_ISTITLE(ch)) - return PyBool_FromLong(0); - else if (!cased && Py_UNICODE_ISLOWER(ch)) - cased = 1; + if (Py_UNICODE_ISUPPER(ch) || Py_UNICODE_ISTITLE(ch)) + return PyBool_FromLong(0); + else if (!cased && Py_UNICODE_ISLOWER(ch)) + cased = 1; } return PyBool_FromLong(cased); } PyDoc_STRVAR(isupper__doc__, -"S.isupper() -> bool\n\ + "S.isupper() -> bool\n\ \n\ Return True if all cased characters in S are uppercase and there is\n\ at least one cased character in S, False otherwise."); @@ -7158,27 +7158,27 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1) - return PyBool_FromLong(Py_UNICODE_ISUPPER(*p) != 0); + return PyBool_FromLong(Py_UNICODE_ISUPPER(*p) != 0); /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return PyBool_FromLong(0); + return PyBool_FromLong(0); e = p + PyUnicode_GET_SIZE(self); cased = 0; for (; p < e; p++) { - register const Py_UNICODE ch = *p; + register const Py_UNICODE ch = *p; - if (Py_UNICODE_ISLOWER(ch) || Py_UNICODE_ISTITLE(ch)) - return PyBool_FromLong(0); - else if (!cased && Py_UNICODE_ISUPPER(ch)) - cased = 1; + if (Py_UNICODE_ISLOWER(ch) || Py_UNICODE_ISTITLE(ch)) + return PyBool_FromLong(0); + else if (!cased && Py_UNICODE_ISUPPER(ch)) + cased = 1; } return PyBool_FromLong(cased); } PyDoc_STRVAR(istitle__doc__, -"S.istitle() -> bool\n\ + "S.istitle() -> bool\n\ \n\ Return True if S is a titlecased string and there is at least one\n\ character in S, i.e. upper- and titlecase characters may only\n\ @@ -7194,39 +7194,39 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1) - return PyBool_FromLong((Py_UNICODE_ISTITLE(*p) != 0) || - (Py_UNICODE_ISUPPER(*p) != 0)); + return PyBool_FromLong((Py_UNICODE_ISTITLE(*p) != 0) || + (Py_UNICODE_ISUPPER(*p) != 0)); /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return PyBool_FromLong(0); + return PyBool_FromLong(0); e = p + PyUnicode_GET_SIZE(self); cased = 0; previous_is_cased = 0; for (; p < e; p++) { - register const Py_UNICODE ch = *p; + register const Py_UNICODE ch = *p; - if (Py_UNICODE_ISUPPER(ch) || Py_UNICODE_ISTITLE(ch)) { - if (previous_is_cased) - return PyBool_FromLong(0); - previous_is_cased = 1; - cased = 1; - } - else if (Py_UNICODE_ISLOWER(ch)) { - if (!previous_is_cased) - return PyBool_FromLong(0); - previous_is_cased = 1; - cased = 1; - } - else - previous_is_cased = 0; + if (Py_UNICODE_ISUPPER(ch) || Py_UNICODE_ISTITLE(ch)) { + if (previous_is_cased) + return PyBool_FromLong(0); + previous_is_cased = 1; + cased = 1; + } + else if (Py_UNICODE_ISLOWER(ch)) { + if (!previous_is_cased) + return PyBool_FromLong(0); + previous_is_cased = 1; + cased = 1; + } + else + previous_is_cased = 0; } return PyBool_FromLong(cased); } PyDoc_STRVAR(isspace__doc__, -"S.isspace() -> bool\n\ + "S.isspace() -> bool\n\ \n\ Return True if all characters in S are whitespace\n\ and there is at least one character in S, False otherwise."); @@ -7239,23 +7239,23 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && - Py_UNICODE_ISSPACE(*p)) - return PyBool_FromLong(1); + Py_UNICODE_ISSPACE(*p)) + return PyBool_FromLong(1); /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return PyBool_FromLong(0); + return PyBool_FromLong(0); e = p + PyUnicode_GET_SIZE(self); for (; p < e; p++) { - if (!Py_UNICODE_ISSPACE(*p)) - return PyBool_FromLong(0); + if (!Py_UNICODE_ISSPACE(*p)) + return PyBool_FromLong(0); } return PyBool_FromLong(1); } PyDoc_STRVAR(isalpha__doc__, -"S.isalpha() -> bool\n\ + "S.isalpha() -> bool\n\ \n\ Return True if all characters in S are alphabetic\n\ and there is at least one character in S, False otherwise."); @@ -7268,23 +7268,23 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && - Py_UNICODE_ISALPHA(*p)) - return PyBool_FromLong(1); + Py_UNICODE_ISALPHA(*p)) + return PyBool_FromLong(1); /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return PyBool_FromLong(0); + return PyBool_FromLong(0); e = p + PyUnicode_GET_SIZE(self); for (; p < e; p++) { - if (!Py_UNICODE_ISALPHA(*p)) - return PyBool_FromLong(0); + if (!Py_UNICODE_ISALPHA(*p)) + return PyBool_FromLong(0); } return PyBool_FromLong(1); } PyDoc_STRVAR(isalnum__doc__, -"S.isalnum() -> bool\n\ + "S.isalnum() -> bool\n\ \n\ Return True if all characters in S are alphanumeric\n\ and there is at least one character in S, False otherwise."); @@ -7297,23 +7297,23 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && - Py_UNICODE_ISALNUM(*p)) - return PyBool_FromLong(1); + Py_UNICODE_ISALNUM(*p)) + return PyBool_FromLong(1); /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return PyBool_FromLong(0); + return PyBool_FromLong(0); e = p + PyUnicode_GET_SIZE(self); for (; p < e; p++) { - if (!Py_UNICODE_ISALNUM(*p)) - return PyBool_FromLong(0); + if (!Py_UNICODE_ISALNUM(*p)) + return PyBool_FromLong(0); } return PyBool_FromLong(1); } PyDoc_STRVAR(isdecimal__doc__, -"S.isdecimal() -> bool\n\ + "S.isdecimal() -> bool\n\ \n\ Return True if there are only decimal characters in S,\n\ False otherwise."); @@ -7326,23 +7326,23 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && - Py_UNICODE_ISDECIMAL(*p)) - return PyBool_FromLong(1); + Py_UNICODE_ISDECIMAL(*p)) + return PyBool_FromLong(1); /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return PyBool_FromLong(0); + return PyBool_FromLong(0); e = p + PyUnicode_GET_SIZE(self); for (; p < e; p++) { - if (!Py_UNICODE_ISDECIMAL(*p)) - return PyBool_FromLong(0); + if (!Py_UNICODE_ISDECIMAL(*p)) + return PyBool_FromLong(0); } return PyBool_FromLong(1); } PyDoc_STRVAR(isdigit__doc__, -"S.isdigit() -> bool\n\ + "S.isdigit() -> bool\n\ \n\ Return True if all characters in S are digits\n\ and there is at least one character in S, False otherwise."); @@ -7355,23 +7355,23 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && - Py_UNICODE_ISDIGIT(*p)) - return PyBool_FromLong(1); + Py_UNICODE_ISDIGIT(*p)) + return PyBool_FromLong(1); /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return PyBool_FromLong(0); + return PyBool_FromLong(0); e = p + PyUnicode_GET_SIZE(self); for (; p < e; p++) { - if (!Py_UNICODE_ISDIGIT(*p)) - return PyBool_FromLong(0); + if (!Py_UNICODE_ISDIGIT(*p)) + return PyBool_FromLong(0); } return PyBool_FromLong(1); } PyDoc_STRVAR(isnumeric__doc__, -"S.isnumeric() -> bool\n\ + "S.isnumeric() -> bool\n\ \n\ Return True if there are only numeric characters in S,\n\ False otherwise."); @@ -7384,17 +7384,17 @@ /* Shortcut for single character strings */ if (PyUnicode_GET_SIZE(self) == 1 && - Py_UNICODE_ISNUMERIC(*p)) - return PyBool_FromLong(1); + Py_UNICODE_ISNUMERIC(*p)) + return PyBool_FromLong(1); /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return PyBool_FromLong(0); + return PyBool_FromLong(0); e = p + PyUnicode_GET_SIZE(self); for (; p < e; p++) { - if (!Py_UNICODE_ISNUMERIC(*p)) - return PyBool_FromLong(0); + if (!Py_UNICODE_ISNUMERIC(*p)) + return PyBool_FromLong(0); } return PyBool_FromLong(1); } @@ -7407,12 +7407,12 @@ /* Special case for empty strings */ if (PyUnicode_GET_SIZE(self) == 0) - return 0; + return 0; /* PEP 3131 says that the first character must be in XID_Start and subsequent characters in XID_Continue, and for the ASCII range, the 2.x rules apply (i.e - start with letters and underscore, continue with + start with letters and underscore, continue with letters, digits, underscore). However, given the current definition of XID_Start and XID_Continue, it is sufficient to check just for these, except that _ must be allowed @@ -7422,14 +7422,14 @@ e = p + PyUnicode_GET_SIZE(self); for (p++; p < e; p++) { - if (!_PyUnicode_IsXidContinue(*p)) - return 0; + if (!_PyUnicode_IsXidContinue(*p)) + return 0; } return 1; } PyDoc_STRVAR(isidentifier__doc__, -"S.isidentifier() -> bool\n\ + "S.isidentifier() -> bool\n\ \n\ Return True if S is a valid identifier according\n\ to the language definition."); @@ -7441,7 +7441,7 @@ } PyDoc_STRVAR(isprintable__doc__, -"S.isprintable() -> bool\n\ + "S.isprintable() -> bool\n\ \n\ Return True if all characters in S are considered\n\ printable in repr() or S is empty, False otherwise."); @@ -7467,7 +7467,7 @@ } PyDoc_STRVAR(join__doc__, -"S.join(sequence) -> str\n\ + "S.join(sequence) -> str\n\ \n\ Return a string which is the concatenation of the strings in the\n\ sequence. The separator between elements is S."); @@ -7485,7 +7485,7 @@ } PyDoc_STRVAR(ljust__doc__, -"S.ljust(width[, fillchar]) -> str\n\ + "S.ljust(width[, fillchar]) -> str\n\ \n\ Return S left-justified in a Unicode string of length width. Padding is\n\ done using the specified fill character (default is a space)."); @@ -7508,7 +7508,7 @@ } PyDoc_STRVAR(lower__doc__, -"S.lower() -> str\n\ + "S.lower() -> str\n\ \n\ Return a copy of the string S converted to lowercase."); @@ -7531,93 +7531,93 @@ PyObject * _PyUnicode_XStrip(PyUnicodeObject *self, int striptype, PyObject *sepobj) { - Py_UNICODE *s = PyUnicode_AS_UNICODE(self); - Py_ssize_t len = PyUnicode_GET_SIZE(self); - Py_UNICODE *sep = PyUnicode_AS_UNICODE(sepobj); - Py_ssize_t seplen = PyUnicode_GET_SIZE(sepobj); - Py_ssize_t i, j; - - BLOOM_MASK sepmask = make_bloom_mask(sep, seplen); - - i = 0; - if (striptype != RIGHTSTRIP) { - while (i < len && BLOOM_MEMBER(sepmask, s[i], sep, seplen)) { - i++; - } - } + Py_UNICODE *s = PyUnicode_AS_UNICODE(self); + Py_ssize_t len = PyUnicode_GET_SIZE(self); + Py_UNICODE *sep = PyUnicode_AS_UNICODE(sepobj); + Py_ssize_t seplen = PyUnicode_GET_SIZE(sepobj); + Py_ssize_t i, j; - j = len; - if (striptype != LEFTSTRIP) { - do { - j--; - } while (j >= i && BLOOM_MEMBER(sepmask, s[j], sep, seplen)); - j++; - } + BLOOM_MASK sepmask = make_bloom_mask(sep, seplen); - if (i == 0 && j == len && PyUnicode_CheckExact(self)) { - Py_INCREF(self); - return (PyObject*)self; - } - else - return PyUnicode_FromUnicode(s+i, j-i); + i = 0; + if (striptype != RIGHTSTRIP) { + while (i < len && BLOOM_MEMBER(sepmask, s[i], sep, seplen)) { + i++; + } + } + + j = len; + if (striptype != LEFTSTRIP) { + do { + j--; + } while (j >= i && BLOOM_MEMBER(sepmask, s[j], sep, seplen)); + j++; + } + + if (i == 0 && j == len && PyUnicode_CheckExact(self)) { + Py_INCREF(self); + return (PyObject*)self; + } + else + return PyUnicode_FromUnicode(s+i, j-i); } static PyObject * do_strip(PyUnicodeObject *self, int striptype) { - Py_UNICODE *s = PyUnicode_AS_UNICODE(self); - Py_ssize_t len = PyUnicode_GET_SIZE(self), i, j; + Py_UNICODE *s = PyUnicode_AS_UNICODE(self); + Py_ssize_t len = PyUnicode_GET_SIZE(self), i, j; + + i = 0; + if (striptype != RIGHTSTRIP) { + while (i < len && Py_UNICODE_ISSPACE(s[i])) { + i++; + } + } + + j = len; + if (striptype != LEFTSTRIP) { + do { + j--; + } while (j >= i && Py_UNICODE_ISSPACE(s[j])); + j++; + } - i = 0; - if (striptype != RIGHTSTRIP) { - while (i < len && Py_UNICODE_ISSPACE(s[i])) { - i++; - } - } - - j = len; - if (striptype != LEFTSTRIP) { - do { - j--; - } while (j >= i && Py_UNICODE_ISSPACE(s[j])); - j++; - } - - if (i == 0 && j == len && PyUnicode_CheckExact(self)) { - Py_INCREF(self); - return (PyObject*)self; - } - else - return PyUnicode_FromUnicode(s+i, j-i); + if (i == 0 && j == len && PyUnicode_CheckExact(self)) { + Py_INCREF(self); + return (PyObject*)self; + } + else + return PyUnicode_FromUnicode(s+i, j-i); } static PyObject * do_argstrip(PyUnicodeObject *self, int striptype, PyObject *args) { - PyObject *sep = NULL; + PyObject *sep = NULL; - if (!PyArg_ParseTuple(args, (char *)stripformat[striptype], &sep)) - return NULL; + if (!PyArg_ParseTuple(args, (char *)stripformat[striptype], &sep)) + return NULL; - if (sep != NULL && sep != Py_None) { - if (PyUnicode_Check(sep)) - return _PyUnicode_XStrip(self, striptype, sep); - else { - PyErr_Format(PyExc_TypeError, - "%s arg must be None or str", - STRIPNAME(striptype)); - return NULL; - } - } + if (sep != NULL && sep != Py_None) { + if (PyUnicode_Check(sep)) + return _PyUnicode_XStrip(self, striptype, sep); + else { + PyErr_Format(PyExc_TypeError, + "%s arg must be None or str", + STRIPNAME(striptype)); + return NULL; + } + } - return do_strip(self, striptype); + return do_strip(self, striptype); } PyDoc_STRVAR(strip__doc__, -"S.strip([chars]) -> str\n\ + "S.strip([chars]) -> str\n\ \n\ Return a copy of the string S with leading and trailing\n\ whitespace removed.\n\ @@ -7626,15 +7626,15 @@ static PyObject * unicode_strip(PyUnicodeObject *self, PyObject *args) { - if (PyTuple_GET_SIZE(args) == 0) - return do_strip(self, BOTHSTRIP); /* Common case */ - else - return do_argstrip(self, BOTHSTRIP, args); + if (PyTuple_GET_SIZE(args) == 0) + return do_strip(self, BOTHSTRIP); /* Common case */ + else + return do_argstrip(self, BOTHSTRIP, args); } PyDoc_STRVAR(lstrip__doc__, -"S.lstrip([chars]) -> str\n\ + "S.lstrip([chars]) -> str\n\ \n\ Return a copy of the string S with leading whitespace removed.\n\ If chars is given and not None, remove characters in chars instead."); @@ -7642,15 +7642,15 @@ static PyObject * unicode_lstrip(PyUnicodeObject *self, PyObject *args) { - if (PyTuple_GET_SIZE(args) == 0) - return do_strip(self, LEFTSTRIP); /* Common case */ - else - return do_argstrip(self, LEFTSTRIP, args); + if (PyTuple_GET_SIZE(args) == 0) + return do_strip(self, LEFTSTRIP); /* Common case */ + else + return do_argstrip(self, LEFTSTRIP, args); } PyDoc_STRVAR(rstrip__doc__, -"S.rstrip([chars]) -> str\n\ + "S.rstrip([chars]) -> str\n\ \n\ Return a copy of the string S with trailing whitespace removed.\n\ If chars is given and not None, remove characters in chars instead."); @@ -7658,10 +7658,10 @@ static PyObject * unicode_rstrip(PyUnicodeObject *self, PyObject *args) { - if (PyTuple_GET_SIZE(args) == 0) - return do_strip(self, RIGHTSTRIP); /* Common case */ - else - return do_argstrip(self, RIGHTSTRIP, args); + if (PyTuple_GET_SIZE(args) == 0) + return do_strip(self, RIGHTSTRIP); /* Common case */ + else + return do_argstrip(self, RIGHTSTRIP, args); } @@ -7706,25 +7706,25 @@ if (str->length == 1 && len > 0) { Py_UNICODE_FILL(p, str->str[0], len); } else { - Py_ssize_t done = 0; /* number of characters copied this far */ - if (done < nchars) { + Py_ssize_t done = 0; /* number of characters copied this far */ + if (done < nchars) { Py_UNICODE_COPY(p, str->str, str->length); done = str->length; - } - while (done < nchars) { + } + while (done < nchars) { Py_ssize_t n = (done <= nchars-done) ? done : nchars-done; Py_UNICODE_COPY(p+done, p, n); done += n; - } + } } return (PyObject*) u; } PyObject *PyUnicode_Replace(PyObject *obj, - PyObject *subobj, - PyObject *replobj, - Py_ssize_t maxcount) + PyObject *subobj, + PyObject *replobj, + Py_ssize_t maxcount) { PyObject *self; PyObject *str1; @@ -7733,22 +7733,22 @@ self = PyUnicode_FromObject(obj); if (self == NULL) - return NULL; + return NULL; str1 = PyUnicode_FromObject(subobj); if (str1 == NULL) { - Py_DECREF(self); - return NULL; + Py_DECREF(self); + return NULL; } str2 = PyUnicode_FromObject(replobj); if (str2 == NULL) { - Py_DECREF(self); - Py_DECREF(str1); - return NULL; + Py_DECREF(self); + Py_DECREF(str1); + return NULL; } result = replace((PyUnicodeObject *)self, - (PyUnicodeObject *)str1, - (PyUnicodeObject *)str2, - maxcount); + (PyUnicodeObject *)str1, + (PyUnicodeObject *)str2, + maxcount); Py_DECREF(self); Py_DECREF(str1); Py_DECREF(str2); @@ -7756,7 +7756,7 @@ } PyDoc_STRVAR(replace__doc__, -"S.replace (old, new[, count]) -> str\n\ + "S.replace (old, new[, count]) -> str\n\ \n\ Return a copy of S with all occurrences of substring\n\ old replaced by new. If the optional argument count is\n\ @@ -7774,11 +7774,11 @@ return NULL; str1 = (PyUnicodeObject *)PyUnicode_FromObject((PyObject *)str1); if (str1 == NULL) - return NULL; + return NULL; str2 = (PyUnicodeObject *)PyUnicode_FromObject((PyObject *)str2); if (str2 == NULL) { - Py_DECREF(str1); - return NULL; + Py_DECREF(str1); + return NULL; } result = replace(self, str1, str2, maxcount); @@ -7815,13 +7815,13 @@ */ repr = PyUnicode_FromUnicode(NULL, - 2 /* quotes */ + 2 /* quotes */ #ifdef Py_UNICODE_WIDE - + 10*size + + 10*size #else - + 6*size + + 6*size #endif - + 1); + + 1); if (repr == NULL) return NULL; @@ -7840,7 +7840,7 @@ continue; } - /* Map special whitespace to '\t', \n', '\r' */ + /* Map special whitespace to '\t', \n', '\r' */ if (ch == '\t') { *p++ = '\\'; *p++ = 't'; @@ -7867,7 +7867,7 @@ *p++ = ch; } - /* Non-ASCII characters */ + /* Non-ASCII characters */ else { Py_UCS4 ucs = ch; @@ -7877,15 +7877,15 @@ if (size > 0) { ch2 = *s; if (ch >= 0xD800 && ch < 0xDC00 && ch2 >= 0xDC00 - && ch2 <= 0xDFFF) { - ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) - + 0x00010000; - s++; + && ch2 <= 0xDFFF) { + ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) + + 0x00010000; + s++; size--; } } #endif - /* Map Unicode whitespace and control characters + /* Map Unicode whitespace and control characters (categories Z* and C* except ASCII space) */ if (!Py_UNICODE_ISPRINTABLE(ucs)) { @@ -7938,7 +7938,7 @@ } PyDoc_STRVAR(rfind__doc__, -"S.rfind(sub[, start[, end]]) -> int\n\ + "S.rfind(sub[, start[, end]]) -> int\n\ \n\ Return the highest index in S where substring sub is found,\n\ such that sub is contained within s[start:end]. Optional\n\ @@ -7955,7 +7955,7 @@ Py_ssize_t result; if (!_ParseTupleFinds(args, &substring, &start, &end)) - return NULL; + return NULL; result = stringlib_rfind_slice( PyUnicode_AS_UNICODE(self), PyUnicode_GET_SIZE(self), @@ -7969,7 +7969,7 @@ } PyDoc_STRVAR(rindex__doc__, -"S.rindex(sub[, start[, end]]) -> int\n\ + "S.rindex(sub[, start[, end]]) -> int\n\ \n\ Like S.rfind() but raise ValueError when the substring is not found."); @@ -7982,7 +7982,7 @@ Py_ssize_t result; if (!_ParseTupleFinds(args, &substring, &start, &end)) - return NULL; + return NULL; result = stringlib_rfind_slice( PyUnicode_AS_UNICODE(self), PyUnicode_GET_SIZE(self), @@ -8000,7 +8000,7 @@ } PyDoc_STRVAR(rjust__doc__, -"S.rjust(width[, fillchar]) -> str\n\ + "S.rjust(width[, fillchar]) -> str\n\ \n\ Return S right-justified in a string of length width. Padding is\n\ done using the specified fill character (default is a space)."); @@ -8023,20 +8023,20 @@ } PyObject *PyUnicode_Split(PyObject *s, - PyObject *sep, - Py_ssize_t maxsplit) + PyObject *sep, + Py_ssize_t maxsplit) { PyObject *result; s = PyUnicode_FromObject(s); if (s == NULL) - return NULL; + return NULL; if (sep != NULL) { - sep = PyUnicode_FromObject(sep); - if (sep == NULL) { - Py_DECREF(s); - return NULL; - } + sep = PyUnicode_FromObject(sep); + if (sep == NULL) { + Py_DECREF(s); + return NULL; + } } result = split((PyUnicodeObject *)s, (PyUnicodeObject *)sep, maxsplit); @@ -8047,7 +8047,7 @@ } PyDoc_STRVAR(split__doc__, -"S.split([sep[, maxsplit]]) -> list of strings\n\ + "S.split([sep[, maxsplit]]) -> list of strings\n\ \n\ Return a list of the words in S, using sep as the\n\ delimiter string. If maxsplit is given, at most maxsplit\n\ @@ -8065,11 +8065,11 @@ return NULL; if (substring == Py_None) - return split(self, NULL, maxcount); + return split(self, NULL, maxcount); else if (PyUnicode_Check(substring)) - return split(self, (PyUnicodeObject *)substring, maxcount); + return split(self, (PyUnicodeObject *)substring, maxcount); else - return PyUnicode_Split((PyObject *)self, substring, maxcount); + return PyUnicode_Split((PyObject *)self, substring, maxcount); } PyObject * @@ -8081,7 +8081,7 @@ str_obj = PyUnicode_FromObject(str_in); if (!str_obj) - return NULL; + return NULL; sep_obj = PyUnicode_FromObject(sep_in); if (!sep_obj) { Py_DECREF(str_obj); @@ -8109,7 +8109,7 @@ str_obj = PyUnicode_FromObject(str_in); if (!str_obj) - return NULL; + return NULL; sep_obj = PyUnicode_FromObject(sep_in); if (!sep_obj) { Py_DECREF(str_obj); @@ -8128,7 +8128,7 @@ } PyDoc_STRVAR(partition__doc__, -"S.partition(sep) -> (head, sep, tail)\n\ + "S.partition(sep) -> (head, sep, tail)\n\ \n\ Search for the separator sep in S, and return the part before it,\n\ the separator itself, and the part after it. If the separator is not\n\ @@ -8141,7 +8141,7 @@ } PyDoc_STRVAR(rpartition__doc__, -"S.rpartition(sep) -> (tail, sep, head)\n\ + "S.rpartition(sep) -> (tail, sep, head)\n\ \n\ Search for the separator sep in S, starting at the end of S, and return\n\ the part before it, the separator itself, and the part after it. If the\n\ @@ -8154,20 +8154,20 @@ } PyObject *PyUnicode_RSplit(PyObject *s, - PyObject *sep, - Py_ssize_t maxsplit) + PyObject *sep, + Py_ssize_t maxsplit) { PyObject *result; - + s = PyUnicode_FromObject(s); if (s == NULL) - return NULL; + return NULL; if (sep != NULL) { - sep = PyUnicode_FromObject(sep); - if (sep == NULL) { - Py_DECREF(s); - return NULL; - } + sep = PyUnicode_FromObject(sep); + if (sep == NULL) { + Py_DECREF(s); + return NULL; + } } result = rsplit((PyUnicodeObject *)s, (PyUnicodeObject *)sep, maxsplit); @@ -8178,7 +8178,7 @@ } PyDoc_STRVAR(rsplit__doc__, -"S.rsplit([sep[, maxsplit]]) -> list of strings\n\ + "S.rsplit([sep[, maxsplit]]) -> list of strings\n\ \n\ Return a list of the words in S, using sep as the\n\ delimiter string, starting at the end of the string and\n\ @@ -8196,15 +8196,15 @@ return NULL; if (substring == Py_None) - return rsplit(self, NULL, maxcount); + return rsplit(self, NULL, maxcount); else if (PyUnicode_Check(substring)) - return rsplit(self, (PyUnicodeObject *)substring, maxcount); + return rsplit(self, (PyUnicodeObject *)substring, maxcount); else - return PyUnicode_RSplit((PyObject *)self, substring, maxcount); + return PyUnicode_RSplit((PyObject *)self, substring, maxcount); } PyDoc_STRVAR(splitlines__doc__, -"S.splitlines([keepends]) -> list of strings\n\ + "S.splitlines([keepends]) -> list of strings\n\ \n\ Return a list of the lines in S, breaking at line boundaries.\n\ Line breaks are not included in the resulting list unless keepends\n\ @@ -8234,7 +8234,7 @@ } PyDoc_STRVAR(swapcase__doc__, -"S.swapcase() -> str\n\ + "S.swapcase() -> str\n\ \n\ Return a copy of S with uppercase characters converted to lowercase\n\ and vice versa."); @@ -8246,7 +8246,7 @@ } PyDoc_STRVAR(maketrans__doc__, -"str.maketrans(x[, y[, z]]) -> dict (static method)\n\ + "str.maketrans(x[, y[, z]]) -> dict (static method)\n\ \n\ Return a translation table usable for str.translate().\n\ If there is only one argument, it must be a dictionary mapping Unicode\n\ @@ -8264,7 +8264,7 @@ PyObject *new = NULL, *key, *value; Py_ssize_t i = 0; int res; - + if (!PyArg_ParseTuple(args, "O|UU:maketrans", &x, &y, &z)) return NULL; new = PyDict_New(); @@ -8349,7 +8349,7 @@ } PyDoc_STRVAR(translate__doc__, -"S.translate(table) -> str\n\ + "S.translate(table) -> str\n\ \n\ Return a copy of the string S, where all characters have been mapped\n\ through the given translation table, which must be a mapping of\n\ @@ -8364,7 +8364,7 @@ } PyDoc_STRVAR(upper__doc__, -"S.upper() -> str\n\ + "S.upper() -> str\n\ \n\ Return a copy of S converted to uppercase."); @@ -8375,7 +8375,7 @@ } PyDoc_STRVAR(zfill__doc__, -"S.zfill(width) -> str\n\ + "S.zfill(width) -> str\n\ \n\ Pad a numeric string S with zeros on the left, to fill a field\n\ of the specified width. The string S is never truncated."); @@ -8399,7 +8399,7 @@ return PyUnicode_FromUnicode( PyUnicode_AS_UNICODE(self), PyUnicode_GET_SIZE(self) - ); + ); } fill = width - self->length; @@ -8427,7 +8427,7 @@ #endif PyDoc_STRVAR(startswith__doc__, -"S.startswith(prefix[, start[, end]]) -> bool\n\ + "S.startswith(prefix[, start[, end]]) -> bool\n\ \n\ Return True if S starts with the specified prefix, False otherwise.\n\ With optional start, test S beginning at that position.\n\ @@ -8436,7 +8436,7 @@ static PyObject * unicode_startswith(PyUnicodeObject *self, - PyObject *args) + PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; @@ -8445,13 +8445,13 @@ int result; if (!PyArg_ParseTuple(args, "O|O&O&:startswith", &subobj, - _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) - return NULL; + _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) + return NULL; if (PyTuple_Check(subobj)) { Py_ssize_t i; for (i = 0; i < PyTuple_GET_SIZE(subobj); i++) { substring = (PyUnicodeObject *)PyUnicode_FromObject( - PyTuple_GET_ITEM(subobj, i)); + PyTuple_GET_ITEM(subobj, i)); if (substring == NULL) return NULL; result = tailmatch(self, substring, start, end, -1); @@ -8465,7 +8465,7 @@ } substring = (PyUnicodeObject *)PyUnicode_FromObject(subobj); if (substring == NULL) - return NULL; + return NULL; result = tailmatch(self, substring, start, end, -1); Py_DECREF(substring); return PyBool_FromLong(result); @@ -8473,7 +8473,7 @@ PyDoc_STRVAR(endswith__doc__, -"S.endswith(suffix[, start[, end]]) -> bool\n\ + "S.endswith(suffix[, start[, end]]) -> bool\n\ \n\ Return True if S ends with the specified suffix, False otherwise.\n\ With optional start, test S beginning at that position.\n\ @@ -8482,7 +8482,7 @@ static PyObject * unicode_endswith(PyUnicodeObject *self, - PyObject *args) + PyObject *args) { PyObject *subobj; PyUnicodeObject *substring; @@ -8491,15 +8491,15 @@ int result; if (!PyArg_ParseTuple(args, "O|O&O&:endswith", &subobj, - _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) - return NULL; + _PyEval_SliceIndex, &start, _PyEval_SliceIndex, &end)) + return NULL; if (PyTuple_Check(subobj)) { Py_ssize_t i; for (i = 0; i < PyTuple_GET_SIZE(subobj); i++) { substring = (PyUnicodeObject *)PyUnicode_FromObject( - PyTuple_GET_ITEM(subobj, i)); + PyTuple_GET_ITEM(subobj, i)); if (substring == NULL) - return NULL; + return NULL; result = tailmatch(self, substring, start, end, +1); Py_DECREF(substring); if (result) { @@ -8510,7 +8510,7 @@ } substring = (PyUnicodeObject *)PyUnicode_FromObject(subobj); if (substring == NULL) - return NULL; + return NULL; result = tailmatch(self, substring, start, end, +1); Py_DECREF(substring); @@ -8520,7 +8520,7 @@ #include "stringlib/string_format.h" PyDoc_STRVAR(format__doc__, -"S.format(*args, **kwargs) -> str\n\ + "S.format(*args, **kwargs) -> str\n\ \n\ "); @@ -8538,7 +8538,7 @@ } PyDoc_STRVAR(p_format__doc__, -"S.__format__(format_spec) -> str\n\ + "S.__format__(format_spec) -> str\n\ \n\ "); @@ -8550,12 +8550,12 @@ } PyDoc_STRVAR(sizeof__doc__, -"S.__sizeof__() -> size of S in memory, in bytes"); + "S.__sizeof__() -> size of S in memory, in bytes"); static PyObject * unicode_getnewargs(PyUnicodeObject *v) { - return Py_BuildValue("(u#)", v->str, v->length); + return Py_BuildValue("(u#)", v->str, v->length); } @@ -8620,36 +8620,36 @@ {"freelistsize", (PyCFunction) unicode_freelistsize, METH_NOARGS}, #endif - {"__getnewargs__", (PyCFunction)unicode_getnewargs, METH_NOARGS}, + {"__getnewargs__", (PyCFunction)unicode_getnewargs, METH_NOARGS}, {NULL, NULL} }; static PyObject * unicode_mod(PyObject *v, PyObject *w) { - if (!PyUnicode_Check(v)) { - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; - } - return PyUnicode_Format(v, w); + if (!PyUnicode_Check(v)) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + return PyUnicode_Format(v, w); } static PyNumberMethods unicode_as_number = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - unicode_mod, /*nb_remainder*/ + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + unicode_mod, /*nb_remainder*/ }; static PySequenceMethods unicode_as_sequence = { - (lenfunc) unicode_length, /* sq_length */ - PyUnicode_Concat, /* sq_concat */ - (ssizeargfunc) unicode_repeat, /* sq_repeat */ - (ssizeargfunc) unicode_getitem, /* sq_item */ - 0, /* sq_slice */ - 0, /* sq_ass_item */ - 0, /* sq_ass_slice */ - PyUnicode_Contains, /* sq_contains */ + (lenfunc) unicode_length, /* sq_length */ + PyUnicode_Concat, /* sq_concat */ + (ssizeargfunc) unicode_repeat, /* sq_repeat */ + (ssizeargfunc) unicode_getitem, /* sq_item */ + 0, /* sq_slice */ + 0, /* sq_ass_item */ + 0, /* sq_ass_slice */ + PyUnicode_Contains, /* sq_contains */ }; static PyObject* @@ -8669,7 +8669,7 @@ PyObject* result; if (PySlice_GetIndicesEx((PySliceObject*)item, PyUnicode_GET_SIZE(self), - &start, &stop, &step, &slicelength) < 0) { + &start, &stop, &step, &slicelength) < 0) { return NULL; } @@ -8685,9 +8685,9 @@ source_buf = PyUnicode_AS_UNICODE((PyObject*)self); result_buf = (Py_UNICODE *)PyObject_MALLOC(slicelength* sizeof(Py_UNICODE)); - - if (result_buf == NULL) - return PyErr_NoMemory(); + + if (result_buf == NULL) + return PyErr_NoMemory(); for (cur = start, i = 0; i < slicelength; cur += step, i++) { result_buf[i] = source_buf[cur]; @@ -8704,9 +8704,9 @@ } static PyMappingMethods unicode_as_mapping = { - (lenfunc)unicode_length, /* mp_length */ - (binaryfunc)unicode_subscript, /* mp_subscript */ - (objobjargproc)0, /* mp_ass_subscript */ + (lenfunc)unicode_length, /* mp_length */ + (binaryfunc)unicode_subscript, /* mp_subscript */ + (objobjargproc)0, /* mp_ass_subscript */ }; @@ -8717,14 +8717,14 @@ { Py_ssize_t argidx = *p_argidx; if (argidx < arglen) { - (*p_argidx)++; - if (arglen < 0) - return args; - else - return PyTuple_GetItem(args, argidx); + (*p_argidx)++; + if (arglen < 0) + return args; + else + return PyTuple_GetItem(args, argidx); } PyErr_SetString(PyExc_TypeError, - "not enough arguments for format string"); + "not enough arguments for format string"); return NULL; } @@ -8734,7 +8734,7 @@ register Py_ssize_t i; Py_ssize_t len = strlen(charbuffer); for (i = len - 1; i >= 0; i--) - buffer[i] = (Py_UNICODE) charbuffer[i]; + buffer[i] = (Py_UNICODE) charbuffer[i]; return len; } @@ -8749,7 +8749,7 @@ return Py_SAFE_DOWNCAST(result, Py_ssize_t, int); } -#if 0 +#if 0 static int longtounicode(Py_UNICODE *buffer, size_t len, const char *format, long x) { @@ -8767,11 +8767,11 @@ static int formatfloat(Py_UNICODE *buf, - size_t buflen, - int flags, - int prec, - int type, - PyObject *v) + size_t buflen, + int flags, + int prec, + int type, + PyObject *v) { /* fmt = '%#.' + `prec` + `type` worst case length = 3 + 10 (len of INT_MAX) + 1 = 14 (use 20)*/ @@ -8780,64 +8780,64 @@ x = PyFloat_AsDouble(v); if (x == -1.0 && PyErr_Occurred()) - return -1; + return -1; if (prec < 0) - prec = 6; + prec = 6; if (type == 'f' && (fabs(x) / 1e25) >= 1e25) - type = 'g'; + type = 'g'; /* Worst case length calc to ensure no buffer overrun: 'g' formats: - fmt = %#.g - buf = '-' + [0-9]*prec + '.' + 'e+' + (longest exp - for any double rep.) - len = 1 + prec + 1 + 2 + 5 = 9 + prec + fmt = %#.g + buf = '-' + [0-9]*prec + '.' + 'e+' + (longest exp + for any double rep.) + len = 1 + prec + 1 + 2 + 5 = 9 + prec 'f' formats: - buf = '-' + [0-9]*x + '.' + [0-9]*prec (with x < 50) - len = 1 + 50 + 1 + prec = 52 + prec + buf = '-' + [0-9]*x + '.' + [0-9]*prec (with x < 50) + len = 1 + 50 + 1 + prec = 52 + prec If prec=0 the effective precision is 1 (the leading digit is always given), therefore increase the length by one. */ - if (((type == 'g' || type == 'G') && - buflen <= (size_t)10 + (size_t)prec) || - (type == 'f' && buflen <= (size_t)53 + (size_t)prec)) { - PyErr_SetString(PyExc_OverflowError, - "formatted float is too long (precision too large?)"); - return -1; + if (((type == 'g' || type == 'G') && + buflen <= (size_t)10 + (size_t)prec) || + (type == 'f' && buflen <= (size_t)53 + (size_t)prec)) { + PyErr_SetString(PyExc_OverflowError, + "formatted float is too long (precision too large?)"); + return -1; } PyOS_snprintf(fmt, sizeof(fmt), "%%%s.%d%c", - (flags&F_ALT) ? "#" : "", - prec, type); + (flags&F_ALT) ? "#" : "", + prec, type); return doubletounicode(buf, buflen, fmt, x); } static PyObject* formatlong(PyObject *val, int flags, int prec, int type) { - char *buf; - int len; - PyObject *str; /* temporary string object. */ - PyObject *result; - - str = _PyBytes_FormatLong(val, flags, prec, type, &buf, &len); - if (!str) - return NULL; - result = PyUnicode_FromStringAndSize(buf, len); - Py_DECREF(str); - return result; + char *buf; + int len; + PyObject *str; /* temporary string object. */ + PyObject *result; + + str = _PyBytes_FormatLong(val, flags, prec, type, &buf, &len); + if (!str) + return NULL; + result = PyUnicode_FromStringAndSize(buf, len); + Py_DECREF(str); + return result; } #if 0 static int formatint(Py_UNICODE *buf, - size_t buflen, - int flags, - int prec, - int type, - PyObject *v) + size_t buflen, + int flags, + int prec, + int type, + PyObject *v) { /* fmt = '%#.' + `prec` + 'l' + `type` * worst case length = 3 + 19 (worst len of INT_MAX on 64-bit machine) @@ -8866,7 +8866,7 @@ */ if (buflen <= 14 || buflen <= (size_t)3 + (size_t)prec) { PyErr_SetString(PyExc_OverflowError, - "formatted integer is too long (precision too large?)"); + "formatted integer is too long (precision too large?)"); return -1; } @@ -8874,7 +8874,7 @@ (type == 'x' || type == 'X' || type == 'o')) { /* When converting under %#o, %#x or %#X, there are a number * of issues that cause pain: - * - for %#o, we want a different base marker than C + * - for %#o, we want a different base marker than C * - when 0 is being converted, the C standard leaves off * the '0x' or '0X', which is inconsistent with other * %#x/%#X conversions and inconsistent with Python's @@ -8915,56 +8915,56 @@ { /* presume that the buffer is at least 3 characters long */ if (PyUnicode_Check(v)) { - if (PyUnicode_GET_SIZE(v) == 1) { - buf[0] = PyUnicode_AS_UNICODE(v)[0]; - buf[1] = '\0'; - return 1; - } + if (PyUnicode_GET_SIZE(v) == 1) { + buf[0] = PyUnicode_AS_UNICODE(v)[0]; + buf[1] = '\0'; + return 1; + } #ifndef Py_UNICODE_WIDE - if (PyUnicode_GET_SIZE(v) == 2) { - /* Decode a valid surrogate pair */ - int c0 = PyUnicode_AS_UNICODE(v)[0]; - int c1 = PyUnicode_AS_UNICODE(v)[1]; - if (0xD800 <= c0 && c0 <= 0xDBFF && - 0xDC00 <= c1 && c1 <= 0xDFFF) { - buf[0] = c0; - buf[1] = c1; - buf[2] = '\0'; - return 2; - } - } + if (PyUnicode_GET_SIZE(v) == 2) { + /* Decode a valid surrogate pair */ + int c0 = PyUnicode_AS_UNICODE(v)[0]; + int c1 = PyUnicode_AS_UNICODE(v)[1]; + if (0xD800 <= c0 && c0 <= 0xDBFF && + 0xDC00 <= c1 && c1 <= 0xDFFF) { + buf[0] = c0; + buf[1] = c1; + buf[2] = '\0'; + return 2; + } + } #endif - goto onError; + goto onError; } else { - /* Integer input truncated to a character */ + /* Integer input truncated to a character */ long x; - x = PyLong_AsLong(v); - if (x == -1 && PyErr_Occurred()) - goto onError; - - if (x < 0 || x > 0x10ffff) { - PyErr_SetString(PyExc_OverflowError, - "%c arg not in range(0x110000)"); - return -1; - } + x = PyLong_AsLong(v); + if (x == -1 && PyErr_Occurred()) + goto onError; + + if (x < 0 || x > 0x10ffff) { + PyErr_SetString(PyExc_OverflowError, + "%c arg not in range(0x110000)"); + return -1; + } #ifndef Py_UNICODE_WIDE - if (x > 0xffff) { - x -= 0x10000; - buf[0] = (Py_UNICODE)(0xD800 | (x >> 10)); - buf[1] = (Py_UNICODE)(0xDC00 | (x & 0x3FF)); - return 2; - } -#endif - buf[0] = (Py_UNICODE) x; - buf[1] = '\0'; - return 1; + if (x > 0xffff) { + x -= 0x10000; + buf[0] = (Py_UNICODE)(0xD800 | (x >> 10)); + buf[1] = (Py_UNICODE)(0xDC00 | (x & 0x3FF)); + return 2; + } +#endif + buf[0] = (Py_UNICODE) x; + buf[1] = '\0'; + return 1; } - onError: + onError: PyErr_SetString(PyExc_TypeError, - "%c requires int or char"); + "%c requires int or char"); return -1; } @@ -8979,7 +8979,7 @@ #define FORMATBUFLEN (size_t)120 PyObject *PyUnicode_Format(PyObject *format, - PyObject *args) + PyObject *args) { Py_UNICODE *fmt, *res; Py_ssize_t fmtcnt, rescnt, reslen, arglen, argidx; @@ -8989,433 +8989,433 @@ PyObject *uformat; if (format == NULL || args == NULL) { - PyErr_BadInternalCall(); - return NULL; + PyErr_BadInternalCall(); + return NULL; } uformat = PyUnicode_FromObject(format); if (uformat == NULL) - return NULL; + return NULL; fmt = PyUnicode_AS_UNICODE(uformat); fmtcnt = PyUnicode_GET_SIZE(uformat); reslen = rescnt = fmtcnt + 100; result = _PyUnicode_New(reslen); if (result == NULL) - goto onError; + goto onError; res = PyUnicode_AS_UNICODE(result); if (PyTuple_Check(args)) { - arglen = PyTuple_Size(args); - argidx = 0; + arglen = PyTuple_Size(args); + argidx = 0; } else { - arglen = -1; - argidx = -2; + arglen = -1; + argidx = -2; } if (Py_TYPE(args)->tp_as_mapping && !PyTuple_Check(args) && !PyUnicode_Check(args)) - dict = args; + dict = args; while (--fmtcnt >= 0) { - if (*fmt != '%') { - if (--rescnt < 0) { - rescnt = fmtcnt + 100; - reslen += rescnt; - if (_PyUnicode_Resize(&result, reslen) < 0) - goto onError; - res = PyUnicode_AS_UNICODE(result) + reslen - rescnt; - --rescnt; - } - *res++ = *fmt++; - } - else { - /* Got a format specifier */ - int flags = 0; - Py_ssize_t width = -1; - int prec = -1; - Py_UNICODE c = '\0'; - Py_UNICODE fill; - int isnumok; - PyObject *v = NULL; - PyObject *temp = NULL; - Py_UNICODE *pbuf; - Py_UNICODE sign; - Py_ssize_t len; - Py_UNICODE formatbuf[FORMATBUFLEN]; /* For format{float,int,char}() */ - - fmt++; - if (*fmt == '(') { - Py_UNICODE *keystart; - Py_ssize_t keylen; - PyObject *key; - int pcount = 1; - - if (dict == NULL) { - PyErr_SetString(PyExc_TypeError, - "format requires a mapping"); - goto onError; - } - ++fmt; - --fmtcnt; - keystart = fmt; - /* Skip over balanced parentheses */ - while (pcount > 0 && --fmtcnt >= 0) { - if (*fmt == ')') - --pcount; - else if (*fmt == '(') - ++pcount; - fmt++; - } - keylen = fmt - keystart - 1; - if (fmtcnt < 0 || pcount > 0) { - PyErr_SetString(PyExc_ValueError, - "incomplete format key"); - goto onError; - } + if (*fmt != '%') { + if (--rescnt < 0) { + rescnt = fmtcnt + 100; + reslen += rescnt; + if (_PyUnicode_Resize(&result, reslen) < 0) + goto onError; + res = PyUnicode_AS_UNICODE(result) + reslen - rescnt; + --rescnt; + } + *res++ = *fmt++; + } + else { + /* Got a format specifier */ + int flags = 0; + Py_ssize_t width = -1; + int prec = -1; + Py_UNICODE c = '\0'; + Py_UNICODE fill; + int isnumok; + PyObject *v = NULL; + PyObject *temp = NULL; + Py_UNICODE *pbuf; + Py_UNICODE sign; + Py_ssize_t len; + Py_UNICODE formatbuf[FORMATBUFLEN]; /* For format{float,int,char}() */ + + fmt++; + if (*fmt == '(') { + Py_UNICODE *keystart; + Py_ssize_t keylen; + PyObject *key; + int pcount = 1; + + if (dict == NULL) { + PyErr_SetString(PyExc_TypeError, + "format requires a mapping"); + goto onError; + } + ++fmt; + --fmtcnt; + keystart = fmt; + /* Skip over balanced parentheses */ + while (pcount > 0 && --fmtcnt >= 0) { + if (*fmt == ')') + --pcount; + else if (*fmt == '(') + ++pcount; + fmt++; + } + keylen = fmt - keystart - 1; + if (fmtcnt < 0 || pcount > 0) { + PyErr_SetString(PyExc_ValueError, + "incomplete format key"); + goto onError; + } #if 0 - /* keys are converted to strings using UTF-8 and - then looked up since Python uses strings to hold - variables names etc. in its namespaces and we - wouldn't want to break common idioms. */ - key = PyUnicode_EncodeUTF8(keystart, - keylen, - NULL); + /* keys are converted to strings using UTF-8 and + then looked up since Python uses strings to hold + variables names etc. in its namespaces and we + wouldn't want to break common idioms. */ + key = PyUnicode_EncodeUTF8(keystart, + keylen, + NULL); #else - key = PyUnicode_FromUnicode(keystart, keylen); + key = PyUnicode_FromUnicode(keystart, keylen); #endif - if (key == NULL) - goto onError; - if (args_owned) { - Py_DECREF(args); - args_owned = 0; - } - args = PyObject_GetItem(dict, key); - Py_DECREF(key); - if (args == NULL) { - goto onError; - } - args_owned = 1; - arglen = -1; - argidx = -2; - } - while (--fmtcnt >= 0) { - switch (c = *fmt++) { - case '-': flags |= F_LJUST; continue; - case '+': flags |= F_SIGN; continue; - case ' ': flags |= F_BLANK; continue; - case '#': flags |= F_ALT; continue; - case '0': flags |= F_ZERO; continue; - } - break; - } - if (c == '*') { - v = getnextarg(args, arglen, &argidx); - if (v == NULL) - goto onError; - if (!PyLong_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "* wants int"); - goto onError; - } - width = PyLong_AsLong(v); - if (width == -1 && PyErr_Occurred()) - goto onError; - if (width < 0) { - flags |= F_LJUST; - width = -width; - } - if (--fmtcnt >= 0) - c = *fmt++; - } - else if (c >= '0' && c <= '9') { - width = c - '0'; - while (--fmtcnt >= 0) { - c = *fmt++; - if (c < '0' || c > '9') - break; - if ((width*10) / 10 != width) { - PyErr_SetString(PyExc_ValueError, - "width too big"); - goto onError; - } - width = width*10 + (c - '0'); - } - } - if (c == '.') { - prec = 0; - if (--fmtcnt >= 0) - c = *fmt++; - if (c == '*') { - v = getnextarg(args, arglen, &argidx); - if (v == NULL) - goto onError; - if (!PyLong_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "* wants int"); - goto onError; - } - prec = PyLong_AsLong(v); - if (prec == -1 && PyErr_Occurred()) - goto onError; - if (prec < 0) - prec = 0; - if (--fmtcnt >= 0) - c = *fmt++; - } - else if (c >= '0' && c <= '9') { - prec = c - '0'; - while (--fmtcnt >= 0) { - c = Py_CHARMASK(*fmt++); - if (c < '0' || c > '9') - break; - if ((prec*10) / 10 != prec) { - PyErr_SetString(PyExc_ValueError, - "prec too big"); - goto onError; - } - prec = prec*10 + (c - '0'); - } - } - } /* prec */ - if (fmtcnt >= 0) { - if (c == 'h' || c == 'l' || c == 'L') { - if (--fmtcnt >= 0) - c = *fmt++; - } - } - if (fmtcnt < 0) { - PyErr_SetString(PyExc_ValueError, - "incomplete format"); - goto onError; - } - if (c != '%') { - v = getnextarg(args, arglen, &argidx); - if (v == NULL) - goto onError; - } - sign = 0; - fill = ' '; - switch (c) { - - case '%': - pbuf = formatbuf; - /* presume that buffer length is at least 1 */ - pbuf[0] = '%'; - len = 1; - break; - - case 's': - case 'r': - case 'a': - if (PyUnicode_Check(v) && c == 's') { - temp = v; - Py_INCREF(temp); - } - else { - if (c == 's') - temp = PyObject_Str(v); - else if (c == 'r') - temp = PyObject_Repr(v); - else - temp = PyObject_ASCII(v); - if (temp == NULL) - goto onError; + if (key == NULL) + goto onError; + if (args_owned) { + Py_DECREF(args); + args_owned = 0; + } + args = PyObject_GetItem(dict, key); + Py_DECREF(key); + if (args == NULL) { + goto onError; + } + args_owned = 1; + arglen = -1; + argidx = -2; + } + while (--fmtcnt >= 0) { + switch (c = *fmt++) { + case '-': flags |= F_LJUST; continue; + case '+': flags |= F_SIGN; continue; + case ' ': flags |= F_BLANK; continue; + case '#': flags |= F_ALT; continue; + case '0': flags |= F_ZERO; continue; + } + break; + } + if (c == '*') { + v = getnextarg(args, arglen, &argidx); + if (v == NULL) + goto onError; + if (!PyLong_Check(v)) { + PyErr_SetString(PyExc_TypeError, + "* wants int"); + goto onError; + } + width = PyLong_AsLong(v); + if (width == -1 && PyErr_Occurred()) + goto onError; + if (width < 0) { + flags |= F_LJUST; + width = -width; + } + if (--fmtcnt >= 0) + c = *fmt++; + } + else if (c >= '0' && c <= '9') { + width = c - '0'; + while (--fmtcnt >= 0) { + c = *fmt++; + if (c < '0' || c > '9') + break; + if ((width*10) / 10 != width) { + PyErr_SetString(PyExc_ValueError, + "width too big"); + goto onError; + } + width = width*10 + (c - '0'); + } + } + if (c == '.') { + prec = 0; + if (--fmtcnt >= 0) + c = *fmt++; + if (c == '*') { + v = getnextarg(args, arglen, &argidx); + if (v == NULL) + goto onError; + if (!PyLong_Check(v)) { + PyErr_SetString(PyExc_TypeError, + "* wants int"); + goto onError; + } + prec = PyLong_AsLong(v); + if (prec == -1 && PyErr_Occurred()) + goto onError; + if (prec < 0) + prec = 0; + if (--fmtcnt >= 0) + c = *fmt++; + } + else if (c >= '0' && c <= '9') { + prec = c - '0'; + while (--fmtcnt >= 0) { + c = Py_CHARMASK(*fmt++); + if (c < '0' || c > '9') + break; + if ((prec*10) / 10 != prec) { + PyErr_SetString(PyExc_ValueError, + "prec too big"); + goto onError; + } + prec = prec*10 + (c - '0'); + } + } + } /* prec */ + if (fmtcnt >= 0) { + if (c == 'h' || c == 'l' || c == 'L') { + if (--fmtcnt >= 0) + c = *fmt++; + } + } + if (fmtcnt < 0) { + PyErr_SetString(PyExc_ValueError, + "incomplete format"); + goto onError; + } + if (c != '%') { + v = getnextarg(args, arglen, &argidx); + if (v == NULL) + goto onError; + } + sign = 0; + fill = ' '; + switch (c) { + + case '%': + pbuf = formatbuf; + /* presume that buffer length is at least 1 */ + pbuf[0] = '%'; + len = 1; + break; + + case 's': + case 'r': + case 'a': + if (PyUnicode_Check(v) && c == 's') { + temp = v; + Py_INCREF(temp); + } + else { + if (c == 's') + temp = PyObject_Str(v); + else if (c == 'r') + temp = PyObject_Repr(v); + else + temp = PyObject_ASCII(v); + if (temp == NULL) + goto onError; if (PyUnicode_Check(temp)) /* nothing to do */; - else { - Py_DECREF(temp); - PyErr_SetString(PyExc_TypeError, - "%s argument has non-string str()"); - goto onError; - } - } - pbuf = PyUnicode_AS_UNICODE(temp); - len = PyUnicode_GET_SIZE(temp); - if (prec >= 0 && len > prec) - len = prec; - break; - - case 'i': - case 'd': - case 'u': - case 'o': - case 'x': - case 'X': - if (c == 'i') - c = 'd'; - isnumok = 0; - if (PyNumber_Check(v)) { - PyObject *iobj=NULL; - - if (PyLong_Check(v)) { - iobj = v; - Py_INCREF(iobj); - } - else { - iobj = PyNumber_Long(v); - } - if (iobj!=NULL) { - if (PyLong_Check(iobj)) { - isnumok = 1; - temp = formatlong(iobj, flags, prec, c); - Py_DECREF(iobj); - if (!temp) - goto onError; - pbuf = PyUnicode_AS_UNICODE(temp); - len = PyUnicode_GET_SIZE(temp); - sign = 1; - } - else { - Py_DECREF(iobj); - } - } - } - if (!isnumok) { - PyErr_Format(PyExc_TypeError, - "%%%c format: a number is required, " - "not %.200s", (char)c, Py_TYPE(v)->tp_name); - goto onError; - } - if (flags & F_ZERO) - fill = '0'; - break; - - case 'e': - case 'E': - case 'f': - case 'F': - case 'g': - case 'G': - if (c == 'F') - c = 'f'; - pbuf = formatbuf; - len = formatfloat(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), - flags, prec, c, v); - if (len < 0) - goto onError; - sign = 1; - if (flags & F_ZERO) - fill = '0'; - break; - - case 'c': - pbuf = formatbuf; - len = formatchar(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), v); - if (len < 0) - goto onError; - break; - - default: - PyErr_Format(PyExc_ValueError, - "unsupported format character '%c' (0x%x) " - "at index %zd", - (31<=c && c<=126) ? (char)c : '?', + else { + Py_DECREF(temp); + PyErr_SetString(PyExc_TypeError, + "%s argument has non-string str()"); + goto onError; + } + } + pbuf = PyUnicode_AS_UNICODE(temp); + len = PyUnicode_GET_SIZE(temp); + if (prec >= 0 && len > prec) + len = prec; + break; + + case 'i': + case 'd': + case 'u': + case 'o': + case 'x': + case 'X': + if (c == 'i') + c = 'd'; + isnumok = 0; + if (PyNumber_Check(v)) { + PyObject *iobj=NULL; + + if (PyLong_Check(v)) { + iobj = v; + Py_INCREF(iobj); + } + else { + iobj = PyNumber_Long(v); + } + if (iobj!=NULL) { + if (PyLong_Check(iobj)) { + isnumok = 1; + temp = formatlong(iobj, flags, prec, c); + Py_DECREF(iobj); + if (!temp) + goto onError; + pbuf = PyUnicode_AS_UNICODE(temp); + len = PyUnicode_GET_SIZE(temp); + sign = 1; + } + else { + Py_DECREF(iobj); + } + } + } + if (!isnumok) { + PyErr_Format(PyExc_TypeError, + "%%%c format: a number is required, " + "not %.200s", (char)c, Py_TYPE(v)->tp_name); + goto onError; + } + if (flags & F_ZERO) + fill = '0'; + break; + + case 'e': + case 'E': + case 'f': + case 'F': + case 'g': + case 'G': + if (c == 'F') + c = 'f'; + pbuf = formatbuf; + len = formatfloat(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), + flags, prec, c, v); + if (len < 0) + goto onError; + sign = 1; + if (flags & F_ZERO) + fill = '0'; + break; + + case 'c': + pbuf = formatbuf; + len = formatchar(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), v); + if (len < 0) + goto onError; + break; + + default: + PyErr_Format(PyExc_ValueError, + "unsupported format character '%c' (0x%x) " + "at index %zd", + (31<=c && c<=126) ? (char)c : '?', (int)c, - (Py_ssize_t)(fmt - 1 - - PyUnicode_AS_UNICODE(uformat))); - goto onError; - } - if (sign) { - if (*pbuf == '-' || *pbuf == '+') { - sign = *pbuf++; - len--; - } - else if (flags & F_SIGN) - sign = '+'; - else if (flags & F_BLANK) - sign = ' '; - else - sign = 0; - } - if (width < len) - width = len; - if (rescnt - (sign != 0) < width) { - reslen -= rescnt; - rescnt = width + fmtcnt + 100; - reslen += rescnt; - if (reslen < 0) { - Py_XDECREF(temp); - PyErr_NoMemory(); - goto onError; - } - if (_PyUnicode_Resize(&result, reslen) < 0) { - Py_XDECREF(temp); - goto onError; - } - res = PyUnicode_AS_UNICODE(result) - + reslen - rescnt; - } - if (sign) { - if (fill != ' ') - *res++ = sign; - rescnt--; - if (width > len) - width--; - } - if ((flags & F_ALT) && (c == 'x' || c == 'X' || c == 'o')) { - assert(pbuf[0] == '0'); - assert(pbuf[1] == c); - if (fill != ' ') { - *res++ = *pbuf++; - *res++ = *pbuf++; - } - rescnt -= 2; - width -= 2; - if (width < 0) - width = 0; - len -= 2; - } - if (width > len && !(flags & F_LJUST)) { - do { - --rescnt; - *res++ = fill; - } while (--width > len); - } - if (fill == ' ') { - if (sign) - *res++ = sign; - if ((flags & F_ALT) && (c == 'x' || c == 'X' || c == 'o')) { - assert(pbuf[0] == '0'); - assert(pbuf[1] == c); - *res++ = *pbuf++; - *res++ = *pbuf++; - } - } - Py_UNICODE_COPY(res, pbuf, len); - res += len; - rescnt -= len; - while (--width >= len) { - --rescnt; - *res++ = ' '; - } - if (dict && (argidx < arglen) && c != '%') { - PyErr_SetString(PyExc_TypeError, - "not all arguments converted during string formatting"); + (Py_ssize_t)(fmt - 1 - + PyUnicode_AS_UNICODE(uformat))); + goto onError; + } + if (sign) { + if (*pbuf == '-' || *pbuf == '+') { + sign = *pbuf++; + len--; + } + else if (flags & F_SIGN) + sign = '+'; + else if (flags & F_BLANK) + sign = ' '; + else + sign = 0; + } + if (width < len) + width = len; + if (rescnt - (sign != 0) < width) { + reslen -= rescnt; + rescnt = width + fmtcnt + 100; + reslen += rescnt; + if (reslen < 0) { + Py_XDECREF(temp); + PyErr_NoMemory(); + goto onError; + } + if (_PyUnicode_Resize(&result, reslen) < 0) { + Py_XDECREF(temp); + goto onError; + } + res = PyUnicode_AS_UNICODE(result) + + reslen - rescnt; + } + if (sign) { + if (fill != ' ') + *res++ = sign; + rescnt--; + if (width > len) + width--; + } + if ((flags & F_ALT) && (c == 'x' || c == 'X' || c == 'o')) { + assert(pbuf[0] == '0'); + assert(pbuf[1] == c); + if (fill != ' ') { + *res++ = *pbuf++; + *res++ = *pbuf++; + } + rescnt -= 2; + width -= 2; + if (width < 0) + width = 0; + len -= 2; + } + if (width > len && !(flags & F_LJUST)) { + do { + --rescnt; + *res++ = fill; + } while (--width > len); + } + if (fill == ' ') { + if (sign) + *res++ = sign; + if ((flags & F_ALT) && (c == 'x' || c == 'X' || c == 'o')) { + assert(pbuf[0] == '0'); + assert(pbuf[1] == c); + *res++ = *pbuf++; + *res++ = *pbuf++; + } + } + Py_UNICODE_COPY(res, pbuf, len); + res += len; + rescnt -= len; + while (--width >= len) { + --rescnt; + *res++ = ' '; + } + if (dict && (argidx < arglen) && c != '%') { + PyErr_SetString(PyExc_TypeError, + "not all arguments converted during string formatting"); Py_XDECREF(temp); - goto onError; - } - Py_XDECREF(temp); - } /* '%' */ + goto onError; + } + Py_XDECREF(temp); + } /* '%' */ } /* until end */ if (argidx < arglen && !dict) { - PyErr_SetString(PyExc_TypeError, - "not all arguments converted during string formatting"); - goto onError; + PyErr_SetString(PyExc_TypeError, + "not all arguments converted during string formatting"); + goto onError; } if (_PyUnicode_Resize(&result, reslen - rescnt) < 0) - goto onError; + goto onError; if (args_owned) { - Py_DECREF(args); + Py_DECREF(args); } Py_DECREF(uformat); return (PyObject *)result; - onError: + onError: Py_XDECREF(result); Py_DECREF(uformat); if (args_owned) { - Py_DECREF(args); + Py_DECREF(args); } return NULL; } @@ -9426,56 +9426,56 @@ static PyObject * unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { - PyObject *x = NULL; - static char *kwlist[] = {"object", "encoding", "errors", 0}; - char *encoding = NULL; - char *errors = NULL; - - if (type != &PyUnicode_Type) - return unicode_subtype_new(type, args, kwds); - if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oss:str", - kwlist, &x, &encoding, &errors)) - return NULL; - if (x == NULL) - return (PyObject *)_PyUnicode_New(0); - if (encoding == NULL && errors == NULL) - return PyObject_Str(x); - else - return PyUnicode_FromEncodedObject(x, encoding, errors); + PyObject *x = NULL; + static char *kwlist[] = {"object", "encoding", "errors", 0}; + char *encoding = NULL; + char *errors = NULL; + + if (type != &PyUnicode_Type) + return unicode_subtype_new(type, args, kwds); + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oss:str", + kwlist, &x, &encoding, &errors)) + return NULL; + if (x == NULL) + return (PyObject *)_PyUnicode_New(0); + if (encoding == NULL && errors == NULL) + return PyObject_Str(x); + else + return PyUnicode_FromEncodedObject(x, encoding, errors); } static PyObject * unicode_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { - PyUnicodeObject *tmp, *pnew; - Py_ssize_t n; + PyUnicodeObject *tmp, *pnew; + Py_ssize_t n; - assert(PyType_IsSubtype(type, &PyUnicode_Type)); - tmp = (PyUnicodeObject *)unicode_new(&PyUnicode_Type, args, kwds); - if (tmp == NULL) - return NULL; - assert(PyUnicode_Check(tmp)); - pnew = (PyUnicodeObject *) type->tp_alloc(type, n = tmp->length); - if (pnew == NULL) { - Py_DECREF(tmp); - return NULL; - } - pnew->str = (Py_UNICODE*) PyObject_MALLOC(sizeof(Py_UNICODE) * (n+1)); - if (pnew->str == NULL) { - _Py_ForgetReference((PyObject *)pnew); - PyObject_Del(pnew); - Py_DECREF(tmp); - return PyErr_NoMemory(); - } - Py_UNICODE_COPY(pnew->str, tmp->str, n+1); - pnew->length = n; - pnew->hash = tmp->hash; - Py_DECREF(tmp); - return (PyObject *)pnew; + assert(PyType_IsSubtype(type, &PyUnicode_Type)); + tmp = (PyUnicodeObject *)unicode_new(&PyUnicode_Type, args, kwds); + if (tmp == NULL) + return NULL; + assert(PyUnicode_Check(tmp)); + pnew = (PyUnicodeObject *) type->tp_alloc(type, n = tmp->length); + if (pnew == NULL) { + Py_DECREF(tmp); + return NULL; + } + pnew->str = (Py_UNICODE*) PyObject_MALLOC(sizeof(Py_UNICODE) * (n+1)); + if (pnew->str == NULL) { + _Py_ForgetReference((PyObject *)pnew); + PyObject_Del(pnew); + Py_DECREF(tmp); + return PyErr_NoMemory(); + } + Py_UNICODE_COPY(pnew->str, tmp->str, n+1); + pnew->length = n; + pnew->hash = tmp->hash; + Py_DECREF(tmp); + return (PyObject *)pnew; } PyDoc_STRVAR(unicode_doc, -"str(string[, encoding[, errors]]) -> str\n\ + "str(string[, encoding[, errors]]) -> str\n\ \n\ Create a new string object from the given encoded string.\n\ encoding defaults to the current default string encoding.\n\ @@ -9485,46 +9485,46 @@ PyTypeObject PyUnicode_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) - "str", /* tp_name */ - sizeof(PyUnicodeObject), /* tp_size */ - 0, /* tp_itemsize */ + "str", /* tp_name */ + sizeof(PyUnicodeObject), /* tp_size */ + 0, /* tp_itemsize */ /* Slots */ - (destructor)unicode_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_compare */ - unicode_repr, /* tp_repr */ - &unicode_as_number, /* tp_as_number */ - &unicode_as_sequence, /* tp_as_sequence */ - &unicode_as_mapping, /* tp_as_mapping */ - (hashfunc) unicode_hash, /* tp_hash*/ - 0, /* tp_call*/ - (reprfunc) unicode_str, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | - Py_TPFLAGS_UNICODE_SUBCLASS, /* tp_flags */ - unicode_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - PyUnicode_RichCompare, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - unicode_iter, /* tp_iter */ - 0, /* tp_iternext */ - unicode_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &PyBaseObject_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - unicode_new, /* tp_new */ - PyObject_Del, /* tp_free */ + (destructor)unicode_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + unicode_repr, /* tp_repr */ + &unicode_as_number, /* tp_as_number */ + &unicode_as_sequence, /* tp_as_sequence */ + &unicode_as_mapping, /* tp_as_mapping */ + (hashfunc) unicode_hash, /* tp_hash*/ + 0, /* tp_call*/ + (reprfunc) unicode_str, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | + Py_TPFLAGS_UNICODE_SUBCLASS, /* tp_flags */ + unicode_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + PyUnicode_RichCompare, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + unicode_iter, /* tp_iter */ + 0, /* tp_iternext */ + unicode_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &PyBaseObject_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + unicode_new, /* tp_new */ + PyObject_Del, /* tp_free */ }; /* Initialize the Unicode implementation */ @@ -9550,12 +9550,12 @@ numfree = 0; unicode_empty = _PyUnicode_New(0); if (!unicode_empty) - return; + return; for (i = 0; i < 256; i++) - unicode_latin1[i] = NULL; + unicode_latin1[i] = NULL; if (PyType_Ready(&PyUnicode_Type) < 0) - Py_FatalError("Can't initialize 'unicode'"); + Py_FatalError("Can't initialize 'unicode'"); /* initialize the linebreak bloom filter */ bloom_linebreak = make_bloom_mask( @@ -9574,13 +9574,13 @@ PyUnicodeObject *u; for (u = free_list; u != NULL;) { - PyUnicodeObject *v = u; - u = *(PyUnicodeObject **)u; - if (v->str) - PyObject_DEL(v->str); - Py_XDECREF(v->defenc); - PyObject_Del(v); - numfree--; + PyUnicodeObject *v = u; + u = *(PyUnicodeObject **)u; + if (v->str) + PyObject_DEL(v->str); + Py_XDECREF(v->defenc); + PyObject_Del(v); + numfree--; } free_list = NULL; assert(numfree == 0); @@ -9596,10 +9596,10 @@ unicode_empty = NULL; for (i = 0; i < 256; i++) { - if (unicode_latin1[i]) { - Py_DECREF(unicode_latin1[i]); - unicode_latin1[i] = NULL; - } + if (unicode_latin1[i]) { + Py_DECREF(unicode_latin1[i]); + unicode_latin1[i] = NULL; + } } (void)PyUnicode_ClearFreeList(); } @@ -9607,238 +9607,238 @@ void PyUnicode_InternInPlace(PyObject **p) { - register PyUnicodeObject *s = (PyUnicodeObject *)(*p); - PyObject *t; - if (s == NULL || !PyUnicode_Check(s)) - Py_FatalError( - "PyUnicode_InternInPlace: unicode strings only please!"); - /* If it's a subclass, we don't really know what putting - it in the interned dict might do. */ - if (!PyUnicode_CheckExact(s)) - return; - if (PyUnicode_CHECK_INTERNED(s)) - return; - if (interned == NULL) { - interned = PyDict_New(); - if (interned == NULL) { - PyErr_Clear(); /* Don't leave an exception */ - return; - } - } - /* It might be that the GetItem call fails even - though the key is present in the dictionary, - namely when this happens during a stack overflow. */ - Py_ALLOW_RECURSION - t = PyDict_GetItem(interned, (PyObject *)s); - Py_END_ALLOW_RECURSION - - if (t) { - Py_INCREF(t); - Py_DECREF(*p); - *p = t; - return; - } - - PyThreadState_GET()->recursion_critical = 1; - if (PyDict_SetItem(interned, (PyObject *)s, (PyObject *)s) < 0) { - PyErr_Clear(); - PyThreadState_GET()->recursion_critical = 0; - return; - } - PyThreadState_GET()->recursion_critical = 0; - /* The two references in interned are not counted by refcnt. - The deallocator will take care of this */ - Py_REFCNT(s) -= 2; - PyUnicode_CHECK_INTERNED(s) = SSTATE_INTERNED_MORTAL; + register PyUnicodeObject *s = (PyUnicodeObject *)(*p); + PyObject *t; + if (s == NULL || !PyUnicode_Check(s)) + Py_FatalError( + "PyUnicode_InternInPlace: unicode strings only please!"); + /* If it's a subclass, we don't really know what putting + it in the interned dict might do. */ + if (!PyUnicode_CheckExact(s)) + return; + if (PyUnicode_CHECK_INTERNED(s)) + return; + if (interned == NULL) { + interned = PyDict_New(); + if (interned == NULL) { + PyErr_Clear(); /* Don't leave an exception */ + return; + } + } + /* It might be that the GetItem call fails even + though the key is present in the dictionary, + namely when this happens during a stack overflow. */ + Py_ALLOW_RECURSION + t = PyDict_GetItem(interned, (PyObject *)s); + Py_END_ALLOW_RECURSION + + if (t) { + Py_INCREF(t); + Py_DECREF(*p); + *p = t; + return; + } + + PyThreadState_GET()->recursion_critical = 1; + if (PyDict_SetItem(interned, (PyObject *)s, (PyObject *)s) < 0) { + PyErr_Clear(); + PyThreadState_GET()->recursion_critical = 0; + return; + } + PyThreadState_GET()->recursion_critical = 0; + /* The two references in interned are not counted by refcnt. + The deallocator will take care of this */ + Py_REFCNT(s) -= 2; + PyUnicode_CHECK_INTERNED(s) = SSTATE_INTERNED_MORTAL; } void PyUnicode_InternImmortal(PyObject **p) { - PyUnicode_InternInPlace(p); - if (PyUnicode_CHECK_INTERNED(*p) != SSTATE_INTERNED_IMMORTAL) { - PyUnicode_CHECK_INTERNED(*p) = SSTATE_INTERNED_IMMORTAL; - Py_INCREF(*p); - } + PyUnicode_InternInPlace(p); + if (PyUnicode_CHECK_INTERNED(*p) != SSTATE_INTERNED_IMMORTAL) { + PyUnicode_CHECK_INTERNED(*p) = SSTATE_INTERNED_IMMORTAL; + Py_INCREF(*p); + } } PyObject * PyUnicode_InternFromString(const char *cp) { - PyObject *s = PyUnicode_FromString(cp); - if (s == NULL) - return NULL; - PyUnicode_InternInPlace(&s); - return s; + PyObject *s = PyUnicode_FromString(cp); + if (s == NULL) + return NULL; + PyUnicode_InternInPlace(&s); + return s; } void _Py_ReleaseInternedUnicodeStrings(void) { - PyObject *keys; - PyUnicodeObject *s; - Py_ssize_t i, n; - Py_ssize_t immortal_size = 0, mortal_size = 0; - - if (interned == NULL || !PyDict_Check(interned)) - return; - keys = PyDict_Keys(interned); - if (keys == NULL || !PyList_Check(keys)) { - PyErr_Clear(); - return; - } - - /* Since _Py_ReleaseInternedUnicodeStrings() is intended to help a leak - detector, interned unicode strings are not forcibly deallocated; - rather, we give them their stolen references back, and then clear - and DECREF the interned dict. */ - - n = PyList_GET_SIZE(keys); - fprintf(stderr, "releasing %" PY_FORMAT_SIZE_T "d interned strings\n", - n); - for (i = 0; i < n; i++) { - s = (PyUnicodeObject *) PyList_GET_ITEM(keys, i); - switch (s->state) { - case SSTATE_NOT_INTERNED: - /* XXX Shouldn't happen */ - break; - case SSTATE_INTERNED_IMMORTAL: - Py_REFCNT(s) += 1; - immortal_size += s->length; - break; - case SSTATE_INTERNED_MORTAL: - Py_REFCNT(s) += 2; - mortal_size += s->length; - break; - default: - Py_FatalError("Inconsistent interned string state."); - } - s->state = SSTATE_NOT_INTERNED; - } - fprintf(stderr, "total size of all interned strings: " - "%" PY_FORMAT_SIZE_T "d/%" PY_FORMAT_SIZE_T "d " - "mortal/immortal\n", mortal_size, immortal_size); - Py_DECREF(keys); - PyDict_Clear(interned); - Py_DECREF(interned); - interned = NULL; + PyObject *keys; + PyUnicodeObject *s; + Py_ssize_t i, n; + Py_ssize_t immortal_size = 0, mortal_size = 0; + + if (interned == NULL || !PyDict_Check(interned)) + return; + keys = PyDict_Keys(interned); + if (keys == NULL || !PyList_Check(keys)) { + PyErr_Clear(); + return; + } + + /* Since _Py_ReleaseInternedUnicodeStrings() is intended to help a leak + detector, interned unicode strings are not forcibly deallocated; + rather, we give them their stolen references back, and then clear + and DECREF the interned dict. */ + + n = PyList_GET_SIZE(keys); + fprintf(stderr, "releasing %" PY_FORMAT_SIZE_T "d interned strings\n", + n); + for (i = 0; i < n; i++) { + s = (PyUnicodeObject *) PyList_GET_ITEM(keys, i); + switch (s->state) { + case SSTATE_NOT_INTERNED: + /* XXX Shouldn't happen */ + break; + case SSTATE_INTERNED_IMMORTAL: + Py_REFCNT(s) += 1; + immortal_size += s->length; + break; + case SSTATE_INTERNED_MORTAL: + Py_REFCNT(s) += 2; + mortal_size += s->length; + break; + default: + Py_FatalError("Inconsistent interned string state."); + } + s->state = SSTATE_NOT_INTERNED; + } + fprintf(stderr, "total size of all interned strings: " + "%" PY_FORMAT_SIZE_T "d/%" PY_FORMAT_SIZE_T "d " + "mortal/immortal\n", mortal_size, immortal_size); + Py_DECREF(keys); + PyDict_Clear(interned); + Py_DECREF(interned); + interned = NULL; } /********************* Unicode Iterator **************************/ typedef struct { - PyObject_HEAD - Py_ssize_t it_index; - PyUnicodeObject *it_seq; /* Set to NULL when iterator is exhausted */ + PyObject_HEAD + Py_ssize_t it_index; + PyUnicodeObject *it_seq; /* Set to NULL when iterator is exhausted */ } unicodeiterobject; static void unicodeiter_dealloc(unicodeiterobject *it) { - _PyObject_GC_UNTRACK(it); - Py_XDECREF(it->it_seq); - PyObject_GC_Del(it); + _PyObject_GC_UNTRACK(it); + Py_XDECREF(it->it_seq); + PyObject_GC_Del(it); } static int unicodeiter_traverse(unicodeiterobject *it, visitproc visit, void *arg) { - Py_VISIT(it->it_seq); - return 0; + Py_VISIT(it->it_seq); + return 0; } static PyObject * unicodeiter_next(unicodeiterobject *it) { - PyUnicodeObject *seq; - PyObject *item; + PyUnicodeObject *seq; + PyObject *item; + + assert(it != NULL); + seq = it->it_seq; + if (seq == NULL) + return NULL; + assert(PyUnicode_Check(seq)); + + if (it->it_index < PyUnicode_GET_SIZE(seq)) { + item = PyUnicode_FromUnicode( + PyUnicode_AS_UNICODE(seq)+it->it_index, 1); + if (item != NULL) + ++it->it_index; + return item; + } - assert(it != NULL); - seq = it->it_seq; - if (seq == NULL) - return NULL; - assert(PyUnicode_Check(seq)); - - if (it->it_index < PyUnicode_GET_SIZE(seq)) { - item = PyUnicode_FromUnicode( - PyUnicode_AS_UNICODE(seq)+it->it_index, 1); - if (item != NULL) - ++it->it_index; - return item; - } - - Py_DECREF(seq); - it->it_seq = NULL; - return NULL; + Py_DECREF(seq); + it->it_seq = NULL; + return NULL; } static PyObject * unicodeiter_len(unicodeiterobject *it) { - Py_ssize_t len = 0; - if (it->it_seq) - len = PyUnicode_GET_SIZE(it->it_seq) - it->it_index; - return PyLong_FromSsize_t(len); + Py_ssize_t len = 0; + if (it->it_seq) + len = PyUnicode_GET_SIZE(it->it_seq) - it->it_index; + return PyLong_FromSsize_t(len); } PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it))."); static PyMethodDef unicodeiter_methods[] = { - {"__length_hint__", (PyCFunction)unicodeiter_len, METH_NOARGS, - length_hint_doc}, - {NULL, NULL} /* sentinel */ + {"__length_hint__", (PyCFunction)unicodeiter_len, METH_NOARGS, + length_hint_doc}, + {NULL, NULL} /* sentinel */ }; PyTypeObject PyUnicodeIter_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - "str_iterator", /* tp_name */ - sizeof(unicodeiterobject), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)unicodeiter_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 */ - 0, /* tp_call */ - 0, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ - 0, /* tp_doc */ - (traverseproc)unicodeiter_traverse, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - PyObject_SelfIter, /* tp_iter */ - (iternextfunc)unicodeiter_next, /* tp_iternext */ - unicodeiter_methods, /* tp_methods */ - 0, + PyVarObject_HEAD_INIT(&PyType_Type, 0) + "str_iterator", /* tp_name */ + sizeof(unicodeiterobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + /* methods */ + (destructor)unicodeiter_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ + 0, /* tp_doc */ + (traverseproc)unicodeiter_traverse, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + PyObject_SelfIter, /* tp_iter */ + (iternextfunc)unicodeiter_next, /* tp_iternext */ + unicodeiter_methods, /* tp_methods */ + 0, }; static PyObject * unicode_iter(PyObject *seq) { - unicodeiterobject *it; + unicodeiterobject *it; - if (!PyUnicode_Check(seq)) { - PyErr_BadInternalCall(); - return NULL; - } - it = PyObject_GC_New(unicodeiterobject, &PyUnicodeIter_Type); - if (it == NULL) - return NULL; - it->it_index = 0; - Py_INCREF(seq); - it->it_seq = (PyUnicodeObject *)seq; - _PyObject_GC_TRACK(it); - return (PyObject *)it; + if (!PyUnicode_Check(seq)) { + PyErr_BadInternalCall(); + return NULL; + } + it = PyObject_GC_New(unicodeiterobject, &PyUnicodeIter_Type); + if (it == NULL) + return NULL; + it->it_index = 0; + Py_INCREF(seq); + it->it_seq = (PyUnicodeObject *)seq; + _PyObject_GC_TRACK(it); + return (PyObject *)it; } size_t @@ -9899,8 +9899,8 @@ /* -Local variables: -c-basic-offset: 4 -indent-tabs-mode: nil -End: + Local variables: + c-basic-offset: 4 + indent-tabs-mode: nil + End: */ Modified: python/branches/io-c/Objects/weakrefobject.c ============================================================================== --- python/branches/io-c/Objects/weakrefobject.c (original) +++ python/branches/io-c/Objects/weakrefobject.c Sun Feb 8 21:39:02 2009 @@ -342,7 +342,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ (reprfunc)weakref_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -642,7 +642,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)proxy_repr, /* tp_repr */ &proxy_as_number, /* tp_as_number */ &proxy_as_sequence, /* tp_as_sequence */ @@ -675,7 +675,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (unaryfunc)proxy_repr, /* tp_repr */ &proxy_as_number, /* tp_as_number */ &proxy_as_sequence, /* tp_as_sequence */ Modified: python/branches/io-c/PC/_msi.c ============================================================================== --- python/branches/io-c/PC/_msi.c (original) +++ python/branches/io-c/PC/_msi.c Sun Feb 8 21:39:02 2009 @@ -473,7 +473,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -643,7 +643,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -791,7 +791,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -908,7 +908,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/PC/_subprocess.c ============================================================================== --- python/branches/io-c/PC/_subprocess.c (original) +++ python/branches/io-c/PC/_subprocess.c Sun Feb 8 21:39:02 2009 @@ -133,7 +133,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ &sp_handle_as_number, /*tp_as_number */ 0, /*tp_as_sequence */ Modified: python/branches/io-c/PC/bdist_wininst/install.c ============================================================================== --- python/branches/io-c/PC/bdist_wininst/install.c (original) +++ python/branches/io-c/PC/bdist_wininst/install.c Sun Feb 8 21:39:02 2009 @@ -114,6 +114,7 @@ FILE *logfile; char modulename[MAX_PATH]; +wchar_t wmodulename[MAX_PATH]; HWND hwndMain; HWND hDialog; @@ -299,6 +300,27 @@ typedef void PyObject; +// Convert a "char *" string to "whcar_t *", or NULL on error. +// Result string must be free'd +wchar_t *widen_string(char *src) +{ + wchar_t *result; + DWORD dest_cch; + int src_len = strlen(src) + 1; // include NULL term in all ops + /* use MultiByteToWideChar() to see how much we need. */ + /* NOTE: this will include the null-term in the length */ + dest_cch = MultiByteToWideChar(CP_ACP, 0, src, src_len, NULL, 0); + // alloc the buffer + result = (wchar_t *)malloc(dest_cch * sizeof(wchar_t)); + if (result==NULL) + return NULL; + /* do the conversion */ + if (0==MultiByteToWideChar(CP_ACP, 0, src, src_len, result, dest_cch)) { + free(result); + return NULL; + } + return result; +} /* * Returns number of files which failed to compile, @@ -307,7 +329,7 @@ static int compile_filelist(HINSTANCE hPython, BOOL optimize_flag) { DECLPROC(hPython, void, Py_Initialize, (void)); - DECLPROC(hPython, void, Py_SetProgramName, (char *)); + DECLPROC(hPython, void, Py_SetProgramName, (wchar_t *)); DECLPROC(hPython, void, Py_Finalize, (void)); DECLPROC(hPython, int, PyRun_SimpleString, (char *)); DECLPROC(hPython, PyObject *, PySys_GetObject, (char *)); @@ -326,7 +348,7 @@ return -1; *Py_OptimizeFlag = optimize_flag ? 1 : 0; - Py_SetProgramName(modulename); + Py_SetProgramName(wmodulename); Py_Initialize(); errors += do_compile_files(PyRun_SimpleString, optimize_flag); @@ -694,10 +716,12 @@ */ static int -run_installscript(HINSTANCE hPython, char *pathname, int argc, char **argv) +do_run_installscript(HINSTANCE hPython, char *pathname, int argc, char **argv) { + int fh, result, i; + static wchar_t *wargv[256]; DECLPROC(hPython, void, Py_Initialize, (void)); - DECLPROC(hPython, int, PySys_SetArgv, (int, char **)); + DECLPROC(hPython, int, PySys_SetArgv, (int, wchar_t **)); DECLPROC(hPython, int, PyRun_SimpleString, (char *)); DECLPROC(hPython, void, Py_Finalize, (void)); DECLPROC(hPython, PyObject *, Py_BuildValue, (char *, ...)); @@ -706,9 +730,6 @@ DECLPROC(hPython, int, PyArg_ParseTuple, (PyObject *, char *, ...)); DECLPROC(hPython, PyObject *, PyErr_Format, (PyObject *, char *)); - int result = 0; - int fh; - if (!Py_Initialize || !PySys_SetArgv || !PyRun_SimpleString || !Py_Finalize) return 1; @@ -730,11 +751,20 @@ } SetDlgItemText(hDialog, IDC_INFO, "Running Script..."); - + Py_Initialize(); prepare_script_environment(hPython); - PySys_SetArgv(argc, argv); + // widen the argv array for py3k. + memset(wargv, 0, sizeof(wargv)); + for (i=0;i integer\n\ -\n\ -Return negative if xy."); - - static char * source_as_string(PyObject *cmd, char *funcname, char *what) { @@ -1036,7 +1017,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -1717,15 +1698,14 @@ static PyObject * builtin_round(PyObject *self, PyObject *args, PyObject *kwds) { -#define UNDEF_NDIGITS (-0x7fffffff) /* Unlikely ndigits value */ static PyObject *round_str = NULL; - int ndigits = UNDEF_NDIGITS; + PyObject *ndigits = NULL; static char *kwlist[] = {"number", "ndigits", 0}; PyObject *number, *round; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|i:round", - kwlist, &number, &ndigits)) - return NULL; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:round", + kwlist, &number, &ndigits)) + return NULL; if (Py_TYPE(number)->tp_dict == NULL) { if (PyType_Ready(Py_TYPE(number)) < 0) @@ -1746,15 +1726,14 @@ return NULL; } - if (ndigits == UNDEF_NDIGITS) - return PyObject_CallFunction(round, "O", number); + if (ndigits == NULL) + return PyObject_CallFunction(round, "O", number); else - return PyObject_CallFunction(round, "Oi", number, ndigits); -#undef UNDEF_NDIGITS + return PyObject_CallFunction(round, "OO", number, ndigits); } PyDoc_STRVAR(round_doc, -"round(number[, ndigits]) -> floating point number\n\ +"round(number[, ndigits]) -> number\n\ \n\ Round a number to a given precision in decimal digits (default 0 digits).\n\ This returns an int when called with one argument, otherwise the\n\ @@ -2187,7 +2166,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -2232,7 +2211,6 @@ {"ascii", builtin_ascii, METH_O, ascii_doc}, {"bin", builtin_bin, METH_O, bin_doc}, {"chr", builtin_chr, METH_VARARGS, chr_doc}, - {"cmp", builtin_cmp, METH_VARARGS, cmp_doc}, {"compile", (PyCFunction)builtin_compile, METH_VARARGS | METH_KEYWORDS, compile_doc}, {"delattr", builtin_delattr, METH_VARARGS, delattr_doc}, {"dir", builtin_dir, METH_VARARGS, dir_doc}, Modified: python/branches/io-c/Python/compile.c ============================================================================== --- python/branches/io-c/Python/compile.c (original) +++ python/branches/io-c/Python/compile.c Sun Feb 8 21:39:02 2009 @@ -4006,6 +4006,8 @@ return NULL; while (PyDict_Next(dict, &pos, &k, &v)) { i = PyLong_AS_LONG(v); + /* The keys of the dictionary are tuples. (see compiler_add_o) + The object we want is always first, though. */ k = PyTuple_GET_ITEM(k, 0); Py_INCREF(k); assert((i - offset) < size); @@ -4029,13 +4031,11 @@ flags |= CO_NESTED; if (ste->ste_generator) flags |= CO_GENERATOR; + if (ste->ste_varargs) + flags |= CO_VARARGS; + if (ste->ste_varkeywords) + flags |= CO_VARKEYWORDS; } - if (ste->ste_varargs) - flags |= CO_VARARGS; - if (ste->ste_varkeywords) - flags |= CO_VARKEYWORDS; - if (ste->ste_generator) - flags |= CO_GENERATOR; /* (Only) inherit compilerflags in PyCF_MASK */ flags |= (c->c_flags->cf_flags & PyCF_MASK); Modified: python/branches/io-c/Python/dynload_win.c ============================================================================== --- python/branches/io-c/Python/dynload_win.c (original) +++ python/branches/io-c/Python/dynload_win.c Sun Feb 8 21:39:02 2009 @@ -11,6 +11,10 @@ #include "importdl.h" #include +// "activation context" magic - see dl_nt.c... +extern ULONG_PTR _Py_ActivateActCtx(); +void _Py_DeactivateActCtx(ULONG_PTR cookie); + const struct filedescr _PyImport_DynLoadFiletab[] = { #ifdef _DEBUG {"_d.pyd", "rb", C_EXTENSION}, @@ -172,6 +176,7 @@ char pathbuf[260]; LPTSTR dummy; unsigned int old_mode; + ULONG_PTR cookie = 0; /* We use LoadLibraryEx so Windows looks for dependent DLLs in directory of pathname first. However, Windows95 can sometimes not work correctly unless the absolute @@ -184,10 +189,13 @@ if (GetFullPathName(pathname, sizeof(pathbuf), pathbuf, - &dummy)) + &dummy)) { + ULONG_PTR cookie = _Py_ActivateActCtx(); /* XXX This call doesn't exist in Windows CE */ hDLL = LoadLibraryEx(pathname, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + _Py_DeactivateActCtx(cookie); + } /* restore old error mode settings */ SetErrorMode(old_mode); Modified: python/branches/io-c/Python/import.c ============================================================================== --- python/branches/io-c/Python/import.c (original) +++ python/branches/io-c/Python/import.c Sun Feb 8 21:39:02 2009 @@ -2894,12 +2894,14 @@ imp_find_module(PyObject *self, PyObject *args) { char *name; - PyObject *path = NULL; + PyObject *ret, *path = NULL; if (!PyArg_ParseTuple(args, "es|O:find_module", Py_FileSystemDefaultEncoding, &name, &path)) return NULL; - return call_find_module(name, path); + ret = call_find_module(name, path); + PyMem_Free(name); + return ret; } static PyObject * @@ -3293,7 +3295,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/Python/makeopcodetargets.py ============================================================================== --- python/branches/io-c/Python/makeopcodetargets.py (original) +++ python/branches/io-c/Python/makeopcodetargets.py Sun Feb 8 21:39:02 2009 @@ -3,6 +3,9 @@ (for compilers supporting computed gotos or "labels-as-values", such as gcc). """ +# This code should stay compatible with Python 2.3, at least while +# some of the buildbots have Python 2.3 as their system Python. + import imp import os @@ -25,7 +28,7 @@ continue targets[op] = "TARGET_%s" % opname f.write("static void *opcode_targets[256] = {\n") - f.write(",\n".join("\t&&%s" % s for s in targets)) + f.write(",\n".join(["\t&&%s" % s for s in targets])) f.write("\n};\n") Modified: python/branches/io-c/Python/symtable.c ============================================================================== --- python/branches/io-c/Python/symtable.c (original) +++ python/branches/io-c/Python/symtable.c Sun Feb 8 21:39:02 2009 @@ -130,7 +130,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)ste_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: python/branches/io-c/Python/sysmodule.c ============================================================================== --- python/branches/io-c/Python/sysmodule.c (original) +++ python/branches/io-c/Python/sysmodule.c Sun Feb 8 21:39:02 2009 @@ -1017,7 +1017,7 @@ builtin_module_names -- tuple of module names built into this interpreter\n\ subversion -- subversion information of the build as tuple\n\ version -- the version of this interpreter as a string\n\ -version_info -- version information as a tuple\n\ +version_info -- version information as a named tuple\n\ hexversion -- version information encoded as a single integer\n\ copyright -- copyright notice pertaining to this interpreter\n\ platform -- platform identifier\n\ @@ -1227,6 +1227,75 @@ return seq; } +PyDoc_STRVAR(version_info__doc__, +"sys.version_info\n\ +\n\ +Version information as a named tuple."); + +static PyTypeObject VersionInfoType; + +static PyStructSequence_Field version_info_fields[] = { + {"major", "Major release number"}, + {"minor", "Minor release number"}, + {"micro", "Patch release number"}, + {"releaselevel", "'alpha', 'beta', 'candidate', or 'release'"}, + {"serial", "Serial release number"}, + {0} +}; + +static PyStructSequence_Desc version_info_desc = { + "sys.version_info", /* name */ + version_info__doc__, /* doc */ + version_info_fields, /* fields */ + 5 +}; + +static PyObject * +make_version_info(void) +{ + PyObject *version_info; + char *s; + int pos = 0; + + version_info = PyStructSequence_New(&VersionInfoType); + if (version_info == NULL) { + return NULL; + } + + /* + * These release level checks are mutually exclusive and cover + * the field, so don't get too fancy with the pre-processor! + */ +#if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_ALPHA + s = "alpha"; +#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_BETA + s = "beta"; +#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_GAMMA + s = "candidate"; +#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_FINAL + s = "final"; +#endif + +#define SetIntItem(flag) \ + PyStructSequence_SET_ITEM(version_info, pos++, PyLong_FromLong(flag)) +#define SetStrItem(flag) \ + PyStructSequence_SET_ITEM(version_info, pos++, PyUnicode_FromString(flag)) + + SetIntItem(PY_MAJOR_VERSION); + SetIntItem(PY_MINOR_VERSION); + SetIntItem(PY_MICRO_VERSION); + SetStrItem(s); + SetIntItem(PY_RELEASE_SERIAL); +#undef SetIntItem +#undef SetStrItem + + if (PyErr_Occurred()) { + Py_CLEAR(version_info); + return NULL; + } + return version_info; +} + static struct PyModuleDef sysmodule = { PyModuleDef_HEAD_INIT, "sys", @@ -1239,8 +1308,6 @@ NULL }; - - PyObject * _PySys_Init(void) { @@ -1291,25 +1358,6 @@ svn_revision)); SET_SYS_FROM_STRING("dont_write_bytecode", PyBool_FromLong(Py_DontWriteBytecodeFlag)); - /* - * These release level checks are mutually exclusive and cover - * the field, so don't get too fancy with the pre-processor! - */ -#if PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_ALPHA - s = "alpha"; -#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_BETA - s = "beta"; -#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_GAMMA - s = "candidate"; -#elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_FINAL - s = "final"; -#endif - - SET_SYS_FROM_STRING("version_info", - Py_BuildValue("iiiUi", PY_MAJOR_VERSION, - PY_MINOR_VERSION, - PY_MICRO_VERSION, s, - PY_RELEASE_SERIAL)); SET_SYS_FROM_STRING("api_version", PyLong_FromLong(PYTHON_API_VERSION)); SET_SYS_FROM_STRING("copyright", @@ -1361,6 +1409,15 @@ PyDict_SetItemString(sysdict, "warnoptions", warnoptions); } + /* version_info */ + if (VersionInfoType.tp_name == 0) + PyStructSequence_InitType(&VersionInfoType, &version_info_desc); + SET_SYS_FROM_STRING("version_info", make_version_info()); + /* prevent user from creating new instances */ + VersionInfoType.tp_init = NULL; + VersionInfoType.tp_new = NULL; + + /* flags */ if (FlagsType.tp_name == 0) PyStructSequence_InitType(&FlagsType, &flags_desc); SET_SYS_FROM_STRING("flags", make_flags()); Modified: python/branches/io-c/Python/traceback.c ============================================================================== --- python/branches/io-c/Python/traceback.c (original) +++ python/branches/io-c/Python/traceback.c Sun Feb 8 21:39:02 2009 @@ -72,7 +72,7 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - 0, /*tp_compare*/ + 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ Modified: python/branches/io-c/README ============================================================================== --- python/branches/io-c/README (original) +++ python/branches/io-c/README Sun Feb 8 21:39:02 2009 @@ -130,11 +130,11 @@ If you're not sure whether you're dealing with a bug or a feature, use the mailing list: - python-3000 at python.org + python-dev at python.org To subscribe to the list, use the mailman form: - http://mail.python.org/mailman/listinfo/python-3000/ + http://mail.python.org/mailman/listinfo/python-dev/ Build Instructions Modified: python/branches/io-c/Tools/framer/framer/slots.py ============================================================================== --- python/branches/io-c/Tools/framer/framer/slots.py (original) +++ python/branches/io-c/Tools/framer/framer/slots.py Sun Feb 8 21:39:02 2009 @@ -15,7 +15,7 @@ Slot("tp_print", "printfunc"), Slot("tp_getattr", "getattrfunc"), Slot("tp_setattr", "setattrfunc"), - Slot("tp_compare", "cmpfunc", "__cmp__"), + Slot("tp_reserved", "void*"), Slot("tp_repr", "reprfunc", "__repr__"), Slot("tp_as_number"), Slot("tp_as_sequence"), Modified: python/branches/io-c/Tools/pybench/Calls.py ============================================================================== --- python/branches/io-c/Tools/pybench/Calls.py (original) +++ python/branches/io-c/Tools/pybench/Calls.py Sun Feb 8 21:39:02 2009 @@ -2,7 +2,7 @@ class PythonFunctionCalls(Test): - version = 2.0 + version = 2.1 operations = 5*(1+4+4+2) rounds = 60000 @@ -178,8 +178,8 @@ # localize functions f0 = globals f1 = hash - f2 = cmp - f3 = range + f2 = divmod + f3 = max # do calls for i in range(self.rounds): @@ -279,8 +279,8 @@ # localize functions f0 = dir f1 = hash - f2 = range - f3 = range + f2 = divmod + f3 = max # do calls for i in range(self.rounds): Modified: python/branches/io-c/Tools/pybench/CommandLine.py ============================================================================== --- python/branches/io-c/Tools/pybench/CommandLine.py (original) +++ python/branches/io-c/Tools/pybench/CommandLine.py Sun Feb 8 21:39:02 2009 @@ -11,6 +11,8 @@ """ +from __future__ import print_function + __copyright__ = """\ Copyright (c), 1997-2006, Marc-Andre Lemburg (mal at lemburg.com) Copyright (c), 2000-2006, eGenix.com Software GmbH (info at egenix.com) Modified: python/branches/io-c/Tools/pybench/README ============================================================================== --- python/branches/io-c/Tools/pybench/README (original) +++ python/branches/io-c/Tools/pybench/README Sun Feb 8 21:39:02 2009 @@ -82,7 +82,7 @@ --examples show examples of usage Version: - 2.0 + 2.1 The normal operation is to run the suite and display the results. Use -f to save them for later reuse or comparisons. @@ -95,9 +95,9 @@ Examples: -python2.1 pybench.py -f p21.pybench -python2.5 pybench.py -f p25.pybench -python pybench.py -s p25.pybench -c p21.pybench +python3.0 pybench.py -f p30.pybench +python3.1 pybench.py -f p31.pybench +python pybench.py -s p31.pybench -c p30.pybench """ License @@ -111,9 +111,9 @@ """ ------------------------------------------------------------------------------- -PYBENCH 2.0 +PYBENCH 2.1 ------------------------------------------------------------------------------- -* using Python 2.4.2 +* using CPython 3.0 * disabled garbage collection * system check interval set to maximum: 2147483647 * using timer: time.time @@ -141,8 +141,9 @@ Processor: x86_64 Python: + Implementation: CPython Executable: /usr/local/bin/python - Version: 2.4.2 + Version: 3.0 Compiler: GCC 3.3.4 (pre 3.3.5 20040809) Bits: 64bit Build: Oct 1 2005 15:24:35 (#1) @@ -331,6 +332,11 @@ Version History --------------- + 2.1: made some minor changes for compatibility with Python 3.0: + - replaced cmp with divmod and range with max in Calls.py + (cmp no longer exists in 3.0, and range is a list in + Python 2.x and an iterator in Python 3.x) + 2.0: rewrote parts of pybench which resulted in more repeatable timings: - made timer a parameter Modified: python/branches/io-c/Tools/pybench/Strings.py ============================================================================== --- python/branches/io-c/Tools/pybench/Strings.py (original) +++ python/branches/io-c/Tools/pybench/Strings.py Sun Feb 8 21:39:02 2009 @@ -1,6 +1,12 @@ from pybench import Test import sys +try: + intern +except NameError: + intern = sys.intern + + class ConcatStrings(Test): version = 2.0 @@ -174,7 +180,7 @@ def test(self): # Make sure the strings *are* interned - s = sys.intern(''.join(map(str,range(10)))) + s = intern(''.join(map(str,range(10)))) t = s for i in range(self.rounds): @@ -240,7 +246,7 @@ def calibrate(self): - s = sys.intern(''.join(map(str,range(10)))) + s = intern(''.join(map(str,range(10)))) t = s for i in range(self.rounds): Modified: python/branches/io-c/Tools/pybench/pybench.py ============================================================================== --- python/branches/io-c/Tools/pybench/pybench.py (original) +++ python/branches/io-c/Tools/pybench/pybench.py Sun Feb 8 21:39:02 2009 @@ -3,14 +3,15 @@ """ A Python Benchmark Suite """ -# -# Note: Please keep this module compatible to Python 1.5.2. +# Note: Please keep this module compatible to Python 2.6. # # Tests may include features in later Python versions, but these # should then be embedded in try-except clauses in the configuration # module Setup.py. # +from __future__ import print_function + # pybench Copyright __copyright__ = """\ Copyright (c), 1997-2006, Marc-Andre Lemburg (mal at lemburg.com) @@ -44,7 +45,7 @@ import pickle # Version number; version history: see README file ! -__version__ = '2.0' +__version__ = '2.1' ### Constants @@ -174,7 +175,7 @@ # Version number of the test as float (x.yy); this is important # for comparisons of benchmark runs - tests with unequal version # number will not get compared. - version = 2.0 + version = 2.1 # The number of abstract operations done in each round of the # test. An operation is the basic unit of what you want to @@ -403,7 +404,7 @@ roundtime = 0 # Benchmark version number as float x.yy - version = 2.0 + version = 2.1 # Produce verbose output ? verbose = 0 Modified: python/branches/io-c/Tools/pybench/systimes.py ============================================================================== --- python/branches/io-c/Tools/pybench/systimes.py (original) +++ python/branches/io-c/Tools/pybench/systimes.py Sun Feb 8 21:39:02 2009 @@ -31,6 +31,9 @@ the author. All Rights Reserved. """ + +from __future__ import print_function + import time, sys # Modified: python/branches/io-c/setup.py ============================================================================== --- python/branches/io-c/setup.py (original) +++ python/branches/io-c/setup.py Sun Feb 8 21:39:02 2009 @@ -112,51 +112,36 @@ self.extensions = extensions # Fix up the autodetected modules, prefixing all the source files - # with Modules/ and adding Python's include directory to the path. - (srcdir,) = sysconfig.get_config_vars('srcdir') + # with Modules/. + srcdir = sysconfig.get_config_var('srcdir') if not srcdir: # Maybe running on Windows but not using CYGWIN? raise ValueError("No source directory; cannot proceed.") - - # Figure out the location of the source code for extension modules - # (This logic is copied in distutils.test.test_sysconfig, - # so building in a separate directory does not break test_distutils.) - moddir = os.path.join(os.getcwd(), srcdir, 'Modules') - moddir = os.path.normpath(moddir) - srcdir, tail = os.path.split(moddir) - srcdir = os.path.normpath(srcdir) - moddir = os.path.normpath(moddir) - - moddirlist = [moddir] - incdirlist = ['./Include'] + srcdir = os.path.abspath(srcdir) + moddirlist = [os.path.join(srcdir, 'Modules')] # Platform-dependent module source and include directories platform = self.get_platform() - alldirlist = moddirlist + incdirlist - # Fix up the paths for scripts, too self.distribution.scripts = [os.path.join(srcdir, filename) for filename in self.distribution.scripts] # Python header files - headers = glob("Include/*.h") + ["pyconfig.h"] + headers = [sysconfig.get_config_h_filename()] + headers += glob(os.path.join(sysconfig.get_python_inc(), "*.h")) for ext in self.extensions[:]: ext.sources = [ find_module_file(filename, moddirlist) for filename in ext.sources ] if ext.depends is not None: - ext.depends = [find_module_file(filename, alldirlist) + ext.depends = [find_module_file(filename, moddirlist) for filename in ext.depends] else: ext.depends = [] # re-compile extensions if a header file has been changed ext.depends.extend(headers) - ext.include_dirs.append( '.' ) # to get config.h - for incdir in incdirlist: - ext.include_dirs.append( os.path.join(srcdir, incdir) ) - # If a module has already been built statically, # don't build it here if ext.name in sys.builtin_module_names: @@ -368,7 +353,7 @@ config_h_vars = sysconfig.parse_config_h(open(config_h)) platform = self.get_platform() - (srcdir,) = sysconfig.get_config_vars('srcdir') + srcdir = sysconfig.get_config_var('srcdir') # Check for AtheOS which has libraries in non-standard locations if platform == 'atheos': @@ -1283,7 +1268,7 @@ def configure_ctypes_darwin(self, ext): # Darwin (OS X) uses preconfigured files, in # the Modules/_ctypes/libffi_osx directory. - (srcdir,) = sysconfig.get_config_vars('srcdir') + srcdir = sysconfig.get_config_var('srcdir') ffi_srcdir = os.path.abspath(os.path.join(srcdir, 'Modules', '_ctypes', 'libffi_osx')) sources = [os.path.join(ffi_srcdir, p) @@ -1312,7 +1297,7 @@ if sys.platform == 'darwin': return self.configure_ctypes_darwin(ext) - (srcdir,) = sysconfig.get_config_vars('srcdir') + srcdir = sysconfig.get_config_var('srcdir') ffi_builddir = os.path.join(self.build_temp, 'libffi') ffi_srcdir = os.path.abspath(os.path.join(srcdir, 'Modules', '_ctypes', 'libffi')) From buildbot at python.org Sun Feb 8 22:07:12 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 08 Feb 2009 21:07:12 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090208210712.AB3491E4002@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/246 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: sincerely, -The Buildbot From python-checkins at python.org Sun Feb 8 22:07:20 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 8 Feb 2009 22:07:20 +0100 (CET) Subject: [Python-checkins] r69451 - in python/branches/py3k: Lib/test/test_builtin.py Misc/NEWS Objects/typeobject.c Message-ID: <20090208210720.E4D821E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 8 22:07:20 2009 New Revision: 69451 Log: fix len() when __len__() returns a non number type #5137 Modified: python/branches/py3k/Lib/test/test_builtin.py python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/typeobject.c Modified: python/branches/py3k/Lib/test/test_builtin.py ============================================================================== --- python/branches/py3k/Lib/test/test_builtin.py (original) +++ python/branches/py3k/Lib/test/test_builtin.py Sun Feb 8 22:07:20 2009 @@ -611,6 +611,18 @@ def __len__(self): raise ValueError self.assertRaises(ValueError, len, BadSeq()) + class InvalidLen: + def __len__(self): + return None + self.assertRaises(TypeError, len, InvalidLen()) + class FloatLen: + def __len__(self): + return 4.5 + self.assertRaises(TypeError, len, FloatLen()) + class HugeLen: + def __len__(self): + return sys.maxsize + 1 + self.assertRaises(OverflowError, len, HugeLen()) def test_map(self): self.assertEqual( Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun Feb 8 22:07:20 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #5137: Make len() correctly raise a TypeError when a __len__ method + returns a non-number type. + - Issue #5182: Removed memoryview.__str__. - Issue #1717: Removed builtin cmp() function, dropped tp_compare Modified: python/branches/py3k/Objects/typeobject.c ============================================================================== --- python/branches/py3k/Objects/typeobject.c (original) +++ python/branches/py3k/Objects/typeobject.c Sun Feb 8 22:07:20 2009 @@ -4618,7 +4618,7 @@ if (res == NULL) return -1; - len = PyLong_AsSsize_t(res); + len = PyNumber_AsSsize_t(res, PyExc_OverflowError); Py_DECREF(res); if (len < 0) { if (!PyErr_Occurred()) From python-checkins at python.org Sun Feb 8 22:16:02 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 8 Feb 2009 22:16:02 +0100 (CET) Subject: [Python-checkins] r69452 - in python/branches/release30-maint: Lib/test/test_builtin.py Misc/NEWS Objects/typeobject.c Message-ID: <20090208211602.1E6221E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 8 22:16:01 2009 New Revision: 69452 Log: Merged revisions 69451 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69451 | benjamin.peterson | 2009-02-08 15:07:20 -0600 (Sun, 08 Feb 2009) | 1 line fix len() when __len__() returns a non number type #5137 ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_builtin.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Objects/typeobject.c Modified: python/branches/release30-maint/Lib/test/test_builtin.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_builtin.py (original) +++ python/branches/release30-maint/Lib/test/test_builtin.py Sun Feb 8 22:16:01 2009 @@ -611,6 +611,18 @@ def __len__(self): raise ValueError self.assertRaises(ValueError, len, BadSeq()) + class InvalidLen: + def __len__(self): + return None + self.assertRaises(TypeError, len, InvalidLen()) + class FloatLen: + def __len__(self): + return 4.5 + self.assertRaises(TypeError, len, FloatLen()) + class HugeLen: + def __len__(self): + return sys.maxsize + 1 + self.assertRaises(OverflowError, len, HugeLen()) def test_map(self): self.assertEqual( Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sun Feb 8 22:16:01 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #5137: Make len() correctly raise a TypeError when a __len__ method + returns a non-number type. + - Issue #5182: Removed memoryview.__str__. - Issue #1717: Removed builtin cmp() function, dropped tp_compare Modified: python/branches/release30-maint/Objects/typeobject.c ============================================================================== --- python/branches/release30-maint/Objects/typeobject.c (original) +++ python/branches/release30-maint/Objects/typeobject.c Sun Feb 8 22:16:01 2009 @@ -4618,7 +4618,7 @@ if (res == NULL) return -1; - len = PyLong_AsSsize_t(res); + len = PyNumber_AsSsize_t(res, PyExc_OverflowError); Py_DECREF(res); if (len < 0) { if (!PyErr_Occurred()) From buildbot at python.org Sun Feb 8 22:40:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 08 Feb 2009 21:40:15 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090208214016.080B71E4002@bag.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/225 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: benjamin.peterson BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Mon Feb 9 00:04:44 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 9 Feb 2009 00:04:44 +0100 (CET) Subject: [Python-checkins] r69453 - peps/trunk/pep-0375.txt Message-ID: <20090208230444.5F09E1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 9 00:04:44 2009 New Revision: 69453 Log: pep for 3.1 release schedule Added: peps/trunk/pep-0375.txt (contents, props changed) Added: peps/trunk/pep-0375.txt ============================================================================== --- (empty file) +++ peps/trunk/pep-0375.txt Mon Feb 9 00:04:44 2009 @@ -0,0 +1,67 @@ +PEP: 375 +Title: Python 3.1 Release Schedule +Version: $Revision$ +Last-Modified: $Date$ +Author: Benjamin Peterson +Status: Draft +Type: Process +Content-Type: text/x-rst +Created: 8-Feb-2009 +Python-Version: 3.1 + + +Abstract +======== + +This document describes the development and release schedule for Python 2.7. +The schedule primarily concerns itself with PEP-sized items. Small features may +be added up to and including the first beta release. Bugs may be fixed until +the final release. + + +Release Manager and Crew +======================== + +=================== ================== +Position Name +=================== ================== +2.7 Release Manager Benjamin Peterson +Windows installers Martin v. Loewis +Mac installers Ronald Oussoren +=================== ================== + + +Release Schedule +================ + +Not yet finalized. + + +Features for 3.1 +================ + +- importlib + + +References +========== + +None yet! + + + +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 Mon Feb 9 00:05:49 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 9 Feb 2009 00:05:49 +0100 (CET) Subject: [Python-checkins] r69454 - in peps/trunk: pep-0373.txt pep-0375.txt Message-ID: <20090208230549.2610F1E402B@bag.python.org> Author: benjamin.peterson Date: Mon Feb 9 00:05:48 2009 New Revision: 69454 Log: make 2.7/3.1 release schedules information since that's what the rest are Modified: peps/trunk/pep-0373.txt peps/trunk/pep-0375.txt Modified: peps/trunk/pep-0373.txt ============================================================================== --- peps/trunk/pep-0373.txt (original) +++ peps/trunk/pep-0373.txt Mon Feb 9 00:05:48 2009 @@ -4,7 +4,7 @@ Last-Modified: $Date$ Author: Benjamin Peterson Status: Draft -Type: Process +Type: Informational Content-Type: text/x-rst Created: 3-Nov-2008 Python-Version: 2.7 Modified: peps/trunk/pep-0375.txt ============================================================================== --- peps/trunk/pep-0375.txt (original) +++ peps/trunk/pep-0375.txt Mon Feb 9 00:05:48 2009 @@ -4,7 +4,7 @@ Last-Modified: $Date$ Author: Benjamin Peterson Status: Draft -Type: Process +Type: Informational Content-Type: text/x-rst Created: 8-Feb-2009 Python-Version: 3.1 From python-checkins at python.org Mon Feb 9 00:06:43 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 9 Feb 2009 00:06:43 +0100 (CET) Subject: [Python-checkins] r69455 - peps/trunk/pep-0001.txt Message-ID: <20090208230643.756B51E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 9 00:06:43 2009 New Revision: 69455 Log: it seems release schedules are not process peps Modified: peps/trunk/pep-0001.txt Modified: peps/trunk/pep-0001.txt ============================================================================== --- peps/trunk/pep-0001.txt (original) +++ peps/trunk/pep-0001.txt Mon Feb 9 00:06:43 2009 @@ -51,10 +51,10 @@ language itself. They may propose an implementation, but not to Python's codebase; they often require community consensus; unlike Informational PEPs, they are more than recommendations, and users - are typically not free to ignore them. Examples include release - schedules, procedures, guidelines, changes to the decision-making - process, and changes to the tools or environment used in Python - development. Any meta-PEP is also considered a Process PEP. + are typically not free to ignore them. Examples include + procedures, guidelines, changes to the decision-making process, and + changes to the tools or environment used in Python development. + Any meta-PEP is also considered a Process PEP. PEP Work Flow From python-checkins at python.org Mon Feb 9 00:10:16 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 9 Feb 2009 00:10:16 +0100 (CET) Subject: [Python-checkins] r69456 - peps/trunk/Makefile Message-ID: <20090208231016.C4BA31E4013@bag.python.org> Author: benjamin.peterson Date: Mon Feb 9 00:10:16 2009 New Revision: 69456 Log: genindex requires python 2.5 Modified: peps/trunk/Makefile Modified: peps/trunk/Makefile ============================================================================== --- peps/trunk/Makefile (original) +++ peps/trunk/Makefile Mon Feb 9 00:10:16 2009 @@ -5,7 +5,7 @@ PEP2HTML=pep2html.py -PYTHON=python +PYTHON=python2.5 .SUFFIXES: .txt .html From python-checkins at python.org Mon Feb 9 00:16:57 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 9 Feb 2009 00:16:57 +0100 (CET) Subject: [Python-checkins] r69457 - in peps/trunk: pep-0361.txt pep-0373.txt pep-0375.txt pep-3100.txt Message-ID: <20090208231657.EADF81E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 9 00:16:57 2009 New Revision: 69457 Log: these information peps need to be marked active Modified: peps/trunk/pep-0361.txt peps/trunk/pep-0373.txt peps/trunk/pep-0375.txt peps/trunk/pep-3100.txt Modified: peps/trunk/pep-0361.txt ============================================================================== --- peps/trunk/pep-0361.txt (original) +++ peps/trunk/pep-0361.txt Mon Feb 9 00:16:57 2009 @@ -3,7 +3,7 @@ Version: $Revision$ Last-Modified: $Date$ Author: Neal Norwitz, Barry Warsaw -Status: Draft +Status: Active Type: Informational Created: 29-June-2006 Python-Version: 2.6 and 3.0 Modified: peps/trunk/pep-0373.txt ============================================================================== --- peps/trunk/pep-0373.txt (original) +++ peps/trunk/pep-0373.txt Mon Feb 9 00:16:57 2009 @@ -3,7 +3,7 @@ Version: $Revision$ Last-Modified: $Date$ Author: Benjamin Peterson -Status: Draft +Status: Active Type: Informational Content-Type: text/x-rst Created: 3-Nov-2008 Modified: peps/trunk/pep-0375.txt ============================================================================== --- peps/trunk/pep-0375.txt (original) +++ peps/trunk/pep-0375.txt Mon Feb 9 00:16:57 2009 @@ -3,7 +3,7 @@ Version: $Revision$ Last-Modified: $Date$ Author: Benjamin Peterson -Status: Draft +Status: Active Type: Informational Content-Type: text/x-rst Created: 8-Feb-2009 Modified: peps/trunk/pep-3100.txt ============================================================================== --- peps/trunk/pep-3100.txt (original) +++ peps/trunk/pep-3100.txt Mon Feb 9 00:16:57 2009 @@ -3,7 +3,7 @@ Version: $Revision$ Last-Modified: $Date$ Author: Brett Cannon -Status: Draft +Status: Active Type: Informational Content-Type: text/x-rst Created: 20-Aug-2004 From nnorwitz at gmail.com Mon Feb 9 11:19:42 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 9 Feb 2009 05:19:42 -0500 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090209101942.GA22327@python.psfb.org> More important issues: ---------------------- test_distutils leaked [103, 103, 103] references, sum=309 Less important issues: ---------------------- test_cmd_line leaked [25, -25, 25] references, sum=25 test_docxmlrpc leaked [0, 1, -1] references, sum=0 test_dumbdbm leaked [0, -92, 0] references, sum=-92 test_smtplib leaked [-14, 14, -10] references, sum=-10 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 From python-checkins at python.org Mon Feb 9 11:46:21 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 9 Feb 2009 11:46:21 +0100 (CET) Subject: [Python-checkins] r69458 - in sandbox/trunk/decimal/decimal_in_c: deccoeff.c decimal.py test_decimal.py Message-ID: <20090209104621.0CD151E4002@bag.python.org> Author: mark.dickinson Date: Mon Feb 9 11:46:20 2009 New Revision: 69458 Log: Remove uses of cmp() from decimal.py. Replace use of Py_CmpToRich in deccoeff.c, rename tp_compare to tp_reserved. Register Decimal as a kind of number; don't subclass from numbers.Real. Update tests to match those in py3k branch. Modified: sandbox/trunk/decimal/decimal_in_c/deccoeff.c sandbox/trunk/decimal/decimal_in_c/decimal.py sandbox/trunk/decimal/decimal_in_c/test_decimal.py Modified: sandbox/trunk/decimal/decimal_in_c/deccoeff.c ============================================================================== --- sandbox/trunk/decimal/decimal_in_c/deccoeff.c (original) +++ sandbox/trunk/decimal/decimal_in_c/deccoeff.c Mon Feb 9 11:46:20 2009 @@ -2121,21 +2121,55 @@ { deccoeff *a, *b; PyObject *z = NULL; - if (!compatible_with_deccoeff(v)) { - Py_INCREF(Py_NotImplemented); + int three_way_result; + bool rich_result; + + /* convert both arguments to deccoeffs */ + if (!compatible_with_deccoeff(v) || !compatible_with_deccoeff(w)) { z = Py_NotImplemented; + Py_INCREF(z); + return z; } - else if ((a = convert_to_deccoeff(v)) != NULL) { - if (!compatible_with_deccoeff(w)) { - Py_INCREF(Py_NotImplemented); - z = Py_NotImplemented; - } - else if ((b = convert_to_deccoeff(w)) != NULL) { - z = Py_CmpToRich(op, _deccoeff_compare(a, b)); - Py_DECREF(b); - } + a = convert_to_deccoeff(v); + if (a == NULL) + return NULL; + b = convert_to_deccoeff(w); + if (b == NULL) { Py_DECREF(a); + return NULL; + } + + /* do three-way comparison */ + three_way_result = _deccoeff_compare(a, b); + Py_DECREF(a); + Py_DECREF(b); + + /* convert three-way comparison result to rich comparison */ + switch(op) { + case Py_EQ: + rich_result = three_way_result == 0; + break; + case Py_NE: + rich_result = three_way_result != 0; + break; + case Py_LT: + rich_result = three_way_result < 0; + break; + case Py_LE: + rich_result = three_way_result <= 0; + break; + case Py_GT: + rich_result = three_way_result > 0; + break; + case Py_GE: + rich_result = three_way_result >= 0; + break; + default: + PyErr_BadArgument(); + return NULL; } + z = rich_result ? Py_True : Py_False; + Py_INCREF(z); return z; } @@ -2369,7 +2403,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_reserved */ (reprfunc)deccoeff_repr, /* tp_repr */ &deccoeff_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ Modified: sandbox/trunk/decimal/decimal_in_c/decimal.py ============================================================================== --- sandbox/trunk/decimal/decimal_in_c/decimal.py (original) +++ sandbox/trunk/decimal/decimal_in_c/decimal.py Mon Feb 9 11:46:20 2009 @@ -134,9 +134,9 @@ from deccoeff import Deccoeff, _Decimal -import numbers as _numbers import copy as _copy import math as _math +import numbers as _numbers try: from collections import namedtuple as _namedtuple @@ -545,7 +545,11 @@ ##### Decimal class ####################################################### -class Decimal(_Decimal, _numbers.Real): +# Do not subclass Decimal from numbers.Real and do not register it as such +# (because Decimals are not interoperable with floats). See the notes in +# numbers.py for more detail. + +class Decimal(_Decimal): """Floating point class for decimal arithmetic.""" # Generally, the value of the Decimal instance is given by @@ -772,7 +776,7 @@ else: return -1 - # check for zeros; note that cmp(0, -0) should return 0 + # check for zeros; note that _cmp(0, -0) should return 0 if not self: if not other: return 0 @@ -781,33 +785,42 @@ if not other: return (-1)**self._sign - # If different signs, neg one is less - if other._sign < self._sign: - return -1 - if self._sign < other._sign: - return 1 + # if signs differ, the argument with negative sign is smaller + if self._sign != other._sign: + if self._sign: + return -1 + else: + return 1 # signs are the same; if both arguments are negative, # swap them and treat as positive. if self._sign == 1: self, other = other, self + # compare adjusted exponents self_adjusted = self.adjusted() other_adjusted = other.adjusted() - if self_adjusted != other_adjusted: - return [1, -1][self_adjusted < other_adjusted] + if self_adjusted < other_adjusted: + return -1 + else: + return 1 + # adjusted exponents are the same; compare coefficients lendiff = self._int.digit_length() - other._int.digit_length() - if lendiff == 0: - return cmp(self._int, other._int) - elif lendiff > 0: - # self is longer than other - return (cmp(self._int[lendiff:], other._int) or - cmp(self._int[:lendiff], deccoeff_zero)) - else: #lendiff < 0 - return (cmp(self._int, other._int[-lendiff:]) or - cmp(deccoeff_zero, other._int[:-lendiff])) + if lendiff >= 0: + self_split = self._int[lendiff:], self._int[:lendiff] + other_split = other._int, deccoeff_zero + else: + self_split = self._int, deccoeff_zero + other_split = other._int[-lendiff:], other._int[:-lendiff] + + if self_split != other_split: + if self_split < other_split: + return -1 + else: + return 1 + return 0 # Note: The Decimal standard doesn't cover rich comparisons for # Decimals. In particular, the specification is silent on the @@ -3602,6 +3615,12 @@ assert not special return Decimal._finite(sign, coefficient, exponent) +# Register Decimal as a kind of Number (an abstract base class). +# However, do not register it as Real (because Decimals are not +# interoperable with floats). +_numbers.Number.register(Decimal) + + ##### Context class ####################################################### Modified: sandbox/trunk/decimal/decimal_in_c/test_decimal.py ============================================================================== --- sandbox/trunk/decimal/decimal_in_c/test_decimal.py (original) +++ sandbox/trunk/decimal/decimal_in_c/test_decimal.py Mon Feb 9 11:46:20 2009 @@ -30,6 +30,7 @@ import pickle, copy import unittest from decimal import * +import numbers from test.support import (TestSkipped, run_unittest, run_doctest, is_resource_enabled) import random @@ -1012,17 +1013,11 @@ self.failUnless(da != dc) self.failUnless(da <= db) self.failUnless(da >= db) - self.assertEqual(cmp(dc,da), 1) - self.assertEqual(cmp(da,dc), -1) - self.assertEqual(cmp(da,db), 0) #a Decimal and an int self.failUnless(dc > 23) self.failUnless(23 < dc) self.assertEqual(dc, 45) - self.assertEqual(cmp(dc,23), 1) - self.assertEqual(cmp(23,dc), -1) - self.assertEqual(cmp(dc,45), 0) #a Decimal and uncomparable self.assertNotEqual(da, 'ugly') @@ -1394,6 +1389,12 @@ class DecimalPythonAPItests(unittest.TestCase): + def test_abc(self): + self.assert_(issubclass(Decimal, numbers.Number)) + self.assert_(not issubclass(Decimal, numbers.Real)) + self.assert_(isinstance(Decimal(0), numbers.Number)) + self.assert_(not isinstance(Decimal(0), numbers.Real)) + def test_pickle(self): d = Decimal('-3.141590000') p = pickle.dumps(d) From python-checkins at python.org Mon Feb 9 15:18:43 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 9 Feb 2009 15:18:43 +0100 (CET) Subject: [Python-checkins] r69459 - in python/trunk: Include/pymath.h Misc/NEWS Python/pymath.c Message-ID: <20090209141843.8D9D61E4002@bag.python.org> Author: mark.dickinson Date: Mon Feb 9 15:18:43 2009 New Revision: 69459 Log: 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/trunk/Include/pymath.h python/trunk/Misc/NEWS python/trunk/Python/pymath.c Modified: python/trunk/Include/pymath.h ============================================================================== --- python/trunk/Include/pymath.h (original) +++ python/trunk/Include/pymath.h Mon Feb 9 15:18: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: @@ -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 -#if defined HAVE_DECL_ISINF && HAVE_DECL_ISINF == 1 -#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) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Feb 9 15:18:43 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- 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 #4978: Passing keyword arguments as unicode strings is now allowed. - Issue 1242657: the __len__() and __length_hint__() calls in several tools Modified: python/trunk/Python/pymath.c ============================================================================== --- python/trunk/Python/pymath.c (original) +++ python/trunk/Python/pymath.c Mon Feb 9 15:18: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) { From buildbot at python.org Mon Feb 9 15:45:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 09 Feb 2009 14:45:39 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090209144539.AFAFE1E4019@bag.python.org> The Buildbot has detected a new failure of OS X x86 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/118 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Abort trap sincerely, -The Buildbot From python-checkins at python.org Mon Feb 9 17:09:17 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 9 Feb 2009 17:09:17 +0100 (CET) Subject: [Python-checkins] r69460 - python/trunk/Lib/lib-tk/ttk.py Message-ID: <20090209160917.524761E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 9 17:09:17 2009 New Revision: 69460 Log: Turned setup_master public Modified: python/trunk/Lib/lib-tk/ttk.py Modified: python/trunk/Lib/lib-tk/ttk.py ============================================================================== --- python/trunk/Lib/lib-tk/ttk.py (original) +++ python/trunk/Lib/lib-tk/ttk.py Mon Feb 9 17:09:17 2009 @@ -23,7 +23,7 @@ # Extensions "LabeledScale", "OptionMenu", # functions - "tclobjs_to_py"] + "tclobjs_to_py", "setup_master"] import Tkinter @@ -47,25 +47,6 @@ master.tk.eval('package require tile') # TclError may be raised here master._tile_loaded = True - -def _setup_master(master=None): - """If master is not None, itself is returned. If master is None, - the default master is returned if there is one, otherwise a new - master is created and returned. - - If it is not allowed to use the default root and master is None, - RuntimeError is raised.""" - if master is None: - if Tkinter._support_default_root: - master = Tkinter._default_root or Tkinter.Tk() - else: - raise RuntimeError( - "No master specified and Tkinter is " - "configured to not support default root") - return master - - - def _format_optdict(optdict, script=False, ignore=None): """Formats optdict to a tuple to pass it to tk.call. @@ -368,6 +349,22 @@ return adict +def setup_master(master=None): + """If master is not None, itself is returned. If master is None, + the default master is returned if there is one, otherwise a new + master is created and returned. + + If it is not allowed to use the default root and master is None, + RuntimeError is raised.""" + if master is None: + if Tkinter._support_default_root: + master = Tkinter._default_root or Tkinter.Tk() + else: + raise RuntimeError( + "No master specified and Tkinter is " + "configured to not support default root") + return master + class Style(object): """Manipulate style database.""" @@ -375,7 +372,7 @@ _name = "ttk::style" def __init__(self, master=None): - master = _setup_master(master) + master = setup_master(master) if not getattr(master, '_tile_loaded', False): # Load tile now, if needed @@ -556,7 +553,7 @@ active, disabled, focus, pressed, selected, background, readonly, alternate, invalid """ - master = _setup_master(master) + master = setup_master(master) if not getattr(master, '_tile_loaded', False): # Load tile now, if needed _load_tile(master) From python-checkins at python.org Mon Feb 9 17:41:09 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 9 Feb 2009 17:41:09 +0100 (CET) Subject: [Python-checkins] r69461 - in python/trunk: Lib/lib-tk/Tkinter.py Misc/NEWS Message-ID: <20090209164109.C38331E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 9 17:41:09 2009 New Revision: 69461 Log: Fixed issue #4890: Handle empty text search pattern in Tkinter.Text.search Modified: python/trunk/Lib/lib-tk/Tkinter.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/lib-tk/Tkinter.py ============================================================================== --- python/trunk/Lib/lib-tk/Tkinter.py (original) +++ python/trunk/Lib/lib-tk/Tkinter.py Mon Feb 9 17:41:09 2009 @@ -3032,7 +3032,8 @@ forwards=None, backwards=None, exact=None, regexp=None, nocase=None, count=None, elide=None): """Search PATTERN beginning from INDEX until STOPINDEX. - Return the index of the first character of a match or an empty string.""" + Return the index of the first character of a match or an + empty string.""" args = [self._w, 'search'] if forwards: args.append('-forwards') if backwards: args.append('-backwards') @@ -3041,7 +3042,7 @@ if nocase: args.append('-nocase') if elide: args.append('-elide') if count: args.append('-count'); args.append(count) - if pattern[0] == '-': args.append('--') + if pattern and pattern[0] == '-': args.append('--') args.append(pattern) args.append(index) if stopindex: args.append(stopindex) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Feb 9 17:41:09 2009 @@ -152,6 +152,8 @@ Library ------- +- Issue #4890: Handle empty text search pattern in Tkinter.Text.search. + - Issue #5170: Fixed Unicode output bug in logging and added test case. This is a regression which did not occur in 2.5. From python-checkins at python.org Mon Feb 9 17:43:02 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 9 Feb 2009 17:43:02 +0100 (CET) Subject: [Python-checkins] r69462 - in python/branches/release26-maint: Lib/lib-tk/Tkinter.py Misc/NEWS Message-ID: <20090209164302.D1E3C1E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 9 17:43:02 2009 New Revision: 69462 Log: Merged revisions 69461 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69461 | guilherme.polo | 2009-02-09 14:41:09 -0200 (Mon, 09 Feb 2009) | 3 lines Fixed issue #4890: Handle empty text search pattern in Tkinter.Text.search ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/lib-tk/Tkinter.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/lib-tk/Tkinter.py ============================================================================== --- python/branches/release26-maint/Lib/lib-tk/Tkinter.py (original) +++ python/branches/release26-maint/Lib/lib-tk/Tkinter.py Mon Feb 9 17:43:02 2009 @@ -3032,7 +3032,8 @@ forwards=None, backwards=None, exact=None, regexp=None, nocase=None, count=None, elide=None): """Search PATTERN beginning from INDEX until STOPINDEX. - Return the index of the first character of a match or an empty string.""" + Return the index of the first character of a match or an + empty string.""" args = [self._w, 'search'] if forwards: args.append('-forwards') if backwards: args.append('-backwards') @@ -3041,7 +3042,7 @@ if nocase: args.append('-nocase') if elide: args.append('-elide') if count: args.append('-count'); args.append(count) - if pattern[0] == '-': args.append('--') + if pattern and pattern[0] == '-': args.append('--') args.append(pattern) args.append(index) if stopindex: args.append(stopindex) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Mon Feb 9 17:43:02 2009 @@ -80,6 +80,8 @@ Library ------- +- Issue #4890: Handle empty text search pattern in Tkinter.Text.search. + - Issue #5170: Fixed Unicode output bug in logging and added test case. This is a regression which did not occur in 2.5. From python-checkins at python.org Mon Feb 9 17:44:25 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 9 Feb 2009 17:44:25 +0100 (CET) Subject: [Python-checkins] r69463 - in python/branches/py3k: Lib/tkinter/__init__.py Misc/NEWS Message-ID: <20090209164425.0A0201E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 9 17:44:24 2009 New Revision: 69463 Log: Merged revisions 69461 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69461 | guilherme.polo | 2009-02-09 14:41:09 -0200 (Mon, 09 Feb 2009) | 3 lines Fixed issue #4890: Handle empty text search pattern in Tkinter.Text.search ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/tkinter/__init__.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/tkinter/__init__.py ============================================================================== --- python/branches/py3k/Lib/tkinter/__init__.py (original) +++ python/branches/py3k/Lib/tkinter/__init__.py Mon Feb 9 17:44:24 2009 @@ -3016,7 +3016,8 @@ forwards=None, backwards=None, exact=None, regexp=None, nocase=None, count=None, elide=None): """Search PATTERN beginning from INDEX until STOPINDEX. - Return the index of the first character of a match or an empty string.""" + Return the index of the first character of a match or an + empty string.""" args = [self._w, 'search'] if forwards: args.append('-forwards') if backwards: args.append('-backwards') @@ -3025,7 +3026,7 @@ if nocase: args.append('-nocase') if elide: args.append('-elide') if count: args.append('-count'); args.append(count) - if pattern[0] == '-': args.append('--') + if pattern and pattern[0] == '-': args.append('--') args.append(pattern) args.append(index) if stopindex: args.append(stopindex) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon Feb 9 17:44:24 2009 @@ -160,6 +160,8 @@ Library ------- +- Issue #4890: Handle empty text search pattern in Tkinter.Text.search. + - Issue #4512 (part 2): Promote ``ZipImporter._get_filename()`` to be a public documented method ``ZipImporter.get_filename()``. From python-checkins at python.org Mon Feb 9 17:47:22 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 9 Feb 2009 17:47:22 +0100 (CET) Subject: [Python-checkins] r69464 - in python/branches/release30-maint: Lib/tkinter/__init__.py Misc/NEWS Message-ID: <20090209164722.C44741E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 9 17:47:22 2009 New Revision: 69464 Log: Merged revisions 69463 via svnmerge from svn+ssh://pythondev/python/branches/py3k ................ r69463 | guilherme.polo | 2009-02-09 14:44:24 -0200 (Mon, 09 Feb 2009) | 10 lines Merged revisions 69461 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69461 | guilherme.polo | 2009-02-09 14:41:09 -0200 (Mon, 09 Feb 2009) | 3 lines Fixed issue #4890: Handle empty text search pattern in Tkinter.Text.search ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/tkinter/__init__.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/tkinter/__init__.py ============================================================================== --- python/branches/release30-maint/Lib/tkinter/__init__.py (original) +++ python/branches/release30-maint/Lib/tkinter/__init__.py Mon Feb 9 17:47:22 2009 @@ -3016,7 +3016,8 @@ forwards=None, backwards=None, exact=None, regexp=None, nocase=None, count=None, elide=None): """Search PATTERN beginning from INDEX until STOPINDEX. - Return the index of the first character of a match or an empty string.""" + Return the index of the first character of a match or an + empty string.""" args = [self._w, 'search'] if forwards: args.append('-forwards') if backwards: args.append('-backwards') @@ -3025,7 +3026,7 @@ if nocase: args.append('-nocase') if elide: args.append('-elide') if count: args.append('-count'); args.append(count) - if pattern[0] == '-': args.append('--') + if pattern and pattern[0] == '-': args.append('--') args.append(pattern) args.append(index) if stopindex: args.append(stopindex) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Mon Feb 9 17:47:22 2009 @@ -116,6 +116,8 @@ Library ------- +- Issue #4890: Handle empty text search pattern in Tkinter.Text.search. + - Partial fix to issue #1731706: memory leak in Tkapp_Call when calling from a thread different than the one that created the Tcl interpreter. Patch by Robert Hancock. From buildbot at python.org Mon Feb 9 17:48:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 09 Feb 2009 16:48:26 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090209164826.ACDFE1E4002@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/108 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: guilherme.polo BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Mon Feb 9 17:52:42 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 09 Feb 2009 16:52:42 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20090209165243.1B4351E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%203.0/builds/128 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: guilherme.polo BUILD FAILED: failed svn sincerely, -The Buildbot From python-checkins at python.org Mon Feb 9 18:15:59 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 9 Feb 2009 18:15:59 +0100 (CET) Subject: [Python-checkins] r69465 - in python/branches/py3k: Include/pymath.h Misc/NEWS Python/pymath.c Message-ID: <20090209171559.F2CDB1E400C@bag.python.org> Author: mark.dickinson Date: Mon Feb 9 18:15:59 2009 New Revision: 69465 Log: Merged revisions 69459 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69459 | mark.dickinson | 2009-02-09 14:18:43 +0000 (Mon, 09 Feb 2009) | 3 lines 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/py3k/ (props changed) python/branches/py3k/Include/pymath.h python/branches/py3k/Misc/NEWS python/branches/py3k/Python/pymath.c Modified: python/branches/py3k/Include/pymath.h ============================================================================== --- python/branches/py3k/Include/pymath.h (original) +++ python/branches/py3k/Include/pymath.h Mon Feb 9 18:15:59 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: @@ -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 -#if defined HAVE_DECL_ISINF && HAVE_DECL_ISINF == 1 -#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) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon Feb 9 18:15:59 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- 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 #5137: Make len() correctly raise a TypeError when a __len__ method returns a non-number type. Modified: python/branches/py3k/Python/pymath.c ============================================================================== --- python/branches/py3k/Python/pymath.c (original) +++ python/branches/py3k/Python/pymath.c Mon Feb 9 18:15:59 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) { From buildbot at python.org Mon Feb 9 19:38:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 09 Feb 2009 18:38:54 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090209183854.452281E4002@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/261 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: guilherme.polo 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.x.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Mon Feb 9 19:39:41 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 9 Feb 2009 19:39:41 +0100 (CET) Subject: [Python-checkins] r69466 - python/trunk/Modules/itertoolsmodule.c Message-ID: <20090209183941.427E91E4002@bag.python.org> Author: raymond.hettinger Date: Mon Feb 9 19:39:41 2009 New Revision: 69466 Log: Issue 5171: itertools.product docstring missing 'repeat' argument Modified: python/trunk/Modules/itertoolsmodule.c Modified: python/trunk/Modules/itertoolsmodule.c ============================================================================== --- python/trunk/Modules/itertoolsmodule.c (original) +++ python/trunk/Modules/itertoolsmodule.c Mon Feb 9 19:39:41 2009 @@ -1970,6 +1970,9 @@ The leftmost iterators are in the outermost for-loop, so the output tuples\n\ cycle in a manner similar to an odometer (with the rightmost element changing\n\ on every iteration).\n\n\ +To compute the product of an iterable with itself, specify the number\n\ +of repetitions with the optional repeat keyword argument. For example,\n\ +product(A, repeat=4) means the same as product(A, A, A, A).\n\n\ product('ab', range(3)) --> ('a',0) ('a',1) ('a',2) ('b',0) ('b',1) ('b',2)\n\ product((0,1), (0,1), (0,1)) --> (0,0,0) (0,0,1) (0,1,0) (0,1,1) (1,0,0) ..."); From buildbot at python.org Mon Feb 9 20:16:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 09 Feb 2009 19:16:52 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090209191653.139741E4002@bag.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/1835 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Mon Feb 9 20:21:21 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 9 Feb 2009 20:21:21 +0100 (CET) Subject: [Python-checkins] r69467 - in python/trunk/Lib: lib-tk/test/test_tkinter lib-tk/test/test_tkinter/__init__.py lib-tk/test/test_tkinter/test_text.py test/regrtest.py test/test_tk.py Message-ID: <20090209192121.CA79C1E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 9 20:21:21 2009 New Revision: 69467 Log: Some tests for Tkinter.Text.search Added: python/trunk/Lib/lib-tk/test/test_tkinter/ (props changed) python/trunk/Lib/lib-tk/test/test_tkinter/__init__.py python/trunk/Lib/lib-tk/test/test_tkinter/test_text.py python/trunk/Lib/test/test_tk.py (contents, props changed) Modified: python/trunk/Lib/test/regrtest.py Added: python/trunk/Lib/lib-tk/test/test_tkinter/__init__.py ============================================================================== Added: python/trunk/Lib/lib-tk/test/test_tkinter/test_text.py ============================================================================== --- (empty file) +++ python/trunk/Lib/lib-tk/test/test_tkinter/test_text.py Mon Feb 9 20:21:21 2009 @@ -0,0 +1,39 @@ +import unittest +import Tkinter +from test.test_support import requires, run_unittest +from ttk import setup_master + +requires('gui') + +class TextTest(unittest.TestCase): + + def setUp(self): + self.root = setup_master() + self.text = Tkinter.Text(self.root) + + def tearDown(self): + self.text.destroy() + + + def test_search(self): + text = self.text + + # pattern and index are obligatory arguments. + self.failUnlessRaises(Tkinter.TclError, text.search, None, '1.0') + self.failUnlessRaises(Tkinter.TclError, text.search, 'a', None) + self.failUnlessRaises(Tkinter.TclError, text.search, None, None) + + # Invalid text index. + self.failUnlessRaises(Tkinter.TclError, text.search, '', 0) + + # Check if we are getting the indices as strings -- you are likely + # to get Tcl_Obj under Tk 8.5 if Tkinter doesn't convert it. + text.insert('1.0', 'hi-test') + self.failUnlessEqual(text.search('-test', '1.0', 'end'), '1.2') + self.failUnlessEqual(text.search('test', '1.0', 'end'), '1.3') + + +tests_gui = (TextTest, ) + +if __name__ == "__main__": + run_unittest(*tests_gui) Modified: python/trunk/Lib/test/regrtest.py ============================================================================== --- python/trunk/Lib/test/regrtest.py (original) +++ python/trunk/Lib/test/regrtest.py Mon Feb 9 20:21:21 2009 @@ -1047,6 +1047,7 @@ test_socket_ssl test_socketserver test_tcl + test_tk test_ttk_guionly test_ttk_textonly test_timeout @@ -1066,6 +1067,7 @@ test_kqueue test_ossaudiodev test_tcl + test_tk test_ttk_guionly test_ttk_textonly test_zipimport @@ -1084,6 +1086,7 @@ test_ossaudiodev test_pep277 test_tcl + test_tk test_ttk_guionly test_ttk_textonly test_multiprocessing @@ -1102,6 +1105,7 @@ test_ossaudiodev test_pep277 test_tcl + test_tk test_ttk_guionly test_ttk_textonly test_multiprocessing Added: python/trunk/Lib/test/test_tk.py ============================================================================== --- (empty file) +++ python/trunk/Lib/test/test_tk.py Mon Feb 9 20:21:21 2009 @@ -0,0 +1,25 @@ +import os +import sys +from _tkinter import TclError +from test import test_support + +this_dir = os.path.dirname(os.path.abspath(__file__)) +lib_tk_test = os.path.abspath(os.path.join(this_dir, os.path.pardir, + 'lib-tk', 'test')) +if lib_tk_test not in sys.path: + sys.path.append(lib_tk_test) + +import runtktests + +def test_main(enable_gui=False): + if enable_gui: + if test_support.use_resources is None: + test_support.use_resources = ['gui'] + elif 'gui' not in test_support.use_resources: + test_support.use_resources.append('gui') + + test_support.run_unittest( + *runtktests.get_tests(text=False, packages=['test_tkinter'])) + +if __name__ == '__main__': + test_main(enable_gui=True) From ggpolo at gmail.com Mon Feb 9 20:26:59 2009 From: ggpolo at gmail.com (Guilherme Polo) Date: Mon, 9 Feb 2009 17:26:59 -0200 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk In-Reply-To: <20090209191653.139741E4002@bag.python.org> References: <20090209191653.139741E4002@bag.python.org> Message-ID: On Mon, Feb 9, 2009 at 5:16 PM, wrote: > 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/1835 > > Buildbot URL: http://www.python.org/dev/buildbot/all/ > > Buildslave for this Build: norwitz-amd64 > > Build Reason: > Build Source Stamp: [branch trunk] HEAD > Blamelist: raymond.hettinger > > BUILD FAILED: failed failed slave lost > Any chance someone can review or at least accept http://bugs.python.org/issue5122 ? It is very likely to fix the problems related to this failure. > sincerely, > -The Buildbot -- -- Guilherme H. Polo Goncalves From python-checkins at python.org Mon Feb 9 20:27:33 2009 From: python-checkins at python.org (brett.cannon) Date: Mon, 9 Feb 2009 20:27:33 +0100 (CET) Subject: [Python-checkins] r69468 - sandbox/trunk/importlib/setup.py Message-ID: <20090209192733.BDE3A1E400C@bag.python.org> Author: brett.cannon Date: Mon Feb 9 20:27:33 2009 New Revision: 69468 Log: Update trove classifiers about version support. Modified: sandbox/trunk/importlib/setup.py Modified: sandbox/trunk/importlib/setup.py ============================================================================== --- sandbox/trunk/importlib/setup.py (original) +++ sandbox/trunk/importlib/setup.py Mon Feb 9 20:27:33 2009 @@ -9,7 +9,7 @@ version_classifiers = ['Programming Language :: Python :: %s' % version - for version in [ '2.5', '2.6', '3.0']] + for version in ['2.3', '2.4', '2.5', '2.6', '3.0']] other_classifiers = [ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: Python Software Foundation License', From buildbot at python.org Mon Feb 9 20:27:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 09 Feb 2009 19:27:40 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090209192740.961F61E4027@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/142 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: guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_posix test_smtplib 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 Feb 9 20:28:31 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 9 Feb 2009 20:28:31 +0100 (CET) Subject: [Python-checkins] r69469 - python/branches/release26-maint Message-ID: <20090209192831.C1E731E400C@bag.python.org> Author: guilherme.polo Date: Mon Feb 9 20:28:31 2009 New Revision: 69469 Log: Blocked revisions 69467 via svnmerge ........ r69467 | guilherme.polo | 2009-02-09 17:21:21 -0200 (Mon, 09 Feb 2009) | 2 lines Some tests for Tkinter.Text.search ........ Modified: python/branches/release26-maint/ (props changed) From buildbot at python.org Mon Feb 9 20:46:36 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 09 Feb 2009 19:46:36 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090209194636.D61221E4002@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/845 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: guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_tk ====================================================================== ERROR: test_search (test_tkinter.test_text.TextTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/lib-tk/test/test_tkinter/test_text.py", line 11, in setUp self.root = setup_master() File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/lib-tk/ttk.py", line 361, in setup_master master = Tkinter._default_root or Tkinter.Tk() File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/lib-tk/Tkinter.py", line 1643, in __init__ self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) TclError: no display name and no $DISPLAY environment variable make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Feb 9 20:57:04 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 9 Feb 2009 20:57:04 +0100 (CET) Subject: [Python-checkins] r69470 - python/trunk/Lib/test/test_tk.py Message-ID: <20090209195704.ACC8B1E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 9 20:57:04 2009 New Revision: 69470 Log: Checking for tk availability before continuing (basically the same that is done in test_ttk_guionly) Modified: python/trunk/Lib/test/test_tk.py Modified: python/trunk/Lib/test/test_tk.py ============================================================================== --- python/trunk/Lib/test/test_tk.py (original) +++ python/trunk/Lib/test/test_tk.py Mon Feb 9 20:57:04 2009 @@ -1,8 +1,14 @@ import os import sys -from _tkinter import TclError +import Tkinter from test import test_support +try: + Tkinter.Button() +except Tkinter.TclError, msg: + # assuming tk is not available + raise test_support.TestSkipped("tk not available: %s" % msg) + this_dir = os.path.dirname(os.path.abspath(__file__)) lib_tk_test = os.path.abspath(os.path.join(this_dir, os.path.pardir, 'lib-tk', 'test')) From buildbot at python.org Mon Feb 9 21:21:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 09 Feb 2009 20:21:48 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090209202148.4F0AF1E4002@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/131 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: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_bsddb3 test_dis make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Feb 9 21:31:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 09 Feb 2009 20:31:50 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 2.6 Message-ID: <20090209203150.424DE1E4002@bag.python.org> The Buildbot has detected a new failure of OS X x86 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%202.6/builds/61 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Mon Feb 9 21:40:42 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 9 Feb 2009 21:40:42 +0100 (CET) Subject: [Python-checkins] r69471 - in python/branches/py3k: Lib/test/regrtest.py Lib/test/test_tk.py Lib/tkinter/test/test_tkinter Lib/tkinter/test/test_tkinter/__init__.py Lib/tkinter/test/test_tkinter/test_text.py Lib/tkinter/ttk.py Message-ID: <20090209204042.691C21E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 9 21:40:42 2009 New Revision: 69471 Log: Merged revisions 69460,69467,69470 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69460 | guilherme.polo | 2009-02-09 14:09:17 -0200 (Mon, 09 Feb 2009) | 1 line Turned setup_master public ........ r69467 | guilherme.polo | 2009-02-09 17:21:21 -0200 (Mon, 09 Feb 2009) | 2 lines Some tests for Tkinter.Text.search ........ r69470 | guilherme.polo | 2009-02-09 17:57:04 -0200 (Mon, 09 Feb 2009) | 1 line Checking for tk availability before continuing (basically the same that is done in test_ttk_guionly) ........ Added: python/branches/py3k/Lib/test/test_tk.py (contents, props changed) python/branches/py3k/Lib/tkinter/test/test_tkinter/ (props changed) python/branches/py3k/Lib/tkinter/test/test_tkinter/__init__.py (contents, props changed) python/branches/py3k/Lib/tkinter/test/test_tkinter/test_text.py (contents, props changed) Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/regrtest.py python/branches/py3k/Lib/tkinter/ttk.py Modified: python/branches/py3k/Lib/test/regrtest.py ============================================================================== --- python/branches/py3k/Lib/test/regrtest.py (original) +++ python/branches/py3k/Lib/test/regrtest.py Mon Feb 9 21:40:42 2009 @@ -1075,6 +1075,7 @@ test_pty test_socketserver test_tcl + test_tk test_ttk_guionly test_ttk_textonly test_timeout @@ -1092,6 +1093,7 @@ test_kqueue test_ossaudiodev test_tcl + test_tk test_ttk_guionly test_ttk_textonly test_zipimport @@ -1109,6 +1111,7 @@ test_ossaudiodev test_pep277 test_tcl + test_tk test_ttk_guionly test_ttk_textonly test_multiprocessing @@ -1125,6 +1128,7 @@ test_ossaudiodev test_pep277 test_tcl + test_tk test_ttk_guionly test_ttk_textonly test_multiprocessing Added: python/branches/py3k/Lib/test/test_tk.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/test/test_tk.py Mon Feb 9 21:40:42 2009 @@ -0,0 +1,22 @@ +import tkinter +from tkinter.test import runtktests +from test import support + +try: + tkinter.Button() +except tkinter.TclError as msg: + # assuming tk is not available + raise support.TestSkipped("tk not available: %s" % msg) + +def test_main(enable_gui=False): + if enable_gui: + if support.use_resources is None: + support.use_resources = ['gui'] + elif 'gui' not in support.use_resources: + support.use_resources.append('gui') + + support.run_unittest( + *runtktests.get_tests(text=False, packages=['test_tkinter'])) + +if __name__ == '__main__': + test_main(enable_gui=True) Added: python/branches/py3k/Lib/tkinter/test/test_tkinter/__init__.py ============================================================================== Added: python/branches/py3k/Lib/tkinter/test/test_tkinter/test_text.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/tkinter/test/test_tkinter/test_text.py Mon Feb 9 21:40:42 2009 @@ -0,0 +1,39 @@ +import unittest +import tkinter +from test.support import requires, run_unittest +from tkinter.ttk import setup_master + +requires('gui') + +class TextTest(unittest.TestCase): + + def setUp(self): + self.root = setup_master() + self.text = tkinter.Text(self.root) + + def tearDown(self): + self.text.destroy() + + + def test_search(self): + text = self.text + + # pattern and index are obligatory arguments. + self.failUnlessRaises(tkinter.TclError, text.search, None, '1.0') + self.failUnlessRaises(tkinter.TclError, text.search, 'a', None) + self.failUnlessRaises(tkinter.TclError, text.search, None, None) + + # Invalid text index. + self.failUnlessRaises(tkinter.TclError, text.search, '', 0) + + # Check if we are getting the indices as strings -- you are likely + # to get Tcl_Obj under Tk 8.5 if Tkinter doesn't convert it. + text.insert('1.0', 'hi-test') + self.failUnlessEqual(text.search('-test', '1.0', 'end'), '1.2') + self.failUnlessEqual(text.search('test', '1.0', 'end'), '1.3') + + +tests_gui = (TextTest, ) + +if __name__ == "__main__": + run_unittest(*tests_gui) Modified: python/branches/py3k/Lib/tkinter/ttk.py ============================================================================== --- python/branches/py3k/Lib/tkinter/ttk.py (original) +++ python/branches/py3k/Lib/tkinter/ttk.py Mon Feb 9 21:40:42 2009 @@ -23,7 +23,7 @@ # Extensions "LabeledScale", "OptionMenu", # functions - "tclobjs_to_py"] + "tclobjs_to_py", "setup_master"] import tkinter @@ -47,24 +47,6 @@ master.tk.eval('package require tile') # TclError may be raised here master._tile_loaded = True - -def _setup_master(master=None): - """If master is not None, itself is returned. If master is None, - the default master is returned if there is one, otherwise a new - master is created and returned. - - If it is not allowed to use the default root and master is None, - RuntimeError is raised.""" - if master is None: - if tkinter._support_default_root: - master = tkinter._default_root or tkinter.Tk() - else: - raise RuntimeError( - "No master specified and tkinter is " - "configured to not support default root") - return master - - def _format_optdict(optdict, script=False, ignore=None): """Formats optdict to a tuple to pass it to tk.call. @@ -367,6 +349,22 @@ return adict +def setup_master(master=None): + """If master is not None, itself is returned. If master is None, + the default master is returned if there is one, otherwise a new + master is created and returned. + + If it is not allowed to use the default root and master is None, + RuntimeError is raised.""" + if master is None: + if tkinter._support_default_root: + master = tkinter._default_root or tkinter.Tk() + else: + raise RuntimeError( + "No master specified and tkinter is " + "configured to not support default root") + return master + class Style(object): """Manipulate style database.""" @@ -374,7 +372,7 @@ _name = "ttk::style" def __init__(self, master=None): - master = _setup_master(master) + master = setup_master(master) if not getattr(master, '_tile_loaded', False): # Load tile now, if needed @@ -555,7 +553,7 @@ active, disabled, focus, pressed, selected, background, readonly, alternate, invalid """ - master = _setup_master(master) + master = setup_master(master) if not getattr(master, '_tile_loaded', False): # Load tile now, if needed _load_tile(master) From python-checkins at python.org Mon Feb 9 21:43:00 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 9 Feb 2009 21:43:00 +0100 (CET) Subject: [Python-checkins] r69472 - python/branches/release30-maint Message-ID: <20090209204300.3B8E61E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 9 21:43:00 2009 New Revision: 69472 Log: Blocked revisions 69471 via svnmerge ................ r69471 | guilherme.polo | 2009-02-09 18:40:42 -0200 (Mon, 09 Feb 2009) | 17 lines Merged revisions 69460,69467,69470 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69460 | guilherme.polo | 2009-02-09 14:09:17 -0200 (Mon, 09 Feb 2009) | 1 line Turned setup_master public ........ r69467 | guilherme.polo | 2009-02-09 17:21:21 -0200 (Mon, 09 Feb 2009) | 2 lines Some tests for Tkinter.Text.search ........ r69470 | guilherme.polo | 2009-02-09 17:57:04 -0200 (Mon, 09 Feb 2009) | 1 line Checking for tk availability before continuing (basically the same that is done in test_ttk_guionly) ........ ................ Modified: python/branches/release30-maint/ (props changed) From eric at trueblade.com Mon Feb 9 21:26:12 2009 From: eric at trueblade.com (Eric Smith) Date: Mon, 09 Feb 2009 15:26:12 -0500 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk In-Reply-To: References: <20090209191653.139741E4002@bag.python.org> Message-ID: <49909164.20308@trueblade.com> Guilherme Polo wrote: > On Mon, Feb 9, 2009 at 5:16 PM, wrote: >> 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/1835 >> >> Buildbot URL: http://www.python.org/dev/buildbot/all/ >> >> Buildslave for this Build: norwitz-amd64 >> >> Build Reason: >> Build Source Stamp: [branch trunk] HEAD >> Blamelist: raymond.hettinger >> >> BUILD FAILED: failed failed slave lost >> > > Any chance someone can review or at least accept > http://bugs.python.org/issue5122 ? It is very likely to fix the > problems related to this failure. The current patch on 5122 looks reasonable to me, and it solves my problem with the tests hanging. So I'd suggest you commit the patch, insofar it improves on the current situation. I'm not an expert in tk, however. So if you're looking for advice from someone knowledgeable on tk's inner workings, you'll need to get someone else involved. Eric. From python-checkins at python.org Mon Feb 9 21:50:27 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 9 Feb 2009 21:50:27 +0100 (CET) Subject: [Python-checkins] r69473 - in python/trunk: Misc/NEWS Modules/_tkinter.c Modules/tkappinit.c Modules/tkinter.h Message-ID: <20090209205027.72C081E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 9 21:50:27 2009 New Revision: 69473 Log: Fixed issue #5122: Synchronize tk load failure check to prevent a potential deadlock. Added: python/trunk/Modules/tkinter.h (contents, props changed) Modified: python/trunk/Misc/NEWS python/trunk/Modules/_tkinter.c python/trunk/Modules/tkappinit.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Feb 9 21:50:27 2009 @@ -152,6 +152,9 @@ Library ------- +- Issue #5122: Synchronize tk load failure check to prevent a potential + deadlock. + - Issue #4890: Handle empty text search pattern in Tkinter.Text.search. - Issue #5170: Fixed Unicode output bug in logging and added test case. Modified: python/trunk/Modules/_tkinter.c ============================================================================== --- python/trunk/Modules/_tkinter.c (original) +++ python/trunk/Modules/_tkinter.c Mon Feb 9 21:50:27 2009 @@ -33,6 +33,8 @@ #include #endif +#include "tkinter.h" + /* Allow using this code in Python 2.[12] */ #ifndef PyDoc_STRVAR #define PyDoc_STRVAR(name,str) static char name[] = str @@ -74,9 +76,7 @@ #define CONST #endif -#define TKMAJORMINOR (TK_MAJOR_VERSION*1000 + TK_MINOR_VERSION) - -#if TKMAJORMINOR < 8002 +#if TK_VERSION_HEX < 0x08020002 #error "Tk older than 8.2 not supported" #endif @@ -280,6 +280,9 @@ static PyObject *valInCmd; static PyObject *trbInCmd; +#ifdef TKINTER_PROTECT_LOADTK +static int tk_load_failed; +#endif static PyObject * @@ -555,21 +558,35 @@ int Tcl_AppInit(Tcl_Interp *interp) { - Tk_Window main; const char * _tkinter_skip_tk_init; if (Tcl_Init(interp) == TCL_ERROR) { PySys_WriteStderr("Tcl_Init error: %s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } - _tkinter_skip_tk_init = Tcl_GetVar(interp, "_tkinter_skip_tk_init", TCL_GLOBAL_ONLY); - if (_tkinter_skip_tk_init == NULL || strcmp(_tkinter_skip_tk_init, "1") != 0) { - main = Tk_MainWindow(interp); - if (Tk_Init(interp) == TCL_ERROR) { - PySys_WriteStderr("Tk_Init error: %s\n", Tcl_GetStringResult(interp)); - return TCL_ERROR; - } + + _tkinter_skip_tk_init = Tcl_GetVar(interp, + "_tkinter_skip_tk_init", TCL_GLOBAL_ONLY); + if (_tkinter_skip_tk_init != NULL && + strcmp(_tkinter_skip_tk_init, "1") == 0) { + return TCL_OK; + } + +#ifdef TKINTER_PROTECT_LOADTK + if (tk_load_failed) { + PySys_WriteStderr("Tk_Init error: %s\n", TKINTER_LOADTK_ERRMSG); + return TCL_ERROR; } +#endif + + if (Tk_Init(interp) == TCL_ERROR) { +#ifdef TKINTER_PROTECT_LOADTK + tk_load_failed = 1; +#endif + PySys_WriteStderr("Tk_Init error: %s\n", Tcl_GetStringResult(interp)); + return TCL_ERROR; + } + return TCL_OK; } #endif /* !WITH_APPINIT */ @@ -652,8 +669,15 @@ ckfree(argv0); if (! wantTk) { - Tcl_SetVar(v->interp, "_tkinter_skip_tk_init", "1", TCL_GLOBAL_ONLY); + Tcl_SetVar(v->interp, + "_tkinter_skip_tk_init", "1", TCL_GLOBAL_ONLY); + } +#ifdef TKINTER_PROTECT_LOADTK + else if (tk_load_failed) { + Tcl_SetVar(v->interp, + "_tkinter_tk_failed", "1", TCL_GLOBAL_ONLY); } +#endif /* some initial arguments need to be in argv */ if (sync || use) { @@ -688,6 +712,18 @@ if (Tcl_AppInit(v->interp) != TCL_OK) { PyObject *result = Tkinter_Error((PyObject *)v); +#ifdef TKINTER_PROTECT_LOADTK + if (wantTk) { + const char *_tkinter_tk_failed; + _tkinter_tk_failed = Tcl_GetVar(v->interp, + "_tkinter_tk_failed", TCL_GLOBAL_ONLY); + + if ( _tkinter_tk_failed != NULL && + strcmp(_tkinter_tk_failed, "1") == 0) { + tk_load_failed = 1; + } + } +#endif Py_DECREF((PyObject *)v); return (TkappObject *)result; } @@ -2669,23 +2705,22 @@ static PyObject * Tkapp_TkInit(PyObject *self, PyObject *args) { - static int has_failed; Tcl_Interp *interp = Tkapp_Interp(self); - Tk_Window main_window; const char * _tk_exists = NULL; int err; - main_window = Tk_MainWindow(interp); - /* In all current versions of Tk (including 8.4.13), Tk_Init - deadlocks on the second call when the first call failed. - To avoid the deadlock, we just refuse the second call through - a static variable. */ - if (has_failed) { - PyErr_SetString(Tkinter_TclError, - "Calling Tk_Init again after a previous call failed might deadlock"); +#ifdef TKINTER_PROTECT_LOADTK + /* Up to Tk 8.4.13, Tk_Init deadlocks on the second call when the + * first call failed. + * To avoid the deadlock, we just refuse the second call through + * a static variable. + */ + if (tk_load_failed) { + PyErr_SetString(Tkinter_TclError, TKINTER_LOADTK_ERRMSG); return NULL; } - +#endif + /* We want to guard against calling Tk_Init() multiple times */ CHECK_TCL_APPARTMENT; ENTER_TCL @@ -2704,8 +2739,10 @@ } if (_tk_exists == NULL || strcmp(_tk_exists, "1") != 0) { if (Tk_Init(interp) == TCL_ERROR) { - PyErr_SetString(Tkinter_TclError, Tcl_GetStringResult(Tkapp_Interp(self))); - has_failed = 1; + PyErr_SetString(Tkinter_TclError, Tcl_GetStringResult(Tkapp_Interp(self))); +#ifdef TKINTER_PROTECT_LOADTK + tk_load_failed = 1; +#endif return NULL; } } Modified: python/trunk/Modules/tkappinit.c ============================================================================== --- python/trunk/Modules/tkappinit.c (original) +++ python/trunk/Modules/tkappinit.c Mon Feb 9 21:50:27 2009 @@ -16,11 +16,21 @@ #include #include +#include "tkinter.h" + +#ifdef TKINTER_PROTECT_LOADTK +/* See Tkapp_TkInit in _tkinter.c for the usage of tk_load_faile */ +static int tk_load_failed; +#endif + int Tcl_AppInit(Tcl_Interp *interp) { Tk_Window main_window; - const char * _tkinter_skip_tk_init; + const char *_tkinter_skip_tk_init; +#ifdef TKINTER_PROTECT_LOADTK + const char *_tkinter_tk_failed; +#endif #ifdef TK_AQUA #ifndef MAX_PATH_LEN @@ -74,12 +84,32 @@ /* Initialize modules that don't require Tk */ #endif - _tkinter_skip_tk_init = Tcl_GetVar(interp, "_tkinter_skip_tk_init", TCL_GLOBAL_ONLY); - if (_tkinter_skip_tk_init != NULL && strcmp(_tkinter_skip_tk_init, "1") == 0) { + _tkinter_skip_tk_init = Tcl_GetVar(interp, + "_tkinter_skip_tk_init", TCL_GLOBAL_ONLY); + if (_tkinter_skip_tk_init != NULL && + strcmp(_tkinter_skip_tk_init, "1") == 0) { return TCL_OK; } - if (Tk_Init(interp) == TCL_ERROR) + +#ifdef TKINTER_PROTECT_LOADTK + _tkinter_tk_failed = Tcl_GetVar(interp, + "_tkinter_tk_failed", TCL_GLOBAL_ONLY); + + if (tk_load_failed || ( + _tkinter_tk_failed != NULL && + strcmp(_tkinter_tk_failed, "1") == 0)) { + Tcl_SetResult(interp, TKINTER_LOADTK_ERRMSG, TCL_STATIC); return TCL_ERROR; + } +#endif + + if (Tk_Init(interp) == TCL_ERROR) { +#ifdef TKINTER_PROTECT_LOADTK + tk_load_failed = 1; + Tcl_SetVar(interp, "_tkinter_tk_failed", "1", TCL_GLOBAL_ONLY); +#endif + return TCL_ERROR; + } main_window = Tk_MainWindow(interp); Added: python/trunk/Modules/tkinter.h ============================================================================== --- (empty file) +++ python/trunk/Modules/tkinter.h Mon Feb 9 21:50:27 2009 @@ -0,0 +1,25 @@ +#ifndef TKINTER_H +#define TKINTER_H + +/* This header is used to share some macros between _tkinter.c and + * tkappinit.c */ + +/* TK_RELEASE_LEVEL is always one of the following: + * TCL_ALPHA_RELEASE 0 + * TCL_BETA_RELEASE 1 + * TCL_FINAL_RELEASE 2 + */ +#define TK_VERSION_HEX ((TK_MAJOR_VERSION << 24) | \ + (TK_MINOR_VERSION << 16) | \ + (TK_RELEASE_SERIAL << 8) | \ + (TK_RELEASE_LEVEL << 0)) + +/* Protect Tk 8.4.13 and older from a deadlock that happens when trying + * to load tk after a failed attempt. */ +#if TK_VERSION_HEX < 0x08040e02 +#define TKINTER_PROTECT_LOADTK +#define TKINTER_LOADTK_ERRMSG \ + "Calling Tk_Init again after a previous call failed might deadlock" +#endif + +#endif /* !TKINTER_H */ From python-checkins at python.org Mon Feb 9 21:57:45 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 9 Feb 2009 21:57:45 +0100 (CET) Subject: [Python-checkins] r69474 - python/trunk/Modules/_tkinter.c Message-ID: <20090209205745.35DB71E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 9 21:57:45 2009 New Revision: 69474 Log: Enforcing Tk 8.3.1 requirement. Modified: python/trunk/Modules/_tkinter.c Modified: python/trunk/Modules/_tkinter.c ============================================================================== --- python/trunk/Modules/_tkinter.c (original) +++ python/trunk/Modules/_tkinter.c Mon Feb 9 21:57:45 2009 @@ -76,8 +76,8 @@ #define CONST #endif -#if TK_VERSION_HEX < 0x08020002 -#error "Tk older than 8.2 not supported" +#if TK_VERSION_HEX < 0x08030102 +#error "Tk older than 8.3.1 not supported" #endif /* Unicode conversion assumes that Tcl_UniChar is two bytes. From buildbot at python.org Mon Feb 9 21:59:21 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 09 Feb 2009 20:59:21 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090209205921.D7C221E4002@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/108 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: guilherme.polo 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 Mon Feb 9 22:34:17 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 9 Feb 2009 16:34:17 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (2) Message-ID: <20090209213417.GA14780@python.psfb.org> 329 tests OK. 1 test failed: test_mailbox 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly test test_mailbox failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_mailbox.py", line 816, in test_lock_conflict self._box.lock) AssertionError: ExternalClashError not raised test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform test_plistlib test_poll test_popen 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 test_pyexpat test_queue test_quopri 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 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess . this bit of output is from a test of stdout in a different process ... test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading 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 runtktests 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 test_xmlrpc test_xpickle 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 329 tests OK. 1 test failed: test_mailbox 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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_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 [17163 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test test_mailbox failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_mailbox.py", line 806, in test_lock_conflict self._box.lock() File "/tmp/python-test/local/lib/python2.7/mailbox.py", line 565, in lock _lock_file(self._file) File "/tmp/python-test/local/lib/python2.7/mailbox.py", line 1860, in _lock_file f.name) ExternalClashError: lockf: lock unavailable: /home/neal/python/trunk/@test test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] [12983 refs] [12986 refs] [12983 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17142 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 329 tests OK. 1 test failed: test_mailbox 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [661625 refs] test test_mailbox failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_mailbox.py", line 816, in test_lock_conflict self._box.lock) AssertionError: ExternalClashError not raised test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] [12983 refs] [12986 refs] [12983 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17142 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 329 tests OK. 1 test failed: test_mailbox 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [661625 refs] From buildbot at python.org Mon Feb 9 22:36:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 09 Feb 2009 21:36:48 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090209213648.B9C051E4002@bag.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/1839 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_augassign test_future test_pty make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Feb 9 22:51:30 2009 From: python-checkins at python.org (brett.cannon) Date: Mon, 9 Feb 2009 22:51:30 +0100 (CET) Subject: [Python-checkins] r69475 - python/branches/py3k/Lib/importlib/NOTES Message-ID: <20090209215130.13D261E4002@bag.python.org> Author: brett.cannon Date: Mon Feb 9 22:51:29 2009 New Revision: 69475 Log: Add a NOTE that alternative VMs should be supported by importlib in a nicer fashion by factoring out bytecode support. Modified: python/branches/py3k/Lib/importlib/NOTES Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Mon Feb 9 22:51:29 2009 @@ -1,6 +1,10 @@ to do ///// +* Refactor source/bytecode finder/loader code such that bytecode support is a + subclass of source support (makes it nicer for VMs that don't use CPython + bytecode). + * Implement PEP 302 protocol for loaders (should just be a matter of testing). + Built-in. From buildbot at python.org Mon Feb 9 23:05:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 09 Feb 2009 22:05:29 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090209220529.44CDC1E4002@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/283 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: guilherme.polo BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pipes make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Feb 9 23:33:59 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 9 Feb 2009 23:33:59 +0100 (CET) Subject: [Python-checkins] r69476 - in python/branches/py3k: Misc/NEWS Modules/_tkinter.c Modules/tkappinit.c Message-ID: <20090209223359.F10AA1E4058@bag.python.org> Author: guilherme.polo Date: Mon Feb 9 23:33:59 2009 New Revision: 69476 Log: Merged revisions 69473 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69473 | guilherme.polo | 2009-02-09 18:50:27 -0200 (Mon, 09 Feb 2009) | 3 lines Fixed issue #5122: Synchronize tk load failure check to prevent a potential deadlock. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_tkinter.c python/branches/py3k/Modules/tkappinit.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon Feb 9 23:33:59 2009 @@ -163,6 +163,9 @@ Library ------- +- Issue #5122: Synchronize tk load failure check to prevent a potential + deadlock. + - Issue #4890: Handle empty text search pattern in Tkinter.Text.search. - Issue #4512 (part 2): Promote ``ZipImporter._get_filename()`` to be a Modified: python/branches/py3k/Modules/_tkinter.c ============================================================================== --- python/branches/py3k/Modules/_tkinter.c (original) +++ python/branches/py3k/Modules/_tkinter.c Mon Feb 9 23:33:59 2009 @@ -33,6 +33,8 @@ #include #endif +#include "tkinter.h" + /* Allow using this code in Python 2.[12] */ #ifndef PyDoc_STRVAR #define PyDoc_STRVAR(name,str) static char name[] = str @@ -74,9 +76,7 @@ #define CONST #endif -#define TKMAJORMINOR (TK_MAJOR_VERSION*1000 + TK_MINOR_VERSION) - -#if TKMAJORMINOR < 8002 +#if TK_VERSION_HEX < 0x08020002 #error "Tk older than 8.2 not supported" #endif @@ -280,6 +280,9 @@ static PyObject *valInCmd; static PyObject *trbInCmd; +#ifdef TKINTER_PROTECT_LOADTK +static int tk_load_failed; +#endif static PyObject * @@ -553,21 +556,35 @@ int Tcl_AppInit(Tcl_Interp *interp) { - Tk_Window main; const char * _tkinter_skip_tk_init; if (Tcl_Init(interp) == TCL_ERROR) { PySys_WriteStderr("Tcl_Init error: %s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } - _tkinter_skip_tk_init = Tcl_GetVar(interp, "_tkinter_skip_tk_init", TCL_GLOBAL_ONLY); - if (_tkinter_skip_tk_init == NULL || strcmp(_tkinter_skip_tk_init, "1") != 0) { - main = Tk_MainWindow(interp); - if (Tk_Init(interp) == TCL_ERROR) { - PySys_WriteStderr("Tk_Init error: %s\n", Tcl_GetStringResult(interp)); - return TCL_ERROR; - } + + _tkinter_skip_tk_init = Tcl_GetVar(interp, + "_tkinter_skip_tk_init", TCL_GLOBAL_ONLY); + if (_tkinter_skip_tk_init != NULL && + strcmp(_tkinter_skip_tk_init, "1") == 0) { + return TCL_OK; + } + +#ifdef TKINTER_PROTECT_LOADTK + if (tk_load_failed) { + PySys_WriteStderr("Tk_Init error: %s\n", TKINTER_LOADTK_ERRMSG); + return TCL_ERROR; + } +#endif + + if (Tk_Init(interp) == TCL_ERROR) { +#ifdef TKINTER_PROTECT_LOADTK + tk_load_failed = 1; +#endif + PySys_WriteStderr("Tk_Init error: %s\n", Tcl_GetStringResult(interp)); + return TCL_ERROR; } + return TCL_OK; } #endif /* !WITH_APPINIT */ @@ -650,8 +667,15 @@ ckfree(argv0); if (! wantTk) { - Tcl_SetVar(v->interp, "_tkinter_skip_tk_init", "1", TCL_GLOBAL_ONLY); + Tcl_SetVar(v->interp, + "_tkinter_skip_tk_init", "1", TCL_GLOBAL_ONLY); } +#ifdef TKINTER_PROTECT_LOADTK + else if (tk_load_failed) { + Tcl_SetVar(v->interp, + "_tkinter_tk_failed", "1", TCL_GLOBAL_ONLY); + } +#endif /* some initial arguments need to be in argv */ if (sync || use) { @@ -686,6 +710,18 @@ if (Tcl_AppInit(v->interp) != TCL_OK) { PyObject *result = Tkinter_Error((PyObject *)v); +#ifdef TKINTER_PROTECT_LOADTK + if (wantTk) { + const char *_tkinter_tk_failed; + _tkinter_tk_failed = Tcl_GetVar(v->interp, + "_tkinter_tk_failed", TCL_GLOBAL_ONLY); + + if ( _tkinter_tk_failed != NULL && + strcmp(_tkinter_tk_failed, "1") == 0) { + tk_load_failed = 1; + } + } +#endif Py_DECREF((PyObject *)v); return (TkappObject *)result; } @@ -2547,22 +2583,21 @@ static PyObject * Tkapp_TkInit(PyObject *self, PyObject *args) { - static int has_failed; Tcl_Interp *interp = Tkapp_Interp(self); - Tk_Window main_window; const char * _tk_exists = NULL; int err; - main_window = Tk_MainWindow(interp); - /* In all current versions of Tk (including 8.4.13), Tk_Init - deadlocks on the second call when the first call failed. - To avoid the deadlock, we just refuse the second call through - a static variable. */ - if (has_failed) { - PyErr_SetString(Tkinter_TclError, - "Calling Tk_Init again after a previous call failed might deadlock"); +#ifdef TKINTER_PROTECT_LOADTK + /* Up to Tk 8.4.13, Tk_Init deadlocks on the second call when the + * first call failed. + * To avoid the deadlock, we just refuse the second call through + * a static variable. + */ + if (tk_load_failed) { + PyErr_SetString(Tkinter_TclError, TKINTER_LOADTK_ERRMSG); return NULL; } +#endif /* We want to guard against calling Tk_Init() multiple times */ CHECK_TCL_APPARTMENT; @@ -2582,8 +2617,10 @@ } if (_tk_exists == NULL || strcmp(_tk_exists, "1") != 0) { if (Tk_Init(interp) == TCL_ERROR) { - PyErr_SetString(Tkinter_TclError, Tcl_GetStringResult(Tkapp_Interp(self))); - has_failed = 1; + PyErr_SetString(Tkinter_TclError, Tcl_GetStringResult(Tkapp_Interp(self))); +#ifdef TKINTER_PROTECT_LOADTK + tk_load_failed = 1; +#endif return NULL; } } Modified: python/branches/py3k/Modules/tkappinit.c ============================================================================== --- python/branches/py3k/Modules/tkappinit.c (original) +++ python/branches/py3k/Modules/tkappinit.c Mon Feb 9 23:33:59 2009 @@ -16,11 +16,21 @@ #include #include +#include "tkinter.h" + +#ifdef TKINTER_PROTECT_LOADTK +/* See Tkapp_TkInit in _tkinter.c for the usage of tk_load_faile */ +static int tk_load_failed; +#endif + int Tcl_AppInit(Tcl_Interp *interp) { Tk_Window main_window; - const char * _tkinter_skip_tk_init; + const char *_tkinter_skip_tk_init; +#ifdef TKINTER_PROTECT_LOADTK + const char *_tkinter_tk_failed; +#endif #ifdef TK_AQUA #ifndef MAX_PATH_LEN @@ -74,12 +84,32 @@ /* Initialize modules that don't require Tk */ #endif - _tkinter_skip_tk_init = Tcl_GetVar(interp, "_tkinter_skip_tk_init", TCL_GLOBAL_ONLY); - if (_tkinter_skip_tk_init != NULL && strcmp(_tkinter_skip_tk_init, "1") == 0) { + _tkinter_skip_tk_init = Tcl_GetVar(interp, + "_tkinter_skip_tk_init", TCL_GLOBAL_ONLY); + if (_tkinter_skip_tk_init != NULL && + strcmp(_tkinter_skip_tk_init, "1") == 0) { return TCL_OK; } - if (Tk_Init(interp) == TCL_ERROR) + +#ifdef TKINTER_PROTECT_LOADTK + _tkinter_tk_failed = Tcl_GetVar(interp, + "_tkinter_tk_failed", TCL_GLOBAL_ONLY); + + if (tk_load_failed || ( + _tkinter_tk_failed != NULL && + strcmp(_tkinter_tk_failed, "1") == 0)) { + Tcl_SetResult(interp, TKINTER_LOADTK_ERRMSG, TCL_STATIC); return TCL_ERROR; + } +#endif + + if (Tk_Init(interp) == TCL_ERROR) { +#ifdef TKINTER_PROTECT_LOADTK + tk_load_failed = 1; + Tcl_SetVar(interp, "_tkinter_tk_failed", "1", TCL_GLOBAL_ONLY); +#endif + return TCL_ERROR; + } main_window = Tk_MainWindow(interp); From python-checkins at python.org Mon Feb 9 23:35:27 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 9 Feb 2009 23:35:27 +0100 (CET) Subject: [Python-checkins] r69477 - in python/branches/py3k: Modules/_tkinter.c Message-ID: <20090209223527.F08CB1E401C@bag.python.org> Author: guilherme.polo Date: Mon Feb 9 23:35:27 2009 New Revision: 69477 Log: Merged revisions 69474 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69474 | guilherme.polo | 2009-02-09 18:57:45 -0200 (Mon, 09 Feb 2009) | 1 line Enforcing Tk 8.3.1 requirement. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Modules/_tkinter.c Modified: python/branches/py3k/Modules/_tkinter.c ============================================================================== --- python/branches/py3k/Modules/_tkinter.c (original) +++ python/branches/py3k/Modules/_tkinter.c Mon Feb 9 23:35:27 2009 @@ -76,8 +76,8 @@ #define CONST #endif -#if TK_VERSION_HEX < 0x08020002 -#error "Tk older than 8.2 not supported" +#if TK_VERSION_HEX < 0x08030102 +#error "Tk older than 8.3.1 not supported" #endif /* Unicode conversion assumes that Tcl_UniChar is two bytes. From python-checkins at python.org Mon Feb 9 23:36:19 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 9 Feb 2009 23:36:19 +0100 (CET) Subject: [Python-checkins] r69478 - python/branches/release30-maint Message-ID: <20090209223619.2B6F91E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 9 23:36:19 2009 New Revision: 69478 Log: Blocked revisions 69477 via svnmerge ................ r69477 | guilherme.polo | 2009-02-09 20:35:27 -0200 (Mon, 09 Feb 2009) | 9 lines Merged revisions 69474 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69474 | guilherme.polo | 2009-02-09 18:57:45 -0200 (Mon, 09 Feb 2009) | 1 line Enforcing Tk 8.3.1 requirement. ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Mon Feb 9 23:36:39 2009 From: python-checkins at python.org (guilherme.polo) Date: Mon, 9 Feb 2009 23:36:39 +0100 (CET) Subject: [Python-checkins] r69479 - python/branches/release26-maint Message-ID: <20090209223639.393011E4002@bag.python.org> Author: guilherme.polo Date: Mon Feb 9 23:36:39 2009 New Revision: 69479 Log: Blocked revisions 69474 via svnmerge ........ r69474 | guilherme.polo | 2009-02-09 18:57:45 -0200 (Mon, 09 Feb 2009) | 1 line Enforcing Tk 8.3.1 requirement. ........ Modified: python/branches/release26-maint/ (props changed) From nnorwitz at gmail.com Tue Feb 10 00:15:13 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 9 Feb 2009 18:15:13 -0500 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090209231513.GA11338@python.psfb.org> More important issues: ---------------------- test_distutils leaked [103, 103, 103] references, sum=309 Less important issues: ---------------------- test_docxmlrpc leaked [0, 4, -4] references, sum=0 test_dumbdbm leaked [0, -92, 0] references, sum=-92 test_file leaked [0, 0, 84] references, sum=84 test_smtplib leaked [-9, 9, 0] references, sum=0 test_threadsignals leaked [-8, 0, 0] references, sum=-8 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 test_xmlrpc leaked [0, 85, 0] references, sum=85 From buildbot at python.org Tue Feb 10 00:57:24 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 09 Feb 2009 23:57:24 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090209235724.F39DA1E4002@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/263 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: guilherme.polo 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.x.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Tue Feb 10 02:24:05 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 10 Feb 2009 02:24:05 +0100 (CET) Subject: [Python-checkins] r69480 - in python/trunk: Doc/library/collections.rst Lib/collections.py Lib/test/test_collections.py Misc/NEWS Message-ID: <20090210012405.5BD921E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 10 02:24:05 2009 New Revision: 69480 Log: Issue 1818: collections.namedtuple() to support automatic renaming of invalid fieldnames. Modified: python/trunk/Doc/library/collections.rst python/trunk/Lib/collections.py python/trunk/Lib/test/test_collections.py python/trunk/Misc/NEWS Modified: python/trunk/Doc/library/collections.rst ============================================================================== --- python/trunk/Doc/library/collections.rst (original) +++ python/trunk/Doc/library/collections.rst Tue Feb 10 02:24:05 2009 @@ -617,7 +617,7 @@ self-documenting code. They can be used wherever regular tuples are used, and they add the ability to access fields by name instead of position index. -.. function:: namedtuple(typename, field_names, [verbose]) +.. function:: namedtuple(typename, field_names, [verbose], [rename]) Returns a new tuple subclass named *typename*. The new subclass is used to create tuple-like objects that have fields accessible by attribute lookup as @@ -635,6 +635,11 @@ a :mod:`keyword` such as *class*, *for*, *return*, *global*, *pass*, *print*, or *raise*. + If *rename* is true, invalid fieldnames are automatically replaced + with positional names. For example, ``['abc', 'def', 'ghi', 'abc']`` is + converted to ``['abc', '_2', 'ghi', '_4']``, eliminating the keyword + ``def`` and the duplicate fieldname ``abc``. + If *verbose* is true, the class definition is printed just before being built. Named tuple instances do not have per-instance dictionaries, so they are @@ -642,6 +647,9 @@ .. versionadded:: 2.6 + .. versionchanged:: 2.7 + added support for *rename*. + Example: .. doctest:: Modified: python/trunk/Lib/collections.py ============================================================================== --- python/trunk/Lib/collections.py (original) +++ python/trunk/Lib/collections.py Tue Feb 10 02:24:05 2009 @@ -16,7 +16,7 @@ ### namedtuple ################################################################################ -def namedtuple(typename, field_names, verbose=False): +def namedtuple(typename, field_names, verbose=False, rename=False): """Returns a new subclass of tuple with named fields. >>> Point = namedtuple('Point', 'x y') @@ -45,6 +45,16 @@ if isinstance(field_names, basestring): field_names = field_names.replace(',', ' ').split() # names separated by whitespace and/or commas field_names = tuple(map(str, field_names)) + if rename: + names = list(field_names) + seen = set() + for i, name in enumerate(names): + if (not all(c.isalnum() or c=='_' for c in name) or _iskeyword(name) + or not name or name[0].isdigit() or name.startswith('_') + or name in seen): + names[i] = '_%d' % (i+1) + seen.add(name) + field_names = tuple(names) for name in (typename,) + field_names: if not all(c.isalnum() or c=='_' for c in name): raise ValueError('Type names and field names can only contain alphanumeric characters and underscores: %r' % name) @@ -54,7 +64,7 @@ raise ValueError('Type names and field names cannot start with a number: %r' % name) seen_names = set() for name in field_names: - if name.startswith('_'): + if name.startswith('_') and not rename: raise ValueError('Field names cannot start with an underscore: %r' % name) if name in seen_names: raise ValueError('Encountered duplicate field name: %r' % name) Modified: python/trunk/Lib/test/test_collections.py ============================================================================== --- python/trunk/Lib/test/test_collections.py (original) +++ python/trunk/Lib/test/test_collections.py Tue Feb 10 02:24:05 2009 @@ -44,6 +44,17 @@ self.assertRaises(TypeError, Point._make, [11]) # catch too few args self.assertRaises(TypeError, Point._make, [11, 22, 33]) # catch too many args + def test_name_fixer(self): + for spec, renamed in [ + [('efg', 'g%hi'), ('efg', '_2')], # field with non-alpha char + [('abc', 'class'), ('abc', '_2')], # field has keyword + [('8efg', '9ghi'), ('_1', '_2')], # field starts with digit + [('abc', '_efg'), ('abc', '_2')], # field with leading underscore + [('abc', 'efg', 'efg', 'ghi'), ('abc', 'efg', '_3', 'ghi')], # duplicate field + [('abc', '', 'x'), ('abc', '_2', 'x')], # fieldname is a space + ]: + self.assertEqual(namedtuple('NT', spec, rename=True)._fields, renamed) + def test_instance(self): Point = namedtuple('Point', 'x y') p = Point(11, 22) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Feb 10 02:24:05 2009 @@ -155,6 +155,10 @@ - Issue #5122: Synchronize tk load failure check to prevent a potential deadlock. +- Issue #1818: collections.namedtuple() now supports a keyword argument + 'rename' which lets invalid fieldnames be automatically converted to + positional names in the form, _1, _2, ... + - Issue #4890: Handle empty text search pattern in Tkinter.Text.search. - Issue #5170: Fixed Unicode output bug in logging and added test case. From buildbot at python.org Tue Feb 10 02:33:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 10 Feb 2009 01:33:40 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090210013340.483C81E4002@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/4619 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Alarm clock sincerely, -The Buildbot From buildbot at python.org Tue Feb 10 02:39:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 10 Feb 2009 01:39:40 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090210013940.83F1F1E401B@bag.python.org> The Buildbot has detected a new failure of OS X x86 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/126 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Abort trap sincerely, -The Buildbot From python-checkins at python.org Tue Feb 10 03:07:39 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 10 Feb 2009 03:07:39 +0100 (CET) Subject: [Python-checkins] r69481 - in python/trunk: Lib/compileall.py Lib/test/test_compileall.py Misc/ACKS Misc/NEWS Message-ID: <20090210020739.230DC1E4002@bag.python.org> Author: brett.cannon Date: Tue Feb 10 03:07:38 2009 New Revision: 69481 Log: compileall used the ctime of bytecode and source to determine if the bytecode should be recreated. This created a timing hole. Fixed by just doing what import does; check the mtime and magic number. Added: python/trunk/Lib/test/test_compileall.py Modified: python/trunk/Lib/compileall.py python/trunk/Misc/ACKS python/trunk/Misc/NEWS Modified: python/trunk/Lib/compileall.py ============================================================================== --- python/trunk/Lib/compileall.py (original) +++ python/trunk/Lib/compileall.py Tue Feb 10 03:07:38 2009 @@ -11,10 +11,11 @@ See module py_compile for details of the actual byte-compilation. """ - import os import sys import py_compile +import struct +import imp __all__ = ["compile_dir","compile_path"] @@ -54,11 +55,17 @@ if os.path.isfile(fullname): head, tail = name[:-3], name[-3:] if tail == '.py': - cfile = fullname + (__debug__ and 'c' or 'o') - ftime = os.stat(fullname).st_mtime - try: ctime = os.stat(cfile).st_mtime - except os.error: ctime = 0 - if (ctime > ftime) and not force: continue + if not force: + try: + mtime = os.stat(fullname).st_mtime + expect = struct.pack('<4sl', imp.get_magic(), mtime) + cfile = fullname + (__debug__ and 'c' or 'o') + with open(cfile, 'rb') as chandle: + actual = chandle.read(8) + if expect == actual: + continue + except IOError: + pass if not quiet: print 'Compiling', fullname, '...' try: @@ -80,7 +87,8 @@ name != os.curdir and name != os.pardir and \ os.path.isdir(fullname) and \ not os.path.islink(fullname): - if not compile_dir(fullname, maxlevels - 1, dfile, force, rx, quiet): + if not compile_dir(fullname, maxlevels - 1, dfile, force, rx, + quiet): success = 0 return success Added: python/trunk/Lib/test/test_compileall.py ============================================================================== --- (empty file) +++ python/trunk/Lib/test/test_compileall.py Tue Feb 10 03:07:38 2009 @@ -0,0 +1,63 @@ +import compileall +import imp +import os +import py_compile +import shutil +import struct +import sys +import tempfile +import time +from test import test_support +import unittest + + +class CompileallTests(unittest.TestCase): + + def setUp(self): + self.directory = tempfile.mkdtemp() + self.source_path = os.path.join(self.directory, '_test.py') + self.bc_path = self.source_path + ('c' if __debug__ else 'o') + with open(self.source_path, 'w') as file: + file.write('x = 123\n') + + def tearDown(self): + shutil.rmtree(self.directory) + + def data(self): + with open(self.bc_path, 'rb') as file: + data = file.read(8) + mtime = int(os.stat(self.source_path).st_mtime) + compare = struct.pack('<4sl', imp.get_magic(), mtime) + return data, compare + + def recreation_check(self, metadata): + """Check that compileall recreates bytecode when the new metadata is + used.""" + if not hasattr(os, 'stat'): + return + py_compile.compile(self.source_path) + self.assertEqual(*self.data()) + with open(self.bc_path, 'rb') as file: + bc = file.read()[len(metadata):] + with open(self.bc_path, 'wb') as file: + file.write(metadata) + file.write(bc) + self.assertNotEqual(*self.data()) + compileall.compile_dir(self.directory, force=False, quiet=True) + self.assertTrue(*self.data()) + + def test_mtime(self): + # Test a change in mtime leads to a new .pyc. + self.recreation_check(struct.pack('<4sl', imp.get_magic(), 1)) + + def test_magic_number(self): + # Test a change in mtime leads to a new .pyc. + self.recreation_check(b'\0\0\0\0') + + +def test_main(): + test_support.run_unittest(CompileallTests) + + +if __name__ == "__main__": + test_main() Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Tue Feb 10 03:07:38 2009 @@ -183,7 +183,7 @@ Andy Dustman Gary Duzan Eugene Dvurechenski -Josip Dzolonga +Josip Dzolonga Maxim Dzumanenko Walter D?rwald Hans Eckardt @@ -233,6 +233,7 @@ Geoff Furnish Ulisses Furquim Achim Gaedke +Martin von Gagern Lele Gaifax Santiago Gala Yitzchak Gale Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Feb 10 03:07:38 2009 @@ -152,6 +152,10 @@ Library ------- +- Issue #5128: Make compileall properly inspect bytecode to determine if needs + to be recreated. This avoids a timing hole thanks to the old reliance on the + ctime of the files involved. + - Issue #5122: Synchronize tk load failure check to prevent a potential deadlock. From python-checkins at python.org Tue Feb 10 03:10:16 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 10 Feb 2009 03:10:16 +0100 (CET) Subject: [Python-checkins] r69482 - in python/branches/py3k: Lib/compileall.py Lib/test/test_compileall.py Misc/ACKS Misc/NEWS Message-ID: <20090210021016.8EAE71E4002@bag.python.org> Author: brett.cannon Date: Tue Feb 10 03:10:16 2009 New Revision: 69482 Log: Merged revisions 69481 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69481 | brett.cannon | 2009-02-09 18:07:38 -0800 (Mon, 09 Feb 2009) | 4 lines compileall used the ctime of bytecode and source to determine if the bytecode should be recreated. This created a timing hole. Fixed by just doing what import does; check the mtime and magic number. ........ Added: python/branches/py3k/Lib/test/test_compileall.py - copied, changed from r69481, /python/trunk/Lib/test/test_compileall.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/compileall.py python/branches/py3k/Misc/ACKS python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/compileall.py ============================================================================== --- python/branches/py3k/Lib/compileall.py (original) +++ python/branches/py3k/Lib/compileall.py Tue Feb 10 03:10:16 2009 @@ -11,10 +11,11 @@ See module py_compile for details of the actual byte-compilation. """ - import os import sys import py_compile +import struct +import imp __all__ = ["compile_dir","compile_path"] @@ -54,11 +55,17 @@ if os.path.isfile(fullname): head, tail = name[:-3], name[-3:] if tail == '.py': - cfile = fullname + (__debug__ and 'c' or 'o') - ftime = os.stat(fullname).st_mtime - try: ctime = os.stat(cfile).st_mtime - except os.error: ctime = 0 - if (ctime > ftime) and not force: continue + if not force: + try: + mtime = os.stat(fullname).st_mtime + expect = struct.pack('<4sl', imp.get_magic(), mtime) + cfile = fullname + (__debug__ and 'c' or 'o') + with open(cfile, 'rb') as chandle: + actual = chandle.read(8) + if expect == actual: + continue + except IOError: + pass if not quiet: print('Compiling', fullname, '...') try: @@ -86,7 +93,8 @@ name != os.curdir and name != os.pardir and \ os.path.isdir(fullname) and \ not os.path.islink(fullname): - if not compile_dir(fullname, maxlevels - 1, dfile, force, rx, quiet): + if not compile_dir(fullname, maxlevels - 1, dfile, force, rx, + quiet): success = 0 return success Copied: python/branches/py3k/Lib/test/test_compileall.py (from r69481, /python/trunk/Lib/test/test_compileall.py) ============================================================================== --- /python/trunk/Lib/test/test_compileall.py (original) +++ python/branches/py3k/Lib/test/test_compileall.py Tue Feb 10 03:10:16 2009 @@ -7,7 +7,7 @@ import sys import tempfile import time -from test import test_support +from test import support import unittest @@ -56,7 +56,7 @@ def test_main(): - test_support.run_unittest(CompileallTests) + support.run_unittest(CompileallTests) if __name__ == "__main__": Modified: python/branches/py3k/Misc/ACKS ============================================================================== --- python/branches/py3k/Misc/ACKS (original) +++ python/branches/py3k/Misc/ACKS Tue Feb 10 03:10:16 2009 @@ -183,7 +183,7 @@ Andy Dustman Gary Duzan Eugene Dvurechenski -Josip Dzolonga +Josip Dzolonga Maxim Dzumanenko Walter D?rwald Hans Eckardt @@ -234,6 +234,7 @@ Ulisses Furquim Hagen F?rstenau Achim Gaedke +Martin von Gagern Lele Gaifax Santiago Gala Yitzchak Gale Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue Feb 10 03:10:16 2009 @@ -163,6 +163,10 @@ Library ------- +- Issue #5128: Make compileall properly inspect bytecode to determine if needs + to be recreated. This avoids a timing hole thanks to the old reliance on the + ctime of the files involved. + - Issue #5122: Synchronize tk load failure check to prevent a potential deadlock. From buildbot at python.org Tue Feb 10 03:14:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 10 Feb 2009 02:14:15 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090210021415.A63581E4002@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/144 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: guilherme.polo 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 Feb 10 03:20:49 2009 From: python-checkins at python.org (guilherme.polo) Date: Tue, 10 Feb 2009 03:20:49 +0100 (CET) Subject: [Python-checkins] r69483 - python/branches/py3k/Modules/tkinter.h Message-ID: <20090210022049.D9F6F1E4002@bag.python.org> Author: guilherme.polo Date: Tue Feb 10 03:20:49 2009 New Revision: 69483 Log: This header was supposed to be committed in r69476 Added: python/branches/py3k/Modules/tkinter.h (contents, props changed) Added: python/branches/py3k/Modules/tkinter.h ============================================================================== --- (empty file) +++ python/branches/py3k/Modules/tkinter.h Tue Feb 10 03:20:49 2009 @@ -0,0 +1,25 @@ +#ifndef TKINTER_H +#define TKINTER_H + +/* This header is used to share some macros between _tkinter.c and + * tkappinit.c */ + +/* TK_RELEASE_LEVEL is always one of the following: + * TCL_ALPHA_RELEASE 0 + * TCL_BETA_RELEASE 1 + * TCL_FINAL_RELEASE 2 + */ +#define TK_VERSION_HEX ((TK_MAJOR_VERSION << 24) | \ + (TK_MINOR_VERSION << 16) | \ + (TK_RELEASE_SERIAL << 8) | \ + (TK_RELEASE_LEVEL << 0)) + +/* Protect Tk 8.4.13 and older from a deadlock that happens when trying + * to load tk after a failed attempt. */ +#if TK_VERSION_HEX < 0x08040e02 +#define TKINTER_PROTECT_LOADTK +#define TKINTER_LOADTK_ERRMSG \ + "Calling Tk_Init again after a previous call failed might deadlock" +#endif + +#endif /* !TKINTER_H */ From python-checkins at python.org Tue Feb 10 03:41:10 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 10 Feb 2009 03:41:10 +0100 (CET) Subject: [Python-checkins] r69484 - in python/branches/py3k: Doc/library/collections.rst Lib/collections.py Lib/test/test_collections.py Misc/NEWS Modules/itertoolsmodule.c Message-ID: <20090210024110.CCA181E4002@bag.python.org> Author: benjamin.peterson Date: Tue Feb 10 03:41:10 2009 New Revision: 69484 Log: Merged revisions 69466,69480 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69466 | raymond.hettinger | 2009-02-09 12:39:41 -0600 (Mon, 09 Feb 2009) | 3 lines Issue 5171: itertools.product docstring missing 'repeat' argument ........ r69480 | raymond.hettinger | 2009-02-09 19:24:05 -0600 (Mon, 09 Feb 2009) | 1 line Issue 1818: collections.namedtuple() to support automatic renaming of invalid fieldnames. ........ Modified: python/branches/py3k/ (props changed) 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 python/branches/py3k/Modules/itertoolsmodule.c Modified: python/branches/py3k/Doc/library/collections.rst ============================================================================== --- python/branches/py3k/Doc/library/collections.rst (original) +++ python/branches/py3k/Doc/library/collections.rst Tue Feb 10 03:41:10 2009 @@ -597,7 +597,7 @@ self-documenting code. They can be used wherever regular tuples are used, and they add the ability to access fields by name instead of position index. -.. function:: namedtuple(typename, field_names, [verbose]) +.. function:: namedtuple(typename, field_names, [verbose], [rename]) Returns a new tuple subclass named *typename*. The new subclass is used to create tuple-like objects that have fields accessible by attribute lookup as @@ -615,11 +615,19 @@ a :mod:`keyword` such as *class*, *for*, *return*, *global*, *pass*, or *raise*. + If *rename* is true, invalid fieldnames are automatically replaced + with positional names. For example, ``['abc', 'def', 'ghi', 'abc']`` is + converted to ``['abc', '_2', 'ghi', '_4']``, eliminating the keyword + ``def`` and the duplicate fieldname ``abc``. + If *verbose* is true, the class definition is printed just before being built. Named tuple instances do not have per-instance dictionaries, so they are lightweight and require no more memory than regular tuples. + .. versionchanged:: 2.7 + added support for *rename*. + Example: .. doctest:: Modified: python/branches/py3k/Lib/collections.py ============================================================================== --- python/branches/py3k/Lib/collections.py (original) +++ python/branches/py3k/Lib/collections.py Tue Feb 10 03:41:10 2009 @@ -18,7 +18,7 @@ ### namedtuple ################################################################################ -def namedtuple(typename, field_names, verbose=False): +def namedtuple(typename, field_names, verbose=False, rename=False): """Returns a new subclass of tuple with named fields. >>> Point = namedtuple('Point', 'x y') @@ -47,6 +47,16 @@ if isinstance(field_names, str): field_names = field_names.replace(',', ' ').split() # names separated by whitespace and/or commas field_names = tuple(map(str, field_names)) + if rename: + names = list(field_names) + seen = set() + for i, name in enumerate(names): + if (not all(c.isalnum() or c=='_' for c in name) or _iskeyword(name) + or not name or name[0].isdigit() or name.startswith('_') + or name in seen): + names[i] = '_%d' % (i+1) + seen.add(name) + field_names = tuple(names) for name in (typename,) + field_names: if not all(c.isalnum() or c=='_' for c in name): raise ValueError('Type names and field names can only contain alphanumeric characters and underscores: %r' % name) @@ -56,7 +66,7 @@ raise ValueError('Type names and field names cannot start with a number: %r' % name) seen_names = set() for name in field_names: - if name.startswith('_'): + if name.startswith('_') and not rename: raise ValueError('Field names cannot start with an underscore: %r' % name) if name in seen_names: raise ValueError('Encountered duplicate field name: %r' % name) 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 Tue Feb 10 03:41:10 2009 @@ -47,6 +47,17 @@ self.assertRaises(TypeError, Point._make, [11]) # catch too few args self.assertRaises(TypeError, Point._make, [11, 22, 33]) # catch too many args + def test_name_fixer(self): + for spec, renamed in [ + [('efg', 'g%hi'), ('efg', '_2')], # field with non-alpha char + [('abc', 'class'), ('abc', '_2')], # field has keyword + [('8efg', '9ghi'), ('_1', '_2')], # field starts with digit + [('abc', '_efg'), ('abc', '_2')], # field with leading underscore + [('abc', 'efg', 'efg', 'ghi'), ('abc', 'efg', '_3', 'ghi')], # duplicate field + [('abc', '', 'x'), ('abc', '_2', 'x')], # fieldname is a space + ]: + self.assertEqual(namedtuple('NT', spec, rename=True)._fields, renamed) + def test_instance(self): Point = namedtuple('Point', 'x y') p = Point(11, 22) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue Feb 10 03:41:10 2009 @@ -170,6 +170,10 @@ - Issue #5122: Synchronize tk load failure check to prevent a potential deadlock. +- Issue #1818: collections.namedtuple() now supports a keyword argument + 'rename' which lets invalid fieldnames be automatically converted to + positional names in the form, _1, _2, ... + - Issue #4890: Handle empty text search pattern in Tkinter.Text.search. - Issue #4512 (part 2): Promote ``ZipImporter._get_filename()`` to be a Modified: python/branches/py3k/Modules/itertoolsmodule.c ============================================================================== --- python/branches/py3k/Modules/itertoolsmodule.c (original) +++ python/branches/py3k/Modules/itertoolsmodule.c Tue Feb 10 03:41:10 2009 @@ -1791,6 +1791,9 @@ The leftmost iterators are in the outermost for-loop, so the output tuples\n\ cycle in a manner similar to an odometer (with the rightmost element changing\n\ on every iteration).\n\n\ +To compute the product of an iterable with itself, specify the number\n\ +of repetitions with the optional repeat keyword argument. For example,\n\ +product(A, repeat=4) means the same as product(A, A, A, A).\n\n\ product('ab', range(3)) --> ('a',0) ('a',1) ('a',2) ('b',0) ('b',1) ('b',2)\n\ product((0,1), (0,1), (0,1)) --> (0,0,0) (0,0,1) (0,1,0) (0,1,1) (1,0,0) ..."); From buildbot at python.org Tue Feb 10 05:23:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 10 Feb 2009 04:23:20 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090210042320.C825F1E4002@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/265 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,brett.cannon,guilherme.polo 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 Tue Feb 10 13:31:09 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 10 Feb 2009 13:31:09 +0100 (CET) Subject: [Python-checkins] r69485 - in python/trunk: Lib/distutils/sysconfig.py Lib/distutils/tests/test_sysconfig.py Misc/NEWS Message-ID: <20090210123109.B0B291E403B@bag.python.org> Author: tarek.ziade Date: Tue Feb 10 13:31:09 2009 New Revision: 69485 Log: Fixed #3386: the optional prefix argument was ignored under OS2 and NT in distutils.sysconfig.get_python_lib Modified: python/trunk/Lib/distutils/sysconfig.py python/trunk/Lib/distutils/tests/test_sysconfig.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/sysconfig.py ============================================================================== --- python/trunk/Lib/distutils/sysconfig.py (original) +++ python/trunk/Lib/distutils/sysconfig.py Tue Feb 10 13:31:09 2009 @@ -132,7 +132,7 @@ if get_python_version() < "2.2": return prefix else: - return os.path.join(PREFIX, "Lib", "site-packages") + return os.path.join(prefix, "Lib", "site-packages") elif os.name == "mac": if plat_specific: @@ -148,9 +148,9 @@ elif os.name == "os2": if standard_lib: - return os.path.join(PREFIX, "Lib") + return os.path.join(prefix, "Lib") else: - return os.path.join(PREFIX, "Lib", "site-packages") + return os.path.join(prefix, "Lib", "site-packages") else: raise DistutilsPlatformError( 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 Tue Feb 10 13:31:09 2009 @@ -26,6 +26,8 @@ # XXX doesn't work on Linux when Python was never installed before #self.assert_(os.path.isdir(lib_dir), lib_dir) # test for pythonxx.lib? + self.assertNotEqual(sysconfig.get_python_lib(), + sysconfig.get_python_lib(prefix=TESTFN)) def test_get_python_inc(self): inc_dir = sysconfig.get_python_inc() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Feb 10 13:31:09 2009 @@ -152,6 +152,9 @@ Library ------- +- Issue #3386: distutils.sysconfig.get_python_lib prefix argument was ignored + under NT and OS2. Patch by Philip Jenvey. + - Issue #5128: Make compileall properly inspect bytecode to determine if needs to be recreated. This avoids a timing hole thanks to the old reliance on the ctime of the files involved. From python-checkins at python.org Tue Feb 10 13:33:42 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 10 Feb 2009 13:33:42 +0100 (CET) Subject: [Python-checkins] r69486 - in python/branches/release26-maint: Lib/distutils/sysconfig.py Lib/distutils/tests/test_sysconfig.py Misc/NEWS Message-ID: <20090210123342.D75891E4002@bag.python.org> Author: tarek.ziade Date: Tue Feb 10 13:33:42 2009 New Revision: 69486 Log: Merged revisions 69485 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69485 | tarek.ziade | 2009-02-10 13:31:09 +0100 (Tue, 10 Feb 2009) | 1 line Fixed #3386: the optional prefix argument was ignored under OS2 and NT in distutils.sysconfig.get_python_lib ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/distutils/sysconfig.py python/branches/release26-maint/Lib/distutils/tests/test_sysconfig.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/distutils/sysconfig.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/sysconfig.py (original) +++ python/branches/release26-maint/Lib/distutils/sysconfig.py Tue Feb 10 13:33:42 2009 @@ -129,7 +129,7 @@ if get_python_version() < "2.2": return prefix else: - return os.path.join(PREFIX, "Lib", "site-packages") + return os.path.join(prefix, "Lib", "site-packages") elif os.name == "mac": if plat_specific: @@ -145,9 +145,9 @@ elif os.name == "os2": if standard_lib: - return os.path.join(PREFIX, "Lib") + return os.path.join(prefix, "Lib") else: - return os.path.join(PREFIX, "Lib", "site-packages") + return os.path.join(prefix, "Lib", "site-packages") else: raise DistutilsPlatformError( Modified: python/branches/release26-maint/Lib/distutils/tests/test_sysconfig.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/tests/test_sysconfig.py (original) +++ python/branches/release26-maint/Lib/distutils/tests/test_sysconfig.py Tue Feb 10 13:33:42 2009 @@ -17,6 +17,8 @@ # XXX doesn't work on Linux when Python was never installed before #self.assert_(os.path.isdir(lib_dir), lib_dir) # test for pythonxx.lib? + self.assertNotEqual(sysconfig.get_python_lib(), + sysconfig.get_python_lib(prefix=TESTFN)) def test_get_python_inc(self): # The check for srcdir is copied from Python's setup.py, Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Tue Feb 10 13:33:42 2009 @@ -80,6 +80,9 @@ Library ------- +- Issue #3386: distutils.sysconfig.get_python_lib prefix argument was ignored + under NT and OS2. Patch by Philip Jenvey. + - Issue #4890: Handle empty text search pattern in Tkinter.Text.search. - Issue #5170: Fixed Unicode output bug in logging and added test case. From python-checkins at python.org Tue Feb 10 13:36:34 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 10 Feb 2009 13:36:34 +0100 (CET) Subject: [Python-checkins] r69487 - in python/branches/py3k: Lib/distutils/sysconfig.py Lib/distutils/tests/test_sysconfig.py Misc/NEWS Message-ID: <20090210123634.0C65F1E4002@bag.python.org> Author: tarek.ziade Date: Tue Feb 10 13:36:33 2009 New Revision: 69487 Log: Merged revisions 69485 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69485 | tarek.ziade | 2009-02-10 13:31:09 +0100 (Tue, 10 Feb 2009) | 1 line Fixed #3386: the optional prefix argument was ignored under OS2 and NT in distutils.sysconfig.get_python_lib ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/sysconfig.py python/branches/py3k/Lib/distutils/tests/test_sysconfig.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/distutils/sysconfig.py ============================================================================== --- python/branches/py3k/Lib/distutils/sysconfig.py (original) +++ python/branches/py3k/Lib/distutils/sysconfig.py Tue Feb 10 13:36:33 2009 @@ -130,7 +130,7 @@ if get_python_version() < "2.2": return prefix else: - return os.path.join(PREFIX, "Lib", "site-packages") + return os.path.join(prefix, "Lib", "site-packages") elif os.name == "mac": if plat_specific: if standard_lib: @@ -144,9 +144,9 @@ return os.path.join(prefix, "Lib", "site-packages") elif os.name == "os2": if standard_lib: - return os.path.join(PREFIX, "Lib") + return os.path.join(prefix, "Lib") else: - return os.path.join(PREFIX, "Lib", "site-packages") + return os.path.join(prefix, "Lib", "site-packages") else: raise DistutilsPlatformError( "I don't know where Python installs its library " 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 Tue Feb 10 13:36:33 2009 @@ -26,6 +26,8 @@ # XXX doesn't work on Linux when Python was never installed before #self.assert_(os.path.isdir(lib_dir), lib_dir) # test for pythonxx.lib? + self.assertNotEqual(sysconfig.get_python_lib(), + sysconfig.get_python_lib(prefix=TESTFN)) def test_get_python_inc(self): inc_dir = sysconfig.get_python_inc() Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue Feb 10 13:36:33 2009 @@ -163,6 +163,9 @@ Library ------- +- Issue #3386: distutils.sysconfig.get_python_lib prefix argument was ignored + under NT and OS2. Patch by Philip Jenvey. + - Issue #5128: Make compileall properly inspect bytecode to determine if needs to be recreated. This avoids a timing hole thanks to the old reliance on the ctime of the files involved. From python-checkins at python.org Tue Feb 10 13:41:19 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 10 Feb 2009 13:41:19 +0100 (CET) Subject: [Python-checkins] r69488 - in python/branches/release30-maint: Lib/distutils/sysconfig.py Lib/distutils/tests/test_sysconfig.py Misc/NEWS Message-ID: <20090210124119.6626D1E4002@bag.python.org> Author: tarek.ziade Date: Tue Feb 10 13:41:19 2009 New Revision: 69488 Log: Merged revisions 69487 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69487 | tarek.ziade | 2009-02-10 13:36:33 +0100 (Tue, 10 Feb 2009) | 9 lines Merged revisions 69485 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69485 | tarek.ziade | 2009-02-10 13:31:09 +0100 (Tue, 10 Feb 2009) | 1 line Fixed #3386: the optional prefix argument was ignored under OS2 and NT in distutils.sysconfig.get_python_lib ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/distutils/sysconfig.py python/branches/release30-maint/Lib/distutils/tests/test_sysconfig.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/distutils/sysconfig.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/sysconfig.py (original) +++ python/branches/release30-maint/Lib/distutils/sysconfig.py Tue Feb 10 13:41:19 2009 @@ -127,7 +127,7 @@ if get_python_version() < "2.2": return prefix else: - return os.path.join(PREFIX, "Lib", "site-packages") + return os.path.join(prefix, "Lib", "site-packages") elif os.name == "mac": if plat_specific: if standard_lib: @@ -141,9 +141,9 @@ return os.path.join(prefix, "Lib", "site-packages") elif os.name == "os2": if standard_lib: - return os.path.join(PREFIX, "Lib") + return os.path.join(prefix, "Lib") else: - return os.path.join(PREFIX, "Lib", "site-packages") + return os.path.join(prefix, "Lib", "site-packages") else: raise DistutilsPlatformError( "I don't know where Python installs its library " Modified: python/branches/release30-maint/Lib/distutils/tests/test_sysconfig.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/tests/test_sysconfig.py (original) +++ python/branches/release30-maint/Lib/distutils/tests/test_sysconfig.py Tue Feb 10 13:41:19 2009 @@ -17,6 +17,8 @@ # XXX doesn't work on Linux when Python was never installed before #self.assert_(os.path.isdir(lib_dir), lib_dir) # test for pythonxx.lib? + self.assertNotEqual(sysconfig.get_python_lib(), + sysconfig.get_python_lib(prefix=TESTFN)) def test_get_python_inc(self): # The check for srcdir is copied from Python's setup.py, Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Tue Feb 10 13:41:19 2009 @@ -116,6 +116,9 @@ Library ------- +- Issue #3386: distutils.sysconfig.get_python_lib prefix argument was ignored + under NT and OS2. Patch by Philip Jenvey. + - Issue #4890: Handle empty text search pattern in Tkinter.Text.search. - Partial fix to issue #1731706: memory leak in Tkapp_Call when calling From python-checkins at python.org Tue Feb 10 14:09:19 2009 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 10 Feb 2009 14:09:19 +0100 (CET) Subject: [Python-checkins] r69489 - in python/trunk: Misc/NEWS PCbuild/sqlite3.vcproj PCbuild/sqlite3.vsprops Message-ID: <20090210130919.AB1F01E4002@bag.python.org> Author: martin.v.loewis Date: Tue Feb 10 14:09:19 2009 New Revision: 69489 Log: Issue #5134: Silence compiler warnings when compiling sqlite with VC++. Added: python/trunk/PCbuild/sqlite3.vsprops Modified: python/trunk/Misc/NEWS python/trunk/PCbuild/sqlite3.vcproj Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Feb 10 14:09:19 2009 @@ -453,6 +453,8 @@ Build ----- +- Issue #5134: Silence compiler warnings when compiling sqlite with VC++. + - Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. - Issue #4895: Use _strdup on Windows CE. Modified: python/trunk/PCbuild/sqlite3.vcproj ============================================================================== --- python/trunk/PCbuild/sqlite3.vcproj (original) +++ python/trunk/PCbuild/sqlite3.vcproj Tue Feb 10 14:09:19 2009 @@ -22,7 +22,7 @@ @@ -166,8 +164,7 @@ /> @@ -229,8 +226,7 @@ /> @@ -291,8 +287,7 @@ /> @@ -354,8 +349,7 @@ /> @@ -415,8 +409,7 @@ /> @@ -478,8 +471,7 @@ /> + + + From python-checkins at python.org Tue Feb 10 14:12:12 2009 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 10 Feb 2009 14:12:12 +0100 (CET) Subject: [Python-checkins] r69490 - python/trunk/PCbuild/sqlite3.vsprops Message-ID: <20090210131212.3DAB11E4002@bag.python.org> Author: martin.v.loewis Date: Tue Feb 10 14:12:12 2009 New Revision: 69490 Log: Set eol-style to native Modified: python/trunk/PCbuild/sqlite3.vsprops (contents, props changed) Modified: python/trunk/PCbuild/sqlite3.vsprops ============================================================================== --- python/trunk/PCbuild/sqlite3.vsprops (original) +++ python/trunk/PCbuild/sqlite3.vsprops Tue Feb 10 14:12:12 2009 @@ -1,14 +1,14 @@ - - - - + + + + From python-checkins at python.org Tue Feb 10 14:13:30 2009 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 10 Feb 2009 14:13:30 +0100 (CET) Subject: [Python-checkins] r69491 - in python/branches/py3k: Misc/NEWS PCbuild/sqlite3.vcproj PCbuild/sqlite3.vsprops Message-ID: <20090210131330.C2EA01E4002@bag.python.org> Author: martin.v.loewis Date: Tue Feb 10 14:13:30 2009 New Revision: 69491 Log: Merged revisions 69489-69490 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69489 | martin.v.loewis | 2009-02-10 14:09:19 +0100 (Di, 10 Feb 2009) | 1 line Issue #5134: Silence compiler warnings when compiling sqlite with VC++. ........ r69490 | martin.v.loewis | 2009-02-10 14:12:12 +0100 (Di, 10 Feb 2009) | 1 line Set eol-style to native ........ Added: python/branches/py3k/PCbuild/sqlite3.vsprops - copied unchanged from r69490, /python/trunk/PCbuild/sqlite3.vsprops Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/PCbuild/sqlite3.vcproj Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue Feb 10 14:13:30 2009 @@ -437,6 +437,8 @@ Build ----- +- Issue #5134: Silence compiler warnings when compiling sqlite with VC++. + - Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. - Issue #4895: Use _strdup on Windows CE. Modified: python/branches/py3k/PCbuild/sqlite3.vcproj ============================================================================== --- python/branches/py3k/PCbuild/sqlite3.vcproj (original) +++ python/branches/py3k/PCbuild/sqlite3.vcproj Tue Feb 10 14:13:30 2009 @@ -22,7 +22,7 @@ @@ -166,8 +164,7 @@ /> @@ -229,8 +226,7 @@ /> @@ -291,8 +287,7 @@ /> @@ -354,8 +349,7 @@ /> @@ -415,8 +409,7 @@ /> @@ -478,8 +471,7 @@ /> Author: martin.v.loewis Date: Tue Feb 10 14:17:46 2009 New Revision: 69492 Log: Merged revisions 69491 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69491 | martin.v.loewis | 2009-02-10 14:13:30 +0100 (Di, 10 Feb 2009) | 13 lines Merged revisions 69489-69490 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69489 | martin.v.loewis | 2009-02-10 14:09:19 +0100 (Di, 10 Feb 2009) | 1 line Issue #5134: Silence compiler warnings when compiling sqlite with VC++. ........ r69490 | martin.v.loewis | 2009-02-10 14:12:12 +0100 (Di, 10 Feb 2009) | 1 line Set eol-style to native ........ ................ Added: python/branches/release30-maint/PCbuild/sqlite3.vsprops - copied unchanged from r69491, /python/branches/py3k/PCbuild/sqlite3.vsprops Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/PCbuild/sqlite3.vcproj Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Tue Feb 10 14:17:46 2009 @@ -283,6 +283,8 @@ Build ----- +- Issue #5134: Silence compiler warnings when compiling sqlite with VC++. + - Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. - Issue #4472: "configure --enable-shared" now works on OSX Modified: python/branches/release30-maint/PCbuild/sqlite3.vcproj ============================================================================== --- python/branches/release30-maint/PCbuild/sqlite3.vcproj (original) +++ python/branches/release30-maint/PCbuild/sqlite3.vcproj Tue Feb 10 14:17:46 2009 @@ -22,7 +22,7 @@ @@ -166,8 +164,7 @@ /> @@ -229,8 +226,7 @@ /> @@ -291,8 +287,7 @@ /> @@ -354,8 +349,7 @@ /> @@ -415,8 +409,7 @@ /> @@ -478,8 +471,7 @@ /> Author: martin.v.loewis Date: Tue Feb 10 14:17:53 2009 New Revision: 69493 Log: Merged revisions 69489-69490 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69489 | martin.v.loewis | 2009-02-10 14:09:19 +0100 (Di, 10 Feb 2009) | 1 line Issue #5134: Silence compiler warnings when compiling sqlite with VC++. ........ r69490 | martin.v.loewis | 2009-02-10 14:12:12 +0100 (Di, 10 Feb 2009) | 1 line Set eol-style to native ........ Added: python/branches/release26-maint/PCbuild/sqlite3.vsprops - copied unchanged from r69490, /python/trunk/PCbuild/sqlite3.vsprops Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/PCbuild/sqlite3.vcproj Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Tue Feb 10 14:17:53 2009 @@ -334,6 +334,8 @@ Build ----- +- Issue #5134: Silence compiler warnings when compiling sqlite with VC++. + - Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. - Issue #4895: Use _strdup on Windows CE. Modified: python/branches/release26-maint/PCbuild/sqlite3.vcproj ============================================================================== --- python/branches/release26-maint/PCbuild/sqlite3.vcproj (original) +++ python/branches/release26-maint/PCbuild/sqlite3.vcproj Tue Feb 10 14:17:53 2009 @@ -22,7 +22,7 @@ @@ -166,8 +164,7 @@ /> @@ -229,8 +226,7 @@ /> @@ -291,8 +287,7 @@ /> @@ -354,8 +349,7 @@ /> @@ -415,8 +409,7 @@ /> @@ -478,8 +471,7 @@ /> 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/851 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: sincerely, -The Buildbot From python-checkins at python.org Tue Feb 10 14:31:28 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Tue, 10 Feb 2009 14:31:28 +0100 (CET) Subject: [Python-checkins] r69494 - in python/trunk/PC/VC6: _msi.dsp _multiprocessing.dsp build_tkinter.py tcl852.patch Message-ID: <20090210133128.69CD31E4023@bag.python.org> Author: hirokazu.yamamoto Date: Tue Feb 10 14:31:28 2009 New Revision: 69494 Log: Fixed svn:eol-style. Modified: python/trunk/PC/VC6/_msi.dsp (props changed) python/trunk/PC/VC6/_multiprocessing.dsp (contents, props changed) python/trunk/PC/VC6/build_tkinter.py (contents, props changed) python/trunk/PC/VC6/tcl852.patch (contents, props changed) Modified: python/trunk/PC/VC6/_multiprocessing.dsp ============================================================================== --- python/trunk/PC/VC6/_multiprocessing.dsp (original) +++ python/trunk/PC/VC6/_multiprocessing.dsp Tue Feb 10 14:31:28 2009 @@ -1,115 +1,115 @@ -# Microsoft Developer Studio Project File - Name="_multiprocessing" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=_multiprocessing - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "_multiprocessing.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "_multiprocessing.mak" CFG="_multiprocessing - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "_multiprocessing - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "_multiprocessing - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "_multiprocessing" -# PROP Scc_LocalPath ".." -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "_multiprocessing - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "." -# PROP Intermediate_Dir "x86-temp-release\_multiprocessing" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1D0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing.pyd" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "_multiprocessing - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "." -# PROP Intermediate_Dir "x86-temp-debug\_multiprocessing" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1d0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing_d.pyd" /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "_multiprocessing - Win32 Release" -# Name "_multiprocessing - Win32 Debug" -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\multiprocessing.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\pipe_connection.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\semaphore.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\socket_connection.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\win32_functions.c -# End Source File -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="_multiprocessing" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=_multiprocessing - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "_multiprocessing.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "_multiprocessing.mak" CFG="_multiprocessing - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "_multiprocessing - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "_multiprocessing - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "_multiprocessing" +# PROP Scc_LocalPath ".." +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "_multiprocessing - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "." +# PROP Intermediate_Dir "x86-temp-release\_multiprocessing" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +F90=df.exe +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1D0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing.pyd" +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "_multiprocessing - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "." +# PROP Intermediate_Dir "x86-temp-debug\_multiprocessing" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +F90=df.exe +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1d0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing_d.pyd" /pdbtype:sept +# SUBTRACT LINK32 /pdb:none + +!ENDIF + +# Begin Target + +# Name "_multiprocessing - Win32 Release" +# Name "_multiprocessing - Win32 Debug" +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\multiprocessing.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\pipe_connection.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\semaphore.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\socket_connection.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\win32_functions.c +# End Source File +# End Target +# End Project Modified: python/trunk/PC/VC6/build_tkinter.py ============================================================================== --- python/trunk/PC/VC6/build_tkinter.py (original) +++ python/trunk/PC/VC6/build_tkinter.py Tue Feb 10 14:31:28 2009 @@ -1,81 +1,81 @@ -import os -import sys -import subprocess - -TCL_MAJOR = 8 -TCL_MINOR = 5 -TCL_PATCH = 2 - -TIX_MAJOR = 8 -TIX_MINOR = 4 -TIX_PATCH = 3 - -def abspath(name): - par = os.path.pardir - return os.path.abspath(os.path.join(__file__, par, par, par, par, name)) - -TCL_DIR = abspath("tcl%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) -TK_DIR = abspath("tk%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) -TIX_DIR = abspath("tix%d.%d.%d" % (TIX_MAJOR, TIX_MINOR, TIX_PATCH)) -OUT_DIR = abspath("tcltk") - -def have_args(*a): - return any(s in sys.argv[1:] for s in a) - -def enter(dir): - os.chdir(os.path.join(dir, "win")) - -def main(): - debug = have_args("-d", "--debug") - clean = have_args("clean") - install = have_args("install") - tcl = have_args("tcl") - tk = have_args("tk") - tix = have_args("tix") - if not(tcl) and not(tk) and not(tix): - tcl = tk = tix = True - - def nmake(makefile, *a): - args = ["nmake", "/nologo", "/f", makefile, "DEBUG=%d" % debug] - args.extend(a) - subprocess.check_call(args) - - if tcl: - enter(TCL_DIR) - def nmake_tcl(*a): - nmake("makefile.vc", *a) - if clean: - nmake_tcl("clean") - elif install: - nmake_tcl("install", "INSTALLDIR=" + OUT_DIR) - else: - nmake_tcl() - - if tk: - enter(TK_DIR) - def nmake_tk(*a): - nmake("makefile.vc", "TCLDIR=" + TCL_DIR, *a) - if clean: - nmake_tk("clean") - elif install: - nmake_tk("install", "INSTALLDIR=" + OUT_DIR) - else: - nmake_tk() - - if tix: - enter(TIX_DIR) - def nmake_tix(*a): - nmake("python.mak", - "TCL_MAJOR=%d" % TCL_MAJOR, - "TCL_MINOR=%d" % TCL_MINOR, - "TCL_PATCH=%d" % TCL_PATCH, - "MACHINE=IX86", *a) - if clean: - nmake_tix("clean") - elif install: - nmake_tix("install", "INSTALL_DIR=" + OUT_DIR) - else: - nmake_tix() - -if __name__ == '__main__': - main() +import os +import sys +import subprocess + +TCL_MAJOR = 8 +TCL_MINOR = 5 +TCL_PATCH = 2 + +TIX_MAJOR = 8 +TIX_MINOR = 4 +TIX_PATCH = 3 + +def abspath(name): + par = os.path.pardir + return os.path.abspath(os.path.join(__file__, par, par, par, par, name)) + +TCL_DIR = abspath("tcl%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) +TK_DIR = abspath("tk%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) +TIX_DIR = abspath("tix%d.%d.%d" % (TIX_MAJOR, TIX_MINOR, TIX_PATCH)) +OUT_DIR = abspath("tcltk") + +def have_args(*a): + return any(s in sys.argv[1:] for s in a) + +def enter(dir): + os.chdir(os.path.join(dir, "win")) + +def main(): + debug = have_args("-d", "--debug") + clean = have_args("clean") + install = have_args("install") + tcl = have_args("tcl") + tk = have_args("tk") + tix = have_args("tix") + if not(tcl) and not(tk) and not(tix): + tcl = tk = tix = True + + def nmake(makefile, *a): + args = ["nmake", "/nologo", "/f", makefile, "DEBUG=%d" % debug] + args.extend(a) + subprocess.check_call(args) + + if tcl: + enter(TCL_DIR) + def nmake_tcl(*a): + nmake("makefile.vc", *a) + if clean: + nmake_tcl("clean") + elif install: + nmake_tcl("install", "INSTALLDIR=" + OUT_DIR) + else: + nmake_tcl() + + if tk: + enter(TK_DIR) + def nmake_tk(*a): + nmake("makefile.vc", "TCLDIR=" + TCL_DIR, *a) + if clean: + nmake_tk("clean") + elif install: + nmake_tk("install", "INSTALLDIR=" + OUT_DIR) + else: + nmake_tk() + + if tix: + enter(TIX_DIR) + def nmake_tix(*a): + nmake("python.mak", + "TCL_MAJOR=%d" % TCL_MAJOR, + "TCL_MINOR=%d" % TCL_MINOR, + "TCL_PATCH=%d" % TCL_PATCH, + "MACHINE=IX86", *a) + if clean: + nmake_tix("clean") + elif install: + nmake_tix("install", "INSTALL_DIR=" + OUT_DIR) + else: + nmake_tix() + +if __name__ == '__main__': + main() Modified: python/trunk/PC/VC6/tcl852.patch ============================================================================== --- python/trunk/PC/VC6/tcl852.patch (original) +++ python/trunk/PC/VC6/tcl852.patch Tue Feb 10 14:31:28 2009 @@ -1,22 +1,22 @@ ---- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 -+++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 -@@ -367,7 +367,7 @@ - typedef struct stati64 Tcl_StatBuf; - # define TCL_LL_MODIFIER "L" - # else /* __BORLANDC__ */ --# if _MSC_VER < 1400 && !defined(_M_IX86) -+# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ - typedef struct _stati64 Tcl_StatBuf; - # else - typedef struct _stat64 Tcl_StatBuf; ---- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 -+++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 -@@ -367,7 +367,7 @@ - typedef struct stati64 Tcl_StatBuf; - # define TCL_LL_MODIFIER "L" - # else /* __BORLANDC__ */ --# if _MSC_VER < 1400 && !defined(_M_IX86) -+# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ - typedef struct _stati64 Tcl_StatBuf; - # else - typedef struct _stat64 Tcl_StatBuf; +--- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 ++++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 +@@ -367,7 +367,7 @@ + typedef struct stati64 Tcl_StatBuf; + # define TCL_LL_MODIFIER "L" + # else /* __BORLANDC__ */ +-# if _MSC_VER < 1400 && !defined(_M_IX86) ++# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ + typedef struct _stati64 Tcl_StatBuf; + # else + typedef struct _stat64 Tcl_StatBuf; +--- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 ++++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 +@@ -367,7 +367,7 @@ + typedef struct stati64 Tcl_StatBuf; + # define TCL_LL_MODIFIER "L" + # else /* __BORLANDC__ */ +-# if _MSC_VER < 1400 && !defined(_M_IX86) ++# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ + typedef struct _stati64 Tcl_StatBuf; + # else + typedef struct _stat64 Tcl_StatBuf; From python-checkins at python.org Tue Feb 10 14:32:25 2009 From: python-checkins at python.org (kristjan.jonsson) Date: Tue, 10 Feb 2009 14:32:25 +0100 (CET) Subject: [Python-checkins] r69495 - in python/trunk: Include/fileobject.h Modules/_fileio.c Modules/posixmodule.c Objects/exceptions.c Message-ID: <20090210133225.280571E400C@bag.python.org> Author: kristjan.jonsson Date: Tue Feb 10 14:32:24 2009 New Revision: 69495 Log: Issue 4804. Add a function to test the validity of file descriptors on Windows, and stop using global runtime settings to silence the warnings / assertions. Modified: python/trunk/Include/fileobject.h python/trunk/Modules/_fileio.c python/trunk/Modules/posixmodule.c python/trunk/Objects/exceptions.c Modified: python/trunk/Include/fileobject.h ============================================================================== --- python/trunk/Include/fileobject.h (original) +++ python/trunk/Include/fileobject.h Tue Feb 10 14:32:24 2009 @@ -68,6 +68,17 @@ */ int _PyFile_SanitizeMode(char *mode); +#if defined _MSC_VER && _MSC_VER >= 1400 +/* A routine to check if a file descriptor is valid on Windows. Returns 0 + * and sets errno to EBADF if it isn't. This is to avoid Assertions + * from various functions in the Windows CRT beginning with + * Visual Studio 2005 + */ +int _PyVerify_fd(int fd); +#else +#define _PyVerify_fd(A) (1) /* dummy */ +#endif + #ifdef __cplusplus } #endif Modified: python/trunk/Modules/_fileio.c ============================================================================== --- python/trunk/Modules/_fileio.c (original) +++ python/trunk/Modules/_fileio.c Tue Feb 10 14:32:24 2009 @@ -127,7 +127,7 @@ { #if defined(HAVE_FSTAT) struct stat buf; - if (fstat(fd, &buf) < 0 && errno == EBADF) { + if (!_PyVerify_fd(fd) || (fstat(fd, &buf) < 0 && errno == EBADF)) { PyObject *exc; char *msg = strerror(EBADF); exc = PyObject_CallFunction(PyExc_OSError, "(is)", Modified: python/trunk/Modules/posixmodule.c ============================================================================== --- python/trunk/Modules/posixmodule.c (original) +++ python/trunk/Modules/posixmodule.c Tue Feb 10 14:32:24 2009 @@ -343,6 +343,109 @@ #endif #endif +#if defined _MSC_VER && _MSC_VER >= 1400 +/* Microsoft CRT in VS2005 and higher will verify that a filehandle is + * valid and throw an assertion if it isn't. + * Normally, an invalid fd is likely to be a C program error and therefore + * an assertion can be useful, but it does contradict the POSIX standard + * which for write(2) states: + * "Otherwise, -1 shall be returned and errno set to indicate the error." + * "[EBADF] The fildes argument is not a valid file descriptor open for + * writing." + * Furthermore, python allows the user to enter any old integer + * as a fd and should merely raise a python exception on error. + * The Microsoft CRT doesn't provide an official way to check for the + * validity of a file descriptor, but we can emulate its internal behaviour + * by using the exported __pinfo data member and knowledge of the + * internal structures involved. + * The structures below must be updated for each version of visual studio + * according to the file internal.h in the CRT source, until MS comes + * up with a less hacky way to do this. + * (all of this is to avoid globally modifying the CRT behaviour using + * _set_invalid_parameter_handler() and _CrtSetReportMode()) + */ +#if _MSC_VER >= 1500 /* VS 2008 */ +typedef struct { + intptr_t osfhnd; + char osfile; + char pipech; + int lockinitflag; + CRITICAL_SECTION lock; +#ifndef _SAFECRT_IMPL + char textmode : 7; + char unicode : 1; + char pipech2[2]; + __int64 startpos; + BOOL utf8translations; + char dbcsBuffer; + BOOL dbcsBufferUsed; +#endif /* _SAFECRT_IMPL */ + } ioinfo; +#elif _MSC_VER >= 1400 /* VS 2005 */ +typedef struct { + intptr_t osfhnd; + char osfile; + char pipech; + int lockinitflag; + CRITICAL_SECTION lock; +#ifndef _SAFECRT_IMPL + char textmode : 7; + char unicode : 1; + char pipech2[2]; + __int64 startpos; + BOOL utf8translations; +#endif /* _SAFECRT_IMPL */ + } ioinfo; +#endif + +extern __declspec(dllimport) ioinfo * __pioinfo[]; +#define IOINFO_L2E 5 +#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) +#define IOINFO_ARRAYS 64 +#define _NHANDLE_ (IOINFO_ARRAYS * IOINFO_ARRAY_ELTS) +#define FOPEN 0x01 +#define _NO_CONSOLE_FILENO (intptr_t)-2 + +/* This function emulates what the windows CRT does to validate file handles */ +int +_PyVerify_fd(int fd) +{ + const int i1 = fd >> IOINFO_L2E; + const int i2 = fd & ((1 << IOINFO_L2E) - 1); + + /* See that it isn't a special CLEAR fileno */ + if (fd != _NO_CONSOLE_FILENO) { + /* Microsoft CRT would check that 0<=fd<_nhandle but we can't do that. Instead + * we check pointer validity and other info + */ + if (0 <= i1 && i1 < IOINFO_ARRAYS && __pioinfo[i1] != NULL) { + /* finally, check that the file is open */ + if (__pioinfo[i1][i2].osfile & FOPEN) + return 1; + } + } + errno = EBADF; + return 0; +} + +/* the special case of checking dup2. The target fd must be in a sensible range */ +static int +_PyVerify_fd_dup2(int fd1, int fd2) +{ + if (!_PyVerify_fd(fd1)) + return 0; + if (fd2 == _NO_CONSOLE_FILENO) + return 0; + if ((unsigned)fd2 < _NHANDLE_) + return 1; + else + return 0; +} +#else +/* dummy version. _PyVerify_fd() is already defined in fileobject.h */ +#define _PyVerify_fd_dup2(A, B) (1) +#endif + /* Return a dictionary corresponding to the POSIX environment table */ #ifdef WITH_NEXT_FRAMEWORK /* On Darwin/MacOSX a shared library or framework has no access to @@ -581,6 +684,8 @@ fd = PyObject_AsFileDescriptor(fdobj); if (fd < 0) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS res = (*func)(fd); Py_END_ALLOW_THREADS @@ -6188,6 +6293,8 @@ int fd, res; if (!PyArg_ParseTuple(args, "i:close", &fd)) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS res = close(fd); Py_END_ALLOW_THREADS @@ -6210,7 +6317,8 @@ return NULL; Py_BEGIN_ALLOW_THREADS for (i = fd_from; i < fd_to; i++) - close(i); + if (_PyVerify_fd(i)) + close(i); Py_END_ALLOW_THREADS Py_RETURN_NONE; } @@ -6226,6 +6334,8 @@ int fd; if (!PyArg_ParseTuple(args, "i:dup", &fd)) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS fd = dup(fd); Py_END_ALLOW_THREADS @@ -6245,6 +6355,8 @@ int fd, fd2, res; if (!PyArg_ParseTuple(args, "ii:dup2", &fd, &fd2)) return NULL; + if (!_PyVerify_fd_dup2(fd, fd2)) + return posix_error(); Py_BEGIN_ALLOW_THREADS res = dup2(fd, fd2); Py_END_ALLOW_THREADS @@ -6289,6 +6401,8 @@ if (PyErr_Occurred()) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS #if defined(MS_WIN64) || defined(MS_WINDOWS) res = _lseeki64(fd, pos, how); @@ -6325,6 +6439,8 @@ buffer = PyString_FromStringAndSize((char *)NULL, size); if (buffer == NULL) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS n = read(fd, PyString_AsString(buffer), size); Py_END_ALLOW_THREADS @@ -6351,6 +6467,8 @@ if (!PyArg_ParseTuple(args, "is*:write", &fd, &pbuf)) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS size = write(fd, pbuf.buf, (size_t)pbuf.len); Py_END_ALLOW_THREADS @@ -6377,6 +6495,8 @@ /* on OpenVMS we must ensure that all bytes are written to the file */ fsync(fd); #endif + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS res = FSTAT(fd, &st); Py_END_ALLOW_THREADS @@ -6419,6 +6539,8 @@ PyMem_FREE(mode); return NULL; } + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS #if !defined(MS_WINDOWS) && defined(HAVE_FCNTL_H) if (mode[0] == 'a') { @@ -6458,6 +6580,8 @@ int fd; if (!PyArg_ParseTuple(args, "i:isatty", &fd)) return NULL; + if (!_PyVerify_fd(fd)) + return PyBool_FromLong(0); return PyBool_FromLong(isatty(fd)); } Modified: python/trunk/Objects/exceptions.c ============================================================================== --- python/trunk/Objects/exceptions.c (original) +++ python/trunk/Objects/exceptions.c Tue Feb 10 14:32:24 2009 @@ -1972,28 +1972,6 @@ if (PyDict_SetItemString(bdict, # TYPE, PyExc_ ## TYPE)) \ Py_FatalError("Module dictionary insertion problem."); -#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__) -/* crt variable checking in VisualStudio .NET 2005 */ -#include - -static int prevCrtReportMode; -static _invalid_parameter_handler prevCrtHandler; - -/* Invalid parameter handler. Sets a ValueError exception */ -static void -InvalidParameterHandler( - const wchar_t * expression, - const wchar_t * function, - const wchar_t * file, - unsigned int line, - uintptr_t pReserved) -{ - /* Do nothing, allow execution to continue. Usually this - * means that the CRT will set errno to EINVAL - */ -} -#endif - PyMODINIT_FUNC _PyExc_Init(void) @@ -2153,13 +2131,6 @@ } Py_DECREF(bltinmod); - -#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__) - /* Set CRT argument error handler */ - prevCrtHandler = _set_invalid_parameter_handler(InvalidParameterHandler); - /* turn off assertions in debug mode */ - prevCrtReportMode = _CrtSetReportMode(_CRT_ASSERT, 0); -#endif } void @@ -2167,9 +2138,4 @@ { Py_XDECREF(PyExc_MemoryErrorInst); PyExc_MemoryErrorInst = NULL; -#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__) - /* reset CRT error handling */ - _set_invalid_parameter_handler(prevCrtHandler); - _CrtSetReportMode(_CRT_ASSERT, prevCrtReportMode); -#endif } From python-checkins at python.org Tue Feb 10 15:18:29 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Tue, 10 Feb 2009 15:18:29 +0100 (CET) Subject: [Python-checkins] r69496 - in python/branches/release26-maint: PC/VC6/_msi.dsp PC/VC6/_multiprocessing.dsp PC/VC6/build_tkinter.py PC/VC6/tcl852.patch Message-ID: <20090210141829.6412C1E4002@bag.python.org> Author: hirokazu.yamamoto Date: Tue Feb 10 15:18:28 2009 New Revision: 69496 Log: Merged revisions 69494 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69494 | hirokazu.yamamoto | 2009-02-10 22:31:28 +0900 | 1 line Fixed svn:eol-style. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/PC/VC6/_msi.dsp (props changed) python/branches/release26-maint/PC/VC6/_multiprocessing.dsp (contents, props changed) python/branches/release26-maint/PC/VC6/build_tkinter.py (contents, props changed) python/branches/release26-maint/PC/VC6/tcl852.patch (contents, props changed) Modified: python/branches/release26-maint/PC/VC6/_multiprocessing.dsp ============================================================================== --- python/branches/release26-maint/PC/VC6/_multiprocessing.dsp (original) +++ python/branches/release26-maint/PC/VC6/_multiprocessing.dsp Tue Feb 10 15:18:28 2009 @@ -1,115 +1,115 @@ -# Microsoft Developer Studio Project File - Name="_multiprocessing" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=_multiprocessing - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "_multiprocessing.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "_multiprocessing.mak" CFG="_multiprocessing - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "_multiprocessing - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "_multiprocessing - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "_multiprocessing" -# PROP Scc_LocalPath ".." -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "_multiprocessing - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "." -# PROP Intermediate_Dir "x86-temp-release\_multiprocessing" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1D0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing.pyd" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "_multiprocessing - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "." -# PROP Intermediate_Dir "x86-temp-debug\_multiprocessing" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1d0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing_d.pyd" /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "_multiprocessing - Win32 Release" -# Name "_multiprocessing - Win32 Debug" -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\multiprocessing.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\pipe_connection.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\semaphore.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\socket_connection.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\win32_functions.c -# End Source File -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="_multiprocessing" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=_multiprocessing - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "_multiprocessing.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "_multiprocessing.mak" CFG="_multiprocessing - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "_multiprocessing - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "_multiprocessing - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "_multiprocessing" +# PROP Scc_LocalPath ".." +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "_multiprocessing - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "." +# PROP Intermediate_Dir "x86-temp-release\_multiprocessing" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +F90=df.exe +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1D0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing.pyd" +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "_multiprocessing - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "." +# PROP Intermediate_Dir "x86-temp-debug\_multiprocessing" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +F90=df.exe +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1d0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing_d.pyd" /pdbtype:sept +# SUBTRACT LINK32 /pdb:none + +!ENDIF + +# Begin Target + +# Name "_multiprocessing - Win32 Release" +# Name "_multiprocessing - Win32 Debug" +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\multiprocessing.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\pipe_connection.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\semaphore.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\socket_connection.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\win32_functions.c +# End Source File +# End Target +# End Project Modified: python/branches/release26-maint/PC/VC6/build_tkinter.py ============================================================================== --- python/branches/release26-maint/PC/VC6/build_tkinter.py (original) +++ python/branches/release26-maint/PC/VC6/build_tkinter.py Tue Feb 10 15:18:28 2009 @@ -1,81 +1,81 @@ -import os -import sys -import subprocess - -TCL_MAJOR = 8 -TCL_MINOR = 5 -TCL_PATCH = 2 - -TIX_MAJOR = 8 -TIX_MINOR = 4 -TIX_PATCH = 3 - -def abspath(name): - par = os.path.pardir - return os.path.abspath(os.path.join(__file__, par, par, par, par, name)) - -TCL_DIR = abspath("tcl%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) -TK_DIR = abspath("tk%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) -TIX_DIR = abspath("tix%d.%d.%d" % (TIX_MAJOR, TIX_MINOR, TIX_PATCH)) -OUT_DIR = abspath("tcltk") - -def have_args(*a): - return any(s in sys.argv[1:] for s in a) - -def enter(dir): - os.chdir(os.path.join(dir, "win")) - -def main(): - debug = have_args("-d", "--debug") - clean = have_args("clean") - install = have_args("install") - tcl = have_args("tcl") - tk = have_args("tk") - tix = have_args("tix") - if not(tcl) and not(tk) and not(tix): - tcl = tk = tix = True - - def nmake(makefile, *a): - args = ["nmake", "/nologo", "/f", makefile, "DEBUG=%d" % debug] - args.extend(a) - subprocess.check_call(args) - - if tcl: - enter(TCL_DIR) - def nmake_tcl(*a): - nmake("makefile.vc", *a) - if clean: - nmake_tcl("clean") - elif install: - nmake_tcl("install", "INSTALLDIR=" + OUT_DIR) - else: - nmake_tcl() - - if tk: - enter(TK_DIR) - def nmake_tk(*a): - nmake("makefile.vc", "TCLDIR=" + TCL_DIR, *a) - if clean: - nmake_tk("clean") - elif install: - nmake_tk("install", "INSTALLDIR=" + OUT_DIR) - else: - nmake_tk() - - if tix: - enter(TIX_DIR) - def nmake_tix(*a): - nmake("python.mak", - "TCL_MAJOR=%d" % TCL_MAJOR, - "TCL_MINOR=%d" % TCL_MINOR, - "TCL_PATCH=%d" % TCL_PATCH, - "MACHINE=IX86", *a) - if clean: - nmake_tix("clean") - elif install: - nmake_tix("install", "INSTALL_DIR=" + OUT_DIR) - else: - nmake_tix() - -if __name__ == '__main__': - main() +import os +import sys +import subprocess + +TCL_MAJOR = 8 +TCL_MINOR = 5 +TCL_PATCH = 2 + +TIX_MAJOR = 8 +TIX_MINOR = 4 +TIX_PATCH = 3 + +def abspath(name): + par = os.path.pardir + return os.path.abspath(os.path.join(__file__, par, par, par, par, name)) + +TCL_DIR = abspath("tcl%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) +TK_DIR = abspath("tk%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) +TIX_DIR = abspath("tix%d.%d.%d" % (TIX_MAJOR, TIX_MINOR, TIX_PATCH)) +OUT_DIR = abspath("tcltk") + +def have_args(*a): + return any(s in sys.argv[1:] for s in a) + +def enter(dir): + os.chdir(os.path.join(dir, "win")) + +def main(): + debug = have_args("-d", "--debug") + clean = have_args("clean") + install = have_args("install") + tcl = have_args("tcl") + tk = have_args("tk") + tix = have_args("tix") + if not(tcl) and not(tk) and not(tix): + tcl = tk = tix = True + + def nmake(makefile, *a): + args = ["nmake", "/nologo", "/f", makefile, "DEBUG=%d" % debug] + args.extend(a) + subprocess.check_call(args) + + if tcl: + enter(TCL_DIR) + def nmake_tcl(*a): + nmake("makefile.vc", *a) + if clean: + nmake_tcl("clean") + elif install: + nmake_tcl("install", "INSTALLDIR=" + OUT_DIR) + else: + nmake_tcl() + + if tk: + enter(TK_DIR) + def nmake_tk(*a): + nmake("makefile.vc", "TCLDIR=" + TCL_DIR, *a) + if clean: + nmake_tk("clean") + elif install: + nmake_tk("install", "INSTALLDIR=" + OUT_DIR) + else: + nmake_tk() + + if tix: + enter(TIX_DIR) + def nmake_tix(*a): + nmake("python.mak", + "TCL_MAJOR=%d" % TCL_MAJOR, + "TCL_MINOR=%d" % TCL_MINOR, + "TCL_PATCH=%d" % TCL_PATCH, + "MACHINE=IX86", *a) + if clean: + nmake_tix("clean") + elif install: + nmake_tix("install", "INSTALL_DIR=" + OUT_DIR) + else: + nmake_tix() + +if __name__ == '__main__': + main() Modified: python/branches/release26-maint/PC/VC6/tcl852.patch ============================================================================== --- python/branches/release26-maint/PC/VC6/tcl852.patch (original) +++ python/branches/release26-maint/PC/VC6/tcl852.patch Tue Feb 10 15:18:28 2009 @@ -1,22 +1,22 @@ ---- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 -+++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 -@@ -367,7 +367,7 @@ - typedef struct stati64 Tcl_StatBuf; - # define TCL_LL_MODIFIER "L" - # else /* __BORLANDC__ */ --# if _MSC_VER < 1400 && !defined(_M_IX86) -+# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ - typedef struct _stati64 Tcl_StatBuf; - # else - typedef struct _stat64 Tcl_StatBuf; ---- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 -+++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 -@@ -367,7 +367,7 @@ - typedef struct stati64 Tcl_StatBuf; - # define TCL_LL_MODIFIER "L" - # else /* __BORLANDC__ */ --# if _MSC_VER < 1400 && !defined(_M_IX86) -+# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ - typedef struct _stati64 Tcl_StatBuf; - # else - typedef struct _stat64 Tcl_StatBuf; +--- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 ++++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 +@@ -367,7 +367,7 @@ + typedef struct stati64 Tcl_StatBuf; + # define TCL_LL_MODIFIER "L" + # else /* __BORLANDC__ */ +-# if _MSC_VER < 1400 && !defined(_M_IX86) ++# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ + typedef struct _stati64 Tcl_StatBuf; + # else + typedef struct _stat64 Tcl_StatBuf; +--- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 ++++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 +@@ -367,7 +367,7 @@ + typedef struct stati64 Tcl_StatBuf; + # define TCL_LL_MODIFIER "L" + # else /* __BORLANDC__ */ +-# if _MSC_VER < 1400 && !defined(_M_IX86) ++# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ + typedef struct _stati64 Tcl_StatBuf; + # else + typedef struct _stat64 Tcl_StatBuf; From python-checkins at python.org Tue Feb 10 15:27:19 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Tue, 10 Feb 2009 15:27:19 +0100 (CET) Subject: [Python-checkins] r69497 - in python/branches/py3k: PC/VC6/_multiprocessing.dsp PC/VC6/build_tkinter.py PC/VC6/tcl852.patch Message-ID: <20090210142719.73E621E4002@bag.python.org> Author: hirokazu.yamamoto Date: Tue Feb 10 15:27:19 2009 New Revision: 69497 Log: Merged revisions 69494 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69494 | hirokazu.yamamoto | 2009-02-10 22:31:28 +0900 | 1 line Fixed svn:eol-style. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/PC/VC6/_multiprocessing.dsp (contents, props changed) python/branches/py3k/PC/VC6/build_tkinter.py (contents, props changed) python/branches/py3k/PC/VC6/tcl852.patch (contents, props changed) Modified: python/branches/py3k/PC/VC6/_multiprocessing.dsp ============================================================================== --- python/branches/py3k/PC/VC6/_multiprocessing.dsp (original) +++ python/branches/py3k/PC/VC6/_multiprocessing.dsp Tue Feb 10 15:27:19 2009 @@ -1,115 +1,115 @@ -# Microsoft Developer Studio Project File - Name="_multiprocessing" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=_multiprocessing - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "_multiprocessing.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "_multiprocessing.mak" CFG="_multiprocessing - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "_multiprocessing - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "_multiprocessing - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "_multiprocessing" -# PROP Scc_LocalPath ".." -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "_multiprocessing - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "." -# PROP Intermediate_Dir "x86-temp-release\_multiprocessing" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1D0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing.pyd" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "_multiprocessing - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "." -# PROP Intermediate_Dir "x86-temp-debug\_multiprocessing" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1d0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing_d.pyd" /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "_multiprocessing - Win32 Release" -# Name "_multiprocessing - Win32 Debug" -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\multiprocessing.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\pipe_connection.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\semaphore.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\socket_connection.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\win32_functions.c -# End Source File -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="_multiprocessing" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=_multiprocessing - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "_multiprocessing.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "_multiprocessing.mak" CFG="_multiprocessing - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "_multiprocessing - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "_multiprocessing - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "_multiprocessing" +# PROP Scc_LocalPath ".." +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "_multiprocessing - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "." +# PROP Intermediate_Dir "x86-temp-release\_multiprocessing" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +F90=df.exe +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1D0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing.pyd" +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "_multiprocessing - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "." +# PROP Intermediate_Dir "x86-temp-debug\_multiprocessing" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +F90=df.exe +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1d0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing_d.pyd" /pdbtype:sept +# SUBTRACT LINK32 /pdb:none + +!ENDIF + +# Begin Target + +# Name "_multiprocessing - Win32 Release" +# Name "_multiprocessing - Win32 Debug" +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\multiprocessing.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\pipe_connection.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\semaphore.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\socket_connection.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\win32_functions.c +# End Source File +# End Target +# End Project Modified: python/branches/py3k/PC/VC6/build_tkinter.py ============================================================================== --- python/branches/py3k/PC/VC6/build_tkinter.py (original) +++ python/branches/py3k/PC/VC6/build_tkinter.py Tue Feb 10 15:27:19 2009 @@ -1,81 +1,81 @@ -import os -import sys -import subprocess - -TCL_MAJOR = 8 -TCL_MINOR = 5 -TCL_PATCH = 2 - -TIX_MAJOR = 8 -TIX_MINOR = 4 -TIX_PATCH = 3 - -def abspath(name): - par = os.path.pardir - return os.path.abspath(os.path.join(__file__, par, par, par, par, name)) - -TCL_DIR = abspath("tcl%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) -TK_DIR = abspath("tk%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) -TIX_DIR = abspath("tix%d.%d.%d" % (TIX_MAJOR, TIX_MINOR, TIX_PATCH)) -OUT_DIR = abspath("tcltk") - -def have_args(*a): - return any(s in sys.argv[1:] for s in a) - -def enter(dir): - os.chdir(os.path.join(dir, "win")) - -def main(): - debug = have_args("-d", "--debug") - clean = have_args("clean") - install = have_args("install") - tcl = have_args("tcl") - tk = have_args("tk") - tix = have_args("tix") - if not(tcl) and not(tk) and not(tix): - tcl = tk = tix = True - - def nmake(makefile, *a): - args = ["nmake", "/nologo", "/f", makefile, "DEBUG=%d" % debug] - args.extend(a) - subprocess.check_call(args) - - if tcl: - enter(TCL_DIR) - def nmake_tcl(*a): - nmake("makefile.vc", *a) - if clean: - nmake_tcl("clean") - elif install: - nmake_tcl("install", "INSTALLDIR=" + OUT_DIR) - else: - nmake_tcl() - - if tk: - enter(TK_DIR) - def nmake_tk(*a): - nmake("makefile.vc", "TCLDIR=" + TCL_DIR, *a) - if clean: - nmake_tk("clean") - elif install: - nmake_tk("install", "INSTALLDIR=" + OUT_DIR) - else: - nmake_tk() - - if tix: - enter(TIX_DIR) - def nmake_tix(*a): - nmake("python.mak", - "TCL_MAJOR=%d" % TCL_MAJOR, - "TCL_MINOR=%d" % TCL_MINOR, - "TCL_PATCH=%d" % TCL_PATCH, - "MACHINE=IX86", *a) - if clean: - nmake_tix("clean") - elif install: - nmake_tix("install", "INSTALL_DIR=" + OUT_DIR) - else: - nmake_tix() - -if __name__ == '__main__': - main() +import os +import sys +import subprocess + +TCL_MAJOR = 8 +TCL_MINOR = 5 +TCL_PATCH = 2 + +TIX_MAJOR = 8 +TIX_MINOR = 4 +TIX_PATCH = 3 + +def abspath(name): + par = os.path.pardir + return os.path.abspath(os.path.join(__file__, par, par, par, par, name)) + +TCL_DIR = abspath("tcl%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) +TK_DIR = abspath("tk%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) +TIX_DIR = abspath("tix%d.%d.%d" % (TIX_MAJOR, TIX_MINOR, TIX_PATCH)) +OUT_DIR = abspath("tcltk") + +def have_args(*a): + return any(s in sys.argv[1:] for s in a) + +def enter(dir): + os.chdir(os.path.join(dir, "win")) + +def main(): + debug = have_args("-d", "--debug") + clean = have_args("clean") + install = have_args("install") + tcl = have_args("tcl") + tk = have_args("tk") + tix = have_args("tix") + if not(tcl) and not(tk) and not(tix): + tcl = tk = tix = True + + def nmake(makefile, *a): + args = ["nmake", "/nologo", "/f", makefile, "DEBUG=%d" % debug] + args.extend(a) + subprocess.check_call(args) + + if tcl: + enter(TCL_DIR) + def nmake_tcl(*a): + nmake("makefile.vc", *a) + if clean: + nmake_tcl("clean") + elif install: + nmake_tcl("install", "INSTALLDIR=" + OUT_DIR) + else: + nmake_tcl() + + if tk: + enter(TK_DIR) + def nmake_tk(*a): + nmake("makefile.vc", "TCLDIR=" + TCL_DIR, *a) + if clean: + nmake_tk("clean") + elif install: + nmake_tk("install", "INSTALLDIR=" + OUT_DIR) + else: + nmake_tk() + + if tix: + enter(TIX_DIR) + def nmake_tix(*a): + nmake("python.mak", + "TCL_MAJOR=%d" % TCL_MAJOR, + "TCL_MINOR=%d" % TCL_MINOR, + "TCL_PATCH=%d" % TCL_PATCH, + "MACHINE=IX86", *a) + if clean: + nmake_tix("clean") + elif install: + nmake_tix("install", "INSTALL_DIR=" + OUT_DIR) + else: + nmake_tix() + +if __name__ == '__main__': + main() Modified: python/branches/py3k/PC/VC6/tcl852.patch ============================================================================== --- python/branches/py3k/PC/VC6/tcl852.patch (original) +++ python/branches/py3k/PC/VC6/tcl852.patch Tue Feb 10 15:27:19 2009 @@ -1,22 +1,22 @@ ---- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 -+++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 -@@ -367,7 +367,7 @@ - typedef struct stati64 Tcl_StatBuf; - # define TCL_LL_MODIFIER "L" - # else /* __BORLANDC__ */ --# if _MSC_VER < 1400 && !defined(_M_IX86) -+# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ - typedef struct _stati64 Tcl_StatBuf; - # else - typedef struct _stat64 Tcl_StatBuf; ---- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 -+++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 -@@ -367,7 +367,7 @@ - typedef struct stati64 Tcl_StatBuf; - # define TCL_LL_MODIFIER "L" - # else /* __BORLANDC__ */ --# if _MSC_VER < 1400 && !defined(_M_IX86) -+# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ - typedef struct _stati64 Tcl_StatBuf; - # else - typedef struct _stat64 Tcl_StatBuf; +--- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 ++++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 +@@ -367,7 +367,7 @@ + typedef struct stati64 Tcl_StatBuf; + # define TCL_LL_MODIFIER "L" + # else /* __BORLANDC__ */ +-# if _MSC_VER < 1400 && !defined(_M_IX86) ++# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ + typedef struct _stati64 Tcl_StatBuf; + # else + typedef struct _stat64 Tcl_StatBuf; +--- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 ++++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 +@@ -367,7 +367,7 @@ + typedef struct stati64 Tcl_StatBuf; + # define TCL_LL_MODIFIER "L" + # else /* __BORLANDC__ */ +-# if _MSC_VER < 1400 && !defined(_M_IX86) ++# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ + typedef struct _stati64 Tcl_StatBuf; + # else + typedef struct _stat64 Tcl_StatBuf; From buildbot at python.org Tue Feb 10 16:07:43 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 10 Feb 2009 15:07:43 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090210150744.7C4181E4080@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/623 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_scriptpackages ====================================================================== ERROR: test_StdSuites (test.test_scriptpackages.TestScriptpackages) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_scriptpackages.py", line 24, in test_StdSuites self._test_scriptpackage('StdSuites') File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_scriptpackages.py", line 13, in _test_scriptpackage klass = getattr(mod, package) AttributeError: 'module' object has no attribute 'StdSuites' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Feb 10 16:31:36 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 10 Feb 2009 15:31:36 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090210153137.3A0CB1E4002@bag.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/109 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: 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 Tue Feb 10 16:46:50 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 10 Feb 2009 16:46:50 +0100 (CET) Subject: [Python-checkins] r69498 - in python/trunk: Doc/c-api/long.rst Lib/test/test_struct.py Misc/ACKS Misc/NEWS Modules/testcapi_long.h Objects/longobject.c Message-ID: <20090210154650.DED3E1E4028@bag.python.org> Author: mark.dickinson Date: Tue Feb 10 16:46:50 2009 New Revision: 69498 Log: Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError for negative arguments. Previously, it raised TypeError. Thanks Lisandro Dalcin. Modified: python/trunk/Doc/c-api/long.rst python/trunk/Lib/test/test_struct.py python/trunk/Misc/ACKS python/trunk/Misc/NEWS python/trunk/Modules/testcapi_long.h python/trunk/Objects/longobject.c Modified: python/trunk/Doc/c-api/long.rst ============================================================================== --- python/trunk/Doc/c-api/long.rst (original) +++ python/trunk/Doc/c-api/long.rst Tue Feb 10 16:46:50 2009 @@ -155,21 +155,32 @@ .. cfunction:: PY_LONG_LONG PyLong_AsLongLong(PyObject *pylong) - Return a C :ctype:`long long` from a Python long integer. If *pylong* cannot be - represented as a :ctype:`long long`, an :exc:`OverflowError` will be raised. + .. index:: + single: OverflowError (built-in exception) + + Return a C :ctype:`long long` from a Python long integer. If + *pylong* cannot be represented as a :ctype:`long long`, an + :exc:`OverflowError` is raised and ``-1`` is returned. .. versionadded:: 2.2 .. cfunction:: unsigned PY_LONG_LONG PyLong_AsUnsignedLongLong(PyObject *pylong) - Return a C :ctype:`unsigned long long` from a Python long integer. If *pylong* - cannot be represented as an :ctype:`unsigned long long`, an :exc:`OverflowError` - will be raised if the value is positive, or a :exc:`TypeError` will be raised if - the value is negative. + .. index:: + single: OverflowError (built-in exception) + + Return a C :ctype:`unsigned long long` from a Python long integer. If + *pylong* cannot be represented as an :ctype:`unsigned long long`, an + :exc:`OverflowError` is raised and ``(unsigned long long)-1`` is + returned. .. versionadded:: 2.2 + .. versionchanged:: 2.7 + A negative *pylong* now raises :exc:`OverflowError`, not + :exc:`TypeError`. + .. cfunction:: unsigned long PyLong_AsUnsignedLongMask(PyObject *io) Modified: python/trunk/Lib/test/test_struct.py ============================================================================== --- python/trunk/Lib/test/test_struct.py (original) +++ python/trunk/Lib/test/test_struct.py Tue Feb 10 16:46:50 2009 @@ -48,7 +48,7 @@ def deprecated_err(func, *args): try: func(*args) - except (struct.error, TypeError): + except (struct.error, OverflowError): pass except DeprecationWarning: if not PY_STRUCT_OVERFLOW_MASKING: @@ -185,7 +185,7 @@ def test_native_qQ(self): # can't pack -1 as unsigned regardless - self.assertRaises((struct.error, TypeError), struct.pack, "Q", -1) + self.assertRaises((struct.error, OverflowError), struct.pack, "Q", -1) # can't pack string as 'q' regardless self.assertRaises(struct.error, struct.pack, "q", "a") # ditto, but 'Q' Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Tue Feb 10 16:46:50 2009 @@ -153,6 +153,7 @@ Drew Csillag John Cugini Tom Culliton +Lisandro Dalcin Andrew Dalke Lars Damerow Eric Daniel Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Feb 10 16:46:50 2009 @@ -482,6 +482,9 @@ C-API ----- +- Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError + for negative arguments. Previously, it raised TypeError. + - Issue #4720: The format for PyArg_ParseTupleAndKeywords can begin with '|'. - Issue #3632: from the gdb debugger, the 'pyo' macro can now be called when Modified: python/trunk/Modules/testcapi_long.h ============================================================================== --- python/trunk/Modules/testcapi_long.h (original) +++ python/trunk/Modules/testcapi_long.h Tue Feb 10 16:46:50 2009 @@ -97,6 +97,10 @@ if (uout != (unsigned TYPENAME)-1 || !PyErr_Occurred()) return error( "PyLong_AsUnsignedXXX(-1) didn't complain"); + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return error( + "PyLong_AsUnsignedXXX(-1) raised " + "something other than OverflowError"); PyErr_Clear(); UNBIND(x); @@ -112,11 +116,15 @@ return error( "unexpected NULL from PyNumber_Lshift"); - uout = F_PY_TO_U(x); + uout = F_PY_TO_U(x); if (uout != (unsigned TYPENAME)-1 || !PyErr_Occurred()) return error( "PyLong_AsUnsignedXXX(2**NBITS) didn't " "complain"); + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return error( + "PyLong_AsUnsignedXXX(2**NBITS) raised " + "something other than OverflowError"); PyErr_Clear(); /* Signed complains about 2**(NBITS-1)? @@ -132,6 +140,10 @@ return error( "PyLong_AsXXX(2**(NBITS-1)) didn't " "complain"); + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return error( + "PyLong_AsXXX(2**(NBITS-1)) raised " + "something other than OverflowError"); PyErr_Clear(); /* Signed complains about -2**(NBITS-1)-1?; @@ -153,6 +165,10 @@ return error( "PyLong_AsXXX(-2**(NBITS-1)-1) didn't " "complain"); + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return error( + "PyLong_AsXXX(-2**(NBITS-1)-1) raised " + "something other than OverflowError"); PyErr_Clear(); UNBIND(y); Modified: python/trunk/Objects/longobject.c ============================================================================== --- python/trunk/Objects/longobject.c (original) +++ python/trunk/Objects/longobject.c Tue Feb 10 16:46:50 2009 @@ -557,7 +557,7 @@ if (Py_SIZE(v) < 0) { ndigits = -(Py_SIZE(v)); if (!is_signed) { - PyErr_SetString(PyExc_TypeError, + PyErr_SetString(PyExc_OverflowError, "can't convert negative long to unsigned"); return -1; } From python-checkins at python.org Tue Feb 10 17:13:26 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 10 Feb 2009 17:13:26 +0100 (CET) Subject: [Python-checkins] r69499 - in python/branches/py3k: Doc/c-api/long.rst Lib/test/test_struct.py Misc/ACKS Misc/NEWS Modules/testcapi_long.h Objects/longobject.c Message-ID: <20090210161326.5082F1E4002@bag.python.org> Author: mark.dickinson Date: Tue Feb 10 17:13:25 2009 New Revision: 69499 Log: Merged revisions 69498 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69498 | mark.dickinson | 2009-02-10 15:46:50 +0000 (Tue, 10 Feb 2009) | 6 lines Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError for negative arguments. Previously, it raised TypeError. Thanks Lisandro Dalcin. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/c-api/long.rst python/branches/py3k/Lib/test/test_struct.py python/branches/py3k/Misc/ACKS python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/testcapi_long.h python/branches/py3k/Objects/longobject.c Modified: python/branches/py3k/Doc/c-api/long.rst ============================================================================== --- python/branches/py3k/Doc/c-api/long.rst (original) +++ python/branches/py3k/Doc/c-api/long.rst Tue Feb 10 17:13:25 2009 @@ -168,17 +168,26 @@ .. cfunction:: PY_LONG_LONG PyLong_AsLongLong(PyObject *pylong) - Return a C :ctype:`long long` from a Python integer. If *pylong* cannot be - represented as a :ctype:`long long`, an :exc:`OverflowError` will be raised. + .. index:: + single: OverflowError (built-in exception) + Return a C :ctype:`long long` from a Python integer. If *pylong* + cannot be represented as a :ctype:`long long`, an + :exc:`OverflowError` is raised and ``-1`` is returned. .. cfunction:: unsigned PY_LONG_LONG PyLong_AsUnsignedLongLong(PyObject *pylong) - Return a C :ctype:`unsigned long long` from a Python integer. If *pylong* - cannot be represented as an :ctype:`unsigned long long`, an :exc:`OverflowError` - will be raised if the value is positive, or a :exc:`TypeError` will be raised if - the value is negative. + .. index:: + single: OverflowError (built-in exception) + Return a C :ctype:`unsigned long long` from a Python integer. If + *pylong* cannot be represented as an :ctype:`unsigned long long`, + an :exc:`OverflowError` is raised and ``(unsigned long long)-1`` is + returned. + + .. versionchanged:: 3.1 + A negative *pylong* now raises :exc:`OverflowError`, not + :exc:`TypeError`. .. cfunction:: unsigned long PyLong_AsUnsignedLongMask(PyObject *io) Modified: python/branches/py3k/Lib/test/test_struct.py ============================================================================== --- python/branches/py3k/Lib/test/test_struct.py (original) +++ python/branches/py3k/Lib/test/test_struct.py Tue Feb 10 17:13:25 2009 @@ -48,7 +48,7 @@ def deprecated_err(func, *args): try: func(*args) - except (struct.error, TypeError): + except (struct.error, OverflowError): pass except DeprecationWarning: if not PY_STRUCT_OVERFLOW_MASKING: @@ -191,7 +191,7 @@ def test_native_qQ(self): # can't pack -1 as unsigned regardless - self.assertRaises((struct.error, TypeError), struct.pack, "Q", -1) + self.assertRaises((struct.error, OverflowError), struct.pack, "Q", -1) # can't pack string as 'q' regardless self.assertRaises(struct.error, struct.pack, "q", "a") # ditto, but 'Q' Modified: python/branches/py3k/Misc/ACKS ============================================================================== --- python/branches/py3k/Misc/ACKS (original) +++ python/branches/py3k/Misc/ACKS Tue Feb 10 17:13:25 2009 @@ -152,6 +152,7 @@ Drew Csillag John Cugini Tom Culliton +Lisandro Dalcin Andrew Dalke Lars Damerow Eric Daniel Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue Feb 10 17:13:25 2009 @@ -467,6 +467,9 @@ C-API ----- +- Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError + for negative arguments. Previously, it raised TypeError. + - Issue #4720: The format for PyArg_ParseTupleAndKeywords can begin with '|'. - Issue #3632: from the gdb debugger, the 'pyo' macro can now be called when Modified: python/branches/py3k/Modules/testcapi_long.h ============================================================================== --- python/branches/py3k/Modules/testcapi_long.h (original) +++ python/branches/py3k/Modules/testcapi_long.h Tue Feb 10 17:13:25 2009 @@ -97,6 +97,10 @@ if (uout != (unsigned TYPENAME)-1 || !PyErr_Occurred()) return error( "PyLong_AsUnsignedXXX(-1) didn't complain"); + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return error( + "PyLong_AsUnsignedXXX(-1) raised " + "something other than OverflowError"); PyErr_Clear(); UNBIND(x); @@ -112,11 +116,15 @@ return error( "unexpected NULL from PyNumber_Lshift"); - uout = F_PY_TO_U(x); + uout = F_PY_TO_U(x); if (uout != (unsigned TYPENAME)-1 || !PyErr_Occurred()) return error( "PyLong_AsUnsignedXXX(2**NBITS) didn't " "complain"); + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return error( + "PyLong_AsUnsignedXXX(2**NBITS) raised " + "something other than OverflowError"); PyErr_Clear(); /* Signed complains about 2**(NBITS-1)? @@ -132,6 +140,10 @@ return error( "PyLong_AsXXX(2**(NBITS-1)) didn't " "complain"); + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return error( + "PyLong_AsXXX(2**(NBITS-1)) raised " + "something other than OverflowError"); PyErr_Clear(); /* Signed complains about -2**(NBITS-1)-1?; @@ -153,6 +165,10 @@ return error( "PyLong_AsXXX(-2**(NBITS-1)-1) didn't " "complain"); + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return error( + "PyLong_AsXXX(-2**(NBITS-1)-1) raised " + "something other than OverflowError"); PyErr_Clear(); UNBIND(y); Modified: python/branches/py3k/Objects/longobject.c ============================================================================== --- python/branches/py3k/Objects/longobject.c (original) +++ python/branches/py3k/Objects/longobject.c Tue Feb 10 17:13:25 2009 @@ -786,7 +786,7 @@ if (Py_SIZE(v) < 0) { ndigits = -(Py_SIZE(v)); if (!is_signed) { - PyErr_SetString(PyExc_TypeError, + PyErr_SetString(PyExc_OverflowError, "can't convert negative int to unsigned"); return -1; } From python-checkins at python.org Tue Feb 10 17:17:16 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 10 Feb 2009 17:17:16 +0100 (CET) Subject: [Python-checkins] r69500 - python/trunk/setup.py Message-ID: <20090210161716.A0B931E4002@bag.python.org> Author: mark.dickinson Date: Tue Feb 10 17:17:16 2009 New Revision: 69500 Log: _testcapi depends on testcapi_long.h Thanks Lisandro Dalcin. Modified: python/trunk/setup.py Modified: python/trunk/setup.py ============================================================================== --- python/trunk/setup.py (original) +++ python/trunk/setup.py Tue Feb 10 17:17:16 2009 @@ -447,7 +447,8 @@ # _json speedups exts.append( Extension("_json", ["_json.c"]) ) # Python C API test module - exts.append( Extension('_testcapi', ['_testcapimodule.c']) ) + exts.append( Extension('_testcapi', ['_testcapimodule.c'], + depends=['testcapi_long.h']) ) # profilers (_lsprof is for cProfile.py) exts.append( Extension('_hotshot', ['_hotshot.c']) ) exts.append( Extension('_lsprof', ['_lsprof.c', 'rotatingtree.c']) ) From python-checkins at python.org Tue Feb 10 17:18:22 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 10 Feb 2009 17:18:22 +0100 (CET) Subject: [Python-checkins] r69501 - in python/branches/py3k: setup.py Message-ID: <20090210161822.BB5B91E4002@bag.python.org> Author: mark.dickinson Date: Tue Feb 10 17:18:22 2009 New Revision: 69501 Log: Merged revisions 69500 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69500 | mark.dickinson | 2009-02-10 16:17:16 +0000 (Tue, 10 Feb 2009) | 4 lines _testcapi depends on testcapi_long.h Thanks Lisandro Dalcin. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/setup.py Modified: python/branches/py3k/setup.py ============================================================================== --- python/branches/py3k/setup.py (original) +++ python/branches/py3k/setup.py Tue Feb 10 17:18:22 2009 @@ -433,7 +433,8 @@ # _json speedups exts.append( Extension("_json", ["_json.c"]) ) # Python C API test module - exts.append( Extension('_testcapi', ['_testcapimodule.c']) ) + exts.append( Extension('_testcapi', ['_testcapimodule.c'], + depends=['testcapi_long.h']) ) # profiler (_lsprof is for cProfile.py) exts.append( Extension('_lsprof', ['_lsprof.c', 'rotatingtree.c']) ) # static Unicode character database From python-checkins at python.org Tue Feb 10 17:23:27 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 10 Feb 2009 17:23:27 +0100 (CET) Subject: [Python-checkins] r69502 - in python/branches/release26-maint: setup.py Message-ID: <20090210162327.9DA9E1E4002@bag.python.org> Author: mark.dickinson Date: Tue Feb 10 17:23:27 2009 New Revision: 69502 Log: Merged revisions 69500 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69500 | mark.dickinson | 2009-02-10 16:17:16 +0000 (Tue, 10 Feb 2009) | 4 lines _testcapi depends on testcapi_long.h Thanks Lisandro Dalcin. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/setup.py Modified: python/branches/release26-maint/setup.py ============================================================================== --- python/branches/release26-maint/setup.py (original) +++ python/branches/release26-maint/setup.py Tue Feb 10 17:23:27 2009 @@ -458,7 +458,8 @@ # _json speedups exts.append( Extension("_json", ["_json.c"]) ) # Python C API test module - exts.append( Extension('_testcapi', ['_testcapimodule.c']) ) + exts.append( Extension('_testcapi', ['_testcapimodule.c'], + depends=['testcapi_long.h']) ) # profilers (_lsprof is for cProfile.py) exts.append( Extension('_hotshot', ['_hotshot.c']) ) exts.append( Extension('_lsprof', ['_lsprof.c', 'rotatingtree.c']) ) From python-checkins at python.org Tue Feb 10 17:25:07 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 10 Feb 2009 17:25:07 +0100 (CET) Subject: [Python-checkins] r69503 - in python/branches/release30-maint: setup.py Message-ID: <20090210162507.320431E4018@bag.python.org> Author: mark.dickinson Date: Tue Feb 10 17:25:06 2009 New Revision: 69503 Log: Merged revisions 69501 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69501 | mark.dickinson | 2009-02-10 16:18:22 +0000 (Tue, 10 Feb 2009) | 11 lines Merged revisions 69500 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69500 | mark.dickinson | 2009-02-10 16:17:16 +0000 (Tue, 10 Feb 2009) | 4 lines _testcapi depends on testcapi_long.h Thanks Lisandro Dalcin. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/setup.py Modified: python/branches/release30-maint/setup.py ============================================================================== --- python/branches/release30-maint/setup.py (original) +++ python/branches/release30-maint/setup.py Tue Feb 10 17:25:06 2009 @@ -448,7 +448,8 @@ # _json speedups exts.append( Extension("_json", ["_json.c"]) ) # Python C API test module - exts.append( Extension('_testcapi', ['_testcapimodule.c']) ) + exts.append( Extension('_testcapi', ['_testcapimodule.c'], + depends=['testcapi_long.h']) ) # profiler (_lsprof is for cProfile.py) exts.append( Extension('_lsprof', ['_lsprof.c', 'rotatingtree.c']) ) # static Unicode character database From python-checkins at python.org Tue Feb 10 17:58:05 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Tue, 10 Feb 2009 17:58:05 +0100 (CET) Subject: [Python-checkins] r69504 - in python/branches/release30-maint: PC/VC6/_multiprocessing.dsp PC/VC6/build_tkinter.py PC/VC6/tcl852.patch Message-ID: <20090210165805.D17F01E4002@bag.python.org> Author: hirokazu.yamamoto Date: Tue Feb 10 17:58:05 2009 New Revision: 69504 Log: Merged revisions 69497 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69497 | hirokazu.yamamoto | 2009-02-10 23:27:19 +0900 | 9 lines Merged revisions 69494 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69494 | hirokazu.yamamoto | 2009-02-10 22:31:28 +0900 | 1 line Fixed svn:eol-style. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/PC/VC6/_multiprocessing.dsp (contents, props changed) python/branches/release30-maint/PC/VC6/build_tkinter.py (contents, props changed) python/branches/release30-maint/PC/VC6/tcl852.patch (contents, props changed) Modified: python/branches/release30-maint/PC/VC6/_multiprocessing.dsp ============================================================================== --- python/branches/release30-maint/PC/VC6/_multiprocessing.dsp (original) +++ python/branches/release30-maint/PC/VC6/_multiprocessing.dsp Tue Feb 10 17:58:05 2009 @@ -1,115 +1,115 @@ -# Microsoft Developer Studio Project File - Name="_multiprocessing" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=_multiprocessing - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "_multiprocessing.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "_multiprocessing.mak" CFG="_multiprocessing - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "_multiprocessing - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "_multiprocessing - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "_multiprocessing" -# PROP Scc_LocalPath ".." -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "_multiprocessing - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "." -# PROP Intermediate_Dir "x86-temp-release\_multiprocessing" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1D0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing.pyd" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "_multiprocessing - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "." -# PROP Intermediate_Dir "x86-temp-debug\_multiprocessing" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1d0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing_d.pyd" /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "_multiprocessing - Win32 Release" -# Name "_multiprocessing - Win32 Debug" -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\multiprocessing.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\pipe_connection.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\semaphore.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\socket_connection.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\win32_functions.c -# End Source File -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="_multiprocessing" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=_multiprocessing - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "_multiprocessing.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "_multiprocessing.mak" CFG="_multiprocessing - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "_multiprocessing - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "_multiprocessing - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "_multiprocessing" +# PROP Scc_LocalPath ".." +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "_multiprocessing - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "." +# PROP Intermediate_Dir "x86-temp-release\_multiprocessing" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +F90=df.exe +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1D0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing.pyd" +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "_multiprocessing - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "." +# PROP Intermediate_Dir "x86-temp-debug\_multiprocessing" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +F90=df.exe +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1d0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing_d.pyd" /pdbtype:sept +# SUBTRACT LINK32 /pdb:none + +!ENDIF + +# Begin Target + +# Name "_multiprocessing - Win32 Release" +# Name "_multiprocessing - Win32 Debug" +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\multiprocessing.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\pipe_connection.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\semaphore.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\socket_connection.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\win32_functions.c +# End Source File +# End Target +# End Project Modified: python/branches/release30-maint/PC/VC6/build_tkinter.py ============================================================================== --- python/branches/release30-maint/PC/VC6/build_tkinter.py (original) +++ python/branches/release30-maint/PC/VC6/build_tkinter.py Tue Feb 10 17:58:05 2009 @@ -1,81 +1,81 @@ -import os -import sys -import subprocess - -TCL_MAJOR = 8 -TCL_MINOR = 5 -TCL_PATCH = 2 - -TIX_MAJOR = 8 -TIX_MINOR = 4 -TIX_PATCH = 3 - -def abspath(name): - par = os.path.pardir - return os.path.abspath(os.path.join(__file__, par, par, par, par, name)) - -TCL_DIR = abspath("tcl%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) -TK_DIR = abspath("tk%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) -TIX_DIR = abspath("tix%d.%d.%d" % (TIX_MAJOR, TIX_MINOR, TIX_PATCH)) -OUT_DIR = abspath("tcltk") - -def have_args(*a): - return any(s in sys.argv[1:] for s in a) - -def enter(dir): - os.chdir(os.path.join(dir, "win")) - -def main(): - debug = have_args("-d", "--debug") - clean = have_args("clean") - install = have_args("install") - tcl = have_args("tcl") - tk = have_args("tk") - tix = have_args("tix") - if not(tcl) and not(tk) and not(tix): - tcl = tk = tix = True - - def nmake(makefile, *a): - args = ["nmake", "/nologo", "/f", makefile, "DEBUG=%d" % debug] - args.extend(a) - subprocess.check_call(args) - - if tcl: - enter(TCL_DIR) - def nmake_tcl(*a): - nmake("makefile.vc", *a) - if clean: - nmake_tcl("clean") - elif install: - nmake_tcl("install", "INSTALLDIR=" + OUT_DIR) - else: - nmake_tcl() - - if tk: - enter(TK_DIR) - def nmake_tk(*a): - nmake("makefile.vc", "TCLDIR=" + TCL_DIR, *a) - if clean: - nmake_tk("clean") - elif install: - nmake_tk("install", "INSTALLDIR=" + OUT_DIR) - else: - nmake_tk() - - if tix: - enter(TIX_DIR) - def nmake_tix(*a): - nmake("python.mak", - "TCL_MAJOR=%d" % TCL_MAJOR, - "TCL_MINOR=%d" % TCL_MINOR, - "TCL_PATCH=%d" % TCL_PATCH, - "MACHINE=IX86", *a) - if clean: - nmake_tix("clean") - elif install: - nmake_tix("install", "INSTALL_DIR=" + OUT_DIR) - else: - nmake_tix() - -if __name__ == '__main__': - main() +import os +import sys +import subprocess + +TCL_MAJOR = 8 +TCL_MINOR = 5 +TCL_PATCH = 2 + +TIX_MAJOR = 8 +TIX_MINOR = 4 +TIX_PATCH = 3 + +def abspath(name): + par = os.path.pardir + return os.path.abspath(os.path.join(__file__, par, par, par, par, name)) + +TCL_DIR = abspath("tcl%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) +TK_DIR = abspath("tk%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) +TIX_DIR = abspath("tix%d.%d.%d" % (TIX_MAJOR, TIX_MINOR, TIX_PATCH)) +OUT_DIR = abspath("tcltk") + +def have_args(*a): + return any(s in sys.argv[1:] for s in a) + +def enter(dir): + os.chdir(os.path.join(dir, "win")) + +def main(): + debug = have_args("-d", "--debug") + clean = have_args("clean") + install = have_args("install") + tcl = have_args("tcl") + tk = have_args("tk") + tix = have_args("tix") + if not(tcl) and not(tk) and not(tix): + tcl = tk = tix = True + + def nmake(makefile, *a): + args = ["nmake", "/nologo", "/f", makefile, "DEBUG=%d" % debug] + args.extend(a) + subprocess.check_call(args) + + if tcl: + enter(TCL_DIR) + def nmake_tcl(*a): + nmake("makefile.vc", *a) + if clean: + nmake_tcl("clean") + elif install: + nmake_tcl("install", "INSTALLDIR=" + OUT_DIR) + else: + nmake_tcl() + + if tk: + enter(TK_DIR) + def nmake_tk(*a): + nmake("makefile.vc", "TCLDIR=" + TCL_DIR, *a) + if clean: + nmake_tk("clean") + elif install: + nmake_tk("install", "INSTALLDIR=" + OUT_DIR) + else: + nmake_tk() + + if tix: + enter(TIX_DIR) + def nmake_tix(*a): + nmake("python.mak", + "TCL_MAJOR=%d" % TCL_MAJOR, + "TCL_MINOR=%d" % TCL_MINOR, + "TCL_PATCH=%d" % TCL_PATCH, + "MACHINE=IX86", *a) + if clean: + nmake_tix("clean") + elif install: + nmake_tix("install", "INSTALL_DIR=" + OUT_DIR) + else: + nmake_tix() + +if __name__ == '__main__': + main() Modified: python/branches/release30-maint/PC/VC6/tcl852.patch ============================================================================== --- python/branches/release30-maint/PC/VC6/tcl852.patch (original) +++ python/branches/release30-maint/PC/VC6/tcl852.patch Tue Feb 10 17:58:05 2009 @@ -1,22 +1,22 @@ ---- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 -+++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 -@@ -367,7 +367,7 @@ - typedef struct stati64 Tcl_StatBuf; - # define TCL_LL_MODIFIER "L" - # else /* __BORLANDC__ */ --# if _MSC_VER < 1400 && !defined(_M_IX86) -+# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ - typedef struct _stati64 Tcl_StatBuf; - # else - typedef struct _stat64 Tcl_StatBuf; ---- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 -+++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 -@@ -367,7 +367,7 @@ - typedef struct stati64 Tcl_StatBuf; - # define TCL_LL_MODIFIER "L" - # else /* __BORLANDC__ */ --# if _MSC_VER < 1400 && !defined(_M_IX86) -+# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ - typedef struct _stati64 Tcl_StatBuf; - # else - typedef struct _stat64 Tcl_StatBuf; +--- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 ++++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 +@@ -367,7 +367,7 @@ + typedef struct stati64 Tcl_StatBuf; + # define TCL_LL_MODIFIER "L" + # else /* __BORLANDC__ */ +-# if _MSC_VER < 1400 && !defined(_M_IX86) ++# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ + typedef struct _stati64 Tcl_StatBuf; + # else + typedef struct _stat64 Tcl_StatBuf; +--- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 ++++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 +@@ -367,7 +367,7 @@ + typedef struct stati64 Tcl_StatBuf; + # define TCL_LL_MODIFIER "L" + # else /* __BORLANDC__ */ +-# if _MSC_VER < 1400 && !defined(_M_IX86) ++# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ + typedef struct _stati64 Tcl_StatBuf; + # else + typedef struct _stat64 Tcl_StatBuf; From buildbot at python.org Tue Feb 10 18:35:16 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 10 Feb 2009 17:35:16 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.x Message-ID: <20090210173516.6BBE01E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%203.x/builds/309 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 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_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Feb 10 19:43:01 2009 From: python-checkins at python.org (thomas.heller) Date: Tue, 10 Feb 2009 19:43:01 +0100 (CET) Subject: [Python-checkins] r69505 - in python/trunk: Misc/NEWS Modules/_ctypes/callproc.c Message-ID: <20090210184301.306901E4002@bag.python.org> Author: thomas.heller Date: Tue Feb 10 19:43:01 2009 New Revision: 69505 Log: Issue#5203: ctypes segfaults when passing a unicode string to a function without argtypes, if HAVE_USABLE_WCHAR_T is false. Modified: python/trunk/Misc/NEWS python/trunk/Modules/_ctypes/callproc.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Feb 10 19:43:01 2009 @@ -152,6 +152,9 @@ Library ------- +- Issue #5203: Fixed ctypes segfaults when passing a unicode string to a + function without argtypes (only occurs if HAVE_USABLE_WCHAR_T is false). + - Issue #3386: distutils.sysconfig.get_python_lib prefix argument was ignored under NT and OS2. Patch by Philip Jenvey. Modified: python/trunk/Modules/_ctypes/callproc.c ============================================================================== --- python/trunk/Modules/_ctypes/callproc.c (original) +++ python/trunk/Modules/_ctypes/callproc.c Tue Feb 10 19:43:01 2009 @@ -664,6 +664,7 @@ return 0; #else int size = PyUnicode_GET_SIZE(obj); + pa->ffi_type = &ffi_type_pointer; size += 1; /* terminating NUL */ size *= sizeof(wchar_t); pa->value.p = PyMem_Malloc(size); From python-checkins at python.org Tue Feb 10 19:46:12 2009 From: python-checkins at python.org (thomas.heller) Date: Tue, 10 Feb 2009 19:46:12 +0100 (CET) Subject: [Python-checkins] r69506 - in python/branches/release26-maint: Misc/NEWS Modules/_ctypes/callproc.c Message-ID: <20090210184612.692041E402D@bag.python.org> Author: thomas.heller Date: Tue Feb 10 19:46:11 2009 New Revision: 69506 Log: Merged revisions 69505 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69505 | thomas.heller | 2009-02-10 19:43:01 +0100 (Di, 10 Feb 2009) | 3 lines Issue#5203: ctypes segfaults when passing a unicode string to a function without argtypes, if HAVE_USABLE_WCHAR_T is false. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/_ctypes/callproc.c Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Tue Feb 10 19:46:11 2009 @@ -80,6 +80,9 @@ Library ------- +- Issue #5203: Fixed ctypes segfaults when passing a unicode string to a + function without argtypes (only occurs if HAVE_USABLE_WCHAR_T is false). + - Issue #3386: distutils.sysconfig.get_python_lib prefix argument was ignored under NT and OS2. Patch by Philip Jenvey. Modified: python/branches/release26-maint/Modules/_ctypes/callproc.c ============================================================================== --- python/branches/release26-maint/Modules/_ctypes/callproc.c (original) +++ python/branches/release26-maint/Modules/_ctypes/callproc.c Tue Feb 10 19:46:11 2009 @@ -664,6 +664,7 @@ return 0; #else int size = PyUnicode_GET_SIZE(obj); + pa->ffi_type = &ffi_type_pointer; size += 1; /* terminating NUL */ size *= sizeof(wchar_t); pa->value.p = PyMem_Malloc(size); From python-checkins at python.org Tue Feb 10 19:59:04 2009 From: python-checkins at python.org (thomas.heller) Date: Tue, 10 Feb 2009 19:59:04 +0100 (CET) Subject: [Python-checkins] r69507 - in python/branches/py3k: Misc/NEWS Modules/_ctypes/callproc.c Message-ID: <20090210185904.C889B1E4002@bag.python.org> Author: thomas.heller Date: Tue Feb 10 19:59:04 2009 New Revision: 69507 Log: (The fix has been slightly adjusted.) Merged revisions 69505 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69505 | thomas.heller | 2009-02-10 19:43:01 +0100 (Di, 10 Feb 2009) | 3 lines Issue#5203: ctypes segfaults when passing a unicode string to a function without argtypes, if HAVE_USABLE_WCHAR_T is false. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_ctypes/callproc.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue Feb 10 19:59:04 2009 @@ -163,6 +163,9 @@ Library ------- +- Issue #5203: Fixed ctypes segfaults when passing a unicode string to a + function without argtypes (only occurs if HAVE_USABLE_WCHAR_T is false). + - Issue #3386: distutils.sysconfig.get_python_lib prefix argument was ignored under NT and OS2. Patch by Philip Jenvey. Modified: python/branches/py3k/Modules/_ctypes/callproc.c ============================================================================== --- python/branches/py3k/Modules/_ctypes/callproc.c (original) +++ python/branches/py3k/Modules/_ctypes/callproc.c Tue Feb 10 19:59:04 2009 @@ -645,14 +645,15 @@ #ifdef CTYPES_UNICODE if (PyUnicode_Check(obj)) { - pa->ffi_type = &ffi_type_pointer; #ifdef HAVE_USABLE_WCHAR_T + pa->ffi_type = &ffi_type_pointer; pa->value.p = PyUnicode_AS_UNICODE(obj); Py_INCREF(obj); pa->keep = obj; return 0; #else int size = PyUnicode_GET_SIZE(obj); + pa->ffi_type = &ffi_type_pointer; size += 1; /* terminating NUL */ size *= sizeof(wchar_t); pa->value.p = PyMem_Malloc(size); From python-checkins at python.org Tue Feb 10 20:04:16 2009 From: python-checkins at python.org (thomas.heller) Date: Tue, 10 Feb 2009 20:04:16 +0100 (CET) Subject: [Python-checkins] r69508 - in python/branches/release30-maint: Misc/NEWS Modules/_ctypes/callproc.c Message-ID: <20090210190416.6E0661E4010@bag.python.org> Author: thomas.heller Date: Tue Feb 10 20:04:16 2009 New Revision: 69508 Log: Merged revisions 69507 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69507 | thomas.heller | 2009-02-10 19:59:04 +0100 (Di, 10 Feb 2009) | 13 lines (The fix has been slightly adjusted.) Merged revisions 69505 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69505 | thomas.heller | 2009-02-10 19:43:01 +0100 (Di, 10 Feb 2009) | 3 lines Issue#5203: ctypes segfaults when passing a unicode string to a function without argtypes, if HAVE_USABLE_WCHAR_T is false. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/_ctypes/callproc.c Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Tue Feb 10 20:04:16 2009 @@ -116,6 +116,9 @@ Library ------- +- Issue #5203: Fixed ctypes segfaults when passing a unicode string to a + function without argtypes (only occurs if HAVE_USABLE_WCHAR_T is false). + - Issue #3386: distutils.sysconfig.get_python_lib prefix argument was ignored under NT and OS2. Patch by Philip Jenvey. Modified: python/branches/release30-maint/Modules/_ctypes/callproc.c ============================================================================== --- python/branches/release30-maint/Modules/_ctypes/callproc.c (original) +++ python/branches/release30-maint/Modules/_ctypes/callproc.c Tue Feb 10 20:04:16 2009 @@ -645,14 +645,15 @@ #ifdef CTYPES_UNICODE if (PyUnicode_Check(obj)) { - pa->ffi_type = &ffi_type_pointer; #ifdef HAVE_USABLE_WCHAR_T + pa->ffi_type = &ffi_type_pointer; pa->value.p = PyUnicode_AS_UNICODE(obj); Py_INCREF(obj); pa->keep = obj; return 0; #else int size = PyUnicode_GET_SIZE(obj); + pa->ffi_type = &ffi_type_pointer; size += 1; /* terminating NUL */ size *= sizeof(wchar_t); pa->value.p = PyMem_Malloc(size); From buildbot at python.org Tue Feb 10 20:32:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 10 Feb 2009 19:32:17 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 2.6 Message-ID: <20090210193217.D609E1E400C@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/117 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: thomas.heller BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_ssl make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Feb 10 20:40:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 10 Feb 2009 19:40:38 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 2.6 Message-ID: <20090210194039.550111E4020@bag.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/88 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: thomas.heller BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/home/buildbot/slave/py-build/2.6.norwitz-amd64/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/home/buildbot/slave/py-build/2.6.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/2.6.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') 1 test failed: test_urllibnet make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Feb 10 20:59:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 10 Feb 2009 19:59:31 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090210195931.5E05E1E4002@bag.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/237 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: thomas.heller 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 Wed Feb 11 01:06:18 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 11 Feb 2009 01:06:18 +0100 (CET) Subject: [Python-checkins] r69509 - python/trunk/Doc/library/collections.rst Message-ID: <20090211000618.345871E400C@bag.python.org> Author: raymond.hettinger Date: Wed Feb 11 01:06:17 2009 New Revision: 69509 Log: Clean-up named tuple docs. 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 Wed Feb 11 01:06:17 2009 @@ -775,7 +775,8 @@ >>> getattr(p, 'x') 11 -To convert a dictionary to a named tuple, use the double-star-operator [#]_: +To convert a dictionary to a named tuple, use the double-star-operator +(as described in :ref:`tut-unpacking-arguments`): >>> d = {'x': 11, 'y': 22} >>> Point(**d) @@ -822,7 +823,7 @@ >>> class Status: ... open, pending, closed = range(3) -.. rubric:: Footnotes +.. seealso:: -.. [#] For information on the double-star-operator see - :ref:`tut-unpacking-arguments` and :ref:`calls`. + `Named tuple recipe `_ + adapted for Python 2.4. From python-checkins at python.org Wed Feb 11 01:12:08 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 11 Feb 2009 01:12:08 +0100 (CET) Subject: [Python-checkins] r69510 - python/branches/release26-maint/Doc/library/collections.rst Message-ID: <20090211001208.2408F1E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 11 01:12:07 2009 New Revision: 69510 Log: Clean-up named tuple docs. 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 Wed Feb 11 01:12:07 2009 @@ -637,7 +637,8 @@ >>> getattr(p, 'x') 11 -To convert a dictionary to a named tuple, use the double-star-operator [#]_: +To convert a dictionary to a named tuple, use the double-star-operator +(as described in :ref:`tut-unpacking-arguments`): >>> d = {'x': 11, 'y': 22} >>> Point(**d) @@ -684,7 +685,7 @@ >>> class Status: ... open, pending, closed = range(3) -.. rubric:: Footnotes +.. seealso:: -.. [#] For information on the double-star-operator see - :ref:`tut-unpacking-arguments` and :ref:`calls`. + `Named tuple recipe `_ + adapted for Python 2.4. From python-checkins at python.org Wed Feb 11 01:16:12 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 11 Feb 2009 01:16:12 +0100 (CET) Subject: [Python-checkins] r69511 - python/branches/release30-maint/Doc/library/collections.rst Message-ID: <20090211001612.C8A6B1E4029@bag.python.org> Author: raymond.hettinger Date: Wed Feb 11 01:16:12 2009 New Revision: 69511 Log: Clean-up named tuple docs. 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 Wed Feb 11 01:16:12 2009 @@ -614,7 +614,8 @@ >>> getattr(p, 'x') 11 -To convert a dictionary to a named tuple, use the double-star-operator [#]_: +To convert a dictionary to a named tuple, use the double-star-operator +(as described in :ref:`tut-unpacking-arguments`): >>> d = {'x': 11, 'y': 22} >>> Point(**d) @@ -662,10 +663,10 @@ >>> class Status: ... open, pending, closed = range(3) -.. rubric:: Footnotes +.. seealso:: -.. [#] For information on the double-star-operator see - :ref:`tut-unpacking-arguments` and :ref:`calls`. + `Named tuple recipe `_ + adapted for Python 2.4. From python-checkins at python.org Wed Feb 11 01:20:02 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 11 Feb 2009 01:20:02 +0100 (CET) Subject: [Python-checkins] r69512 - python/branches/py3k/Doc/library/collections.rst Message-ID: <20090211002002.DB4221E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 11 01:20:02 2009 New Revision: 69512 Log: Clean-up named tuple docs. 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 Wed Feb 11 01:20:02 2009 @@ -755,7 +755,8 @@ >>> getattr(p, 'x') 11 -To convert a dictionary to a named tuple, use the double-star-operator [#]_: +To convert a dictionary to a named tuple, use the double-star-operator +(as described in :ref:`tut-unpacking-arguments`): >>> d = {'x': 11, 'y': 22} >>> Point(**d) @@ -803,10 +804,10 @@ >>> class Status: ... open, pending, closed = range(3) -.. rubric:: Footnotes +.. seealso:: -.. [#] For information on the double-star-operator see - :ref:`tut-unpacking-arguments` and :ref:`calls`. + `Named tuple recipe `_ + adapted for Python 2.4. From python-checkins at python.org Wed Feb 11 01:39:14 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 11 Feb 2009 01:39:14 +0100 (CET) Subject: [Python-checkins] r69513 - in python/branches/py3k: Lib/http/client.py Lib/io.py Lib/test/test_httplib.py Lib/test/test_io.py Lib/test/test_urllib2_localnet.py Lib/test/test_urllib2net.py Lib/urllib/request.py Lib/urllib/response.py Misc/NEWS Message-ID: <20090211003914.AF2E81E4002@bag.python.org> Author: antoine.pitrou Date: Wed Feb 11 01:39:14 2009 New Revision: 69513 Log: Issue #4631: Fix urlopen() result when an HTTP response uses chunked encoding. Modified: python/branches/py3k/Lib/http/client.py python/branches/py3k/Lib/io.py python/branches/py3k/Lib/test/test_httplib.py python/branches/py3k/Lib/test/test_io.py python/branches/py3k/Lib/test/test_urllib2_localnet.py python/branches/py3k/Lib/test/test_urllib2net.py python/branches/py3k/Lib/urllib/request.py python/branches/py3k/Lib/urllib/response.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/http/client.py ============================================================================== --- python/branches/py3k/Lib/http/client.py (original) +++ python/branches/py3k/Lib/http/client.py Wed Feb 11 01:39:14 2009 @@ -249,7 +249,7 @@ return email.parser.Parser(_class=HTTPMessage).parsestr(hstring) -class HTTPResponse: +class HTTPResponse(io.RawIOBase): # strict: If true, raise BadStatusLine if the status line can't be # parsed as a valid HTTP/1.0 or 1.1 status line. By default it is @@ -471,8 +471,6 @@ # called, meaning self.isclosed() is meaningful. return self.fp is None - # XXX It would be nice to have readline and __iter__ for this, too. - def read(self, amt=None): if self.fp is None: return b"" @@ -585,6 +583,9 @@ amt -= len(chunk) return b"".join(s) + def fileno(self): + return self.fp.fileno() + def getheader(self, name, default=None): if self.msg is None: raise ResponseNotReady() @@ -596,6 +597,11 @@ raise ResponseNotReady() return list(self.msg.items()) + # We override IOBase.__iter__ so that it doesn't check for closed-ness + + def __iter__(self): + return self + class HTTPConnection: Modified: python/branches/py3k/Lib/io.py ============================================================================== --- python/branches/py3k/Lib/io.py (original) +++ python/branches/py3k/Lib/io.py Wed Feb 11 01:39:14 2009 @@ -491,7 +491,6 @@ terminator(s) recognized. """ # For backwards compatibility, a (slowish) readline(). - self._checkClosed() if hasattr(self, "peek"): def nreadahead(): readahead = self.peek(1) @@ -533,7 +532,6 @@ lines will be read if the total size (in bytes/characters) of all lines so far exceeds hint. """ - self._checkClosed() if hint is None or hint <= 0: return list(self) n = 0 Modified: python/branches/py3k/Lib/test/test_httplib.py ============================================================================== --- python/branches/py3k/Lib/test/test_httplib.py (original) +++ python/branches/py3k/Lib/test/test_httplib.py Wed Feb 11 01:39:14 2009 @@ -42,7 +42,6 @@ raise AssertionError('caller tried to read past EOF') return data - class HeaderTests(TestCase): def test_auto_headers(self): # Some headers are added automatically, but should not be added by @@ -245,7 +244,6 @@ self.assertEqual(httpConn.sock.gettimeout(), 30) httpConn.close() - class HTTPSTimeoutTest(TestCase): # XXX Here should be tests for HTTPS, there isn't any right now! @@ -257,7 +255,7 @@ def test_main(verbose=None): support.run_unittest(HeaderTests, OfflineTest, BasicTest, TimeoutTest, - HTTPSTimeoutTest) + HTTPSTimeoutTest) if __name__ == '__main__': test_main() 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 Wed Feb 11 01:39:14 2009 @@ -1363,6 +1363,7 @@ self.assertRaises(ValueError, f.fileno) self.assertRaises(ValueError, f.isatty) self.assertRaises(ValueError, f.__iter__) + self.assertRaises(ValueError, next, f) if hasattr(f, "peek"): self.assertRaises(ValueError, f.peek, 1) self.assertRaises(ValueError, f.read) 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 Wed Feb 11 01:39:14 2009 @@ -310,7 +310,7 @@ self.send_response(response_code) for (header, value) in headers: - self.send_header(header, value % self.port) + self.send_header(header, value % {'port':self.port}) if body: self.send_header("Content-type", "text/plain") self.end_headers() @@ -341,10 +341,17 @@ self.server.stop() def urlopen(self, url, data=None): + l = [] f = urllib.request.urlopen(url, data) - result = f.read() - f.close() - return result + try: + # Exercise various methods + l.extend(f.readlines(200)) + l.append(f.readline()) + l.append(f.read(1024)) + l.append(f.read()) + finally: + f.close() + return b"".join(l) def start_server(self, responses=None): if responses is None: @@ -361,7 +368,8 @@ def test_redirection(self): expected_response = b"We got here..." responses = [ - (302, [("Location", "http://localhost:%s/somewhere_else")], ""), + (302, [("Location", "http://localhost:%(port)s/somewhere_else")], + ""), (200, [], expected_response) ] @@ -370,6 +378,20 @@ self.assertEquals(data, expected_response) self.assertEquals(handler.requests, ["/", "/somewhere_else"]) + def test_chunked(self): + expected_response = b"hello world" + chunked_start = ( + b'a\r\n' + b'hello worl\r\n' + b'1\r\n' + b'd\r\n' + b'0\r\n' + ) + response = [(200, [("Transfer-Encoding", "chunked")], chunked_start)] + handler = self.start_server(response) + data = self.urlopen("http://localhost:%s/" % handler.port) + self.assertEquals(data, expected_response) + def test_404(self): expected_response = b"Bad bad bad..." handler = self.start_server([(404, [], expected_response)]) Modified: python/branches/py3k/Lib/test/test_urllib2net.py ============================================================================== --- python/branches/py3k/Lib/test/test_urllib2net.py (original) +++ python/branches/py3k/Lib/test/test_urllib2net.py Wed Feb 11 01:39:14 2009 @@ -195,7 +195,7 @@ def test_http_basic(self): self.assertTrue(socket.getdefaulttimeout() is None) u = _urlopen_with_retry("http://www.python.org") - self.assertTrue(u.fp.raw._sock.gettimeout() is None) + self.assertTrue(u.fp.fp.raw._sock.gettimeout() is None) def test_http_default_timeout(self): self.assertTrue(socket.getdefaulttimeout() is None) @@ -204,7 +204,7 @@ u = _urlopen_with_retry("http://www.python.org") finally: socket.setdefaulttimeout(None) - self.assertEqual(u.fp.raw._sock.gettimeout(), 60) + self.assertEqual(u.fp.fp.raw._sock.gettimeout(), 60) def test_http_no_timeout(self): self.assertTrue(socket.getdefaulttimeout() is None) @@ -213,11 +213,11 @@ u = _urlopen_with_retry("http://www.python.org", timeout=None) finally: socket.setdefaulttimeout(None) - self.assertTrue(u.fp.raw._sock.gettimeout() is None) + self.assertTrue(u.fp.fp.raw._sock.gettimeout() is None) def test_http_timeout(self): u = _urlopen_with_retry("http://www.python.org", timeout=120) - self.assertEqual(u.fp.raw._sock.gettimeout(), 120) + self.assertEqual(u.fp.fp.raw._sock.gettimeout(), 120) FTP_HOST = "ftp://ftp.mirror.nl/pub/mirror/gnu/" Modified: python/branches/py3k/Lib/urllib/request.py ============================================================================== --- python/branches/py3k/Lib/urllib/request.py (original) +++ python/branches/py3k/Lib/urllib/request.py Wed Feb 11 01:39:14 2009 @@ -333,7 +333,6 @@ handlers = chain.get(kind, ()) for handler in handlers: func = getattr(handler, meth_name) - result = func(*args) if result is not None: return result @@ -1070,7 +1069,8 @@ except socket.error as err: # XXX what error? raise URLError(err) - resp = addinfourl(r.fp, r.msg, req.get_full_url()) +## resp = addinfourl(r.fp, r.msg, req.get_full_url()) + resp = addinfourl(r, r.msg, req.get_full_url()) resp.code = r.status resp.msg = r.reason return resp @@ -1606,7 +1606,7 @@ # According to RFC 2616, "2xx" code indicates that the client's # request was successfully received, understood, and accepted. if 200 <= response.status < 300: - return addinfourl(response.fp, response.msg, "http:" + url, + return addinfourl(response, response.msg, "http:" + url, response.status) else: return self.http_error( Modified: python/branches/py3k/Lib/urllib/response.py ============================================================================== --- python/branches/py3k/Lib/urllib/response.py (original) +++ python/branches/py3k/Lib/urllib/response.py Wed Feb 11 01:39:14 2009 @@ -17,7 +17,8 @@ self.read = self.fp.read self.readline = self.fp.readline # TODO(jhylton): Make sure an object with readlines() is also iterable - if hasattr(self.fp, "readlines"): self.readlines = self.fp.readlines + if hasattr(self.fp, "readlines"): + self.readlines = self.fp.readlines if hasattr(self.fp, "fileno"): self.fileno = self.fp.fileno else: Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed Feb 11 01:39:14 2009 @@ -163,6 +163,9 @@ Library ------- +- Issue #4631: Fix urlopen() result when an HTTP response uses chunked + encoding. + - Issue #5203: Fixed ctypes segfaults when passing a unicode string to a function without argtypes (only occurs if HAVE_USABLE_WCHAR_T is false). From python-checkins at python.org Wed Feb 11 02:01:42 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 11 Feb 2009 02:01:42 +0100 (CET) Subject: [Python-checkins] r69514 - in python/branches/release30-maint: Lib/http/client.py Lib/io.py Lib/test/test_httplib.py Lib/test/test_io.py Lib/test/test_urllib2_localnet.py Lib/test/test_urllib2net.py Lib/urllib/request.py Lib/urllib/response.py Misc/NEWS Message-ID: <20090211010142.10B5F1E4002@bag.python.org> Author: antoine.pitrou Date: Wed Feb 11 02:01:41 2009 New Revision: 69514 Log: Merged revisions 69513 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69513 | antoine.pitrou | 2009-02-11 01:39:14 +0100 (mer., 11 f?vr. 2009) | 3 lines Issue #4631: Fix urlopen() result when an HTTP response uses chunked encoding. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/http/client.py python/branches/release30-maint/Lib/io.py python/branches/release30-maint/Lib/test/test_httplib.py python/branches/release30-maint/Lib/test/test_io.py python/branches/release30-maint/Lib/test/test_urllib2_localnet.py python/branches/release30-maint/Lib/test/test_urllib2net.py python/branches/release30-maint/Lib/urllib/request.py python/branches/release30-maint/Lib/urllib/response.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/http/client.py ============================================================================== --- python/branches/release30-maint/Lib/http/client.py (original) +++ python/branches/release30-maint/Lib/http/client.py Wed Feb 11 02:01:41 2009 @@ -249,7 +249,7 @@ return email.parser.Parser(_class=HTTPMessage).parsestr(hstring) -class HTTPResponse: +class HTTPResponse(io.RawIOBase): # strict: If true, raise BadStatusLine if the status line can't be # parsed as a valid HTTP/1.0 or 1.1 status line. By default it is @@ -471,8 +471,6 @@ # called, meaning self.isclosed() is meaningful. return self.fp is None - # XXX It would be nice to have readline and __iter__ for this, too. - def read(self, amt=None): if self.fp is None: return b"" @@ -585,6 +583,9 @@ amt -= len(chunk) return b"".join(s) + def fileno(self): + return self.fp.fileno() + def getheader(self, name, default=None): if self.msg is None: raise ResponseNotReady() @@ -596,6 +597,11 @@ raise ResponseNotReady() return list(self.msg.items()) + # We override IOBase.__iter__ so that it doesn't check for closed-ness + + def __iter__(self): + return self + class HTTPConnection: Modified: python/branches/release30-maint/Lib/io.py ============================================================================== --- python/branches/release30-maint/Lib/io.py (original) +++ python/branches/release30-maint/Lib/io.py Wed Feb 11 02:01:41 2009 @@ -491,7 +491,6 @@ terminator(s) recognized. """ # For backwards compatibility, a (slowish) readline(). - self._checkClosed() if hasattr(self, "peek"): def nreadahead(): readahead = self.peek(1) @@ -533,7 +532,6 @@ lines will be read if the total size (in bytes/characters) of all lines so far exceeds hint. """ - self._checkClosed() if hint is None or hint <= 0: return list(self) n = 0 Modified: python/branches/release30-maint/Lib/test/test_httplib.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_httplib.py (original) +++ python/branches/release30-maint/Lib/test/test_httplib.py Wed Feb 11 02:01:41 2009 @@ -42,7 +42,6 @@ raise AssertionError('caller tried to read past EOF') return data - class HeaderTests(TestCase): def test_auto_headers(self): # Some headers are added automatically, but should not be added by @@ -245,7 +244,6 @@ self.assertEqual(httpConn.sock.gettimeout(), 30) httpConn.close() - class HTTPSTimeoutTest(TestCase): # XXX Here should be tests for HTTPS, there isn't any right now! @@ -257,7 +255,7 @@ def test_main(verbose=None): support.run_unittest(HeaderTests, OfflineTest, BasicTest, TimeoutTest, - HTTPSTimeoutTest) + HTTPSTimeoutTest) if __name__ == '__main__': test_main() Modified: python/branches/release30-maint/Lib/test/test_io.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_io.py (original) +++ python/branches/release30-maint/Lib/test/test_io.py Wed Feb 11 02:01:41 2009 @@ -1359,6 +1359,7 @@ self.assertRaises(ValueError, f.fileno) self.assertRaises(ValueError, f.isatty) self.assertRaises(ValueError, f.__iter__) + self.assertRaises(ValueError, next, f) if hasattr(f, "peek"): self.assertRaises(ValueError, f.peek, 1) self.assertRaises(ValueError, f.read) Modified: python/branches/release30-maint/Lib/test/test_urllib2_localnet.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_urllib2_localnet.py (original) +++ python/branches/release30-maint/Lib/test/test_urllib2_localnet.py Wed Feb 11 02:01:41 2009 @@ -310,7 +310,7 @@ self.send_response(response_code) for (header, value) in headers: - self.send_header(header, value % self.port) + self.send_header(header, value % {'port':self.port}) if body: self.send_header("Content-type", "text/plain") self.end_headers() @@ -341,10 +341,17 @@ self.server.stop() def urlopen(self, url, data=None): + l = [] f = urllib.request.urlopen(url, data) - result = f.read() - f.close() - return result + try: + # Exercise various methods + l.extend(f.readlines(200)) + l.append(f.readline()) + l.append(f.read(1024)) + l.append(f.read()) + finally: + f.close() + return b"".join(l) def start_server(self, responses=None): if responses is None: @@ -361,7 +368,8 @@ def test_redirection(self): expected_response = b"We got here..." responses = [ - (302, [("Location", "http://localhost:%s/somewhere_else")], ""), + (302, [("Location", "http://localhost:%(port)s/somewhere_else")], + ""), (200, [], expected_response) ] @@ -370,6 +378,20 @@ self.assertEquals(data, expected_response) self.assertEquals(handler.requests, ["/", "/somewhere_else"]) + def test_chunked(self): + expected_response = b"hello world" + chunked_start = ( + b'a\r\n' + b'hello worl\r\n' + b'1\r\n' + b'd\r\n' + b'0\r\n' + ) + response = [(200, [("Transfer-Encoding", "chunked")], chunked_start)] + handler = self.start_server(response) + data = self.urlopen("http://localhost:%s/" % handler.port) + self.assertEquals(data, expected_response) + def test_404(self): expected_response = b"Bad bad bad..." handler = self.start_server([(404, [], expected_response)]) Modified: python/branches/release30-maint/Lib/test/test_urllib2net.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_urllib2net.py (original) +++ python/branches/release30-maint/Lib/test/test_urllib2net.py Wed Feb 11 02:01:41 2009 @@ -195,7 +195,8 @@ def test_http_basic(self): self.assertTrue(socket.getdefaulttimeout() is None) u = _urlopen_with_retry("http://www.python.org") - self.assertTrue(u.fp._sock.gettimeout() is None) + #self.assertTrue(u.fp._sock.gettimeout() is None) + self.assertTrue(u.fp.fp._sock.gettimeout() is None) def test_http_default_timeout(self): self.assertTrue(socket.getdefaulttimeout() is None) @@ -204,7 +205,8 @@ u = _urlopen_with_retry("http://www.python.org") finally: socket.setdefaulttimeout(None) - self.assertEqual(u.fp._sock.gettimeout(), 60) + #self.assertEqual(u.fp._sock.gettimeout(), 60) + self.assertEqual(u.fp.fp._sock.gettimeout(), 60) def test_http_no_timeout(self): self.assertTrue(socket.getdefaulttimeout() is None) @@ -213,11 +215,13 @@ u = _urlopen_with_retry("http://www.python.org", timeout=None) finally: socket.setdefaulttimeout(None) - self.assertTrue(u.fp._sock.gettimeout() is None) + #self.assertTrue(u.fp._sock.gettimeout() is None) + self.assertTrue(u.fp.fp._sock.gettimeout() is None) def test_http_timeout(self): u = _urlopen_with_retry("http://www.python.org", timeout=120) - self.assertEqual(u.fp._sock.gettimeout(), 120) + #self.assertEqual(u.fp._sock.gettimeout(), 120) + self.assertEqual(u.fp.fp._sock.gettimeout(), 120) FTP_HOST = "ftp://ftp.mirror.nl/pub/mirror/gnu/" Modified: python/branches/release30-maint/Lib/urllib/request.py ============================================================================== --- python/branches/release30-maint/Lib/urllib/request.py (original) +++ python/branches/release30-maint/Lib/urllib/request.py Wed Feb 11 02:01:41 2009 @@ -333,7 +333,6 @@ handlers = chain.get(kind, ()) for handler in handlers: func = getattr(handler, meth_name) - result = func(*args) if result is not None: return result @@ -1070,7 +1069,8 @@ except socket.error as err: # XXX what error? raise URLError(err) - resp = addinfourl(r.fp, r.msg, req.get_full_url()) +## resp = addinfourl(r.fp, r.msg, req.get_full_url()) + resp = addinfourl(r, r.msg, req.get_full_url()) resp.code = r.status resp.msg = r.reason return resp @@ -1606,7 +1606,7 @@ # According to RFC 2616, "2xx" code indicates that the client's # request was successfully received, understood, and accepted. if 200 <= response.status < 300: - return addinfourl(response.fp, response.msg, "http:" + url, + return addinfourl(response, response.msg, "http:" + url, response.status) else: return self.http_error( Modified: python/branches/release30-maint/Lib/urllib/response.py ============================================================================== --- python/branches/release30-maint/Lib/urllib/response.py (original) +++ python/branches/release30-maint/Lib/urllib/response.py Wed Feb 11 02:01:41 2009 @@ -17,7 +17,8 @@ self.read = self.fp.read self.readline = self.fp.readline # TODO(jhylton): Make sure an object with readlines() is also iterable - if hasattr(self.fp, "readlines"): self.readlines = self.fp.readlines + if hasattr(self.fp, "readlines"): + self.readlines = self.fp.readlines if hasattr(self.fp, "fileno"): self.fileno = self.fp.fileno else: Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Wed Feb 11 02:01:41 2009 @@ -116,6 +116,9 @@ Library ------- +- Issue #4631: Fix urlopen() result when an HTTP response uses chunked + encoding. + - Issue #5203: Fixed ctypes segfaults when passing a unicode string to a function without argtypes (only occurs if HAVE_USABLE_WCHAR_T is false). From buildbot at python.org Wed Feb 11 02:27:04 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 11 Feb 2009 01:27:04 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090211012704.54CE71E4002@bag.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/113 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: antoine.pitrou,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 Wed Feb 11 02:51:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 11 Feb 2009 01:51:07 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.0 Message-ID: <20090211015107.684CD1E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%203.0/builds/136 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: antoine.pitrou,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Wed Feb 11 02:53:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 11 Feb 2009 01:53:20 +0000 Subject: [Python-checkins] buildbot failure in x86 FreeBSD 3.x Message-ID: <20090211015320.24ECA1E4002@bag.python.org> The Buildbot has detected a new failure of x86 FreeBSD 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20FreeBSD%203.x/builds/221 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-freebsd Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Wed Feb 11 05:10:53 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 11 Feb 2009 05:10:53 +0100 (CET) Subject: [Python-checkins] r69515 - python/branches/py3k Message-ID: <20090211041053.706C71E4045@bag.python.org> Author: benjamin.peterson Date: Wed Feb 11 05:10:53 2009 New Revision: 69515 Log: Blocked revisions 69509 via svnmerge ........ r69509 | raymond.hettinger | 2009-02-10 18:06:17 -0600 (Tue, 10 Feb 2009) | 1 line Clean-up named tuple docs. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Wed Feb 11 05:13:07 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Wed, 11 Feb 2009 05:13:07 +0100 (CET) Subject: [Python-checkins] r69516 - python/trunk/Include/fileobject.h Message-ID: <20090211041307.183611E4002@bag.python.org> Author: hirokazu.yamamoto Date: Wed Feb 11 05:13:06 2009 New Revision: 69516 Log: Issue #5204: Define _PyVerify_fd on VC6 to make test_fdopen (test_os.py) pass. Modified: python/trunk/Include/fileobject.h Modified: python/trunk/Include/fileobject.h ============================================================================== --- python/trunk/Include/fileobject.h (original) +++ python/trunk/Include/fileobject.h Wed Feb 11 05:13:06 2009 @@ -75,6 +75,9 @@ * Visual Studio 2005 */ int _PyVerify_fd(int fd); +#elif defined _MSC_VER && _MSC_VER >= 1200 +/* fdopen doesn't set errno EBADF and crashes for large fd on debug build */ +#define _PyVerify_fd(fd) (_get_osfhandle(fd) >= 0) #else #define _PyVerify_fd(A) (1) /* dummy */ #endif From buildbot at python.org Wed Feb 11 06:21:08 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 11 Feb 2009 05:21:08 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090211052108.C2F121E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/627 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: hirokazu.yamamoto,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_asynchat make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Feb 11 06:37:16 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 11 Feb 2009 05:37:16 +0000 Subject: [Python-checkins] buildbot failure in x86 FreeBSD trunk Message-ID: <20090211053716.DDA6D1E400C@bag.python.org> The Buildbot has detected a new failure of x86 FreeBSD trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20FreeBSD%20trunk/builds/1869 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-freebsd Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: hirokazu.yamamoto,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Wed Feb 11 06:57:55 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 11 Feb 2009 05:57:55 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu trunk Message-ID: <20090211055755.DE1B71E4002@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%20trunk/builds/1013 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: hirokazu.yamamoto,raymond.hettinger 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/trunk.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 182, in test_update d = self._empty_mapping() File "/home/pybot/buildarea/trunk.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/trunk.klose-debian-ia64/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/shelve.py", line 218, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/dbhash.py", line 19, in open return bsddb.hashopen(file, flag, mode) File "/home/pybot/buildarea/trunk.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/trunk.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 107, in test_write d = self._full_mapping(self.reference) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 24, in _full_mapping x = self._empty_mapping() File "/home/pybot/buildarea/trunk.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/trunk.klose-debian-ia64/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/shelve.py", line 218, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/dbhash.py", line 19, in open return bsddb.hashopen(file, flag, mode) File "/home/pybot/buildarea/trunk.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/trunk.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 182, in test_update d = self._empty_mapping() File "/home/pybot/buildarea/trunk.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/trunk.klose-debian-ia64/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/shelve.py", line 218, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/dbhash.py", line 19, in open return bsddb.hashopen(file, flag, mode) File "/home/pybot/buildarea/trunk.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/trunk.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 107, in test_write d = self._full_mapping(self.reference) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 24, in _full_mapping x = self._empty_mapping() File "/home/pybot/buildarea/trunk.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/trunk.klose-debian-ia64/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/shelve.py", line 218, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/dbhash.py", line 19, in open return bsddb.hashopen(file, flag, mode) File "/home/pybot/buildarea/trunk.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/trunk.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 182, in test_update d = self._empty_mapping() File "/home/pybot/buildarea/trunk.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/trunk.klose-debian-ia64/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/shelve.py", line 218, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/dbhash.py", line 19, in open return bsddb.hashopen(file, flag, mode) File "/home/pybot/buildarea/trunk.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/trunk.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 107, in test_write d = self._full_mapping(self.reference) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 24, in _full_mapping x = self._empty_mapping() File "/home/pybot/buildarea/trunk.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/trunk.klose-debian-ia64/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/shelve.py", line 218, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/dbhash.py", line 19, in open return bsddb.hashopen(file, flag, mode) File "/home/pybot/buildarea/trunk.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 Wed Feb 11 07:17:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 11 Feb 2009 06:17:25 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 trunk Message-ID: <20090211061725.DBB901E4002@bag.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/1852 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: hirokazu.yamamoto,raymond.hettinger 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\trunk.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\trunk.bolen-windows\build\lib\bsddb\dbshelve.py", line 106, in open d.open(filename, dbname, filetype, flags, mode) File "E:\cygwin\home\db3l\buildarea\trunk.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\trunk.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\trunk.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\trunk.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\trunk.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\trunk.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\trunk.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\trunk.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') sincerely, -The Buildbot From nnorwitz at gmail.com Wed Feb 11 11:21:01 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 11 Feb 2009 05:21:01 -0500 Subject: [Python-checkins] Python Regression Test Failures refleak (2) Message-ID: <20090211102101.GA20016@python.psfb.org> More important issues: ---------------------- test_distutils leaked [103, 103, 103] references, sum=309 test_poplib leaked [-213, 0, 0] references, sum=-213 Less important issues: ---------------------- test_asynchat leaked [-117, 0, 0] references, sum=-117 test_cmd_line leaked [-25, 25, -25] references, sum=-25 test_file leaked [0, 0, 82] references, sum=82 test_filecmp leaked [0, -82, 0] references, sum=-82 test_smtplib leaked [0, 81, -81] references, sum=0 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 From python-checkins at python.org Wed Feb 11 18:04:37 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 11 Feb 2009 18:04:37 +0100 (CET) Subject: [Python-checkins] r69517 - in python/branches/py3k: Doc/c-api/number.rst Include/abstract.h Include/intobject.h Message-ID: <20090211170437.507311E4002@bag.python.org> Author: mark.dickinson Date: Wed Feb 11 18:04:37 2009 New Revision: 69517 Log: Issue #4910: PyNumber_Int is deprecated in 3.0.1; will be removed in 3.1. Modified: python/branches/py3k/Doc/c-api/number.rst python/branches/py3k/Include/abstract.h python/branches/py3k/Include/intobject.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 Wed Feb 11 18:04:37 2009 @@ -233,6 +233,12 @@ Returns the *o* converted to an integer object on success, or *NULL* on failure. This is the equivalent of the Python expression ``int(o)``. + .. note:: + + This function is defined in the transitional :file:`intobject.h` + header file. It will be removed completely in Python 3.1. Use + the :cfunc:`PyNumber_Long` function instead. + .. cfunction:: PyObject* PyNumber_Long(PyObject *o) Modified: python/branches/py3k/Include/abstract.h ============================================================================== --- python/branches/py3k/Include/abstract.h (original) +++ python/branches/py3k/Include/abstract.h Wed Feb 11 18:04:37 2009 @@ -784,7 +784,11 @@ is cleared and the value is clipped. */ - #define PyNumber_Int PyNumber_Long + /* + PyNumber_Int used to be found here. It's now in Include/intobject.h, + where it is defined to be an alias for PyNumber_Long. New code + should use PyNumber_Long instead. + */ PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o); Modified: python/branches/py3k/Include/intobject.h ============================================================================== --- python/branches/py3k/Include/intobject.h (original) +++ python/branches/py3k/Include/intobject.h Wed Feb 11 18:04:37 2009 @@ -1,8 +1,8 @@ /* Integer object interface - This header files exists to make porting code to Python 3.0 easier. It - defines aliases from PyInt_* to PyLong_*. Only PyInt_GetMax() and - PyInt_CheckExact() remain in longobject.h. + This header file exists to make porting code to Python 3.0 easier. It + defines aliases from PyInt_* to PyLong_* and an alias from + PyNumber_Int to PyNumber_Long. */ #ifndef Py_INTOBJECT_H @@ -28,6 +28,7 @@ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyInt_AS_LONG PyLong_AS_LONG +#define PyNumber_Int PyNumber_Long #ifdef __cplusplus } From python-checkins at python.org Wed Feb 11 18:05:35 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 11 Feb 2009 18:05:35 +0100 (CET) Subject: [Python-checkins] r69518 - in python/branches/release30-maint: Doc/c-api/number.rst Include/abstract.h Include/intobject.h Message-ID: <20090211170535.F2F011E404B@bag.python.org> Author: mark.dickinson Date: Wed Feb 11 18:05:35 2009 New Revision: 69518 Log: Merged revisions 69517 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69517 | mark.dickinson | 2009-02-11 17:04:37 +0000 (Wed, 11 Feb 2009) | 2 lines Issue #4910: PyNumber_Int is deprecated in 3.0.1; will be removed in 3.1. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/c-api/number.rst python/branches/release30-maint/Include/abstract.h python/branches/release30-maint/Include/intobject.h Modified: python/branches/release30-maint/Doc/c-api/number.rst ============================================================================== --- python/branches/release30-maint/Doc/c-api/number.rst (original) +++ python/branches/release30-maint/Doc/c-api/number.rst Wed Feb 11 18:05:35 2009 @@ -233,6 +233,12 @@ Returns the *o* converted to an integer object on success, or *NULL* on failure. This is the equivalent of the Python expression ``int(o)``. + .. note:: + + This function is defined in the transitional :file:`intobject.h` + header file. It will be removed completely in Python 3.1. Use + the :cfunc:`PyNumber_Long` function instead. + .. cfunction:: PyObject* PyNumber_Long(PyObject *o) Modified: python/branches/release30-maint/Include/abstract.h ============================================================================== --- python/branches/release30-maint/Include/abstract.h (original) +++ python/branches/release30-maint/Include/abstract.h Wed Feb 11 18:05:35 2009 @@ -783,7 +783,11 @@ is cleared and the value is clipped. */ - #define PyNumber_Int PyNumber_Long + /* + PyNumber_Int used to be found here. It's now in Include/intobject.h, + where it is defined to be an alias for PyNumber_Long. New code + should use PyNumber_Long instead. + */ PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o); Modified: python/branches/release30-maint/Include/intobject.h ============================================================================== --- python/branches/release30-maint/Include/intobject.h (original) +++ python/branches/release30-maint/Include/intobject.h Wed Feb 11 18:05:35 2009 @@ -1,8 +1,8 @@ /* Integer object interface - This header files exists to make porting code to Python 3.0 easier. It - defines aliases from PyInt_* to PyLong_*. Only PyInt_GetMax() and - PyInt_CheckExact() remain in longobject.h. + This header file exists to make porting code to Python 3.0 easier. It + defines aliases from PyInt_* to PyLong_* and an alias from + PyNumber_Int to PyNumber_Long. */ #ifndef Py_INTOBJECT_H @@ -28,6 +28,7 @@ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyInt_AS_LONG PyLong_AS_LONG +#define PyNumber_Int PyNumber_Long #ifdef __cplusplus } From buildbot at python.org Wed Feb 11 19:40:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 11 Feb 2009 18:40:54 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090211184054.75E6A1E4032@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/146 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 Wed Feb 11 23:18:28 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 11 Feb 2009 17:18:28 -0500 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090211221828.GA7591@python.psfb.org> More important issues: ---------------------- test_distutils leaked [103, 103, 103] references, sum=309 Less important issues: ---------------------- test_asynchat leaked [-125, 0, 0] references, sum=-125 test_cmd_line leaked [25, -25, 25] references, sum=25 test_smtplib leaked [-4, 4, 0] references, sum=0 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 From python-checkins at python.org Thu Feb 12 00:45:25 2009 From: python-checkins at python.org (gregory.p.smith) Date: Thu, 12 Feb 2009 00:45:25 +0100 (CET) Subject: [Python-checkins] r69519 - in python/trunk: Lib/test/test_socket.py Misc/NEWS Modules/socketmodule.c Message-ID: <20090211234525.EA1791E4002@bag.python.org> Author: gregory.p.smith Date: Thu Feb 12 00:45:25 2009 New Revision: 69519 Log: Issue #1008086: Fixes socket.inet_aton() to always return 4 bytes even on LP64 platforms (most 64-bit Linux, bsd, unix systems). Modified: python/trunk/Lib/test/test_socket.py python/trunk/Misc/NEWS python/trunk/Modules/socketmodule.c Modified: python/trunk/Lib/test/test_socket.py ============================================================================== --- python/trunk/Lib/test/test_socket.py (original) +++ python/trunk/Lib/test/test_socket.py Thu Feb 12 00:45:25 2009 @@ -388,6 +388,14 @@ # Check that setting it to an invalid type raises TypeError self.assertRaises(TypeError, socket.setdefaulttimeout, "spam") + def testIPv4_inet_aton_fourbytes(self): + if not hasattr(socket, 'inet_aton'): + return # No inet_aton, nothing to check + # Test that issue1008086 and issue767150 are fixed. + # It must return 4 bytes. + self.assertEquals('\x00'*4, socket.inet_aton('0.0.0.0')) + self.assertEquals('\xff'*4, socket.inet_aton('255.255.255.255')) + def testIPv4toString(self): if not hasattr(socket, 'inet_pton'): return # No inet_pton() on this platform Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Feb 12 00:45:25 2009 @@ -152,6 +152,9 @@ Library ------- +- Issue #1008086: Fixed socket.inet_aton() to always return 4 bytes even on + LP64 platforms (most 64-bit Linux, bsd, unix systems). + - Issue #5203: Fixed ctypes segfaults when passing a unicode string to a function without argtypes (only occurs if HAVE_USABLE_WCHAR_T is false). Modified: python/trunk/Modules/socketmodule.c ============================================================================== --- python/trunk/Modules/socketmodule.c (original) +++ python/trunk/Modules/socketmodule.c Thu Feb 12 00:45:25 2009 @@ -3769,8 +3769,11 @@ #endif #if !defined(HAVE_INET_ATON) || defined(USE_INET_ATON_WEAKLINK) +#if (SIZEOF_INT != 4) +#error "Not sure if in_addr_t exists and int is not 32-bits." +#endif /* Have to use inet_addr() instead */ - unsigned long packed_addr; + unsigned int packed_addr; #endif char *ip_addr; @@ -5305,7 +5308,10 @@ inet_pton(int af, const char *src, void *dst) { if (af == AF_INET) { - long packed_addr; +#if (SIZEOF_INT != 4) +#error "Not sure if in_addr_t exists and int is not 32-bits." +#endif + unsigned int packed_addr; packed_addr = inet_addr(src); if (packed_addr == INADDR_NONE) return 0; From buildbot at python.org Thu Feb 12 01:12:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 00:12:30 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090212001230.A07641E400C@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/858 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_urllib2 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Feb 12 02:24:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 01:24:30 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian 3.x Message-ID: <20090212012430.4C7171E4002@bag.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/52 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,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_unicode make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Feb 12 04:50:00 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 12 Feb 2009 04:50:00 +0100 (CET) Subject: [Python-checkins] r69520 - python/trunk/Doc/library/stdtypes.rst Message-ID: <20090212035000.C04041E4002@bag.python.org> Author: benjamin.peterson Date: Thu Feb 12 04:50:00 2009 New Revision: 69520 Log: os.fsync() should be used to ensure that data is written to disk 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 Thu Feb 12 04:50:00 2009 @@ -2110,6 +2110,11 @@ Flush the internal buffer, like ``stdio``'s :cfunc:`fflush`. This may be a no-op on some file-like objects. + .. note:: + + :meth:`flush` does not necessarily write the file's data to disk. Use + :meth:`flush` followed by :func:`os.fsync` to ensure this behavior. + .. method:: file.fileno() From python-checkins at python.org Thu Feb 12 05:17:05 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 12 Feb 2009 05:17:05 +0100 (CET) Subject: [Python-checkins] r69521 - python/trunk/Lib/urllib2.py Message-ID: <20090212041705.441E51E4002@bag.python.org> Author: benjamin.peterson Date: Thu Feb 12 05:17:04 2009 New Revision: 69521 Log: no need for this __bases__ trick anymore Modified: python/trunk/Lib/urllib2.py Modified: python/trunk/Lib/urllib2.py ============================================================================== --- python/trunk/Lib/urllib2.py (original) +++ python/trunk/Lib/urllib2.py Thu Feb 12 05:17:04 2009 @@ -441,7 +441,7 @@ """ import types def isclass(obj): - return isinstance(obj, types.ClassType) or hasattr(obj, "__bases__") + return isinstance(obj, (types.ClassType, type)) opener = OpenerDirector() default_classes = [ProxyHandler, UnknownHandler, HTTPHandler, From python-checkins at python.org Thu Feb 12 06:39:47 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 12 Feb 2009 06:39:47 +0100 (CET) Subject: [Python-checkins] r69522 - in python/trunk: Doc/library/itertools.rst Lib/test/test_itertools.py Misc/NEWS Modules/itertoolsmodule.c Message-ID: <20090212053947.2CA951E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 12 06:39:46 2009 New Revision: 69522 Log: Issue 5032: added a step argument to itertools.count() and allowed non-integer arguments. Modified: python/trunk/Doc/library/itertools.rst python/trunk/Lib/test/test_itertools.py python/trunk/Misc/NEWS python/trunk/Modules/itertoolsmodule.c Modified: python/trunk/Doc/library/itertools.rst ============================================================================== --- python/trunk/Doc/library/itertools.rst (original) +++ python/trunk/Doc/library/itertools.rst Thu Feb 12 06:39:46 2009 @@ -200,20 +200,23 @@ .. versionadded:: 2.7 -.. function:: count([n]) +.. function:: count(n=0, step=1) - Make an iterator that returns consecutive integers starting with *n*. If not - specified *n* defaults to zero. Often used as an argument to :func:`imap` to - generate consecutive data points. Also, used with :func:`izip` to add sequence - numbers. Equivalent to:: + Make an iterator that returns evenly spaced values starting with *n*. Often + used as an argument to :func:`imap` to generate consecutive data points. + Also, used with :func:`izip` to add sequence numbers. Equivalent to:: - def count(n=0): + def count(n=0, step=1): # count(10) --> 10 11 12 13 14 ... + # count(2.5, 0.5) -> 3.5 3.0 4.5 ... while True: yield n - n += 1 + n += step + .. versionchanged:: 2.7 + added *step* argument and allowed non-integer arguments. + .. function:: cycle(iterable) Make an iterator returning elements from the iterable and saving a copy of each. Modified: python/trunk/Lib/test/test_itertools.py ============================================================================== --- python/trunk/Lib/test/test_itertools.py (original) +++ python/trunk/Lib/test/test_itertools.py Thu Feb 12 06:39:46 2009 @@ -324,7 +324,7 @@ self.assertEqual(take(2, zip('abc',count(3))), [('a', 3), ('b', 4)]) self.assertEqual(take(2, zip('abc',count(-1))), [('a', -1), ('b', 0)]) self.assertEqual(take(2, zip('abc',count(-3))), [('a', -3), ('b', -2)]) - self.assertRaises(TypeError, count, 2, 3) + self.assertRaises(TypeError, count, 2, 3, 4) self.assertRaises(TypeError, count, 'a') self.assertEqual(list(islice(count(maxsize-5), 10)), range(maxsize-5, maxsize+5)) self.assertEqual(list(islice(count(-maxsize-5), 10)), range(-maxsize-5, -maxsize+5)) @@ -335,6 +335,7 @@ c = count(-9) self.assertEqual(repr(c), 'count(-9)') c.next() + self.assertEqual(repr(count(10.25)), 'count(10.25)') self.assertEqual(c.next(), -8) for i in (-sys.maxint-5, -sys.maxint+5 ,-10, -1, 0, 10, sys.maxint-5, sys.maxint+5): # Test repr (ignoring the L in longs) @@ -342,6 +343,40 @@ r2 = 'count(%r)'.__mod__(i).replace('L', '') self.assertEqual(r1, r2) + def test_count_with_stride(self): + self.assertEqual(zip('abc',count(2,3)), [('a', 2), ('b', 5), ('c', 8)]) + self.assertEqual(zip('abc',count(2,0)), [('a', 2), ('b', 2), ('c', 2)]) + self.assertEqual(zip('abc',count(2,1)), [('a', 2), ('b', 3), ('c', 4)]) + self.assertEqual(take(20, count(maxsize-15, 3)), take(20, range(maxsize-15, maxsize+100, 3))) + self.assertEqual(take(20, count(-maxsize-15, 3)), take(20, range(-maxsize-15,-maxsize+100, 3))) + self.assertEqual(take(3, count(2, 3.25-4j)), [2, 5.25-4j, 8.5-8j]) + self.assertEqual(repr(take(3, count(10, 2.5))), repr([10, 12.5, 15.0])) + c = count(3, 5) + self.assertEqual(repr(c), 'count(3, 5)') + c.next() + self.assertEqual(repr(c), 'count(8, 5)') + c = count(-9, 0) + self.assertEqual(repr(c), 'count(-9, 0)') + c.next() + self.assertEqual(repr(c), 'count(-9, 0)') + c = count(-9, -3) + self.assertEqual(repr(c), 'count(-9, -3)') + c.next() + self.assertEqual(repr(c), 'count(-12, -3)') + self.assertEqual(repr(c), 'count(-12, -3)') + self.assertEqual(repr(count(10.5, 1.25)), 'count(10.5, 1.25)') + self.assertEqual(repr(count(10.5, 1)), 'count(10.5)') # suppress step=1 when it's an int + self.assertEqual(repr(count(10.5, 1.00)), 'count(10.5, 1.0)') # do show float values lilke 1.0 + for i in (-sys.maxint-5, -sys.maxint+5 ,-10, -1, 0, 10, sys.maxint-5, sys.maxint+5): + for j in (-sys.maxint-5, -sys.maxint+5 ,-10, -1, 0, 1, 10, sys.maxint-5, sys.maxint+5): + # Test repr (ignoring the L in longs) + r1 = repr(count(i, j)).replace('L', '') + if j == 1: + r2 = ('count(%r)' % i).replace('L', '') + else: + r2 = ('count(%r, %r)' % (i, j)).replace('L', '') + self.assertEqual(r1, r2) + def test_cycle(self): self.assertEqual(take(10, cycle('abc')), list('abcabcabca')) self.assertEqual(list(cycle('')), []) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Feb 12 06:39:46 2009 @@ -227,6 +227,9 @@ - Added a new itertools functions: combinations_with_replacement() and compress(). +- Issue 5032: added a step argument to itertools.count() and + allowed non-integer arguments. + - Fix and properly document the multiprocessing module's logging support, expose the internal levels and provide proper usage examples. Modified: python/trunk/Modules/itertoolsmodule.c ============================================================================== --- python/trunk/Modules/itertoolsmodule.c (original) +++ python/trunk/Modules/itertoolsmodule.c Thu Feb 12 06:39:46 2009 @@ -3203,9 +3203,27 @@ typedef struct { PyObject_HEAD Py_ssize_t cnt; - PyObject *long_cnt; /* Arbitrarily large count when cnt >= PY_SSIZE_T_MAX */ + PyObject *long_cnt; + PyObject *long_step; } countobject; +/* Counting logic and invariants: + +C_add_mode: when cnt an integer < PY_SSIZE_T_MAX and no step is specified. + + assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL && long_step==PyInt(1)); + Advances with: cnt += 1 + When count hits Y_SSIZE_T_MAX, switch to Py_add_mode. + +Py_add_mode: when cnt == PY_SSIZE_T_MAX, step is not int(1), or cnt is a float. + + assert(cnt == PY_SSIZE_T_MAX && long_cnt != NULL && long_step != NULL); + All counting is done with python objects (no overflows or underflows). + Advances with: long_cnt += long_step + Step may be zero -- effectively a slow version of repeat(cnt). + Either long_cnt or long_step may be a float. +*/ + static PyTypeObject count_type; static PyObject * @@ -3213,28 +3231,45 @@ { countobject *lz; Py_ssize_t cnt = 0; - PyObject *cnt_arg = NULL; PyObject *long_cnt = NULL; + PyObject *long_step = NULL; if (type == &count_type && !_PyArg_NoKeywords("count()", kwds)) return NULL; - if (!PyArg_UnpackTuple(args, "count", 0, 1, &cnt_arg)) + if (!PyArg_UnpackTuple(args, "count", 0, 2, &long_cnt, &long_step)) return NULL; - if (cnt_arg != NULL) { - cnt = PyInt_AsSsize_t(cnt_arg); - if (cnt == -1 && PyErr_Occurred()) { + if (long_cnt != NULL && !PyNumber_Check(long_cnt) || + long_step != NULL && !PyNumber_Check(long_step)) { + PyErr_SetString(PyExc_TypeError, "a number is required"); + return NULL; + } + + if (long_step == NULL) { + /* If not specified, step defaults to 1 */ + long_step = PyInt_FromLong(1); + if (long_step == NULL) + return NULL; + } else + Py_INCREF(long_step); + assert(long_step != NULL); + + if (long_cnt != NULL) { + cnt = PyInt_AsSsize_t(long_cnt); + if ((cnt == -1 && PyErr_Occurred()) || + !PyIndex_Check(long_cnt) || + !PyInt_Check(long_step) || + PyInt_AS_LONG(long_step) != 1) { + /* Switch to Py_add_mode */ PyErr_Clear(); - if (!PyLong_Check(cnt_arg)) { - PyErr_SetString(PyExc_TypeError, "an integer is required"); - return NULL; - } - long_cnt = cnt_arg; Py_INCREF(long_cnt); cnt = PY_SSIZE_T_MAX; - } + } else + long_cnt = NULL; } + assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL || + cnt == PY_SSIZE_T_MAX && long_cnt != NULL); /* create countobject structure */ lz = (countobject *)PyObject_New(countobject, &count_type); @@ -3244,6 +3279,7 @@ } lz->cnt = cnt; lz->long_cnt = long_cnt; + lz->long_step = long_step; return (PyObject *)lz; } @@ -3251,7 +3287,8 @@ static void count_dealloc(countobject *lz) { - Py_XDECREF(lz->long_cnt); + Py_XDECREF(lz->long_cnt); + Py_XDECREF(lz->long_step); PyObject_Del(lz); } @@ -3259,32 +3296,29 @@ count_nextlong(countobject *lz) { static PyObject *one = NULL; - PyObject *cnt; + PyObject *long_cnt; PyObject *stepped_up; - if (lz->long_cnt == NULL) { - lz->long_cnt = PyInt_FromSsize_t(PY_SSIZE_T_MAX); - if (lz->long_cnt == NULL) - return NULL; - } - if (one == NULL) { - one = PyInt_FromLong(1); - if (one == NULL) + long_cnt = lz->long_cnt; + if (long_cnt == NULL) { + /* Switch to Py_add_mode */ + long_cnt = PyInt_FromSsize_t(PY_SSIZE_T_MAX); + if (long_cnt == NULL) return NULL; } - cnt = lz->long_cnt; - assert(cnt != NULL); - stepped_up = PyNumber_Add(cnt, one); + assert(lz->cnt == PY_SSIZE_T_MAX && long_cnt != NULL); + + stepped_up = PyNumber_Add(long_cnt, lz->long_step); if (stepped_up == NULL) return NULL; lz->long_cnt = stepped_up; - return cnt; + return long_cnt; } static PyObject * count_next(countobject *lz) { - if (lz->cnt == PY_SSIZE_T_MAX) + if (lz->cnt == PY_SSIZE_T_MAX) return count_nextlong(lz); return PyInt_FromSsize_t(lz->cnt++); } @@ -3292,25 +3326,44 @@ static PyObject * count_repr(countobject *lz) { - PyObject *cnt_repr; - PyObject *result; + PyObject *cnt_repr, *step_repr = NULL; + PyObject *result = NULL; - if (lz->cnt != PY_SSIZE_T_MAX) + if (lz->cnt != PY_SSIZE_T_MAX) return PyString_FromFormat("count(%zd)", lz->cnt); cnt_repr = PyObject_Repr(lz->long_cnt); if (cnt_repr == NULL) return NULL; - result = PyString_FromFormat("count(%s)", PyString_AS_STRING(cnt_repr)); + + if (PyInt_Check(lz->long_step) && PyInt_AS_LONG(lz->long_step) == 1) { + /* Don't display step when it is an integer equal to 1 */ + result = PyString_FromFormat("count(%s)", + PyString_AS_STRING(cnt_repr)); + } else { + step_repr = PyObject_Repr(lz->long_step); + if (step_repr != NULL) + result = PyString_FromFormat("count(%s, %s)", + PyString_AS_STRING(cnt_repr), + PyString_AS_STRING(step_repr)); + } Py_DECREF(cnt_repr); + Py_XDECREF(step_repr); return result; } PyDoc_STRVAR(count_doc, -"count([firstval]) --> count object\n\ + "count([firstval[, step]]) --> count object\n\ \n\ Return a count object whose .next() method returns consecutive\n\ -integers starting from zero or, if specified, from firstval."); +integers starting from zero or, if specified, from firstval.\n\ +If step is specified, counts by that interval.\n\ +Same as:\n\ + def count(firstval=0, step=1):\n\ + x = firstval\n\ + while 1:\n\ + yield x\n\ + x += step\n"); static PyTypeObject count_type = { PyVarObject_HEAD_INIT(NULL, 0) From python-checkins at python.org Thu Feb 12 07:28:28 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 12 Feb 2009 07:28:28 +0100 (CET) Subject: [Python-checkins] r69523 - in python/branches/py3k: Doc/library/itertools.rst Lib/test/test_itertools.py Misc/NEWS Modules/itertoolsmodule.c Message-ID: <20090212062828.3622B1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 12 07:28:27 2009 New Revision: 69523 Log: Issue 5032: added a step argument to itertools.count() and allowed non-integer arguments. Modified: python/branches/py3k/Doc/library/itertools.rst python/branches/py3k/Lib/test/test_itertools.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/itertoolsmodule.c Modified: python/branches/py3k/Doc/library/itertools.rst ============================================================================== --- python/branches/py3k/Doc/library/itertools.rst (original) +++ python/branches/py3k/Doc/library/itertools.rst Thu Feb 12 07:28:27 2009 @@ -178,7 +178,7 @@ The number of items returned is ``(n+r-1)! / r! / (n-1)!`` when ``n > 0``. - .. versionadded:: 2.7 + .. versionadded:: 3.1 .. function:: compress(data, selectors) @@ -191,22 +191,24 @@ # compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F return (d for d, s in zip(data, selectors) if s) - .. versionadded:: 2.7 + .. versionadded:: 3.1 -.. function:: count([n]) +.. function:: count(n=0, step=1) - Make an iterator that returns consecutive integers starting with *n*. If not - specified *n* defaults to zero. Often used as an argument to :func:`map` to - generate consecutive data points. Also, used with :func:`zip` to add sequence - numbers. Equivalent to:: + Make an iterator that returns evenly spaced values starting with *n*. Often + used as an argument to :func:`map` to generate consecutive data points. + Also, used with :func:`zip` to add sequence numbers. Equivalent to:: - def count(n=0): + def count(n=0, step=1): # count(10) --> 10 11 12 13 14 ... + # count(2.5, 0.5) -> 3.5 3.0 4.5 ... while True: yield n - n += 1 + n += step + .. versionchanged:: 3.1 + added *step* argument and allowed non-integer arguments. .. function:: cycle(iterable) Modified: python/branches/py3k/Lib/test/test_itertools.py ============================================================================== --- python/branches/py3k/Lib/test/test_itertools.py (original) +++ python/branches/py3k/Lib/test/test_itertools.py Thu Feb 12 07:28:27 2009 @@ -328,7 +328,7 @@ self.assertEqual(take(2, lzip('abc',count(3))), [('a', 3), ('b', 4)]) self.assertEqual(take(2, zip('abc',count(-1))), [('a', -1), ('b', 0)]) self.assertEqual(take(2, zip('abc',count(-3))), [('a', -3), ('b', -2)]) - self.assertRaises(TypeError, count, 2, 3) + self.assertRaises(TypeError, count, 2, 3, 4) self.assertRaises(TypeError, count, 'a') self.assertEqual(list(islice(count(maxsize-5), 10)), list(range(maxsize-5, maxsize+5))) @@ -341,6 +341,7 @@ c = count(-9) self.assertEqual(repr(c), 'count(-9)') next(c) + self.assertEqual(repr(count(10.25)), 'count(10.25)') self.assertEqual(next(c), -8) for i in (-sys.maxsize-5, -sys.maxsize+5 ,-10, -1, 0, 10, sys.maxsize-5, sys.maxsize+5): # Test repr (ignoring the L in longs) @@ -348,6 +349,40 @@ r2 = 'count(%r)'.__mod__(i).replace('L', '') self.assertEqual(r1, r2) + def test_count_with_stride(self): + self.assertEqual(lzip('abc',count(2,3)), [('a', 2), ('b', 5), ('c', 8)]) + self.assertEqual(lzip('abc',count(2,0)), [('a', 2), ('b', 2), ('c', 2)]) + self.assertEqual(lzip('abc',count(2,1)), [('a', 2), ('b', 3), ('c', 4)]) + self.assertEqual(take(20, count(maxsize-15, 3)), take(20, range(maxsize-15, maxsize+100, 3))) + self.assertEqual(take(20, count(-maxsize-15, 3)), take(20, range(-maxsize-15,-maxsize+100, 3))) + self.assertEqual(take(3, count(2, 3.25-4j)), [2, 5.25-4j, 8.5-8j]) + self.assertEqual(repr(take(3, count(10, 2.5))), repr([10, 12.5, 15.0])) + c = count(3, 5) + self.assertEqual(repr(c), 'count(3, 5)') + next(c) + self.assertEqual(repr(c), 'count(8, 5)') + c = count(-9, 0) + self.assertEqual(repr(c), 'count(-9, 0)') + next(c) + self.assertEqual(repr(c), 'count(-9, 0)') + c = count(-9, -3) + self.assertEqual(repr(c), 'count(-9, -3)') + next(c) + self.assertEqual(repr(c), 'count(-12, -3)') + self.assertEqual(repr(c), 'count(-12, -3)') + self.assertEqual(repr(count(10.5, 1.25)), 'count(10.5, 1.25)') + self.assertEqual(repr(count(10.5, 1)), 'count(10.5)') # suppress step=1 when it's an int + self.assertEqual(repr(count(10.5, 1.00)), 'count(10.5, 1.0)') # do show float values lilke 1.0 + for i in (-sys.maxsize-5, -sys.maxsize+5 ,-10, -1, 0, 10, sys.maxsize-5, sys.maxsize+5): + for j in (-sys.maxsize-5, -sys.maxsize+5 ,-10, -1, 0, 1, 10, sys.maxsize-5, sys.maxsize+5): + # Test repr (ignoring the L in longs) + r1 = repr(count(i, j)).replace('L', '') + if j == 1: + r2 = ('count(%r)' % i).replace('L', '') + else: + r2 = ('count(%r, %r)' % (i, j)).replace('L', '') + self.assertEqual(r1, r2) + def test_cycle(self): self.assertEqual(take(10, cycle('abc')), list('abcabcabca')) self.assertEqual(list(cycle('')), []) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu Feb 12 07:28:27 2009 @@ -241,6 +241,9 @@ - Added a new itertools functions: combinations_with_replacement() and compress(). +- Issue 5032: added a step argument to itertools.count() and + allowed non-integer arguments. + - Fix and properly document the multiprocessing module's logging support, expose the internal levels and provide proper usage examples. Modified: python/branches/py3k/Modules/itertoolsmodule.c ============================================================================== --- python/branches/py3k/Modules/itertoolsmodule.c (original) +++ python/branches/py3k/Modules/itertoolsmodule.c Thu Feb 12 07:28:27 2009 @@ -2886,9 +2886,27 @@ typedef struct { PyObject_HEAD Py_ssize_t cnt; - PyObject *long_cnt; /* Arbitrarily large count when cnt >= PY_SSIZE_T_MAX */ + PyObject *long_cnt; + PyObject *long_step; } countobject; +/* Counting logic and invariants: + +C_add_mode: when cnt an integer < PY_SSIZE_T_MAX and no step is specified. + + assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL && long_step==PyInt(1)); + Advances with: cnt += 1 + When count hits Y_SSIZE_T_MAX, switch to Py_add_mode. + +Py_add_mode: when cnt == PY_SSIZE_T_MAX, step is not int(1), or cnt is a float. + + assert(cnt == PY_SSIZE_T_MAX && long_cnt != NULL && long_step != NULL); + All counting is done with python objects (no overflows or underflows). + Advances with: long_cnt += long_step + Step may be zero -- effectively a slow version of repeat(cnt). + Either long_cnt or long_step may be a float. +*/ + static PyTypeObject count_type; static PyObject * @@ -2896,28 +2914,45 @@ { countobject *lz; Py_ssize_t cnt = 0; - PyObject *cnt_arg = NULL; PyObject *long_cnt = NULL; + PyObject *long_step = NULL; if (type == &count_type && !_PyArg_NoKeywords("count()", kwds)) return NULL; - if (!PyArg_UnpackTuple(args, "count", 0, 1, &cnt_arg)) + if (!PyArg_UnpackTuple(args, "count", 0, 2, &long_cnt, &long_step)) return NULL; - if (cnt_arg != NULL) { - cnt = PyLong_AsSsize_t(cnt_arg); - if (cnt == -1 && PyErr_Occurred()) { + if (long_cnt != NULL && !PyNumber_Check(long_cnt) || + long_step != NULL && !PyNumber_Check(long_step)) { + PyErr_SetString(PyExc_TypeError, "a number is required"); + return NULL; + } + + if (long_step == NULL) { + /* If not specified, step defaults to 1 */ + long_step = PyLong_FromLong(1); + if (long_step == NULL) + return NULL; + } else + Py_INCREF(long_step); + assert(long_step != NULL); + + if (long_cnt != NULL) { + cnt = PyLong_AsSsize_t(long_cnt); + if ((cnt == -1 && PyErr_Occurred()) || + !PyIndex_Check(long_cnt) || + !PyLong_Check(long_step) || + PyLong_AS_LONG(long_step) != 1) { + /* Switch to Py_add_mode */ PyErr_Clear(); - if (!PyLong_Check(cnt_arg)) { - PyErr_SetString(PyExc_TypeError, "an integer is required"); - return NULL; - } - long_cnt = cnt_arg; Py_INCREF(long_cnt); cnt = PY_SSIZE_T_MAX; - } + } else + long_cnt = NULL; } + assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL || + cnt == PY_SSIZE_T_MAX && long_cnt != NULL); /* create countobject structure */ lz = (countobject *)PyObject_New(countobject, &count_type); @@ -2927,6 +2962,7 @@ } lz->cnt = cnt; lz->long_cnt = long_cnt; + lz->long_step = long_step; return (PyObject *)lz; } @@ -2934,7 +2970,8 @@ static void count_dealloc(countobject *lz) { - Py_XDECREF(lz->long_cnt); + Py_XDECREF(lz->long_cnt); + Py_XDECREF(lz->long_step); PyObject_Del(lz); } @@ -2942,32 +2979,29 @@ count_nextlong(countobject *lz) { static PyObject *one = NULL; - PyObject *cnt; + PyObject *long_cnt; PyObject *stepped_up; - if (lz->long_cnt == NULL) { - lz->long_cnt = PyLong_FromSsize_t(PY_SSIZE_T_MAX); - if (lz->long_cnt == NULL) + long_cnt = lz->long_cnt; + if (long_cnt == NULL) { + /* Switch to Py_add_mode */ + long_cnt = PyLong_FromSsize_t(PY_SSIZE_T_MAX); + if (long_cnt == NULL) return NULL; } - if (one == NULL) { - one = PyLong_FromLong(1); - if (one == NULL) - return NULL; - } - cnt = lz->long_cnt; - assert(cnt != NULL); - stepped_up = PyNumber_Add(cnt, one); + assert(lz->cnt == PY_SSIZE_T_MAX && long_cnt != NULL); + + stepped_up = PyNumber_Add(long_cnt, lz->long_step); if (stepped_up == NULL) return NULL; lz->long_cnt = stepped_up; - return cnt; + return long_cnt; } static PyObject * count_next(countobject *lz) { - if (lz->cnt == PY_SSIZE_T_MAX) + if (lz->cnt == PY_SSIZE_T_MAX) return count_nextlong(lz); return PyLong_FromSsize_t(lz->cnt++); } @@ -2975,17 +3009,35 @@ static PyObject * count_repr(countobject *lz) { - if (lz->cnt != PY_SSIZE_T_MAX) + if (lz->cnt != PY_SSIZE_T_MAX) return PyUnicode_FromFormat("count(%zd)", lz->cnt); - return PyUnicode_FromFormat("count(%R)", lz->long_cnt); + if (PyLong_Check(lz->long_step)) { + long step = PyLong_AsLong(lz->long_step); + if (step == -1 && PyErr_Occurred()) { + PyErr_Clear(); + } + if (step == 1) { + /* Don't display step when it is an integer equal to 1 */ + return PyUnicode_FromFormat("count(%R)", lz->long_cnt); + } + } + return PyUnicode_FromFormat("count(%R, %R)", + lz->long_cnt, lz->long_step); } PyDoc_STRVAR(count_doc, -"count([firstval]) --> count object\n\ + "count([firstval[, step]]) --> count object\n\ \n\ Return a count object whose .__next__() method returns consecutive\n\ -integers starting from zero or, if specified, from firstval."); +integers starting from zero or, if specified, from firstval.\n\ +If step is specified, counts by that interval.\n\ +Same as:\n\ + def count(firstval=0, step=1):\n\ + x = firstval\n\ + while 1:\n\ + yield x\n\ + x += step\n"); static PyTypeObject count_type = { PyVarObject_HEAD_INIT(NULL, 0) From buildbot at python.org Thu Feb 12 07:44:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 06:44:41 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 trunk Message-ID: <20090212064441.987801E4002@bag.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/1854 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: 1 test failed: test_bsddb3 ====================================================================== ERROR: test01_badpointer (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.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\trunk.bolen-windows\build\lib\bsddb\dbshelve.py", line 106, in open d.open(filename, dbname, filetype, flags, mode) File "E:\cygwin\home\db3l\buildarea\trunk.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\trunk.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\trunk.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\trunk.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\trunk.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\trunk.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\trunk.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\trunk.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\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 osx.5 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%203.x/builds/315 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_calendar test_email test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Feb 12 08:14:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 07:14:37 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090212071437.AFA251E4002@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/269 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: 2 tests failed: test_httpservers 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 Thu Feb 12 08:35:30 2009 From: python-checkins at python.org (gregory.p.smith) Date: Thu, 12 Feb 2009 08:35:30 +0100 (CET) Subject: [Python-checkins] r69524 - in python/branches/py3k: Lib/test/test_hashlib.py Misc/NEWS Modules/_hashopenssl.c Modules/hashlib.h Modules/md5module.c Modules/sha1module.c Modules/sha256module.c Modules/sha512module.c Message-ID: <20090212073530.3D7E01E4002@bag.python.org> Author: gregory.p.smith Date: Thu Feb 12 08:35:29 2009 New Revision: 69524 Log: Fixes 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). Added: python/branches/py3k/Modules/hashlib.h Modified: python/branches/py3k/Lib/test/test_hashlib.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_hashopenssl.c python/branches/py3k/Modules/md5module.c python/branches/py3k/Modules/sha1module.c python/branches/py3k/Modules/sha256module.c python/branches/py3k/Modules/sha512module.c 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 Thu Feb 12 08:35:29 2009 @@ -63,6 +63,18 @@ computed = hashlib.new(name, data).hexdigest() self.assertEqual(computed, digest) + def check_no_unicode(self, algorithm_name): + # Unicode objects are not allowed as input. + self.assertRaises(TypeError, getattr(hashlib, algorithm_name), 'spam') + self.assertRaises(TypeError, hashlib.new, algorithm_name, 'spam') + + def test_no_unicode(self): + self.check_no_unicode('md5') + self.check_no_unicode('sha1') + self.check_no_unicode('sha224') + self.check_no_unicode('sha256') + self.check_no_unicode('sha384') + self.check_no_unicode('sha512') def test_case_md5_0(self): self.check('md5', b'', 'd41d8cd98f00b204e9800998ecf8427e') Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu Feb 12 08:35:29 2009 @@ -491,6 +491,10 @@ Extension Modules ----------------- +- 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). + - Issue #4397: Fix occasional test_socket failure on OS X. - Issue #4279: Fix build of parsermodule under Cygwin. Modified: python/branches/py3k/Modules/_hashopenssl.c ============================================================================== --- python/branches/py3k/Modules/_hashopenssl.c (original) +++ python/branches/py3k/Modules/_hashopenssl.c Thu Feb 12 08:35:29 2009 @@ -15,6 +15,7 @@ #include "Python.h" #include "structmember.h" +#include "hashlib.h" /* EVP is the preferred interface to hashing in OpenSSL */ #include @@ -203,28 +204,6 @@ return retval; } -#define MY_GET_BUFFER_VIEW_OR_ERROUT(obj, viewp) do { \ - if (PyUnicode_Check((obj))) { \ - PyErr_SetString(PyExc_TypeError, \ - "Unicode-objects must be encoded before hashing");\ - return NULL; \ - } \ - if (!PyObject_CheckBuffer((obj))) { \ - PyErr_SetString(PyExc_TypeError, \ - "object supporting the buffer API required"); \ - return NULL; \ - } \ - if (PyObject_GetBuffer((obj), (viewp), PyBUF_SIMPLE) == -1) { \ - return NULL; \ - } \ - if ((viewp)->ndim > 1) { \ - PyErr_SetString(PyExc_BufferError, \ - "Buffer must be single dimension"); \ - PyBuffer_Release((viewp)); \ - return NULL; \ - } \ - } while(0); - PyDoc_STRVAR(EVP_update__doc__, "Update this hash object's state with the provided string."); @@ -237,7 +216,7 @@ if (!PyArg_ParseTuple(args, "O:update", &obj)) return NULL; - MY_GET_BUFFER_VIEW_OR_ERROUT(obj, &view); + GET_BUFFER_VIEW_OR_ERROUT(obj, &view); #ifdef WITH_THREAD if (self->lock == NULL && view.len >= HASHLIB_GIL_MINSIZE) { @@ -344,7 +323,7 @@ } if (data_obj) - MY_GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); if (!PyArg_Parse(name_obj, "s", &nameStr)) { PyErr_SetString(PyExc_TypeError, "name must be a string"); @@ -507,7 +486,7 @@ } if (data_obj) - MY_GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); digest = EVP_get_digestbyname(name); @@ -538,7 +517,7 @@ } \ \ if (data_obj) \ - MY_GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); \ + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); \ \ ret_obj = EVPnew( \ CONST_ ## NAME ## _name_obj, \ Added: python/branches/py3k/Modules/hashlib.h ============================================================================== --- (empty file) +++ python/branches/py3k/Modules/hashlib.h Thu Feb 12 08:35:29 2009 @@ -0,0 +1,28 @@ +/* Common code for use by all hashlib related modules. */ + +/* + * Given a PyObject* obj, fill in the Py_buffer* viewp with the result + * of PyObject_GetBuffer. Sets and exception and issues a return NULL + * on any errors. + */ +#define GET_BUFFER_VIEW_OR_ERROUT(obj, viewp) do { \ + if (PyUnicode_Check((obj))) { \ + PyErr_SetString(PyExc_TypeError, \ + "Unicode-objects must be encoded before hashing");\ + return NULL; \ + } \ + if (!PyObject_CheckBuffer((obj))) { \ + PyErr_SetString(PyExc_TypeError, \ + "object supporting the buffer API required"); \ + return NULL; \ + } \ + if (PyObject_GetBuffer((obj), (viewp), PyBUF_SIMPLE) == -1) { \ + return NULL; \ + } \ + if ((viewp)->ndim > 1) { \ + PyErr_SetString(PyExc_BufferError, \ + "Buffer must be single dimension"); \ + PyBuffer_Release((viewp)); \ + return NULL; \ + } \ + } while(0); Modified: python/branches/py3k/Modules/md5module.c ============================================================================== --- python/branches/py3k/Modules/md5module.c (original) +++ python/branches/py3k/Modules/md5module.c Thu Feb 12 08:35:29 2009 @@ -17,6 +17,7 @@ /* MD5 objects */ #include "Python.h" +#include "hashlib.h" /* Some useful types */ @@ -411,11 +412,14 @@ static PyObject * MD5_update(MD5object *self, PyObject *args) { + PyObject *obj; Py_buffer buf; - if (!PyArg_ParseTuple(args, "s*:update", &buf)) + if (!PyArg_ParseTuple(args, "O:update", &obj)) return NULL; + GET_BUFFER_VIEW_OR_ERROUT(obj, &buf); + md5_process(&self->hash_state, buf.buf, buf.len); PyBuffer_Release(&buf); @@ -511,14 +515,17 @@ { static char *kwlist[] = {"string", NULL}; MD5object *new; + PyObject *data_obj = NULL; Py_buffer buf; - buf.buf = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s*:new", kwlist, - &buf)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf); + if ((new = newMD5object()) == NULL) return NULL; @@ -528,7 +535,7 @@ Py_DECREF(new); return NULL; } - if (buf.buf) { + if (data_obj) { md5_process(&new->hash_state, buf.buf, buf.len); PyBuffer_Release(&buf); } Modified: python/branches/py3k/Modules/sha1module.c ============================================================================== --- python/branches/py3k/Modules/sha1module.c (original) +++ python/branches/py3k/Modules/sha1module.c Thu Feb 12 08:35:29 2009 @@ -17,6 +17,7 @@ /* SHA1 objects */ #include "Python.h" +#include "hashlib.h" /* Some useful types */ @@ -387,11 +388,14 @@ static PyObject * SHA1_update(SHA1object *self, PyObject *args) { + PyObject *obj; Py_buffer buf; - if (!PyArg_ParseTuple(args, "s*:update", &buf)) + if (!PyArg_ParseTuple(args, "O:update", &obj)) return NULL; + GET_BUFFER_VIEW_OR_ERROUT(obj, &buf); + sha1_process(&self->hash_state, buf.buf, buf.len); PyBuffer_Release(&buf); @@ -487,14 +491,17 @@ { static char *kwlist[] = {"string", NULL}; SHA1object *new; + PyObject *data_obj = NULL; Py_buffer buf; - buf.buf = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s*:new", kwlist, - &buf)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf); + if ((new = newSHA1object()) == NULL) return NULL; @@ -504,7 +511,7 @@ Py_DECREF(new); return NULL; } - if (buf.buf) { + if (data_obj) { sha1_process(&new->hash_state, buf.buf, buf.len); PyBuffer_Release(&buf); } Modified: python/branches/py3k/Modules/sha256module.c ============================================================================== --- python/branches/py3k/Modules/sha256module.c (original) +++ python/branches/py3k/Modules/sha256module.c Thu Feb 12 08:35:29 2009 @@ -18,6 +18,7 @@ #include "Python.h" #include "structmember.h" +#include "hashlib.h" /* Endianness testing and definitions */ @@ -480,14 +481,17 @@ static PyObject * SHA256_update(SHAobject *self, PyObject *args) { - unsigned char *cp; - int len; + PyObject *obj; + Py_buffer buf; - if (!PyArg_ParseTuple(args, "s#:update", &cp, &len)) + if (!PyArg_ParseTuple(args, "O:update", &obj)) return NULL; - sha_update(self, cp, len); + GET_BUFFER_VIEW_OR_ERROUT(obj, &buf); + sha_update(self, buf.buf, buf.len); + + PyBuffer_Release(&buf); Py_INCREF(Py_None); return Py_None; } @@ -614,14 +618,17 @@ { static char *kwlist[] = {"string", NULL}; SHAobject *new; - unsigned char *cp = NULL; - int len; + PyObject *data_obj = NULL; + Py_buffer buf; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s#:new", kwlist, - &cp, &len)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf); + if ((new = newSHA256object()) == NULL) return NULL; @@ -631,8 +638,10 @@ Py_DECREF(new); return NULL; } - if (cp) - sha_update(new, cp, len); + if (data_obj) { + sha_update(new, buf.buf, buf.len); + PyBuffer_Release(&buf); + } return (PyObject *)new; } @@ -645,14 +654,17 @@ { static char *kwlist[] = {"string", NULL}; SHAobject *new; - unsigned char *cp = NULL; - int len; + PyObject *data_obj = NULL; + Py_buffer buf; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s#:new", kwlist, - &cp, &len)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf); + if ((new = newSHA224object()) == NULL) return NULL; @@ -662,8 +674,10 @@ Py_DECREF(new); return NULL; } - if (cp) - sha_update(new, cp, len); + if (data_obj) { + sha_update(new, buf.buf, buf.len); + PyBuffer_Release(&buf); + } return (PyObject *)new; } Modified: python/branches/py3k/Modules/sha512module.c ============================================================================== --- python/branches/py3k/Modules/sha512module.c (original) +++ python/branches/py3k/Modules/sha512module.c Thu Feb 12 08:35:29 2009 @@ -18,6 +18,7 @@ #include "Python.h" #include "structmember.h" +#include "hashlib.h" #ifdef PY_LONG_LONG /* If no PY_LONG_LONG, don't compile anything! */ @@ -546,14 +547,17 @@ static PyObject * SHA512_update(SHAobject *self, PyObject *args) { - unsigned char *cp; - int len; + PyObject *obj; + Py_buffer buf; - if (!PyArg_ParseTuple(args, "s#:update", &cp, &len)) + if (!PyArg_ParseTuple(args, "O:update", &obj)) return NULL; - sha512_update(self, cp, len); + GET_BUFFER_VIEW_OR_ERROUT(obj, &buf); + sha512_update(self, buf.buf, buf.len); + + PyBuffer_Release(&buf); Py_INCREF(Py_None); return Py_None; } @@ -680,14 +684,17 @@ { static char *kwlist[] = {"string", NULL}; SHAobject *new; - unsigned char *cp = NULL; - int len; + PyObject *data_obj = NULL; + Py_buffer buf; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s#:new", kwlist, - &cp, &len)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf); + if ((new = newSHA512object()) == NULL) return NULL; @@ -697,8 +704,10 @@ Py_DECREF(new); return NULL; } - if (cp) - sha512_update(new, cp, len); + if (data_obj) { + sha512_update(new, buf.buf, buf.len); + PyBuffer_Release(&buf); + } return (PyObject *)new; } @@ -711,14 +720,17 @@ { static char *kwlist[] = {"string", NULL}; SHAobject *new; - unsigned char *cp = NULL; - int len; + PyObject *data_obj = NULL; + Py_buffer buf; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s#:new", kwlist, - &cp, &len)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf); + if ((new = newSHA384object()) == NULL) return NULL; @@ -728,8 +740,10 @@ Py_DECREF(new); return NULL; } - if (cp) - sha512_update(new, cp, len); + if (data_obj) { + sha512_update(new, buf.buf, buf.len); + PyBuffer_Release(&buf); + } return (PyObject *)new; } From python-checkins at python.org Thu Feb 12 11:16:20 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 12 Feb 2009 11:16:20 +0100 (CET) Subject: [Python-checkins] r69525 - python/trunk/Modules/itertoolsmodule.c Message-ID: <20090212101620.33A9C1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 12 11:16:19 2009 New Revision: 69525 Log: Fix spaces/tabs in example. Modified: python/trunk/Modules/itertoolsmodule.c Modified: python/trunk/Modules/itertoolsmodule.c ============================================================================== --- python/trunk/Modules/itertoolsmodule.c (original) +++ python/trunk/Modules/itertoolsmodule.c Thu Feb 12 11:16:19 2009 @@ -3357,13 +3357,12 @@ \n\ Return a count object whose .next() method returns consecutive\n\ integers starting from zero or, if specified, from firstval.\n\ -If step is specified, counts by that interval.\n\ -Same as:\n\ +If step is specified, counts by that interval. Equivalent to:\n\n\ def count(firstval=0, step=1):\n\ x = firstval\n\ - while 1:\n\ + while 1:\n\ yield x\n\ - x += step\n"); + x += step\n"); static PyTypeObject count_type = { PyVarObject_HEAD_INIT(NULL, 0) From nnorwitz at gmail.com Thu Feb 12 11:18:54 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 12 Feb 2009 05:18:54 -0500 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090212101854.GA7075@python.psfb.org> More important issues: ---------------------- test_distutils leaked [103, 103, 103] references, sum=309 Less important issues: ---------------------- test_asynchat leaked [132, -132, 0] references, sum=0 test_cmd_line leaked [25, -25, 25] references, sum=25 test_smtplib leaked [4, -88, 74] references, sum=-10 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 From python-checkins at python.org Thu Feb 12 11:19:59 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 12 Feb 2009 11:19:59 +0100 (CET) Subject: [Python-checkins] r69526 - python/branches/py3k/Modules/itertoolsmodule.c Message-ID: <20090212101959.A803C1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 12 11:19:59 2009 New Revision: 69526 Log: Fix spaces/tabs in example. Modified: python/branches/py3k/Modules/itertoolsmodule.c Modified: python/branches/py3k/Modules/itertoolsmodule.c ============================================================================== --- python/branches/py3k/Modules/itertoolsmodule.c (original) +++ python/branches/py3k/Modules/itertoolsmodule.c Thu Feb 12 11:19:59 2009 @@ -3031,13 +3031,12 @@ \n\ Return a count object whose .__next__() method returns consecutive\n\ integers starting from zero or, if specified, from firstval.\n\ -If step is specified, counts by that interval.\n\ -Same as:\n\ +If step is specified, counts by that interval. Equivalent to:\n\n\ def count(firstval=0, step=1):\n\ x = firstval\n\ - while 1:\n\ + while 1:\n\ yield x\n\ - x += step\n"); + x += step\n"); static PyTypeObject count_type = { PyVarObject_HEAD_INIT(NULL, 0) From ncoghlan at gmail.com Thu Feb 12 12:01:37 2009 From: ncoghlan at gmail.com (Nick Coghlan) Date: Thu, 12 Feb 2009 21:01:37 +1000 Subject: [Python-checkins] r69522 - in python/trunk: Doc/library/itertools.rst Lib/test/test_itertools.py Misc/NEWS Modules/itertoolsmodule.c In-Reply-To: <20090212053947.2CA951E4002@bag.python.org> References: <20090212053947.2CA951E4002@bag.python.org> Message-ID: <49940191.7030700@gmail.com> raymond.hettinger wrote: > Modified: python/trunk/Doc/library/itertools.rst > ============================================================================== > --- python/trunk/Doc/library/itertools.rst (original) > +++ python/trunk/Doc/library/itertools.rst Thu Feb 12 06:39:46 2009 > @@ -200,20 +200,23 @@ > .. versionadded:: 2.7 > > > -.. function:: count([n]) > +.. function:: count(n=0, step=1) > > - Make an iterator that returns consecutive integers starting with *n*. If not > - specified *n* defaults to zero. Often used as an argument to :func:`imap` to > - generate consecutive data points. Also, used with :func:`izip` to add sequence > - numbers. Equivalent to:: > + Make an iterator that returns evenly spaced values starting with *n*. Often > + used as an argument to :func:`imap` to generate consecutive data points. > + Also, used with :func:`izip` to add sequence numbers. Equivalent to:: > > - def count(n=0): > + def count(n=0, step=1): > # count(10) --> 10 11 12 13 14 ... > + # count(2.5, 0.5) -> 3.5 3.0 4.5 ... Something appears to have gone a little wrong with the float example in that comment... Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- From python-checkins at python.org Thu Feb 12 12:05:02 2009 From: python-checkins at python.org (guilherme.polo) Date: Thu, 12 Feb 2009 12:05:02 +0100 (CET) Subject: [Python-checkins] r69527 - python/branches/release26-maint Message-ID: <20090212110502.C86191E4002@bag.python.org> Author: guilherme.polo Date: Thu Feb 12 12:05:02 2009 New Revision: 69527 Log: Blocked revisions 69460,69470 via svnmerge ........ r69460 | guilherme.polo | 2009-02-09 14:09:17 -0200 (Mon, 09 Feb 2009) | 1 line Turned setup_master public ........ r69470 | guilherme.polo | 2009-02-09 17:57:04 -0200 (Mon, 09 Feb 2009) | 1 line Checking for tk availability before continuing (basically the same that is done in test_ttk_guionly) ........ Modified: python/branches/release26-maint/ (props changed) From buildbot at python.org Thu Feb 12 12:32:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 11:32:57 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 2.6 Message-ID: <20090212113257.8B74B1E403A@bag.python.org> The Buildbot has detected a new failure of OS X x86 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%202.6/builds/68 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: guilherme.polo,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bz2 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Feb 12 12:57:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 11:57:37 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090212115737.E57FF1E403F@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/271 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: 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.x.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Thu Feb 12 13:04:26 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 12 Feb 2009 13:04:26 +0100 (CET) Subject: [Python-checkins] r69528 - python/trunk/Lib/test/test_itertools.py Message-ID: <20090212120426.7E70E1E4057@bag.python.org> Author: raymond.hettinger Date: Thu Feb 12 13:04:26 2009 New Revision: 69528 Log: Add an extra testcase. Modified: python/trunk/Lib/test/test_itertools.py Modified: python/trunk/Lib/test/test_itertools.py ============================================================================== --- python/trunk/Lib/test/test_itertools.py (original) +++ python/trunk/Lib/test/test_itertools.py Thu Feb 12 13:04:26 2009 @@ -2,6 +2,7 @@ from test import test_support from itertools import * from weakref import proxy +from decimal import Decimal import sys import operator import random @@ -350,6 +351,8 @@ self.assertEqual(take(20, count(maxsize-15, 3)), take(20, range(maxsize-15, maxsize+100, 3))) self.assertEqual(take(20, count(-maxsize-15, 3)), take(20, range(-maxsize-15,-maxsize+100, 3))) self.assertEqual(take(3, count(2, 3.25-4j)), [2, 5.25-4j, 8.5-8j]) + self.assertEqual(take(3, count(Decimal('1.1'), Decimal('.1'))), + [Decimal('1.1'), Decimal('1.2'), Decimal('1.3')]) self.assertEqual(repr(take(3, count(10, 2.5))), repr([10, 12.5, 15.0])) c = count(3, 5) self.assertEqual(repr(c), 'count(3, 5)') From python-checkins at python.org Thu Feb 12 13:08:18 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 12 Feb 2009 13:08:18 +0100 (CET) Subject: [Python-checkins] r69529 - python/branches/py3k/Lib/test/test_itertools.py Message-ID: <20090212120818.70AA71E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 12 13:08:18 2009 New Revision: 69529 Log: Add an extra testcase. Modified: python/branches/py3k/Lib/test/test_itertools.py Modified: python/branches/py3k/Lib/test/test_itertools.py ============================================================================== --- python/branches/py3k/Lib/test/test_itertools.py (original) +++ python/branches/py3k/Lib/test/test_itertools.py Thu Feb 12 13:08:18 2009 @@ -2,6 +2,7 @@ from test import support from itertools import * from weakref import proxy +from decimal import Decimal import sys import operator import random @@ -356,6 +357,8 @@ self.assertEqual(take(20, count(maxsize-15, 3)), take(20, range(maxsize-15, maxsize+100, 3))) self.assertEqual(take(20, count(-maxsize-15, 3)), take(20, range(-maxsize-15,-maxsize+100, 3))) self.assertEqual(take(3, count(2, 3.25-4j)), [2, 5.25-4j, 8.5-8j]) + self.assertEqual(take(3, count(Decimal('1.1'), Decimal('.1'))), + [Decimal('1.1'), Decimal('1.2'), Decimal('1.3')]) self.assertEqual(repr(take(3, count(10, 2.5))), repr([10, 12.5, 15.0])) c = count(3, 5) self.assertEqual(repr(c), 'count(3, 5)') From buildbot at python.org Thu Feb 12 13:14:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 12:14:00 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090212121400.B2D041E4002@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/116 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: guilherme.polo,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/test/test_ftplib.py", line 203, in run asyncore.loop(timeout=0.1, count=1) File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/asyncore.py", line 204, in loop poll_fun(timeout, map) File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/asyncore.py", line 141, in poll read(obj) File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/asyncore.py", line 78, in read obj.handle_error() File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/asyncore.py", line 74, in read obj.handle_read_event() File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/asyncore.py", line 413, in handle_read_event self.handle_read() File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/test/test_ssl.py", line 408, in handle_read self.send(data.lower()) File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/asyncore.py", line 519, in send self.initiate_send() File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/asyncore.py", line 506, in initiate_send num_sent = dispatcher.send(self, self.out_buffer[:512]) File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/asyncore.py", line 349, in send result = self.socket.send(data) File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/socket.py", line 165, in _dummy raise error(EBADF, 'Bad file descriptor') error: [Errno 9] Bad file descriptor 1 test failed: test_ftplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Feb 12 13:33:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 12:33:18 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090212123318.A64001E4002@bag.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/1853 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_timeout make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Feb 12 13:43:01 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 12 Feb 2009 13:43:01 +0100 (CET) Subject: [Python-checkins] r69530 - python/trunk/Lib/test/test_itertools.py Message-ID: <20090212124301.A18531E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 12 13:43:01 2009 New Revision: 69530 Log: One more test. Modified: python/trunk/Lib/test/test_itertools.py Modified: python/trunk/Lib/test/test_itertools.py ============================================================================== --- python/trunk/Lib/test/test_itertools.py (original) +++ python/trunk/Lib/test/test_itertools.py Thu Feb 12 13:43:01 2009 @@ -3,6 +3,7 @@ from itertools import * from weakref import proxy from decimal import Decimal +from fractions import Fraction import sys import operator import random @@ -353,6 +354,8 @@ self.assertEqual(take(3, count(2, 3.25-4j)), [2, 5.25-4j, 8.5-8j]) self.assertEqual(take(3, count(Decimal('1.1'), Decimal('.1'))), [Decimal('1.1'), Decimal('1.2'), Decimal('1.3')]) + self.assertEqual(take(3, count(Fraction(2,3), Fraction(1,7))), + [Fraction(2,3), Fraction(17,21), Fraction(20,21)]) self.assertEqual(repr(take(3, count(10, 2.5))), repr([10, 12.5, 15.0])) c = count(3, 5) self.assertEqual(repr(c), 'count(3, 5)') From python-checkins at python.org Thu Feb 12 13:53:53 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 12 Feb 2009 13:53:53 +0100 (CET) Subject: [Python-checkins] r69531 - python/branches/py3k/Lib/test/test_itertools.py Message-ID: <20090212125353.AB3871E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 12 13:53:53 2009 New Revision: 69531 Log: One more test. Modified: python/branches/py3k/Lib/test/test_itertools.py Modified: python/branches/py3k/Lib/test/test_itertools.py ============================================================================== --- python/branches/py3k/Lib/test/test_itertools.py (original) +++ python/branches/py3k/Lib/test/test_itertools.py Thu Feb 12 13:53:53 2009 @@ -3,6 +3,7 @@ from itertools import * from weakref import proxy from decimal import Decimal +from fractions import Fraction import sys import operator import random @@ -359,6 +360,8 @@ self.assertEqual(take(3, count(2, 3.25-4j)), [2, 5.25-4j, 8.5-8j]) self.assertEqual(take(3, count(Decimal('1.1'), Decimal('.1'))), [Decimal('1.1'), Decimal('1.2'), Decimal('1.3')]) + self.assertEqual(take(3, count(Fraction(2,3), Fraction(1,7))), + [Fraction(2,3), Fraction(17,21), Fraction(20,21)]) self.assertEqual(repr(take(3, count(10, 2.5))), repr([10, 12.5, 15.0])) c = count(3, 5) self.assertEqual(repr(c), 'count(3, 5)') From buildbot at python.org Thu Feb 12 14:28:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 13:28:26 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090212132826.7F3351E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/633 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_asynchat make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Feb 12 14:54:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 13:54:39 +0000 Subject: [Python-checkins] buildbot failure in x86 FreeBSD 2.6 Message-ID: <20090212135439.B59E11E4002@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/104 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: guilherme.polo,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Thu Feb 12 16:01:44 2009 From: python-checkins at python.org (ronald.oussoren) Date: Thu, 12 Feb 2009 16:01:44 +0100 (CET) Subject: [Python-checkins] r69532 - in python/branches/py3k: Lib/idlelib/Bindings.py Lib/idlelib/EditorWindow.py Lib/idlelib/MultiCall.py Lib/idlelib/keybindingDialog.py Lib/idlelib/macosxSupport.py Mac/IDLE/IDLE.app/Contents/MacOS/IDLE Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py Mac/Makefile.in Message-ID: <20090212150144.B5FC61E4002@bag.python.org> Author: ronald.oussoren Date: Thu Feb 12 16:01:44 2009 New Revision: 69532 Log: Fix for issue5194, based on a patch by Ned Deily. Modified: python/branches/py3k/Lib/idlelib/Bindings.py python/branches/py3k/Lib/idlelib/EditorWindow.py python/branches/py3k/Lib/idlelib/MultiCall.py python/branches/py3k/Lib/idlelib/keybindingDialog.py python/branches/py3k/Lib/idlelib/macosxSupport.py python/branches/py3k/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE python/branches/py3k/Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py python/branches/py3k/Mac/Makefile.in Modified: python/branches/py3k/Lib/idlelib/Bindings.py ============================================================================== --- python/branches/py3k/Lib/idlelib/Bindings.py (original) +++ python/branches/py3k/Lib/idlelib/Bindings.py Thu Feb 12 16:01:44 2009 @@ -10,6 +10,7 @@ """ import sys from idlelib.configHandler import idleConf +from idlelib import macosxSupport menudefs = [ # underscore prefixes character to underscore @@ -80,7 +81,7 @@ ]), ] -if sys.platform == 'darwin' and '.app' in sys.executable: +if macosxSupport.runningAsOSXApp(): # Running as a proper MacOS application bundle. This block restructures # the menus a little to make them conform better to the HIG. Modified: python/branches/py3k/Lib/idlelib/EditorWindow.py ============================================================================== --- python/branches/py3k/Lib/idlelib/EditorWindow.py (original) +++ python/branches/py3k/Lib/idlelib/EditorWindow.py Thu Feb 12 16:01:44 2009 @@ -363,7 +363,7 @@ underline, label = prepstr(label) menudict[name] = menu = Menu(mbar, name=name) mbar.add_cascade(label=label, menu=menu, underline=underline) - if sys.platform == 'darwin' and '.framework' in sys.executable: + if macosxSupport.runningAsOSXApp(): # Insert the application menu menudict['application'] = menu = Menu(mbar, name='apple') mbar.add_cascade(label='IDLE', menu=menu) Modified: python/branches/py3k/Lib/idlelib/MultiCall.py ============================================================================== --- python/branches/py3k/Lib/idlelib/MultiCall.py (original) +++ python/branches/py3k/Lib/idlelib/MultiCall.py Thu Feb 12 16:01:44 2009 @@ -32,6 +32,7 @@ import sys import re import tkinter +from idlelib import macosxSupport # the event type constants, which define the meaning of mc_type MC_KEYPRESS=0; MC_KEYRELEASE=1; MC_BUTTONPRESS=2; MC_BUTTONRELEASE=3; @@ -44,7 +45,7 @@ MC_OPTION = 1<<6; MC_COMMAND = 1<<7 # define the list of modifiers, to be used in complex event types. -if sys.platform == "darwin" and sys.executable.count(".app"): +if macosxSupport.runningAsOSXApp(): _modifiers = (("Shift",), ("Control",), ("Option",), ("Command",)) _modifier_masks = (MC_SHIFT, MC_CONTROL, MC_OPTION, MC_COMMAND) else: Modified: python/branches/py3k/Lib/idlelib/keybindingDialog.py ============================================================================== --- python/branches/py3k/Lib/idlelib/keybindingDialog.py (original) +++ python/branches/py3k/Lib/idlelib/keybindingDialog.py Thu Feb 12 16:01:44 2009 @@ -4,6 +4,7 @@ from tkinter import * import tkinter.messagebox as tkMessageBox import string +from idlelib import macosxSupport class GetKeysDialog(Toplevel): def __init__(self,parent,title,action,currentKeySequences): @@ -133,7 +134,7 @@ config-keys.def must use the same ordering. """ import sys - if sys.platform == 'darwin' and sys.argv[0].count('.app'): + if macosxSupport.runningAsOSXApp(): self.modifiers = ['Shift', 'Control', 'Option', 'Command'] else: self.modifiers = ['Control', 'Alt', 'Shift'] Modified: python/branches/py3k/Lib/idlelib/macosxSupport.py ============================================================================== --- python/branches/py3k/Lib/idlelib/macosxSupport.py (original) +++ python/branches/py3k/Lib/idlelib/macosxSupport.py Thu Feb 12 16:01:44 2009 @@ -6,8 +6,12 @@ import tkinter def runningAsOSXApp(): - """ Returns True iff running from the IDLE.app bundle on OSX """ - return (sys.platform == 'darwin' and 'IDLE.app' in sys.argv[0]) + """ + Returns True if Python is running from within an app on OSX. + If so, assume that Python was built with Aqua Tcl/Tk rather than + X11 Tck/Tk. + """ + return (sys.platform == 'darwin' and '.app' in sys.executable) def addOpenEventSupport(root, flist): """ Modified: python/branches/py3k/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE ============================================================================== --- python/branches/py3k/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE (original) +++ python/branches/py3k/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE Thu Feb 12 16:01:44 2009 @@ -1,4 +1,4 @@ -#!%prefix%/Resources/Python.app/Contents/MacOS/Python3 +#!%prefix%/Resources/Python.app/Contents/MacOS/%exe% import sys, os execdir = os.path.dirname(sys.argv[0]) Modified: python/branches/py3k/Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py ============================================================================== --- python/branches/py3k/Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py (original) +++ python/branches/py3k/Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py Thu Feb 12 16:01:44 2009 @@ -3,8 +3,6 @@ """ import sys, os -from idlelib.PyShell import main - # Change the current directory the user's home directory, that way we'll get # a more useful default location in the open/save dialogs. os.chdir(os.path.expanduser('~/Documents')) @@ -13,10 +11,54 @@ # Make sure sys.executable points to the python interpreter inside the # framework, instead of at the helper executable inside the application # bundle (the latter works, but doesn't allow access to the window server) -if sys.executable.endswith('-32'): - sys.executable = os.path.join(sys.prefix, 'bin', 'python-32') -else: - sys.executable = os.path.join(sys.prefix, 'bin', 'python') +# +# .../IDLE.app/ +# Contents/ +# MacOS/ +# IDLE (a python script) +# Python{-32} (symlink) +# Resources/ +# idlemain.py (this module) +# ... +# +# ../IDLE.app/Contents/MacOS/Python{-32} is symlinked to +# ..Library/Frameworks/Python.framework/Versions/m.n +# /Resources/Python.app/Contents/MacOS/Python{-32} +# which is the Python interpreter executable +# +# The flow of control is as follows: +# 1. IDLE.app is launched which starts python running the IDLE script +# 2. IDLE script exports +# PYTHONEXECUTABLE = .../IDLE.app/Contents/MacOS/Python{-32} +# (the symlink to the framework python) +# 3. IDLE script alters sys.argv and uses os.execve to replace itself with +# idlemain.py running under the symlinked python. +# This is the magic step. +# 4. During interpreter initialization, because PYTHONEXECUTABLE is defined, +# sys.executable may get set to an unuseful value. +# +# (Note that the IDLE script and the setting of PYTHONEXECUTABLE is +# generated automatically by bundlebuilder in the Python 2.x build. +# Also, IDLE invoked via command line, i.e. bin/idle, bypasses all of +# this.) +# +# Now fix up the execution environment before importing idlelib. + +# Reset sys.executable to its normal value, the actual path of +# the interpreter in the framework, by following the symlink +# exported in PYTHONEXECUTABLE. +pyex = os.environ['PYTHONEXECUTABLE'] +sys.executable = os.path.join(os.path.dirname(pyex), os.readlink(pyex)) + +# Remove any sys.path entries for the Resources dir in the IDLE.app bundle. +p = pyex.partition('.app') +if p[2].startswith('/Contents/MacOS/Python'): + sys.path = [value for value in sys.path if + value.partition('.app') != (p[0], p[1], '/Contents/Resources')] + +# Unexport PYTHONEXECUTABLE so that the other Python processes started +# by IDLE have a normal sys.executable. +del os.environ['PYTHONEXECUTABLE'] # Look for the -psn argument that the launcher adds and remove it, it will # only confuse the IDLE startup code. @@ -25,6 +67,7 @@ del sys.argv[idx] break -#argvemulator.ArgvCollector().mainloop() +# Now it is safe to import idlelib. +from idlelib.PyShell import main if __name__ == '__main__': main() Modified: python/branches/py3k/Mac/Makefile.in ============================================================================== --- python/branches/py3k/Mac/Makefile.in (original) +++ python/branches/py3k/Mac/Makefile.in Thu Feb 12 16:01:44 2009 @@ -215,7 +215,7 @@ install_IDLE: test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" - -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" + -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -rf "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" /bin/cp -PR "$(srcdir)/IDLE/IDLE.app" "$(DESTDIR)$(PYTHONAPPSDIR)" ln -sf $(INSTALLED_PYTHONAPP) "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/Python" sed -e "s!%prefix%!$(prefix)!g" -e 's!%exe%!$(PYTHONFRAMEWORK)!g' < "$(srcdir)/IDLE/IDLE.app/Contents/MacOS/IDLE" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/IDLE" From python-checkins at python.org Thu Feb 12 16:03:20 2009 From: python-checkins at python.org (ronald.oussoren) Date: Thu, 12 Feb 2009 16:03:20 +0100 (CET) Subject: [Python-checkins] r69533 - in python/branches/release30-maint: Lib/idlelib/Bindings.py Lib/idlelib/EditorWindow.py Lib/idlelib/MultiCall.py Lib/idlelib/keybindingDialog.py Lib/idlelib/macosxSupport.py Mac/IDLE/IDLE.app/Contents/MacOS/IDLE Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py Mac/Makefile.in Message-ID: <20090212150320.3C2701E4002@bag.python.org> Author: ronald.oussoren Date: Thu Feb 12 16:03:19 2009 New Revision: 69533 Log: Backport of r69532 Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/idlelib/Bindings.py python/branches/release30-maint/Lib/idlelib/EditorWindow.py python/branches/release30-maint/Lib/idlelib/MultiCall.py python/branches/release30-maint/Lib/idlelib/keybindingDialog.py python/branches/release30-maint/Lib/idlelib/macosxSupport.py python/branches/release30-maint/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE python/branches/release30-maint/Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py python/branches/release30-maint/Mac/Makefile.in Modified: python/branches/release30-maint/Lib/idlelib/Bindings.py ============================================================================== --- python/branches/release30-maint/Lib/idlelib/Bindings.py (original) +++ python/branches/release30-maint/Lib/idlelib/Bindings.py Thu Feb 12 16:03:19 2009 @@ -10,6 +10,7 @@ """ import sys from idlelib.configHandler import idleConf +from idlelib import macosxSupport menudefs = [ # underscore prefixes character to underscore @@ -80,7 +81,7 @@ ]), ] -if sys.platform == 'darwin' and '.app' in sys.executable: +if macosxSupport.runningAsOSXApp(): # Running as a proper MacOS application bundle. This block restructures # the menus a little to make them conform better to the HIG. Modified: python/branches/release30-maint/Lib/idlelib/EditorWindow.py ============================================================================== --- python/branches/release30-maint/Lib/idlelib/EditorWindow.py (original) +++ python/branches/release30-maint/Lib/idlelib/EditorWindow.py Thu Feb 12 16:03:19 2009 @@ -363,7 +363,7 @@ underline, label = prepstr(label) menudict[name] = menu = Menu(mbar, name=name) mbar.add_cascade(label=label, menu=menu, underline=underline) - if sys.platform == 'darwin' and '.framework' in sys.executable: + if macosxSupport.runningAsOSXApp(): # Insert the application menu menudict['application'] = menu = Menu(mbar, name='apple') mbar.add_cascade(label='IDLE', menu=menu) Modified: python/branches/release30-maint/Lib/idlelib/MultiCall.py ============================================================================== --- python/branches/release30-maint/Lib/idlelib/MultiCall.py (original) +++ python/branches/release30-maint/Lib/idlelib/MultiCall.py Thu Feb 12 16:03:19 2009 @@ -32,6 +32,7 @@ import sys import re import tkinter +from idlelib import macosxSupport # the event type constants, which define the meaning of mc_type MC_KEYPRESS=0; MC_KEYRELEASE=1; MC_BUTTONPRESS=2; MC_BUTTONRELEASE=3; @@ -44,7 +45,7 @@ MC_OPTION = 1<<6; MC_COMMAND = 1<<7 # define the list of modifiers, to be used in complex event types. -if sys.platform == "darwin" and sys.executable.count(".app"): +if macosxSupport.runningAsOSXApp(): _modifiers = (("Shift",), ("Control",), ("Option",), ("Command",)) _modifier_masks = (MC_SHIFT, MC_CONTROL, MC_OPTION, MC_COMMAND) else: Modified: python/branches/release30-maint/Lib/idlelib/keybindingDialog.py ============================================================================== --- python/branches/release30-maint/Lib/idlelib/keybindingDialog.py (original) +++ python/branches/release30-maint/Lib/idlelib/keybindingDialog.py Thu Feb 12 16:03:19 2009 @@ -4,6 +4,7 @@ from tkinter import * import tkinter.messagebox as tkMessageBox import string +from idlelib import macosxSupport class GetKeysDialog(Toplevel): def __init__(self,parent,title,action,currentKeySequences): @@ -133,7 +134,7 @@ config-keys.def must use the same ordering. """ import sys - if sys.platform == 'darwin' and sys.argv[0].count('.app'): + if macosxSupport.runningAsOSXApp(): self.modifiers = ['Shift', 'Control', 'Option', 'Command'] else: self.modifiers = ['Control', 'Alt', 'Shift'] Modified: python/branches/release30-maint/Lib/idlelib/macosxSupport.py ============================================================================== --- python/branches/release30-maint/Lib/idlelib/macosxSupport.py (original) +++ python/branches/release30-maint/Lib/idlelib/macosxSupport.py Thu Feb 12 16:03:19 2009 @@ -6,8 +6,12 @@ import tkinter def runningAsOSXApp(): - """ Returns True iff running from the IDLE.app bundle on OSX """ - return (sys.platform == 'darwin' and 'IDLE.app' in sys.argv[0]) + """ + Returns True if Python is running from within an app on OSX. + If so, assume that Python was built with Aqua Tcl/Tk rather than + X11 Tck/Tk. + """ + return (sys.platform == 'darwin' and '.app' in sys.executable) def addOpenEventSupport(root, flist): """ Modified: python/branches/release30-maint/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE ============================================================================== --- python/branches/release30-maint/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE (original) +++ python/branches/release30-maint/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE Thu Feb 12 16:03:19 2009 @@ -1,4 +1,4 @@ -#!%prefix%/Resources/Python.app/Contents/MacOS/Python3 +#!%prefix%/Resources/Python.app/Contents/MacOS/%exe% import sys, os execdir = os.path.dirname(sys.argv[0]) Modified: python/branches/release30-maint/Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py ============================================================================== --- python/branches/release30-maint/Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py (original) +++ python/branches/release30-maint/Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py Thu Feb 12 16:03:19 2009 @@ -3,8 +3,6 @@ """ import sys, os -from idlelib.PyShell import main - # Change the current directory the user's home directory, that way we'll get # a more useful default location in the open/save dialogs. os.chdir(os.path.expanduser('~/Documents')) @@ -13,10 +11,54 @@ # Make sure sys.executable points to the python interpreter inside the # framework, instead of at the helper executable inside the application # bundle (the latter works, but doesn't allow access to the window server) -if sys.executable.endswith('-32'): - sys.executable = os.path.join(sys.prefix, 'bin', 'python-32') -else: - sys.executable = os.path.join(sys.prefix, 'bin', 'python') +# +# .../IDLE.app/ +# Contents/ +# MacOS/ +# IDLE (a python script) +# Python{-32} (symlink) +# Resources/ +# idlemain.py (this module) +# ... +# +# ../IDLE.app/Contents/MacOS/Python{-32} is symlinked to +# ..Library/Frameworks/Python.framework/Versions/m.n +# /Resources/Python.app/Contents/MacOS/Python{-32} +# which is the Python interpreter executable +# +# The flow of control is as follows: +# 1. IDLE.app is launched which starts python running the IDLE script +# 2. IDLE script exports +# PYTHONEXECUTABLE = .../IDLE.app/Contents/MacOS/Python{-32} +# (the symlink to the framework python) +# 3. IDLE script alters sys.argv and uses os.execve to replace itself with +# idlemain.py running under the symlinked python. +# This is the magic step. +# 4. During interpreter initialization, because PYTHONEXECUTABLE is defined, +# sys.executable may get set to an unuseful value. +# +# (Note that the IDLE script and the setting of PYTHONEXECUTABLE is +# generated automatically by bundlebuilder in the Python 2.x build. +# Also, IDLE invoked via command line, i.e. bin/idle, bypasses all of +# this.) +# +# Now fix up the execution environment before importing idlelib. + +# Reset sys.executable to its normal value, the actual path of +# the interpreter in the framework, by following the symlink +# exported in PYTHONEXECUTABLE. +pyex = os.environ['PYTHONEXECUTABLE'] +sys.executable = os.path.join(os.path.dirname(pyex), os.readlink(pyex)) + +# Remove any sys.path entries for the Resources dir in the IDLE.app bundle. +p = pyex.partition('.app') +if p[2].startswith('/Contents/MacOS/Python'): + sys.path = [value for value in sys.path if + value.partition('.app') != (p[0], p[1], '/Contents/Resources')] + +# Unexport PYTHONEXECUTABLE so that the other Python processes started +# by IDLE have a normal sys.executable. +del os.environ['PYTHONEXECUTABLE'] # Look for the -psn argument that the launcher adds and remove it, it will # only confuse the IDLE startup code. @@ -25,6 +67,7 @@ del sys.argv[idx] break -#argvemulator.ArgvCollector().mainloop() +# Now it is safe to import idlelib. +from idlelib.PyShell import main if __name__ == '__main__': main() Modified: python/branches/release30-maint/Mac/Makefile.in ============================================================================== --- python/branches/release30-maint/Mac/Makefile.in (original) +++ python/branches/release30-maint/Mac/Makefile.in Thu Feb 12 16:03:19 2009 @@ -215,7 +215,7 @@ install_IDLE: test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" - -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" + -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -rf "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" /bin/cp -PR "$(srcdir)/IDLE/IDLE.app" "$(DESTDIR)$(PYTHONAPPSDIR)" ln -sf $(INSTALLED_PYTHONAPP) "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/Python" sed -e "s!%prefix%!$(prefix)!g" -e 's!%exe%!$(PYTHONFRAMEWORK)!g' < "$(srcdir)/IDLE/IDLE.app/Contents/MacOS/IDLE" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/IDLE" From python-checkins at python.org Thu Feb 12 16:12:03 2009 From: python-checkins at python.org (ronald.oussoren) Date: Thu, 12 Feb 2009 16:12:03 +0100 (CET) Subject: [Python-checkins] r69534 - python/branches/py3k/Mac/Makefile.in Message-ID: <20090212151203.418C31E4002@bag.python.org> Author: ronald.oussoren Date: Thu Feb 12 16:12:03 2009 New Revision: 69534 Log: Fix for issue5195, a patch by Ned Deily 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 Thu Feb 12 16:12:03 2009 @@ -220,6 +220,23 @@ ln -sf $(INSTALLED_PYTHONAPP) "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/Python" sed -e "s!%prefix%!$(prefix)!g" -e 's!%exe%!$(PYTHONFRAMEWORK)!g' < "$(srcdir)/IDLE/IDLE.app/Contents/MacOS/IDLE" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/IDLE" sed "s!%version%!`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`!g" < "$(srcdir)/IDLE/IDLE.app/Contents/Info.plist" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/Info.plist" + if [ -f "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def" ]; then \ + /bin/cp -p "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def" \ + "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def~" ; \ + sed -e 's!name= IDLE Classic Windows!name= IDLE Classic OSX!g' \ + < "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def~" \ + > "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def" ; \ + rm "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def~" ; \ + fi + if [ -f "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def" ]; then \ + /bin/cp -p "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def" \ + "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def~" ; \ + sed -e 's!zoom-height=!zoom-height=!g' \ + -e 's! "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def" ; \ + rm "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def~" ; \ + fi touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" $(INSTALLED_PYTHONAPP): install_Python From python-checkins at python.org Thu Feb 12 16:12:48 2009 From: python-checkins at python.org (ronald.oussoren) Date: Thu, 12 Feb 2009 16:12:48 +0100 (CET) Subject: [Python-checkins] r69535 - in python/branches/release30-maint: Mac/Makefile.in Message-ID: <20090212151248.C82911E4002@bag.python.org> Author: ronald.oussoren Date: Thu Feb 12 16:12:48 2009 New Revision: 69535 Log: Backport of r69534 Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Mac/Makefile.in Modified: python/branches/release30-maint/Mac/Makefile.in ============================================================================== --- python/branches/release30-maint/Mac/Makefile.in (original) +++ python/branches/release30-maint/Mac/Makefile.in Thu Feb 12 16:12:48 2009 @@ -220,6 +220,23 @@ ln -sf $(INSTALLED_PYTHONAPP) "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/Python" sed -e "s!%prefix%!$(prefix)!g" -e 's!%exe%!$(PYTHONFRAMEWORK)!g' < "$(srcdir)/IDLE/IDLE.app/Contents/MacOS/IDLE" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/IDLE" sed "s!%version%!`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`!g" < "$(srcdir)/IDLE/IDLE.app/Contents/Info.plist" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/Info.plist" + if [ -f "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def" ]; then \ + /bin/cp -p "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def" \ + "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def~" ; \ + sed -e 's!name= IDLE Classic Windows!name= IDLE Classic OSX!g' \ + < "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def~" \ + > "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def" ; \ + rm "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def~" ; \ + fi + if [ -f "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def" ]; then \ + /bin/cp -p "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def" \ + "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def~" ; \ + sed -e 's!zoom-height=!zoom-height=!g' \ + -e 's! "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def" ; \ + rm "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def~" ; \ + fi touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" $(INSTALLED_PYTHONAPP): install_Python From python-checkins at python.org Thu Feb 12 16:18:15 2009 From: python-checkins at python.org (ronald.oussoren) Date: Thu, 12 Feb 2009 16:18:15 +0100 (CET) Subject: [Python-checkins] r69536 - python/branches/py3k/Mac/Makefile.in Message-ID: <20090212151815.41F1B1E4002@bag.python.org> Author: ronald.oussoren Date: Thu Feb 12 16:18:15 2009 New Revision: 69536 Log: Fix for issue5196, patch by Ned Deily. 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 Thu Feb 12 16:18:15 2009 @@ -49,7 +49,7 @@ checkapplepython install_pythonw install_versionedtools installapps4way: install_Python4way install_PythonLauncher \ - install_IDLE install_pythonw4way install_versionedtools + install_IDLE4way install_pythonw4way install_versionedtools install_pythonw: pythonw @@ -217,7 +217,7 @@ test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -rf "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" /bin/cp -PR "$(srcdir)/IDLE/IDLE.app" "$(DESTDIR)$(PYTHONAPPSDIR)" - ln -sf $(INSTALLED_PYTHONAPP) "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/Python" + ln -sf "$(INSTALLED_PYTHONAPP)" "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/Python" sed -e "s!%prefix%!$(prefix)!g" -e 's!%exe%!$(PYTHONFRAMEWORK)!g' < "$(srcdir)/IDLE/IDLE.app/Contents/MacOS/IDLE" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/IDLE" sed "s!%version%!`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`!g" < "$(srcdir)/IDLE/IDLE.app/Contents/Info.plist" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/Info.plist" if [ -f "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def" ]; then \ @@ -239,6 +239,11 @@ fi touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" +install_IDLE4way: install_IDLE + ln -sf "$(INSTALLED_PYTHONAPP)-32" "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/Python" + sed -e "s!%prefix%!$(prefix)!g" -e 's!%exe%!$(PYTHONFRAMEWORK)-32!g' < "$(srcdir)/IDLE/IDLE.app/Contents/MacOS/IDLE" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/IDLE" + touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" + $(INSTALLED_PYTHONAPP): install_Python installextras: $(srcdir)/Extras.ReadMe.txt $(srcdir)/Extras.install.py From python-checkins at python.org Thu Feb 12 16:19:14 2009 From: python-checkins at python.org (ronald.oussoren) Date: Thu, 12 Feb 2009 16:19:14 +0100 (CET) Subject: [Python-checkins] r69537 - in python/branches/release30-maint: Mac/Makefile.in Message-ID: <20090212151914.7F8161E4002@bag.python.org> Author: ronald.oussoren Date: Thu Feb 12 16:19:14 2009 New Revision: 69537 Log: Merged revisions 69536 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69536 | ronald.oussoren | 2009-02-12 16:18:15 +0100 (Thu, 12 Feb 2009) | 2 lines Fix for issue5196, patch by Ned Deily. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Mac/Makefile.in Modified: python/branches/release30-maint/Mac/Makefile.in ============================================================================== --- python/branches/release30-maint/Mac/Makefile.in (original) +++ python/branches/release30-maint/Mac/Makefile.in Thu Feb 12 16:19:14 2009 @@ -49,7 +49,7 @@ checkapplepython install_pythonw install_versionedtools installapps4way: install_Python4way install_PythonLauncher \ - install_IDLE install_pythonw4way install_versionedtools + install_IDLE4way install_pythonw4way install_versionedtools install_pythonw: pythonw @@ -217,7 +217,7 @@ test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -rf "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" /bin/cp -PR "$(srcdir)/IDLE/IDLE.app" "$(DESTDIR)$(PYTHONAPPSDIR)" - ln -sf $(INSTALLED_PYTHONAPP) "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/Python" + ln -sf "$(INSTALLED_PYTHONAPP)" "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/Python" sed -e "s!%prefix%!$(prefix)!g" -e 's!%exe%!$(PYTHONFRAMEWORK)!g' < "$(srcdir)/IDLE/IDLE.app/Contents/MacOS/IDLE" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/IDLE" sed "s!%version%!`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`!g" < "$(srcdir)/IDLE/IDLE.app/Contents/Info.plist" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/Info.plist" if [ -f "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def" ]; then \ @@ -239,6 +239,11 @@ fi touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" +install_IDLE4way: install_IDLE + ln -sf "$(INSTALLED_PYTHONAPP)-32" "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/Python" + sed -e "s!%prefix%!$(prefix)!g" -e 's!%exe%!$(PYTHONFRAMEWORK)-32!g' < "$(srcdir)/IDLE/IDLE.app/Contents/MacOS/IDLE" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/IDLE" + touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" + $(INSTALLED_PYTHONAPP): install_Python installextras: $(srcdir)/Extras.ReadMe.txt $(srcdir)/Extras.install.py From python-checkins at python.org Thu Feb 12 16:24:51 2009 From: python-checkins at python.org (ronald.oussoren) Date: Thu, 12 Feb 2009 16:24:51 +0100 (CET) Subject: [Python-checkins] r69538 - in python/branches/py3k/Mac/BuildScript/resources: ReadMe.txt Welcome.rtf Message-ID: <20090212152451.B25551E4002@bag.python.org> Author: ronald.oussoren Date: Thu Feb 12 16:24:51 2009 New Revision: 69538 Log: Update the ReadMe and Welcome files that are used by the OSX binary installer. Fixes issue5226. Patch by Ned Deily. Modified: python/branches/py3k/Mac/BuildScript/resources/ReadMe.txt python/branches/py3k/Mac/BuildScript/resources/Welcome.rtf 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 Thu Feb 12 16:24:51 2009 @@ -14,10 +14,9 @@ MacPython consists of the Python programming language interpreter, plus a set of programs to allow easy -access to it for Mac users (an integrated development -environment, an applet builder), plus a set of pre-built -extension modules that open up specific Macintosh technologies -to Python programs (Carbon, AppleScript, Quicktime, more). +access to it for Mac users including an integrated development +environment, IDLE, plus a set of pre-built extension modules +that open up specific Macintosh technologies to Python programs. The installer puts the applications in "Python $VERSION" in your Applications folder, command-line tools in @@ -25,7 +24,7 @@ $PYTHONFRAMEWORKINSTALLDIR. More information on MacPython can be found at -http://www.cwi.nl/~jack/macpython and -http://pythonmac.org/. More information on -Python in general 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/resources/Welcome.rtf ============================================================================== --- python/branches/py3k/Mac/BuildScript/resources/Welcome.rtf (original) +++ python/branches/py3k/Mac/BuildScript/resources/Welcome.rtf Thu Feb 12 16:24:51 2009 @@ -10,11 +10,10 @@ \b Mac OS X $MACOSX_DEPLOYMENT_TARGET \b0 .\ \ -MacPython consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for Mac users (an integrated development environment, an applet builder), plus a set of pre-built extension modules that open up specific Macintosh technologies to Python programs (Carbon, AppleScript, Quicktime, more).\ +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.\ \ See the ReadMe file for more information.\ \ \b NOTE: -\b0 This package will by default update not your shell profile, and will also not install\ -files in /usr/local. } \ No newline at end of file +\b0 This package will by default not update your shell profile and will also not install files in /usr/local. Double-click \b Update Shell Profile\b0 at any time to make $FULL_VERSION the default Python.} From python-checkins at python.org Thu Feb 12 16:27:00 2009 From: python-checkins at python.org (ronald.oussoren) Date: Thu, 12 Feb 2009 16:27:00 +0100 (CET) Subject: [Python-checkins] r69539 - in python/branches/release30-maint: Mac/BuildScript/resources/ReadMe.txt Mac/BuildScript/resources/Welcome.rtf Message-ID: <20090212152700.E7B3F1E4002@bag.python.org> Author: ronald.oussoren Date: Thu Feb 12 16:27:00 2009 New Revision: 69539 Log: Merged revisions 69538 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69538 | ronald.oussoren | 2009-02-12 16:24:51 +0100 (Thu, 12 Feb 2009) | 3 lines Update the ReadMe and Welcome files that are used by the OSX binary installer. Fixes issue5226. Patch by Ned Deily. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Mac/BuildScript/resources/ReadMe.txt python/branches/release30-maint/Mac/BuildScript/resources/Welcome.rtf Modified: python/branches/release30-maint/Mac/BuildScript/resources/ReadMe.txt ============================================================================== --- python/branches/release30-maint/Mac/BuildScript/resources/ReadMe.txt (original) +++ python/branches/release30-maint/Mac/BuildScript/resources/ReadMe.txt Thu Feb 12 16:27:00 2009 @@ -14,10 +14,9 @@ MacPython consists of the Python programming language interpreter, plus a set of programs to allow easy -access to it for Mac users (an integrated development -environment, an applet builder), plus a set of pre-built -extension modules that open up specific Macintosh technologies -to Python programs (Carbon, AppleScript, Quicktime, more). +access to it for Mac users including an integrated development +environment, IDLE, plus a set of pre-built extension modules +that open up specific Macintosh technologies to Python programs. The installer puts the applications in "Python $VERSION" in your Applications folder, command-line tools in @@ -25,7 +24,7 @@ $PYTHONFRAMEWORKINSTALLDIR. More information on MacPython can be found at -http://www.cwi.nl/~jack/macpython and -http://pythonmac.org/. More information on -Python in general 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/release30-maint/Mac/BuildScript/resources/Welcome.rtf ============================================================================== --- python/branches/release30-maint/Mac/BuildScript/resources/Welcome.rtf (original) +++ python/branches/release30-maint/Mac/BuildScript/resources/Welcome.rtf Thu Feb 12 16:27:00 2009 @@ -10,11 +10,10 @@ \b Mac OS X $MACOSX_DEPLOYMENT_TARGET \b0 .\ \ -MacPython consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for Mac users (an integrated development environment, an applet builder), plus a set of pre-built extension modules that open up specific Macintosh technologies to Python programs (Carbon, AppleScript, Quicktime, more).\ +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.\ \ See the ReadMe file for more information.\ \ \b NOTE: -\b0 This package will by default update not your shell profile, and will also not install\ -files in /usr/local. } \ No newline at end of file +\b0 This package will by default not update your shell profile and will also not install files in /usr/local. Double-click \b Update Shell Profile\b0 at any time to make $FULL_VERSION the default Python.} From buildbot at python.org Thu Feb 12 16:49:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 15:49:05 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090212154906.4341D1E4002@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/273 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: 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.x.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From buildbot at python.org Thu Feb 12 16:50:03 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 15:50:03 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.6 Message-ID: <20090212155003.DBE731E4002@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/80 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: guilherme.polo,raymond.hettinger 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') ====================================================================== 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 i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/341 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 test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Thu Feb 12 16:55:38 2009 From: python-checkins at python.org (ronald.oussoren) Date: Thu, 12 Feb 2009 16:55:38 +0100 (CET) Subject: [Python-checkins] r69540 - in python/branches/py3k: Lib/test/test_osx_env.py Modules/getpath.c Modules/main.c Message-ID: <20090212155538.481DD1E400C@bag.python.org> Author: ronald.oussoren Date: Thu Feb 12 16:55:38 2009 New Revision: 69540 Log: This fixes issue5143 and includes a test. Issue5143 notes that getpath.c and main.c pass a 'char*' where a 'wchar_t*' is expected on OSX. Added: python/branches/py3k/Lib/test/test_osx_env.py (contents, props changed) Modified: python/branches/py3k/Modules/getpath.c python/branches/py3k/Modules/main.c Added: python/branches/py3k/Lib/test/test_osx_env.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/test/test_osx_env.py Thu Feb 12 16:55:38 2009 @@ -0,0 +1,34 @@ +""" +Test suite for OS X interpreter environment variables. +""" + +from test.support import EnvironmentVarGuard, run_unittest +import subprocess +import sys +import unittest + +class OSXEnvironmentVariableTestCase(unittest.TestCase): + def _check_sys(self, ev, cond, sv, val = '/some/path/to/python'): + with EnvironmentVarGuard() as evg: + subpc = [str(sys.executable), '-c', + 'import sys; sys.exit(2 if "%s" %s %s else 3)' % (val, cond, sv)] + # ensure environment variable does not exist + evg.unset(ev) + # test that test on sys.xxx normally fails + rc = subprocess.call(subpc) + self.assertEqual(rc, 3, "expected %s not %s %s" % (ev, cond, sv)) + # set environ variable + evg.set(ev, val) + # test that sys.xxx has been influenced by the environ value + rc = subprocess.call(subpc) + self.assertEqual(rc, 2, "expected %s %s %s" % (ev, cond, sv)) + + def test_pythonexecutable_sets_sys_executable(self): + self._check_sys('PYTHONEXECUTABLE', '==', 'sys.executable') + +def test_main(): + if sys.platform == 'darwin': + run_unittest(OSXEnvironmentVariableTestCase) + +if __name__ == "__main__": + test_main() Modified: python/branches/py3k/Modules/getpath.c ============================================================================== --- python/branches/py3k/Modules/getpath.c (original) +++ python/branches/py3k/Modules/getpath.c Thu Feb 12 16:55:38 2009 @@ -457,6 +457,7 @@ #else unsigned long nsexeclength = MAXPATHLEN; #endif + char execpath[MAXPATHLEN+1]; #endif if (_path) { @@ -486,8 +487,13 @@ * will fail if a relative path was used. but in that case, * absolutize() should help us out below */ - else if(0 == _NSGetExecutablePath(progpath, &nsexeclength) && progpath[0] == SEP) - ; + else if(0 == _NSGetExecutablePath(execpath, &nsexeclength) && execpath[0] == SEP) { + size_t r = mbstowcs(progpath, execpath, MAXPATHLEN+1); + if (r == (size_t)-1 || r > MAXPATHLEN) { + /* Could not convert execpath, or it's too long. */ + progpath[0] = '\0'; + } + } #endif /* __APPLE__ */ else if (path) { while (1) { Modified: python/branches/py3k/Modules/main.c ============================================================================== --- python/branches/py3k/Modules/main.c (original) +++ python/branches/py3k/Modules/main.c Thu Feb 12 16:55:38 2009 @@ -487,10 +487,23 @@ so the actual executable path is passed in an environment variable. See Lib/plat-mac/bundlebuiler.py for details about the bootstrap script. */ - if ((p = Py_GETENV("PYTHONEXECUTABLE")) && *p != '\0') - Py_SetProgramName(p); - else + if ((p = Py_GETENV("PYTHONEXECUTABLE")) && *p != '\0') { + wchar_t* buffer; + size_t len = strlen(p); + size_t r; + + buffer = malloc(len * sizeof(wchar_t)); + if (buffer == NULL) { + Py_FatalError( + "not enough memory to copy PYTHONEXECUTABLE"); + } + + r = mbstowcs(buffer, p, len); + Py_SetProgramName(buffer); + /* buffer is now handed off - do not free */ + } else { Py_SetProgramName(argv[0]); + } #else Py_SetProgramName(argv[0]); #endif From python-checkins at python.org Thu Feb 12 16:56:48 2009 From: python-checkins at python.org (ronald.oussoren) Date: Thu, 12 Feb 2009 16:56:48 +0100 (CET) Subject: [Python-checkins] r69541 - in python/branches/release30-maint: Lib/test/test_osx_env.py Modules/getpath.c Modules/main.c Message-ID: <20090212155648.4D59B1E4002@bag.python.org> Author: ronald.oussoren Date: Thu Feb 12 16:56:48 2009 New Revision: 69541 Log: Merged revisions 69540 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69540 | ronald.oussoren | 2009-02-12 16:55:38 +0100 (Thu, 12 Feb 2009) | 5 lines This fixes issue5143 and includes a test. Issue5143 notes that getpath.c and main.c pass a 'char*' where a 'wchar_t*' is expected on OSX. ........ Added: python/branches/release30-maint/Lib/test/test_osx_env.py - copied unchanged from r69540, /python/branches/py3k/Lib/test/test_osx_env.py Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Modules/getpath.c python/branches/release30-maint/Modules/main.c Modified: python/branches/release30-maint/Modules/getpath.c ============================================================================== --- python/branches/release30-maint/Modules/getpath.c (original) +++ python/branches/release30-maint/Modules/getpath.c Thu Feb 12 16:56:48 2009 @@ -457,6 +457,7 @@ #else unsigned long nsexeclength = MAXPATHLEN; #endif + char execpath[MAXPATHLEN+1]; #endif if (_path) { @@ -486,8 +487,13 @@ * will fail if a relative path was used. but in that case, * absolutize() should help us out below */ - else if(0 == _NSGetExecutablePath(progpath, &nsexeclength) && progpath[0] == SEP) - ; + else if(0 == _NSGetExecutablePath(execpath, &nsexeclength) && execpath[0] == SEP) { + size_t r = mbstowcs(progpath, execpath, MAXPATHLEN+1); + if (r == (size_t)-1 || r > MAXPATHLEN) { + /* Could not convert execpath, or it's too long. */ + progpath[0] = '\0'; + } + } #endif /* __APPLE__ */ else if (path) { while (1) { Modified: python/branches/release30-maint/Modules/main.c ============================================================================== --- python/branches/release30-maint/Modules/main.c (original) +++ python/branches/release30-maint/Modules/main.c Thu Feb 12 16:56:48 2009 @@ -487,10 +487,23 @@ so the actual executable path is passed in an environment variable. See Lib/plat-mac/bundlebuiler.py for details about the bootstrap script. */ - if ((p = Py_GETENV("PYTHONEXECUTABLE")) && *p != '\0') - Py_SetProgramName(p); - else + if ((p = Py_GETENV("PYTHONEXECUTABLE")) && *p != '\0') { + wchar_t* buffer; + size_t len = strlen(p); + size_t r; + + buffer = malloc(len * sizeof(wchar_t)); + if (buffer == NULL) { + Py_FatalError( + "not enough memory to copy PYTHONEXECUTABLE"); + } + + r = mbstowcs(buffer, p, len); + Py_SetProgramName(buffer); + /* buffer is now handed off - do not free */ + } else { Py_SetProgramName(argv[0]); + } #else Py_SetProgramName(argv[0]); #endif From python-checkins at python.org Thu Feb 12 17:02:11 2009 From: python-checkins at python.org (ronald.oussoren) Date: Thu, 12 Feb 2009 17:02:11 +0100 (CET) Subject: [Python-checkins] r69542 - python/branches/py3k/Lib/idlelib/configDialog.py Message-ID: <20090212160211.81D7A1E4021@bag.python.org> Author: ronald.oussoren Date: Thu Feb 12 17:02:11 2009 New Revision: 69542 Log: This fixes issue3883 (text on the buttons in the preferences panel for IDLE doesn't fit on OSX) 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 Thu Feb 12 17:02:11 2009 @@ -21,6 +21,7 @@ from idlelib.keybindingDialog import GetKeysDialog from idlelib.configSectionNameDialog import GetCfgSectionNameDialog from idlelib.configHelpSourceEdit import GetHelpSourceDialog +from idlelib import macosxSupport class ConfigDialog(Toplevel): @@ -71,18 +72,27 @@ page_names=['Fonts/Tabs','Highlighting','Keys','General']) frameActionButtons = Frame(self,pady=2) #action buttons + + if macosxSupport.runningAsOSXApp(): + # Surpress the padx and pady arguments when + # running as IDLE.app, otherwise the text + # on these buttons will not be readable. + extraKwds={} + else: + extraKwds=dict(padx=6, pady=3) + self.buttonHelp = Button(frameActionButtons,text='Help', command=self.Help,takefocus=FALSE, - padx=6,pady=3) + **extraKwds) self.buttonOk = Button(frameActionButtons,text='Ok', command=self.Ok,takefocus=FALSE, - padx=6,pady=3) + **extraKwds) self.buttonApply = Button(frameActionButtons,text='Apply', command=self.Apply,takefocus=FALSE, - padx=6,pady=3) + **extraKwds) self.buttonCancel = Button(frameActionButtons,text='Cancel', command=self.Cancel,takefocus=FALSE, - padx=6,pady=3) + **extraKwds) self.CreatePageFontTab() self.CreatePageHighlight() self.CreatePageKeys() From python-checkins at python.org Thu Feb 12 17:03:30 2009 From: python-checkins at python.org (ronald.oussoren) Date: Thu, 12 Feb 2009 17:03:30 +0100 (CET) Subject: [Python-checkins] r69543 - in python/branches/release30-maint: Lib/idlelib/configDialog.py Message-ID: <20090212160330.75EE21E4002@bag.python.org> Author: ronald.oussoren Date: Thu Feb 12 17:03:30 2009 New Revision: 69543 Log: Merged revisions 69542 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69542 | ronald.oussoren | 2009-02-12 17:02:11 +0100 (Thu, 12 Feb 2009) | 2 lines This fixes issue3883 (text on the buttons in the preferences panel for IDLE doesn't fit on OSX) ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/idlelib/configDialog.py Modified: python/branches/release30-maint/Lib/idlelib/configDialog.py ============================================================================== --- python/branches/release30-maint/Lib/idlelib/configDialog.py (original) +++ python/branches/release30-maint/Lib/idlelib/configDialog.py Thu Feb 12 17:03:30 2009 @@ -21,6 +21,7 @@ from idlelib.keybindingDialog import GetKeysDialog from idlelib.configSectionNameDialog import GetCfgSectionNameDialog from idlelib.configHelpSourceEdit import GetHelpSourceDialog +from idlelib import macosxSupport class ConfigDialog(Toplevel): @@ -71,18 +72,27 @@ page_names=['Fonts/Tabs','Highlighting','Keys','General']) frameActionButtons = Frame(self,pady=2) #action buttons + + if macosxSupport.runningAsOSXApp(): + # Surpress the padx and pady arguments when + # running as IDLE.app, otherwise the text + # on these buttons will not be readable. + extraKwds={} + else: + extraKwds=dict(padx=6, pady=3) + self.buttonHelp = Button(frameActionButtons,text='Help', command=self.Help,takefocus=FALSE, - padx=6,pady=3) + **extraKwds) self.buttonOk = Button(frameActionButtons,text='Ok', command=self.Ok,takefocus=FALSE, - padx=6,pady=3) + **extraKwds) self.buttonApply = Button(frameActionButtons,text='Apply', command=self.Apply,takefocus=FALSE, - padx=6,pady=3) + **extraKwds) self.buttonCancel = Button(frameActionButtons,text='Cancel', command=self.Cancel,takefocus=FALSE, - padx=6,pady=3) + **extraKwds) self.CreatePageFontTab() self.CreatePageHighlight() self.CreatePageKeys() From buildbot at python.org Thu Feb 12 17:05:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 16:05:40 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 3.0 Message-ID: <20090212160540.72B551E4040@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/167 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: ronald.oussoren BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Unknown signal 32 sincerely, -The Buildbot From python-checkins at python.org Thu Feb 12 17:08:14 2009 From: python-checkins at python.org (ronald.oussoren) Date: Thu, 12 Feb 2009 17:08:14 +0100 (CET) Subject: [Python-checkins] r69544 - in python/branches/py3k/Mac/BuildScript: build-installer.py scripts/postflight.patch-profile Message-ID: <20090212160814.E9F891E4002@bag.python.org> Author: ronald.oussoren Date: Thu Feb 12 17:08:14 2009 New Revision: 69544 Log: Fix for issue5224 ("Update Shell Profile.command" contains wrong Python version on OSX) Modified: python/branches/py3k/Mac/BuildScript/build-installer.py python/branches/py3k/Mac/BuildScript/scripts/postflight.patch-profile 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 Thu Feb 12 17:08:14 2009 @@ -1033,8 +1033,7 @@ buildPythonDocs() fn = os.path.join(WORKDIR, "_root", "Applications", "Python %s"%(getVersion(),), "Update Shell Profile.command") - patchFile("scripts/postflight.patch-profile", fn) - os.chmod(fn, 0755) + patchScript("scripts/postflight.patch-profile", fn) folder = os.path.join(WORKDIR, "_root", "Applications", "Python %s"%( getVersion(),)) 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 Thu Feb 12 17:08:14 2009 @@ -5,8 +5,8 @@ echo "These changes will be effective only in shell windows that you open" echo "after running this script." -PYVER=2.5 -PYTHON_ROOT="/Library/Frameworks/Python.framework/Versions/Current" +PYVER=@PYVER@ +PYTHON_ROOT="/Library/Frameworks/Python.framework/Versions/@PYVER@" if [ `id -ur` = 0 ]; then # Run from the installer, do some trickery to fetch the information From python-checkins at python.org Thu Feb 12 17:09:09 2009 From: python-checkins at python.org (ronald.oussoren) Date: Thu, 12 Feb 2009 17:09:09 +0100 (CET) Subject: [Python-checkins] r69545 - in python/branches/release30-maint: Mac/BuildScript/build-installer.py Mac/BuildScript/scripts/postflight.patch-profile Message-ID: <20090212160909.ED5491E4002@bag.python.org> Author: ronald.oussoren Date: Thu Feb 12 17:09:09 2009 New Revision: 69545 Log: Merged revisions 69544 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69544 | ronald.oussoren | 2009-02-12 17:08:14 +0100 (Thu, 12 Feb 2009) | 2 lines Fix for issue5224 ("Update Shell Profile.command" contains wrong Python version on OSX) ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Mac/BuildScript/build-installer.py python/branches/release30-maint/Mac/BuildScript/scripts/postflight.patch-profile Modified: python/branches/release30-maint/Mac/BuildScript/build-installer.py ============================================================================== --- python/branches/release30-maint/Mac/BuildScript/build-installer.py (original) +++ python/branches/release30-maint/Mac/BuildScript/build-installer.py Thu Feb 12 17:09:09 2009 @@ -1033,8 +1033,7 @@ buildPythonDocs() fn = os.path.join(WORKDIR, "_root", "Applications", "Python %s"%(getVersion(),), "Update Shell Profile.command") - patchFile("scripts/postflight.patch-profile", fn) - os.chmod(fn, 0755) + patchScript("scripts/postflight.patch-profile", fn) folder = os.path.join(WORKDIR, "_root", "Applications", "Python %s"%( getVersion(),)) Modified: python/branches/release30-maint/Mac/BuildScript/scripts/postflight.patch-profile ============================================================================== --- python/branches/release30-maint/Mac/BuildScript/scripts/postflight.patch-profile (original) +++ python/branches/release30-maint/Mac/BuildScript/scripts/postflight.patch-profile Thu Feb 12 17:09:09 2009 @@ -5,8 +5,8 @@ echo "These changes will be effective only in shell windows that you open" echo "after running this script." -PYVER=2.5 -PYTHON_ROOT="/Library/Frameworks/Python.framework/Versions/Current" +PYVER=@PYVER@ +PYTHON_ROOT="/Library/Frameworks/Python.framework/Versions/@PYVER@" if [ `id -ur` = 0 ]; then # Run from the installer, do some trickery to fetch the information From buildbot at python.org Thu Feb 12 17:12:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 16:12:00 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 3.x Message-ID: <20090212161200.411C41E4010@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%203.x/builds/321 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 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_calendar make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Feb 12 17:25:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 16:25:53 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090212162553.5DEAD1E4043@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/263 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/test/test_http_cookiejar.py", line 256, in test_bad_magic self.assertRaises(LoadError, c.load, filename) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/unittest.py", line 344, in failUnlessRaises callableObj(*args, **kwargs) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/http/cookiejar.py", line 1756, in load f.close() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/io.py", line 1467, in close self.buffer.close() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/io.py", line 747, in close self.raw.close() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/io.py", line 623, in close _fileio._FileIO.close(self) IOError: [Errno 9] Bad file descriptor 1 test failed: test_http_cookiejar make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Feb 12 18:55:42 2009 From: python-checkins at python.org (mark.dickinson) Date: Thu, 12 Feb 2009 18:55:42 +0100 (CET) Subject: [Python-checkins] r69546 - python/trunk/Misc/NEWS Message-ID: <20090212175542.AD2FD1E4058@bag.python.org> Author: mark.dickinson Date: Thu Feb 12 18:55:42 2009 New Revision: 69546 Log: Typo fix. Modified: python/trunk/Misc/NEWS Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Feb 12 18:55:42 2009 @@ -257,7 +257,7 @@ - Issue #4998: The memory saving effect of __slots__ had been lost on Fractions which inherited from numbers.py which did not have __slots__ defined. The - numbers heirarchy now has its own __slots__ declarations. + numbers hierarchy now has its own __slots__ declarations. - Issue #3321: _multiprocessing.Connection() doesn't check handle; added checks for *nix machines for negative handles and large int handles. Without this check From python-checkins at python.org Thu Feb 12 18:58:37 2009 From: python-checkins at python.org (mark.dickinson) Date: Thu, 12 Feb 2009 18:58:37 +0100 (CET) Subject: [Python-checkins] r69547 - in python/branches/py3k: Lib/numbers.py Lib/test/test_fractions.py Misc/NEWS Message-ID: <20090212175837.A4A581E402C@bag.python.org> Author: mark.dickinson Date: Thu Feb 12 18:58:36 2009 New Revision: 69547 Log: Issue 4998: restore utility of __slots__ on Fraction. (forward merge of r68813). Modified: python/branches/py3k/Lib/numbers.py python/branches/py3k/Lib/test/test_fractions.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/numbers.py ============================================================================== --- python/branches/py3k/Lib/numbers.py (original) +++ python/branches/py3k/Lib/numbers.py Thu Feb 12 18:58:36 2009 @@ -15,6 +15,8 @@ If you just want to check if an argument x is a number, without caring what kind, use isinstance(x, Number). """ + __slots__ = () + # Concrete numeric types must provide their own hash implementation __hash__ = None @@ -38,6 +40,8 @@ type as described below. """ + __slots__ = () + @abstractmethod def __complex__(self): """Return a builtin complex instance. Called for complex(self).""" @@ -152,6 +156,8 @@ Real also provides defaults for the derived operations. """ + __slots__ = () + @abstractmethod def __float__(self): """Any Real can be converted to a native float object. @@ -264,6 +270,8 @@ class Rational(Real): """.numerator and .denominator should be in lowest terms.""" + __slots__ = () + @abstractproperty def numerator(self): raise NotImplementedError @@ -287,6 +295,8 @@ class Integral(Rational): """Integral adds a conversion to int and the bit-string operations.""" + __slots__ = () + @abstractmethod def __int__(self): """int(self)""" Modified: python/branches/py3k/Lib/test/test_fractions.py ============================================================================== --- python/branches/py3k/Lib/test/test_fractions.py (original) +++ python/branches/py3k/Lib/test/test_fractions.py Thu Feb 12 18:58:36 2009 @@ -407,6 +407,11 @@ self.assertEqual(id(r), id(copy(r))) self.assertEqual(id(r), id(deepcopy(r))) + def test_slots(self): + # Issue 4998 + r = F(13, 7) + self.assertRaises(AttributeError, setattr, r, 'a', 10) + def test_main(): run_unittest(FractionTest, GcdTest) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu Feb 12 18:58:36 2009 @@ -163,6 +163,10 @@ Library ------- +- Issue #4998: The memory saving effect of __slots__ had been lost on Fractions + which inherited from numbers.py which did not have __slots__ defined. The + numbers hierarchy now has its own __slots__ declarations. + - Issue #4631: Fix urlopen() result when an HTTP response uses chunked encoding. From python-checkins at python.org Thu Feb 12 19:00:48 2009 From: python-checkins at python.org (mark.dickinson) Date: Thu, 12 Feb 2009 19:00:48 +0100 (CET) Subject: [Python-checkins] r69548 - in python/branches/release30-maint: Lib/numbers.py Lib/test/test_fractions.py Misc/NEWS Message-ID: <20090212180048.ED8A51E4002@bag.python.org> Author: mark.dickinson Date: Thu Feb 12 19:00:48 2009 New Revision: 69548 Log: Merged revisions 69547 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69547 | mark.dickinson | 2009-02-12 17:58:36 +0000 (Thu, 12 Feb 2009) | 3 lines Issue 4998: restore utility of __slots__ on Fraction. (forward merge of r68813). ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/numbers.py python/branches/release30-maint/Lib/test/test_fractions.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/numbers.py ============================================================================== --- python/branches/release30-maint/Lib/numbers.py (original) +++ python/branches/release30-maint/Lib/numbers.py Thu Feb 12 19:00:48 2009 @@ -15,6 +15,8 @@ If you just want to check if an argument x is a number, without caring what kind, use isinstance(x, Number). """ + __slots__ = () + # Concrete numeric types must provide their own hash implementation __hash__ = None @@ -38,6 +40,8 @@ type as described below. """ + __slots__ = () + @abstractmethod def __complex__(self): """Return a builtin complex instance. Called for complex(self).""" @@ -152,6 +156,8 @@ Real also provides defaults for the derived operations. """ + __slots__ = () + @abstractmethod def __float__(self): """Any Real can be converted to a native float object. @@ -264,6 +270,8 @@ class Rational(Real): """.numerator and .denominator should be in lowest terms.""" + __slots__ = () + @abstractproperty def numerator(self): raise NotImplementedError @@ -287,6 +295,8 @@ class Integral(Rational): """Integral adds a conversion to int and the bit-string operations.""" + __slots__ = () + @abstractmethod def __int__(self): """int(self)""" Modified: python/branches/release30-maint/Lib/test/test_fractions.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_fractions.py (original) +++ python/branches/release30-maint/Lib/test/test_fractions.py Thu Feb 12 19:00:48 2009 @@ -407,6 +407,11 @@ self.assertEqual(id(r), id(copy(r))) self.assertEqual(id(r), id(deepcopy(r))) + def test_slots(self): + # Issue 4998 + r = F(13, 7) + self.assertRaises(AttributeError, setattr, r, 'a', 10) + def test_main(): run_unittest(FractionTest, GcdTest) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Thu Feb 12 19:00:48 2009 @@ -116,6 +116,10 @@ Library ------- +- Issue #4998: The memory saving effect of __slots__ had been lost on Fractions + which inherited from numbers.py which did not have __slots__ defined. The + numbers hierarchy now has its own __slots__ declarations. + - Issue #4631: Fix urlopen() result when an HTTP response uses chunked encoding. From buildbot at python.org Thu Feb 12 19:01:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 18:01:00 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090212180100.4AA991E4002@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/148 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: ronald.oussoren 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 Feb 12 19:05:07 2009 From: python-checkins at python.org (mark.dickinson) Date: Thu, 12 Feb 2009 19:05:07 +0100 (CET) Subject: [Python-checkins] r69549 - in python/branches/release26-maint: Lib/numbers.py Lib/test/test_fractions.py Misc/NEWS Message-ID: <20090212180508.042EB1E403A@bag.python.org> Author: mark.dickinson Date: Thu Feb 12 19:05:07 2009 New Revision: 69549 Log: Merged revisions 68813,69546 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68813 | raymond.hettinger | 2009-01-20 20:34:19 +0000 (Tue, 20 Jan 2009) | 3 lines Issue 4998: __slots__ on Fractions was useless. ........ r69546 | mark.dickinson | 2009-02-12 17:55:42 +0000 (Thu, 12 Feb 2009) | 2 lines Typo fix. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/numbers.py python/branches/release26-maint/Lib/test/test_fractions.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/numbers.py ============================================================================== --- python/branches/release26-maint/Lib/numbers.py (original) +++ python/branches/release26-maint/Lib/numbers.py Thu Feb 12 19:05:07 2009 @@ -17,6 +17,7 @@ caring what kind, use isinstance(x, Number). """ __metaclass__ = ABCMeta + __slots__ = () # Concrete numeric types must provide their own hash implementation __hash__ = None @@ -41,6 +42,8 @@ type as described below. """ + __slots__ = () + @abstractmethod def __complex__(self): """Return a builtin complex instance. Called for complex(self).""" @@ -172,6 +175,8 @@ Real also provides defaults for the derived operations. """ + __slots__ = () + @abstractmethod def __float__(self): """Any Real can be converted to a native float object. @@ -265,6 +270,8 @@ class Rational(Real): """.numerator and .denominator should be in lowest terms.""" + __slots__ = () + @abstractproperty def numerator(self): raise NotImplementedError @@ -288,6 +295,8 @@ class Integral(Rational): """Integral adds a conversion to long and the bit-string operations.""" + __slots__ = () + @abstractmethod def __long__(self): """long(self)""" Modified: python/branches/release26-maint/Lib/test/test_fractions.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_fractions.py (original) +++ python/branches/release26-maint/Lib/test/test_fractions.py Thu Feb 12 19:05:07 2009 @@ -394,6 +394,11 @@ self.assertEqual(id(r), id(copy(r))) self.assertEqual(id(r), id(deepcopy(r))) + def test_slots(self): + # Issue 4998 + r = F(13, 7) + self.assertRaises(AttributeError, setattr, r, 'a', 10) + def test_main(): run_unittest(FractionTest, GcdTest) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Thu Feb 12 19:05:07 2009 @@ -80,6 +80,10 @@ Library ------- +- Issue #4998: The memory saving effect of __slots__ had been lost on Fractions + which inherited from numbers.py which did not have __slots__ defined. The + numbers hierarchy now has its own __slots__ declarations. + - Issue #5203: Fixed ctypes segfaults when passing a unicode string to a function without argtypes (only occurs if HAVE_USABLE_WCHAR_T is false). From buildbot at python.org Thu Feb 12 19:23:01 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 18:23:01 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090212182301.EC46C1E4002@bag.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/250 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 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 Feb 12 19:48:44 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 18:48:44 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090212184844.60D4D1E4002@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/275 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: 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.x.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Thu Feb 12 20:44:59 2009 From: python-checkins at python.org (jesse.noller) Date: Thu, 12 Feb 2009 20:44:59 +0100 (CET) Subject: [Python-checkins] r69550 - in python/branches/release30-maint: Lib/test/test_multiprocessing.py Misc/NEWS Modules/_multiprocessing/connection.h Modules/_multiprocessing/pipe_connection.c Modules/_multiprocessing/socket_connection.c Message-ID: <20090212194459.BACF41E4002@bag.python.org> Author: jesse.noller Date: Thu Feb 12 20:44:58 2009 New Revision: 69550 Log: Merge 68778,68788 to maint Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_multiprocessing.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/_multiprocessing/connection.h python/branches/release30-maint/Modules/_multiprocessing/pipe_connection.c python/branches/release30-maint/Modules/_multiprocessing/socket_connection.c Modified: python/branches/release30-maint/Lib/test/test_multiprocessing.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_multiprocessing.py (original) +++ python/branches/release30-maint/Lib/test/test_multiprocessing.py Thu Feb 12 20:44:58 2009 @@ -62,6 +62,8 @@ HAVE_GETVALUE = not getattr(_multiprocessing, 'HAVE_BROKEN_SEM_GETVALUE', False) +WIN32 = (sys.platform == "win32") + # # Creates a wrapper for a function which records the time it takes to finish # @@ -1683,6 +1685,18 @@ logger.setLevel(level=LOG_LEVEL) # +# Test to verify handle verification, see issue 3321 +# + +class TestInvalidHandle(unittest.TestCase): + + def test_invalid_handles(self): + if WIN32: + return + conn = _multiprocessing.Connection(44977608) + self.assertRaises(IOError, conn.poll) + self.assertRaises(IOError, _multiprocessing.Connection, -1) +# # Functions used to create test cases from the base ones in this module # @@ -1786,7 +1800,7 @@ multiprocessing.connection.answer_challenge, _FakeConnection(), b'abc') -testcases_other = [OtherTest] +testcases_other = [OtherTest, TestInvalidHandle] # # Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Thu Feb 12 20:44:58 2009 @@ -129,6 +129,13 @@ - Issue #3386: distutils.sysconfig.get_python_lib prefix argument was ignored under NT and OS2. Patch by Philip Jenvey. +- Issue #3321: _multiprocessing.Connection() doesn't check handle; added checks + for *nix machines for negative handles and large int handles. Without this check + it is possible to segfault the interpreter. + +- Issue #4449: AssertionError in mp_benchmarks.py, caused by an underlying issue + in sharedctypes.py. + - Issue #4890: Handle empty text search pattern in Tkinter.Text.search. - Partial fix to issue #1731706: memory leak in Tkapp_Call when calling Modified: python/branches/release30-maint/Modules/_multiprocessing/connection.h ============================================================================== --- python/branches/release30-maint/Modules/_multiprocessing/connection.h (original) +++ python/branches/release30-maint/Modules/_multiprocessing/connection.h Thu Feb 12 20:44:58 2009 @@ -362,7 +362,7 @@ } Py_BEGIN_ALLOW_THREADS - res = conn_poll(self, timeout); + res = conn_poll(self, timeout, _save); Py_END_ALLOW_THREADS switch (res) { Modified: python/branches/release30-maint/Modules/_multiprocessing/pipe_connection.c ============================================================================== --- python/branches/release30-maint/Modules/_multiprocessing/pipe_connection.c (original) +++ python/branches/release30-maint/Modules/_multiprocessing/pipe_connection.c Thu Feb 12 20:44:58 2009 @@ -83,10 +83,8 @@ * Check whether any data is available for reading */ -#define conn_poll(conn, timeout) conn_poll_save(conn, timeout, _save) - static int -conn_poll_save(ConnectionObject *conn, double timeout, PyThreadState *_save) +conn_poll(ConnectionObject *conn, double timeout, PyThreadState *_save) { DWORD bytes, deadline, delay; int difference, res; Modified: python/branches/release30-maint/Modules/_multiprocessing/socket_connection.c ============================================================================== --- python/branches/release30-maint/Modules/_multiprocessing/socket_connection.c (original) +++ python/branches/release30-maint/Modules/_multiprocessing/socket_connection.c Thu Feb 12 20:44:58 2009 @@ -153,11 +153,23 @@ */ static int -conn_poll(ConnectionObject *conn, double timeout) +conn_poll(ConnectionObject *conn, double timeout, PyThreadState *_save) { int res; fd_set rfds; + /* + * Verify the handle, issue 3321. Not required for windows. + */ + #ifndef MS_WINDOWS + if (((int)conn->handle) < 0 || ((int)conn->handle) >= FD_SETSIZE) { + Py_BLOCK_THREADS + PyErr_SetString(PyExc_IOError, "handle out of range in select()"); + Py_UNBLOCK_THREADS + return MP_EXCEPTION_HAS_BEEN_SET; + } + #endif + FD_ZERO(&rfds); FD_SET((SOCKET)conn->handle, &rfds); From buildbot at python.org Thu Feb 12 21:03:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 20:03:07 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090212200307.F2CEF1E404D@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/111 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: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Thu Feb 12 21:56:23 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 12 Feb 2009 21:56:23 +0100 (CET) Subject: [Python-checkins] r69551 - python/trunk/Lib/distutils/tests/test_build_ext.py Message-ID: <20090212205623.5DBFD1E4002@bag.python.org> Author: tarek.ziade Date: Thu Feb 12 21:56:21 2009 New Revision: 69551 Log: fixing the leak introduced in r69304 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 Feb 12 21:56:21 2009 @@ -1,6 +1,5 @@ import sys import os -import tempfile import shutil from StringIO import StringIO @@ -19,7 +18,8 @@ def setUp(self): # Create a simple test environment # Note that we're making changes to sys.path - self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_") + self.tmp_dir = os.path.join(os.path.dirname(__file__), 'xx') + os.mkdir(self.tmp_dir) self.sys_path = sys.path[:] sys.path.append(self.tmp_dir) shutil.copy(_get_source_filename(), self.tmp_dir) From python-checkins at python.org Thu Feb 12 22:00:20 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 12 Feb 2009 22:00:20 +0100 (CET) Subject: [Python-checkins] r69552 - in python/branches/release26-maint: Lib/distutils/tests/test_build_ext.py Message-ID: <20090212210020.09CCD1E4002@bag.python.org> Author: tarek.ziade Date: Thu Feb 12 22:00:18 2009 New Revision: 69552 Log: Merged revisions 69551 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69551 | tarek.ziade | 2009-02-12 21:56:21 +0100 (Thu, 12 Feb 2009) | 1 line fixing the leak introduced in r69304 ........ 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 Feb 12 22:00:18 2009 @@ -1,6 +1,5 @@ import sys import os -import tempfile import shutil from StringIO import StringIO @@ -15,7 +14,8 @@ def setUp(self): # Create a simple test environment # Note that we're making changes to sys.path - self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_") + self.tmp_dir = os.path.join(os.path.dirname(__file__), 'xx') + os.mkdir(self.tmp_dir) self.sys_path = sys.path[:] sys.path.append(self.tmp_dir) From python-checkins at python.org Thu Feb 12 22:02:08 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 12 Feb 2009 22:02:08 +0100 (CET) Subject: [Python-checkins] r69553 - in python/branches/py3k: Lib/distutils/tests/test_build_ext.py Message-ID: <20090212210208.7165F1E4002@bag.python.org> Author: tarek.ziade Date: Thu Feb 12 22:02:07 2009 New Revision: 69553 Log: Merged revisions 69551 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69551 | tarek.ziade | 2009-02-12 21:56:21 +0100 (Thu, 12 Feb 2009) | 1 line fixing the leak introduced in r69304 ........ 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 Feb 12 22:02:07 2009 @@ -1,6 +1,5 @@ import sys import os -import tempfile import shutil from io import StringIO @@ -23,7 +22,8 @@ def setUp(self): # Create a simple test environment # Note that we're making changes to sys.path - self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_") + self.tmp_dir = os.path.join(os.path.dirname(__file__), 'xx') + os.mkdir(self.tmp_dir) self.sys_path = sys.path[:] sys.path.append(self.tmp_dir) shutil.copy(_get_source_filename(), self.tmp_dir) From python-checkins at python.org Thu Feb 12 22:04:22 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 12 Feb 2009 22:04:22 +0100 (CET) Subject: [Python-checkins] r69554 - in python/branches/release30-maint: Lib/distutils/tests/test_build_ext.py Message-ID: <20090212210422.9B0BD1E4002@bag.python.org> Author: tarek.ziade Date: Thu Feb 12 22:04:22 2009 New Revision: 69554 Log: Merged revisions 69553 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69553 | tarek.ziade | 2009-02-12 22:02:07 +0100 (Thu, 12 Feb 2009) | 9 lines Merged revisions 69551 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69551 | tarek.ziade | 2009-02-12 21:56:21 +0100 (Thu, 12 Feb 2009) | 1 line fixing the leak introduced in r69304 ........ ................ 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 Feb 12 22:04:22 2009 @@ -1,6 +1,5 @@ import sys import os -import tempfile import shutil from io import StringIO @@ -19,7 +18,8 @@ def setUp(self): # Create a simple test environment # Note that we're making changes to sys.path - self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_") + self.tmp_dir = os.path.join(os.path.dirname(__file__), 'xx') + os.mkdir(self.tmp_dir) self.sys_path = sys.path[:] sys.path.append(self.tmp_dir) From python-checkins at python.org Thu Feb 12 22:13:48 2009 From: python-checkins at python.org (gregory.p.smith) Date: Thu, 12 Feb 2009 22:13:48 +0100 (CET) Subject: [Python-checkins] r69555 - in python/branches/release30-maint: Lib/test/test_hashlib.py Misc/NEWS Modules/_hashopenssl.c Modules/hashlib.h Modules/md5module.c Modules/sha1module.c Modules/sha256module.c Modules/sha512module.c Message-ID: <20090212211348.5BF961E4002@bag.python.org> Author: gregory.p.smith Date: Thu Feb 12 22:13:48 2009 New Revision: 69555 Log: - 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). Added: python/branches/release30-maint/Modules/hashlib.h Modified: python/branches/release30-maint/Lib/test/test_hashlib.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/_hashopenssl.c python/branches/release30-maint/Modules/md5module.c python/branches/release30-maint/Modules/sha1module.c python/branches/release30-maint/Modules/sha256module.c python/branches/release30-maint/Modules/sha512module.c Modified: python/branches/release30-maint/Lib/test/test_hashlib.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_hashlib.py (original) +++ python/branches/release30-maint/Lib/test/test_hashlib.py Thu Feb 12 22:13:48 2009 @@ -63,6 +63,18 @@ computed = hashlib.new(name, data).hexdigest() self.assertEqual(computed, digest) + def check_no_unicode(self, algorithm_name): + # Unicode objects are not allowed as input. + self.assertRaises(TypeError, getattr(hashlib, algorithm_name), 'spam') + self.assertRaises(TypeError, hashlib.new, algorithm_name, 'spam') + + def test_no_unicode(self): + self.check_no_unicode('md5') + self.check_no_unicode('sha1') + self.check_no_unicode('sha224') + self.check_no_unicode('sha256') + self.check_no_unicode('sha384') + self.check_no_unicode('sha512') def test_case_md5_0(self): self.check('md5', b'', 'd41d8cd98f00b204e9800998ecf8427e') Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Thu Feb 12 22:13:48 2009 @@ -340,6 +340,10 @@ Extension Modules ----------------- +- 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). + - Issue #4397: Fix occasional test_socket failure on OS X. - Issue #4279: Fix build of parsermodule under Cygwin. Modified: python/branches/release30-maint/Modules/_hashopenssl.c ============================================================================== --- python/branches/release30-maint/Modules/_hashopenssl.c (original) +++ python/branches/release30-maint/Modules/_hashopenssl.c Thu Feb 12 22:13:48 2009 @@ -15,6 +15,7 @@ #include "Python.h" #include "structmember.h" +#include "hashlib.h" /* EVP is the preferred interface to hashing in OpenSSL */ #include @@ -154,23 +155,6 @@ return retval; } -#define MY_GET_BUFFER_VIEW_OR_ERROUT(obj, viewp) do { \ - if (PyUnicode_Check(obj) || !PyObject_CheckBuffer((obj))) { \ - PyErr_SetString(PyExc_TypeError, \ - "object supporting the buffer API required"); \ - return NULL; \ - } \ - if (PyObject_GetBuffer((obj), (viewp), PyBUF_SIMPLE) == -1) { \ - return NULL; \ - } \ - if ((viewp)->ndim > 1) { \ - PyErr_SetString(PyExc_BufferError, \ - "Buffer must be single dimension"); \ - PyBuffer_Release((viewp)); \ - return NULL; \ - } \ - } while(0); - PyDoc_STRVAR(EVP_update__doc__, "Update this hash object's state with the provided string."); @@ -183,7 +167,7 @@ if (!PyArg_ParseTuple(args, "O:update", &obj)) return NULL; - MY_GET_BUFFER_VIEW_OR_ERROUT(obj, &view); + GET_BUFFER_VIEW_OR_ERROUT(obj, &view); if (view.len > 0 && view.len <= MUNCH_SIZE) { EVP_DigestUpdate(&self->ctx, view.buf, view.len); } else { @@ -271,7 +255,7 @@ } if (data_obj) - MY_GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); if (!PyArg_Parse(name_obj, "s", &nameStr)) { PyErr_SetString(PyExc_TypeError, "name must be a string"); @@ -444,7 +428,7 @@ } if (data_obj) - MY_GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); digest = EVP_get_digestbyname(name); @@ -475,7 +459,7 @@ } \ \ if (data_obj) \ - MY_GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); \ + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); \ \ ret_obj = EVPnew( \ CONST_ ## NAME ## _name_obj, \ Added: python/branches/release30-maint/Modules/hashlib.h ============================================================================== --- (empty file) +++ python/branches/release30-maint/Modules/hashlib.h Thu Feb 12 22:13:48 2009 @@ -0,0 +1,28 @@ +/* Common code for use by all hashlib related modules. */ + +/* + * Given a PyObject* obj, fill in the Py_buffer* viewp with the result + * of PyObject_GetBuffer. Sets and exception and issues a return NULL + * on any errors. + */ +#define GET_BUFFER_VIEW_OR_ERROUT(obj, viewp) do { \ + if (PyUnicode_Check((obj))) { \ + PyErr_SetString(PyExc_TypeError, \ + "Unicode-objects must be encoded before hashing");\ + return NULL; \ + } \ + if (!PyObject_CheckBuffer((obj))) { \ + PyErr_SetString(PyExc_TypeError, \ + "object supporting the buffer API required"); \ + return NULL; \ + } \ + if (PyObject_GetBuffer((obj), (viewp), PyBUF_SIMPLE) == -1) { \ + return NULL; \ + } \ + if ((viewp)->ndim > 1) { \ + PyErr_SetString(PyExc_BufferError, \ + "Buffer must be single dimension"); \ + PyBuffer_Release((viewp)); \ + return NULL; \ + } \ + } while(0); Modified: python/branches/release30-maint/Modules/md5module.c ============================================================================== --- python/branches/release30-maint/Modules/md5module.c (original) +++ python/branches/release30-maint/Modules/md5module.c Thu Feb 12 22:13:48 2009 @@ -17,6 +17,7 @@ /* MD5 objects */ #include "Python.h" +#include "hashlib.h" /* Some useful types */ @@ -411,11 +412,14 @@ static PyObject * MD5_update(MD5object *self, PyObject *args) { + PyObject *obj; Py_buffer buf; - if (!PyArg_ParseTuple(args, "s*:update", &buf)) + if (!PyArg_ParseTuple(args, "O:update", &obj)) return NULL; + GET_BUFFER_VIEW_OR_ERROUT(obj, &buf); + md5_process(&self->hash_state, buf.buf, buf.len); PyBuffer_Release(&buf); @@ -511,14 +515,17 @@ { static char *kwlist[] = {"string", NULL}; MD5object *new; + PyObject *data_obj = NULL; Py_buffer buf; - buf.buf = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s*:new", kwlist, - &buf)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf); + if ((new = newMD5object()) == NULL) return NULL; @@ -528,7 +535,7 @@ Py_DECREF(new); return NULL; } - if (buf.buf) { + if (data_obj) { md5_process(&new->hash_state, buf.buf, buf.len); PyBuffer_Release(&buf); } Modified: python/branches/release30-maint/Modules/sha1module.c ============================================================================== --- python/branches/release30-maint/Modules/sha1module.c (original) +++ python/branches/release30-maint/Modules/sha1module.c Thu Feb 12 22:13:48 2009 @@ -17,6 +17,7 @@ /* SHA1 objects */ #include "Python.h" +#include "hashlib.h" /* Some useful types */ @@ -387,11 +388,14 @@ static PyObject * SHA1_update(SHA1object *self, PyObject *args) { + PyObject *obj; Py_buffer buf; - if (!PyArg_ParseTuple(args, "s*:update", &buf)) + if (!PyArg_ParseTuple(args, "O:update", &obj)) return NULL; + GET_BUFFER_VIEW_OR_ERROUT(obj, &buf); + sha1_process(&self->hash_state, buf.buf, buf.len); PyBuffer_Release(&buf); @@ -487,14 +491,17 @@ { static char *kwlist[] = {"string", NULL}; SHA1object *new; + PyObject *data_obj = NULL; Py_buffer buf; - buf.buf = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s*:new", kwlist, - &buf)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf); + if ((new = newSHA1object()) == NULL) return NULL; @@ -504,7 +511,7 @@ Py_DECREF(new); return NULL; } - if (buf.buf) { + if (data_obj) { sha1_process(&new->hash_state, buf.buf, buf.len); PyBuffer_Release(&buf); } Modified: python/branches/release30-maint/Modules/sha256module.c ============================================================================== --- python/branches/release30-maint/Modules/sha256module.c (original) +++ python/branches/release30-maint/Modules/sha256module.c Thu Feb 12 22:13:48 2009 @@ -18,6 +18,7 @@ #include "Python.h" #include "structmember.h" +#include "hashlib.h" /* Endianness testing and definitions */ @@ -480,14 +481,17 @@ static PyObject * SHA256_update(SHAobject *self, PyObject *args) { - unsigned char *cp; - int len; + PyObject *obj; + Py_buffer buf; - if (!PyArg_ParseTuple(args, "s#:update", &cp, &len)) + if (!PyArg_ParseTuple(args, "O:update", &obj)) return NULL; - sha_update(self, cp, len); + GET_BUFFER_VIEW_OR_ERROUT(obj, &buf); + sha_update(self, buf.buf, buf.len); + + PyBuffer_Release(&buf); Py_INCREF(Py_None); return Py_None; } @@ -614,14 +618,17 @@ { static char *kwlist[] = {"string", NULL}; SHAobject *new; - unsigned char *cp = NULL; - int len; + PyObject *data_obj = NULL; + Py_buffer buf; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s#:new", kwlist, - &cp, &len)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf); + if ((new = newSHA256object()) == NULL) return NULL; @@ -631,8 +638,10 @@ Py_DECREF(new); return NULL; } - if (cp) - sha_update(new, cp, len); + if (data_obj) { + sha_update(new, buf.buf, buf.len); + PyBuffer_Release(&buf); + } return (PyObject *)new; } @@ -645,14 +654,17 @@ { static char *kwlist[] = {"string", NULL}; SHAobject *new; - unsigned char *cp = NULL; - int len; + PyObject *data_obj = NULL; + Py_buffer buf; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s#:new", kwlist, - &cp, &len)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf); + if ((new = newSHA224object()) == NULL) return NULL; @@ -662,8 +674,10 @@ Py_DECREF(new); return NULL; } - if (cp) - sha_update(new, cp, len); + if (data_obj) { + sha_update(new, buf.buf, buf.len); + PyBuffer_Release(&buf); + } return (PyObject *)new; } Modified: python/branches/release30-maint/Modules/sha512module.c ============================================================================== --- python/branches/release30-maint/Modules/sha512module.c (original) +++ python/branches/release30-maint/Modules/sha512module.c Thu Feb 12 22:13:48 2009 @@ -18,6 +18,7 @@ #include "Python.h" #include "structmember.h" +#include "hashlib.h" #ifdef PY_LONG_LONG /* If no PY_LONG_LONG, don't compile anything! */ @@ -546,14 +547,17 @@ static PyObject * SHA512_update(SHAobject *self, PyObject *args) { - unsigned char *cp; - int len; + PyObject *obj; + Py_buffer buf; - if (!PyArg_ParseTuple(args, "s#:update", &cp, &len)) + if (!PyArg_ParseTuple(args, "O:update", &obj)) return NULL; - sha512_update(self, cp, len); + GET_BUFFER_VIEW_OR_ERROUT(obj, &buf); + sha512_update(self, buf.buf, buf.len); + + PyBuffer_Release(&buf); Py_INCREF(Py_None); return Py_None; } @@ -680,14 +684,17 @@ { static char *kwlist[] = {"string", NULL}; SHAobject *new; - unsigned char *cp = NULL; - int len; + PyObject *data_obj = NULL; + Py_buffer buf; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s#:new", kwlist, - &cp, &len)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf); + if ((new = newSHA512object()) == NULL) return NULL; @@ -697,8 +704,10 @@ Py_DECREF(new); return NULL; } - if (cp) - sha512_update(new, cp, len); + if (data_obj) { + sha512_update(new, buf.buf, buf.len); + PyBuffer_Release(&buf); + } return (PyObject *)new; } @@ -711,14 +720,17 @@ { static char *kwlist[] = {"string", NULL}; SHAobject *new; - unsigned char *cp = NULL; - int len; + PyObject *data_obj = NULL; + Py_buffer buf; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s#:new", kwlist, - &cp, &len)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf); + if ((new = newSHA384object()) == NULL) return NULL; @@ -728,8 +740,10 @@ Py_DECREF(new); return NULL; } - if (cp) - sha512_update(new, cp, len); + if (data_obj) { + sha512_update(new, buf.buf, buf.len); + PyBuffer_Release(&buf); + } return (PyObject *)new; } From buildbot at python.org Thu Feb 12 22:47:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 21:47:39 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090212214739.8EB981E4002@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/150 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: jesse.noller 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 Thu Feb 12 22:58:51 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 12 Feb 2009 21:58:51 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 2.6 Message-ID: <20090212215851.80C221E4002@bag.python.org> The Buildbot has detected a new failure of OS X x86 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%202.6/builds/70 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 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 "/Users/buildbot/buildarea/2.6.noller-osx86/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/2.6.noller-osx86/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/Users/buildbot/buildarea/2.6.noller-osx86/build/Lib/bsddb/test/test_replication.py", line 253, in thread_client self.client_doing_election, False) File "/Users/buildbot/buildarea/2.6.noller-osx86/build/Lib/bsddb/test/test_replication.py", line 297, in thread_do env.rep_process_message(v[0], v[1], envid) DBError: (9, 'Bad file descriptor -- close: Bad file descriptor') 1 test failed: test_bsddb3 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From ziade.tarek at gmail.com Thu Feb 12 23:48:14 2009 From: ziade.tarek at gmail.com (=?ISO-8859-1?Q?Tarek_Ziad=E9?=) Date: Thu, 12 Feb 2009 23:48:14 +0100 Subject: [Python-checkins] r69551 - python/trunk/Lib/distutils/tests/test_build_ext.py In-Reply-To: <20090212205623.5DBFD1E4002@bag.python.org> References: <20090212205623.5DBFD1E4002@bag.python.org> Message-ID: <94bdd2610902121448m3c5fce1cjcc158a618fff62b@mail.gmail.com> I have just seen that someone else fixed the leak here when I was merging my fix in py3k http://bugs.python.org/issue4373 I came up with another fix, shown below. I think my patch is simpler, I'd like to : - change the one in py3k so it is similar - add Amaury's explanation in setUp Opinions ? Tarek On Thu, Feb 12, 2009 at 9:56 PM, tarek. ziade wrote: > Author: tarek.ziade > Date: Thu Feb 12 21:56:21 2009 > New Revision: 69551 > > Log: > fixing the leak introduced in r69304 > > 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 Feb 12 21:56:21 2009 > @@ -1,6 +1,5 @@ > import sys > import os > -import tempfile > import shutil > from StringIO import StringIO > > @@ -19,7 +18,8 @@ > def setUp(self): > # Create a simple test environment > # Note that we're making changes to sys.path > - self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_") > + self.tmp_dir = os.path.join(os.path.dirname(__file__), 'xx') > + os.mkdir(self.tmp_dir) > self.sys_path = sys.path[:] > sys.path.append(self.tmp_dir) > shutil.copy(_get_source_filename(), self.tmp_dir) > _______________________________________________ > Python-checkins mailing list > Python-checkins at python.org > http://mail.python.org/mailman/listinfo/python-checkins > -- Tarek Ziad? | Association AfPy | www.afpy.org Blog FR | http://programmation-python.org Blog EN | http://tarekziade.wordpress.com/ From python-checkins at python.org Fri Feb 13 00:35:41 2009 From: python-checkins at python.org (barry.warsaw) Date: Fri, 13 Feb 2009 00:35:41 +0100 (CET) Subject: [Python-checkins] r69556 - in python/branches/release30-maint: Include/patchlevel.h Lib/distutils/__init__.py Lib/idlelib/idlever.py Lib/pydoc_topics.py Misc/NEWS Misc/RPM/python-3.0.spec README Message-ID: <20090212233541.DC71A1E4002@bag.python.org> Author: barry.warsaw Date: Fri Feb 13 00:35:41 2009 New Revision: 69556 Log: Bump to 3.0.1 Modified: python/branches/release30-maint/Include/patchlevel.h python/branches/release30-maint/Lib/distutils/__init__.py python/branches/release30-maint/Lib/idlelib/idlever.py python/branches/release30-maint/Lib/pydoc_topics.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Misc/RPM/python-3.0.spec python/branches/release30-maint/README Modified: python/branches/release30-maint/Include/patchlevel.h ============================================================================== --- python/branches/release30-maint/Include/patchlevel.h (original) +++ python/branches/release30-maint/Include/patchlevel.h Fri Feb 13 00:35:41 2009 @@ -18,12 +18,12 @@ /*--start constants--*/ #define PY_MAJOR_VERSION 3 #define PY_MINOR_VERSION 0 -#define PY_MICRO_VERSION 0 +#define PY_MICRO_VERSION 1 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL #define PY_RELEASE_SERIAL 0 /* Version as a string */ -#define PY_VERSION "3.0+" +#define PY_VERSION "3.0.1" /*--end constants--*/ /* Subversion Revision number of this file (not of the repository) */ Modified: python/branches/release30-maint/Lib/distutils/__init__.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/__init__.py (original) +++ python/branches/release30-maint/Lib/distutils/__init__.py Fri Feb 13 00:35:41 2009 @@ -20,5 +20,5 @@ # #--start constants-- -__version__ = "3.0" +__version__ = "3.0.1" #--end constants-- Modified: python/branches/release30-maint/Lib/idlelib/idlever.py ============================================================================== --- python/branches/release30-maint/Lib/idlelib/idlever.py (original) +++ python/branches/release30-maint/Lib/idlelib/idlever.py Fri Feb 13 00:35:41 2009 @@ -1 +1 @@ -IDLE_VERSION = "3.0" +IDLE_VERSION = "3.0.1" Modified: python/branches/release30-maint/Lib/pydoc_topics.py ============================================================================== --- python/branches/release30-maint/Lib/pydoc_topics.py (original) +++ python/branches/release30-maint/Lib/pydoc_topics.py Fri Feb 13 00:35:41 2009 @@ -1,11 +1,11 @@ -# Autogenerated by Sphinx on Wed Dec 3 12:00:16 2008 +# Autogenerated by Sphinx on Thu Feb 12 18:17:03 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:\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 a sequence 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 ::= target augop (expression_list | yield_expression)\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', + '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:\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 a sequence 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', 'atom-literals': "\nLiterals\n********\n\nPython supports string and bytes literals and various numeric\nliterals:\n\n literal ::= stringliteral | bytesliteral\n | integer | floatnumber | imagnumber\n\nEvaluation of a literal yields an object of the given type (string,\nbytes, integer, floating point number, complex number) with the given\nvalue. The value may be approximated in the case of floating point\nand imaginary (complex) literals. See section *Literals* for details.\n\nWith the exception of bytes literals, these all correspond to\nimmutable data types, and hence the object's identity is less\nimportant than its value. Multiple evaluations of literals with the\nsame value (either the same occurrence in the program text or a\ndifferent occurrence) may obtain the same object or a different object\nwith the same value.\n", 'attribute-access': '\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', 'attribute-references': '\nAttribute references\n********************\n\nAn attribute reference is a primary followed by a period and a name:\n\n attributeref ::= primary "." identifier\n\nThe primary must evaluate to an object of a type that supports\nattribute references, which most objects do. This object is then\nasked to produce the attribute whose name is the identifier (which can\nbe customized by overriding the ``__getattr__()`` method). If this\nattribute is not available, the exception ``AttributeError`` is\nraised. Otherwise, the type and value of the object produced is\ndetermined by the object. Multiple evaluations of the same attribute\nreference may yield different objects.\n', - 'augassign': '\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 ::= target augop (expression_list | yield_expression)\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', + 'augassign': '\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', 'binary': '\nBinary arithmetic operations\n****************************\n\nThe binary arithmetic operations have the conventional priority\nlevels. Note that some of these operations also apply to certain non-\nnumeric types. Apart from the power operator, there are only two\nlevels, one for multiplicative operators and one for additive\noperators:\n\n m_expr ::= u_expr | m_expr "*" u_expr | m_expr "//" u_expr | m_expr "/" u_expr\n | m_expr "%" u_expr\n a_expr ::= m_expr | a_expr "+" m_expr | a_expr "-" m_expr\n\nThe ``*`` (multiplication) operator yields the product of its\narguments. The arguments must either both be numbers, or one argument\nmust be an integer and the other must be a sequence. In the former\ncase, the numbers are converted to a common type and then multiplied\ntogether. In the latter case, sequence repetition is performed; a\nnegative repetition factor yields an empty sequence.\n\nThe ``/`` (division) and ``//`` (floor division) operators yield the\nquotient of their arguments. The numeric arguments are first\nconverted to a common type. Integer division yields a float, while\nfloor division of integers results in an integer; the result is that\nof mathematical division with the \'floor\' function applied to the\nresult. Division by zero raises the ``ZeroDivisionError`` exception.\n\nThe ``%`` (modulo) operator yields the remainder from the division of\nthe first argument by the second. The numeric arguments are first\nconverted to a common type. A zero right argument raises the\n``ZeroDivisionError`` exception. The arguments may be floating point\nnumbers, e.g., ``3.14%0.7`` equals ``0.34`` (since ``3.14`` equals\n``4*0.7 + 0.34``.) The modulo operator always yields a result with\nthe same sign as its second operand (or zero); the absolute value of\nthe result is strictly smaller than the absolute value of the second\noperand [1].\n\nThe floor division and modulo operators are connected by the following\nidentity: ``x == (x//y)*y + (x%y)``. Floor division and modulo are\nalso connected with the built-in function ``divmod()``: ``divmod(x, y)\n== (x//y, x%y)``. [2].\n\nIn addition to performing the modulo operation on numbers, the ``%``\noperator is also overloaded by string objects to perform old-style\nstring formatting (also known as interpolation). The syntax for\nstring formatting is described in the Python Library Reference,\nsection *Old String Formatting Operations*.\n\nThe floor division operator, the modulo operator, and the ``divmod()``\nfunction are not defined for complex numbers. Instead, convert to a\nfloating point number using the ``abs()`` function if appropriate.\n\nThe ``+`` (addition) operator yields the sum of its arguments. The\narguments must either both be numbers or both sequences of the same\ntype. In the former case, the numbers are converted to a common type\nand then added together. In the latter case, the sequences are\nconcatenated.\n\nThe ``-`` (subtraction) operator yields the difference of its\narguments. The numeric arguments are first converted to a common\ntype.\n', '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', @@ -18,12 +18,12 @@ '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', '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, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(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', + '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\nWarning: 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 *Expression lists*. Note that the lambda form is\nmerely a shorthand for a simplified function definition; a function\ndefined in a "``def``" statement can be passed around or assigned to\nanother name just like a function defined by a lambda form. The\n"``def``" form is actually more powerful since it allows the execution\nof multiple statements 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', - '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. For this reason, ``__del__()`` methods should do\n the absolute minimum needed to maintain external invariants.\n Starting with version 1.5, Python guarantees that globals whose\n name begins with a single underscore are deleted from their\n module before other globals are deleted; if no other references\n to such globals exist, this may help in assuring that imported\n modules are still available at the time when the ``__del__()``\n 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\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 overrrides ``__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``. When this method\n is not defined, ``__len__()`` is called, if it is defined (see\n below) and ``True`` is returned when the length is not zero. If a\n class defines neither ``__len__()`` nor ``__bool__()``, all its\n instances are considered true.\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\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 overrrides ``__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``. When this method\n is not defined, ``__len__()`` is called, if it is defined (see\n below) and ``True`` is returned when the length is not zero. If a\n class defines neither ``__len__()`` nor ``__bool__()``, all its\n instances are 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', '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', @@ -42,13 +42,13 @@ '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\nfirst form (without ``from``) repeats these steps for each identifier\nin the list. The form with ``from`` performs step (1) once, and then\nperforms step (2) repeatedly.\n\nIn this context, to "initialize" a built-in or extension module means\nto call an initialization function that the module must provide for\nthe purpose (in the reference implementation, the function\'s name is\nobtained by prepending string "init" to the module\'s name); to\n"initialize" a Python-coded module means to execute the module\'s body.\n\nThe system maintains a table of modules that have been or are being\ninitialized, indexed by module name. This table is accessible as\n``sys.modules``. When a module name is found in this table, step (1)\nis finished. If not, a search for a module definition is started.\nWhen a module is found, it is loaded. Details of the module searching\nand loading process are implementation and platform specific. It\ngenerally involves searching for a "built-in" module with the given\nname and then searching a list of locations given as ``sys.path``.\n\nIf a built-in module is found, its built-in initialization code is\nexecuted and step (1) is finished. If no matching file is found,\n``ImportError`` is raised. If a file is found, it is parsed, yielding\nan executable code block. If a syntax error occurs, ``SyntaxError``\nis raised. Otherwise, an empty module of the given name is created\nand inserted in the module table, and then the code block is executed\nin the context of this module. Exceptions during this execution\nterminate step (1).\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. If the\nwild card form of import --- ``import *`` --- is used in a function\nand the function contains or is a nested block with free variables,\nthe compiler will raise a ``SyntaxError``.\n\n**Hierarchical module names:** when the module names contains one or\nmore dots, the module search path is carried out differently. The\nsequence of identifiers up to the last dot is used to find a\n"package"; the final identifier is then searched inside the package.\nA package is generally a subdirectory of a directory on ``sys.path``\nthat has a file ``__init__.py``.\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', - '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, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(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', + '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': '\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', 'lists': '\nList displays\n*************\n\nA list display is a possibly empty series of expressions enclosed in\nsquare brackets:\n\n list_display ::= "[" [expression_list | comprehension] "]"\n\nA list display yields a new list object, the contents being specified\nby either a list of expressions or a comprehension. When a comma-\nseparated list of expressions is supplied, its elements are evaluated\nfrom left to right and placed into the list object in that order.\nWhen a comprehension is supplied, the list is constructed from the\nelements resulting from the comprehension.\n', 'naming': '\nNaming and binding\n******************\n\n*Names* refer to objects. Names are introduced by name binding\noperations. Each occurrence of a name in the program text refers to\nthe *binding* of that name established in the innermost function block\ncontaining the use.\n\nA *block* is a piece of Python program text that is executed as a\nunit. The following are blocks: a module, a function body, and a class\ndefinition. Each command typed interactively is a block. A script\nfile (a file given as standard input to the interpreter or specified\non the interpreter command line the first argument) is a code block.\nA script command (a command specified on the interpreter command line\nwith the \'**-c**\' option) is a code block. The string argument passed\nto the built-in functions ``eval()`` and ``exec()`` is a code block.\n\nA code block is executed in an *execution frame*. A frame contains\nsome administrative information (used for debugging) and determines\nwhere and how execution continues after the code block\'s execution has\ncompleted.\n\nA *scope* defines the visibility of a name within a block. If a local\nvariable is defined in a block, its scope includes that block. If the\ndefinition occurs in a function block, the scope extends to any blocks\ncontained within the defining one, unless a contained block introduces\na different binding for the name. The scope of names defined in a\nclass block is limited to the class block; it does not extend to the\ncode blocks of methods -- this includes generator expressions since\nthey are implemented using a function scope. This means that the\nfollowing will fail:\n\n class A:\n a = 42\n b = list(a + i for i in range(10))\n\nWhen a name is used in a code block, it is resolved using the nearest\nenclosing scope. The set of all such scopes visible to a code block\nis called the block\'s *environment*.\n\nIf a name is bound in a block, it is a local variable of that block,\nunless declared as ``nonlocal``. If a name is bound at the module\nlevel, it is a global variable. (The variables of the module code\nblock are local and global.) If a variable is used in a code block\nbut not defined there, it is a *free variable*.\n\nWhen a name is not found at all, a ``NameError`` exception is raised.\nIf the name refers to a local variable that has not been bound, a\n``UnboundLocalError`` exception is raised. ``UnboundLocalError`` is a\nsubclass of ``NameError``.\n\nThe following constructs bind names: formal parameters to functions,\n``import`` statements, class and function definitions (these bind the\nclass or function name in the defining block), and targets that are\nidentifiers if occurring in an assignment, ``for`` loop header, or in\nthe second position of an ``except`` clause header. The ``import``\nstatement of the form "``from ...import *``" binds all names defined\nin the imported module, except those beginning with an underscore.\nThis form may only be used at the module level.\n\nA target occurring in a ``del`` statement is also considered bound for\nthis purpose (though the actual semantics are to unbind the name). It\nis illegal to unbind a name that is referenced by an enclosing scope;\nthe compiler will report a ``SyntaxError``.\n\nEach assignment or import statement occurs within a block defined by a\nclass or function definition or at the module level (the top-level\ncode block).\n\nIf a name binding operation occurs anywhere within a code block, all\nuses of the name within the block are treated as references to the\ncurrent block. This can lead to errors when a name is used within a\nblock before it is bound. This rule is subtle. Python lacks\ndeclarations and allows name binding operations to occur anywhere\nwithin a code block. The local variables of a code block can be\ndetermined by scanning the entire text of the block for name binding\noperations.\n\nIf the ``global`` statement occurs within a block, all uses of the\nname specified in the statement refer to the binding of that name in\nthe top-level namespace. Names are resolved in the top-level\nnamespace by searching the global namespace, i.e. the namespace of the\nmodule containing the code block, and the builtin namespace, the\nnamespace of the module ``builtins``. The global namespace is\nsearched first. If the name is not found there, the builtin namespace\nis searched. The global statement must precede all uses of the name.\n\nThe built-in namespace associated with the execution of a code block\nis actually found by looking up the name ``__builtins__`` in its\nglobal namespace; this should be a dictionary or a module (in the\nlatter case the module\'s dictionary is used). By default, when in the\n``__main__`` module, ``__builtins__`` is the built-in module\n``builtins``; when in any other module, ``__builtins__`` is an alias\nfor the dictionary of the ``builtins`` module itself.\n``__builtins__`` can be set to a user-created dictionary to create a\nweak form of restricted execution.\n\nNote: Users should not touch ``__builtins__``; it is strictly an\n implementation detail. Users wanting to override values in the\n built-in namespace should ``import`` the ``builtins`` module and\n modify its attributes appropriately.\n\nThe namespace for a module is automatically created the first time a\nmodule is imported. The main module for a script is always called\n``__main__``.\n\nThe global statement has the same scope as a name binding operation in\nthe same block. If the nearest enclosing scope for a free variable\ncontains a global statement, the free variable is treated as a global.\n\nA class definition is an executable statement that may use and define\nnames. These references follow the normal rules for name resolution.\nThe namespace of the class definition becomes the attribute dictionary\nof the class. Names defined at the class scope are not visible in\nmethods.\n\n\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', 'numbers': "\nNumeric literals\n****************\n\nThere are three types of numeric literals: integers, floating point\nnumbers, and imaginary numbers. There are no complex literals\n(complex numbers can be formed by adding a real number and an\nimaginary number).\n\nNote that numeric literals do not include a sign; a phrase like ``-1``\nis actually an expression composed of the unary operator '``-``' and\nthe literal ``1``.\n", - 'numeric-types': "\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 operations (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\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 operation falls back to the normal methods. For instance, to\n evaluate the expression ``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", + 'numeric-types': "\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", 'objects': '\nObjects, values and types\n*************************\n\n*Objects* are Python\'s abstraction for data. All data in a Python\nprogram is represented by objects or by relations between objects. (In\na sense, and in conformance to Von Neumann\'s model of a "stored\nprogram computer," code is also represented by objects.)\n\nEvery object has an identity, a type and a value. An object\'s\n*identity* never changes once it has been created; you may think of it\nas the object\'s address in memory. The \'``is``\' operator compares the\nidentity of two objects; the ``id()`` function returns an integer\nrepresenting its identity (currently implemented as its address). An\nobject\'s *type* is also unchangeable. [1] An object\'s type determines\nthe operations that the object supports (e.g., "does it have a\nlength?") and also defines the possible values for objects of that\ntype. The ``type()`` function returns an object\'s type (which is an\nobject itself). The *value* of some objects can change. Objects\nwhose value can change are said to be *mutable*; objects whose value\nis unchangeable once they are created are called *immutable*. (The\nvalue of an immutable container object that contains a reference to a\nmutable object can change when the latter\'s value is changed; however\nthe container is still considered immutable, because the collection of\nobjects it contains cannot be changed. So, immutability is not\nstrictly the same as having an unchangeable value, it is more subtle.)\nAn object\'s mutability is determined by its type; for instance,\nnumbers, strings and tuples are immutable, while dictionaries and\nlists are mutable.\n\nObjects are never explicitly destroyed; however, when they become\nunreachable they may be garbage-collected. An implementation is\nallowed to postpone garbage collection or omit it altogether --- it is\na matter of implementation quality how garbage collection is\nimplemented, as long as no objects are collected that are still\nreachable. (Implementation note: the current implementation uses a\nreference-counting scheme with (optional) delayed detection of\ncyclically linked garbage, which collects most objects as soon as they\nbecome unreachable, but is not guaranteed to collect garbage\ncontaining circular references. See the documentation of the ``gc``\nmodule for information on controlling the collection of cyclic\ngarbage.)\n\nNote that the use of the implementation\'s tracing or debugging\nfacilities may keep objects alive that would normally be collectable.\nAlso note that catching an exception with a \'``try``...``except``\'\nstatement may keep objects alive.\n\nSome objects contain references to "external" resources such as open\nfiles or windows. It is understood that these resources are freed\nwhen the object is garbage-collected, but since garbage collection is\nnot guaranteed to happen, such objects also provide an explicit way to\nrelease the external resource, usually a ``close()`` method. Programs\nare strongly recommended to explicitly close such objects. The\n\'``try``...``finally``\' statement and the \'``with``\' statement provide\nconvenient ways to do this.\n\nSome objects contain references to other objects; these are called\n*containers*. Examples of containers are tuples, lists and\ndictionaries. The references are part of a container\'s value. In\nmost cases, when we talk about the value of a container, we imply the\nvalues, not the identities of the contained objects; however, when we\ntalk about the mutability of a container, only the identities of the\nimmediately contained objects are implied. So, if an immutable\ncontainer (like a tuple) contains a reference to a mutable object, its\nvalue changes if that mutable object is changed.\n\nTypes affect almost all aspects of object behavior. Even the\nimportance of object identity is affected in some sense: for immutable\ntypes, operations that compute new values may actually return a\nreference to any existing object with the same type and value, while\nfor mutable objects this is not allowed. E.g., after ``a = 1; b =\n1``, ``a`` and ``b`` may or may not refer to the same object with the\nvalue one, depending on the implementation, but after ``c = []; d =\n[]``, ``c`` and ``d`` are guaranteed to refer to two different,\nunique, newly created empty lists. (Note that ``c = d = []`` assigns\nthe same object to both ``c`` and ``d``.)\n', 'operator-summary': '\nSummary\n*******\n\nThe following table summarizes the operator precedences in Python,\nfrom lowest precedence (least binding) to highest precedence (most\nbinding). Operators in the same box have the same precedence. Unless\nthe syntax is explicitly given, operators are binary. Operators in\nthe same box group left to right (except for comparisons, including\ntests, which all have the same precedence and chain from left to right\n--- see section *Comparisons* --- and exponentiation, which groups\nfrom right to left).\n\n+------------------------------------------------+---------------------------------------+\n| Operator | Description |\n+================================================+=======================================+\n| ``lambda`` | Lambda expression |\n+------------------------------------------------+---------------------------------------+\n| ``or`` | Boolean OR |\n+------------------------------------------------+---------------------------------------+\n| ``and`` | Boolean AND |\n+------------------------------------------------+---------------------------------------+\n| ``not`` *x* | Boolean NOT |\n+------------------------------------------------+---------------------------------------+\n| ``in``, ``not`` ``in`` | Membership tests |\n+------------------------------------------------+---------------------------------------+\n| ``is``, ``is not`` | Identity tests |\n+------------------------------------------------+---------------------------------------+\n| ``<``, ``<=``, ``>``, ``>=``, ``!=``, ``==`` | Comparisons |\n+------------------------------------------------+---------------------------------------+\n| ``|`` | Bitwise OR |\n+------------------------------------------------+---------------------------------------+\n| ``^`` | Bitwise XOR |\n+------------------------------------------------+---------------------------------------+\n| ``&`` | Bitwise AND |\n+------------------------------------------------+---------------------------------------+\n| ``<<``, ``>>`` | Shifts |\n+------------------------------------------------+---------------------------------------+\n| ``+``, ``-`` | Addition and subtraction |\n+------------------------------------------------+---------------------------------------+\n| ``*``, ``/``, ``//``, ``%`` | Multiplication, division, remainder |\n+------------------------------------------------+---------------------------------------+\n| ``+x``, ``-x`` | Positive, negative |\n+------------------------------------------------+---------------------------------------+\n| ``~x`` | Bitwise not |\n+------------------------------------------------+---------------------------------------+\n| ``**`` | Exponentiation |\n+------------------------------------------------+---------------------------------------+\n| ``x[index]`` | Subscription |\n+------------------------------------------------+---------------------------------------+\n| ``x[index:index]`` | Slicing |\n+------------------------------------------------+---------------------------------------+\n| ``x(arguments...)`` | Call |\n+------------------------------------------------+---------------------------------------+\n| ``x.attribute`` | Attribute reference |\n+------------------------------------------------+---------------------------------------+\n| ``(expressions...)`` | Binding, tuple display, generator |\n| | expressions |\n+------------------------------------------------+---------------------------------------+\n| ``[expressions...]`` | List display |\n+------------------------------------------------+---------------------------------------+\n| ``{expressions...}`` | Dictionary or set display |\n+------------------------------------------------+---------------------------------------+\n\n-[ Footnotes ]-\n\n[1] While ``abs(x%y) < abs(y)`` is true mathematically, for floats it\n may not be true numerically due to roundoff. For example, and\n assuming a platform on which a Python float is an IEEE 754 double-\n precision number, in order that ``-1e-100 % 1e100`` have the same\n sign as ``1e100``, the computed result is ``-1e-100 + 1e100``,\n which is numerically exactly equal to ``1e100``. Function\n ``fmod()`` in the ``math`` module returns a result whose sign\n matches the sign of the first argument instead, and so returns\n ``-1e-100`` in this case. Which approach is more appropriate\n depends on the application.\n\n[2] If x is very close to an exact integer multiple of y, it\'s\n possible for ``x//y`` to be one larger than ``(x-x%y)//y`` due to\n rounding. In such cases, Python returns the latter result, in\n order to preserve that ``divmod(x,y)[0] * y + x % y`` be very\n close to ``x``.\n\n[3] While comparisons between strings make sense at the byte level,\n they may be counter-intuitive to users. For example, the strings\n ``"\\u00C7"`` and ``"\\u0327\\u0043"`` compare differently, even\n though they both represent the same unicode character (LATIN\n CAPTITAL LETTER C WITH CEDILLA). To compare strings in a human\n recognizable way, compare using ``unicodedata.normalize()``.\n\n[4] The implementation computes this efficiently, without constructing\n lists or sorting.\n\n[5] Earlier versions of Python used lexicographic comparison of the\n sorted (key, value) lists, but this was very expensive for the\n common case of comparing for equality. An even earlier version of\n Python compared dictionaries by identity only, but this caused\n surprises because people expected to be able to test a dictionary\n for emptiness by comparing it to ``{}``.\n\n[6] Due to automatic garbage-collection, free lists, and the dynamic\n nature of descriptors, you may notice seemingly unusual behaviour\n in certain uses of the ``is`` operator, like those involving\n comparisons between instance methods, or constants. Check their\n documentation for more info.\n', 'pass': '\nThe ``pass`` statement\n**********************\n\n pass_stmt ::= "pass"\n\n``pass`` is a null operation --- when it is executed, nothing happens.\nIt is useful as a placeholder when a statement is required\nsyntactically, but no code needs to be executed, for example:\n\n def f(arg): pass # a function that does nothing (yet)\n\n class C: pass # a class with no methods (yet)\n', @@ -59,18 +59,18 @@ '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\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", - '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. For this reason, ``__del__()`` methods should do\n the absolute minimum needed to maintain external invariants.\n Starting with version 1.5, Python guarantees that globals whose\n name begins with a single underscore are deleted from their\n module before other globals are deleted; if no other references\n to such globals exist, this may help in assuring that imported\n modules are still available at the time when the ``__del__()``\n 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\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 overrrides ``__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``. When this method\n is not defined, ``__len__()`` is called, if it is defined (see\n below) and ``True`` is returned when the length is not zero. If a\n class defines neither ``__len__()`` nor ``__bool__()``, all its\n instances are 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\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 operations (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\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 operation falls back to the normal methods. For instance, to\n evaluate the expression ``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 may also bypass the\n``__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 occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n 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(format_string, *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\nstr.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\n ordinals(integers) to Unicode ordinals, strings or ``None``.\n Unmapped characters are left untouched. Characters mapped to\n ``None`` are deleted.\n\n A *map* for ``translate()`` is usually best created by\n ``str.maketrans()``.\n\n You can use the ``maketrans()`` helper function in the ``string``\n module to create a translation table. For string objects, set the\n *table* argument to ``None`` for translations that only delete\n characters:\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', + '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\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 overrrides ``__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``. When this method\n is not defined, ``__len__()`` is called, if it is defined (see\n below) and ``True`` is returned when the length is not zero. If a\n class defines neither ``__len__()`` nor ``__bool__()``, all its\n instances are 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\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 occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n 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(format_string, *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\nstr.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", '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 is currently a single intrinsic mutable sequence type:\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', + '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 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 clear()\n\n Remove all items from the dictionary.\n\n copy()\n\n Return a shallow copy of the dictionary.\n\n 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\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 five sequence types: strings, byte sequences, byte arrays,\nlists, tuples, and range objects. (For other containers see the\nbuilt-in ``dict``, ``list``, ``set``, and ``tuple`` classes, and the\n``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 occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n 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(format_string, *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\nstr.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\n ordinals(integers) to Unicode ordinals, strings or ``None``.\n Unmapped characters are left untouched. Characters mapped to\n ``None`` are deleted.\n\n A *map* for ``translate()`` is usually best created by\n ``str.maketrans()``.\n\n You can use the ``maketrans()`` helper function in the ``string``\n module to create a translation table. For string objects, set the\n *table* argument to ``None`` for translations that only delete\n characters:\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\'`` | Obselete 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 1e25 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\nbytes.fromhex(string)\nbytearray.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', + '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 occurrences of substring *sub* in the range\n [*start*, *end*]. Optional arguments *start* and *end* are\n 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(format_string, *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\nstr.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\'`` | Obselete 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 1e25 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\nbytes.fromhex(string)\nbytearray.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 translate method differs in semantics from the version available\non 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 ``string.maketrans()`` helper function 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', '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 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', Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Fri Feb 13 00:35:41 2009 @@ -7,7 +7,7 @@ What's New in Python 3.0.1? =========================== -*Release date: XX-XXX-200X* +*Release date: 13-Feb-2009* Core and Builtins ----------------- Modified: python/branches/release30-maint/Misc/RPM/python-3.0.spec ============================================================================== --- python/branches/release30-maint/Misc/RPM/python-3.0.spec (original) +++ python/branches/release30-maint/Misc/RPM/python-3.0.spec Fri Feb 13 00:35:41 2009 @@ -34,7 +34,7 @@ %define name python #--start constants-- -%define version 3.0 +%define version 3.0.1 %define libver 3.0 #--end constants-- %define release 1pydotorg Modified: python/branches/release30-maint/README ============================================================================== --- python/branches/release30-maint/README (original) +++ python/branches/release30-maint/README Fri Feb 13 00:35:41 2009 @@ -1,5 +1,5 @@ -This is Python version 3.0 final -================================ +This is Python version 3.0.1 +============================ For notes specific to this release, see RELNOTES in this directory. Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 @@ -159,7 +159,7 @@ Copyright and License Information --------------------------------- -Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Python Software Foundation. All rights reserved. From python-checkins at python.org Fri Feb 13 00:46:00 2009 From: python-checkins at python.org (barry.warsaw) Date: Fri, 13 Feb 2009 00:46:00 +0100 (CET) Subject: [Python-checkins] r69557 - in python/branches/release30-maint: Doc/README.txt Doc/copyright.rst Doc/license.rst LICENSE PC/python_nt.rc Message-ID: <20090212234600.D600E1E401F@bag.python.org> Author: barry.warsaw Date: Fri Feb 13 00:46:00 2009 New Revision: 69557 Log: More copyright and version number updates. Modified: python/branches/release30-maint/Doc/README.txt python/branches/release30-maint/Doc/copyright.rst python/branches/release30-maint/Doc/license.rst python/branches/release30-maint/LICENSE python/branches/release30-maint/PC/python_nt.rc Modified: python/branches/release30-maint/Doc/README.txt ============================================================================== --- python/branches/release30-maint/Doc/README.txt (original) +++ python/branches/release30-maint/Doc/README.txt Fri Feb 13 00:46:00 2009 @@ -125,7 +125,7 @@ as long as you don't change or remove the copyright notice: ---------------------------------------------------------------------- -Copyright (c) 2000-2008 Python Software Foundation. +Copyright (c) 2000-2009 Python Software Foundation. All rights reserved. Copyright (c) 2000 BeOpen.com. Modified: python/branches/release30-maint/Doc/copyright.rst ============================================================================== --- python/branches/release30-maint/Doc/copyright.rst (original) +++ python/branches/release30-maint/Doc/copyright.rst Fri Feb 13 00:46:00 2009 @@ -4,7 +4,7 @@ Python and this documentation is: -Copyright ?? 2001-2008 Python Software Foundation. All rights reserved. +Copyright ?? 2001-2009 Python Software Foundation. All rights reserved. Copyright ?? 2000 BeOpen.com. All rights reserved. Modified: python/branches/release30-maint/Doc/license.rst ============================================================================== --- python/branches/release30-maint/Doc/license.rst (original) +++ python/branches/release30-maint/Doc/license.rst Fri Feb 13 00:46:00 2009 @@ -95,6 +95,8 @@ +----------------+--------------+------------+------------+-----------------+ | 3.0 | 2.6 | 2008 | PSF | yes | +----------------+--------------+------------+------------+-----------------+ +| 3.0.1 | 3.0 | 2009 | PSF | yes | ++----------------+--------------+------------+------------+-----------------+ .. note:: Modified: python/branches/release30-maint/LICENSE ============================================================================== --- python/branches/release30-maint/LICENSE (original) +++ python/branches/release30-maint/LICENSE Fri Feb 13 00:46:00 2009 @@ -60,6 +60,7 @@ 2.6 2.5 2008 PSF yes 2.6.1 2.6 2008 PSF yes 3.0 2.6 2008 PSF yes + 3.0.1 3.0 2009 PSF yes Footnotes: Modified: python/branches/release30-maint/PC/python_nt.rc ============================================================================== --- python/branches/release30-maint/PC/python_nt.rc (original) +++ python/branches/release30-maint/PC/python_nt.rc Fri Feb 13 00:46:00 2009 @@ -61,7 +61,7 @@ VALUE "FileDescription", "Python Core\0" VALUE "FileVersion", PYTHON_VERSION VALUE "InternalName", "Python DLL\0" - VALUE "LegalCopyright", "Copyright ? 2001-2008 Python Software Foundation. Copyright ? 2000 BeOpen.com. Copyright ? 1995-2001 CNRI. Copyright ? 1991-1995 SMC.\0" + VALUE "LegalCopyright", "Copyright ? 2001-2009 Python Software Foundation. Copyright ? 2000 BeOpen.com. Copyright ? 1995-2001 CNRI. Copyright ? 1991-1995 SMC.\0" VALUE "OriginalFilename", PYTHON_DLL_NAME "\0" VALUE "ProductName", "Python\0" VALUE "ProductVersion", PYTHON_VERSION From python-checkins at python.org Fri Feb 13 00:47:16 2009 From: python-checkins at python.org (barry.warsaw) Date: Fri, 13 Feb 2009 00:47:16 +0100 (CET) Subject: [Python-checkins] r69558 - python/tags/r301 Message-ID: <20090212234716.980E41E4002@bag.python.org> Author: barry.warsaw Date: Fri Feb 13 00:47:16 2009 New Revision: 69558 Log: Tagging 3.0.1 Added: python/tags/r301/ - copied from r69557, /python/branches/release30-maint/ From buildbot at python.org Fri Feb 13 01:08:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 00:08:11 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090213000811.4880A1E4002@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/277 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: 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.x.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From buildbot at python.org Fri Feb 13 02:33:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 01:33:05 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090213013305.944DA1E4002@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/152 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: barry.warsaw 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 Fri Feb 13 02:35:28 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 13 Feb 2009 02:35:28 +0100 (CET) Subject: [Python-checkins] r69559 - python/branches/py3k Message-ID: <20090213013528.7EC551E4002@bag.python.org> Author: benjamin.peterson Date: Fri Feb 13 02:35:28 2009 New Revision: 69559 Log: Blocked revisions 69522,69525,69528,69530,69546 via svnmerge ........ r69522 | raymond.hettinger | 2009-02-11 23:39:46 -0600 (Wed, 11 Feb 2009) | 3 lines Issue 5032: added a step argument to itertools.count() and allowed non-integer arguments. ........ r69525 | raymond.hettinger | 2009-02-12 04:16:19 -0600 (Thu, 12 Feb 2009) | 1 line Fix spaces/tabs in example. ........ r69528 | raymond.hettinger | 2009-02-12 06:04:26 -0600 (Thu, 12 Feb 2009) | 1 line Add an extra testcase. ........ r69530 | raymond.hettinger | 2009-02-12 06:43:01 -0600 (Thu, 12 Feb 2009) | 1 line One more test. ........ r69546 | mark.dickinson | 2009-02-12 11:55:42 -0600 (Thu, 12 Feb 2009) | 2 lines Typo fix. ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Fri Feb 13 03:19:10 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 02:19:10 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.6 Message-ID: <20090213021910.E74AD1E4002@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/82 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: 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') ====================================================================== 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: benjamin.peterson Date: Fri Feb 13 03:50:59 2009 New Revision: 69560 Log: Merged revisions 69364-69365,69409-69410,69413,69417,69435,69442,69447,69495,69519-69521 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69364 | kristjan.jonsson | 2009-02-06 04:17:34 -0600 (Fri, 06 Feb 2009) | 1 line Fix a number of Win32ErrorTests error cases. chmod wasn't being tested. 'access' never raises an error. ........ r69365 | armin.rigo | 2009-02-06 05:46:26 -0600 (Fri, 06 Feb 2009) | 2 lines Ivan on IRC in #twisted reported this crasher. ........ r69409 | georg.brandl | 2009-02-07 06:21:17 -0600 (Sat, 07 Feb 2009) | 1 line #5174: fix wrong file closing in example. ........ r69410 | neil.schemenauer | 2009-02-07 08:53:31 -0600 (Sat, 07 Feb 2009) | 4 lines Fix broken test in test_hotshot. Treating the current directory as an empty file is sloppy and non-portable. Use NamedTemporaryFile to make an empty file. ........ r69413 | neil.schemenauer | 2009-02-07 12:35:16 -0600 (Sat, 07 Feb 2009) | 2 lines Add test for issue #999042, explict global statement works. ........ r69417 | benjamin.peterson | 2009-02-07 17:01:19 -0600 (Sat, 07 Feb 2009) | 1 line document individual 2to3 fixers ........ r69435 | benjamin.peterson | 2009-02-08 08:38:13 -0600 (Sun, 08 Feb 2009) | 1 line document numliterals fixer ........ r69442 | benjamin.peterson | 2009-02-08 09:14:57 -0600 (Sun, 08 Feb 2009) | 1 line a few edits and typos ........ r69447 | vinay.sajip | 2009-02-08 13:06:08 -0600 (Sun, 08 Feb 2009) | 2 lines Issue #5170: Fixed Unicode output bug in logging and added test case. This is a regression which did not occur in 2.5. ........ r69495 | kristjan.jonsson | 2009-02-10 07:32:24 -0600 (Tue, 10 Feb 2009) | 1 line Issue 4804. Add a function to test the validity of file descriptors on Windows, and stop using global runtime settings to silence the warnings / assertions. ........ r69519 | gregory.p.smith | 2009-02-11 17:45:25 -0600 (Wed, 11 Feb 2009) | 3 lines Issue #1008086: Fixes socket.inet_aton() to always return 4 bytes even on LP64 platforms (most 64-bit Linux, bsd, unix systems). ........ r69520 | benjamin.peterson | 2009-02-11 21:50:00 -0600 (Wed, 11 Feb 2009) | 1 line os.fsync() should be used to ensure that data is written to disk ........ r69521 | benjamin.peterson | 2009-02-11 22:17:04 -0600 (Wed, 11 Feb 2009) | 1 line no need for this __bases__ trick anymore ........ Added: python/branches/py3k/Lib/test/crashers/compiler_recursion.py - copied unchanged from r69365, /python/trunk/Lib/test/crashers/compiler_recursion.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/2to3.rst python/branches/py3k/Doc/library/stdtypes.rst python/branches/py3k/Doc/tools/sphinxext/pyspecific.py python/branches/py3k/Include/fileobject.h python/branches/py3k/Lib/logging/__init__.py python/branches/py3k/Lib/test/test_logging.py python/branches/py3k/Lib/test/test_os.py python/branches/py3k/Lib/test/test_socket.py python/branches/py3k/Modules/_fileio.c python/branches/py3k/Modules/socketmodule.c python/branches/py3k/Objects/exceptions.c Modified: python/branches/py3k/Doc/library/2to3.rst ============================================================================== --- python/branches/py3k/Doc/library/2to3.rst (original) +++ python/branches/py3k/Doc/library/2to3.rst Fri Feb 13 03:50:59 2009 @@ -14,6 +14,8 @@ automatically. +.. _2to3-using: + Using 2to3 ---------- @@ -52,10 +54,10 @@ Comments and exact indentation are preserved throughout the translation process. -By default, 2to3 runs a set of predefined fixers. The :option:`-l` flag lists -all available fixers. An explicit set of fixers to run can be given with -:option:`-f`. Likewise the :option:`-x` explicitly disables a fixer. The -following example runs only the ``imports`` and ``has_key`` fixers:: +By default, 2to3 runs a set of :ref:`predefined fixers <2to3-fixers>`. The +:option:`-l` flag lists all available fixers. An explicit set of fixers to run +can be given with :option:`-f`. Likewise the :option:`-x` explicitly disables a +fixer. The following example runs only the ``imports`` and ``has_key`` fixers:: $ 2to3 -f imports -f has_key example.py @@ -84,12 +86,263 @@ The :option:`-v` option enables output of more information on the translation process. -When the :option:`-p` is passed, 2to3 treats ``print`` as a function instead of -a statement. This is useful when ``from __future__ import print_function`` is -being used. If this option is not given, the print fixer will surround print -calls in an extra set of parentheses because it cannot differentiate between the -print statement with parentheses (such as ``print ("a" + "b" + "c")``) and a -true function call. +When the :option:`-p` is passed, the :2to3fixer:`print` fixer ``print`` as a +function instead of a statement. This is useful when ``from __future__ import +print_function`` is being used. If this option is not given, the print fixer +will surround print calls in an extra set of parentheses because it cannot +differentiate between the print statement with parentheses (such as ``print +("a" + "b" + "c")``) and a true function call. + + +.. _2to3-fixers: + +Fixers +------ + +Each step of tranforming code is encapsulated in a fixer. The command ``2to3 +-l`` lists them. As :ref:`documented above <2to3-using>`, each can be turned on +and off individually. They are described here in more detail. + + +.. 2to3fixer:: apply + + Removes usage of :func:`apply`. For example ``apply(function, *args, + **kwargs)`` is converted to ``function(*args, **kwargs)``. + +.. 2to3fixer:: basestring + + Converts :class:`basestring` to :class:`str`. + +.. 2to3fixer:: buffer + + Converts :class:`buffer` to :class:`memoryview`. This fixer is optional + because the :class:`memoryview` API is similar but not exactly the same as + that of :class:`buffer`. + +.. 2to3fixer:: callable + + Converts ``callable(x)`` to ``hasattr(x, "__call_")``. + +.. 2to3fixer:: dict + + Fixes dictionary iteration methods. :meth:`dict.iteritems` is converted to + :meth:`dict.items`, :meth:`dict.iterkeys` to :meth:`dict.keys`, and + :meth:`dict.itervalues` to :meth:`dict.values`. It also wraps existing + usages of :meth:`dict.items`, :meth:`dict.keys`, and :meth:`dict.values` in a + call to :class:`list`. + +.. 2to3fixer:: except + + Converts ``except X, T`` to ``except X as T``. + +.. 2to3fixer:: exec + + Converts the :keyword:`exec` statement to the :func:`exec` function. + +.. 2to3fixer:: execfile + + Removes usage of :func:`execfile`. The argument to :func:`execfile` is + wrapped in calls to :func:`open`, :func:`compile`, and :func:`exec`. + +.. 2to3fixer:: filter + + Wraps :func:`filter` usage in a :class:`list` call. + +.. 2to3fixer:: funcattrs + + Fixes function attributes that have been renamed. For example, + ``my_function.func_closure`` is converted to ``my_function.__closure__``. + +.. 2to3fixer:: future + + Removes ``from __future__ import new_feature`` statements. + +.. 2to3fixer:: getcwdu + + Renames :func:`os.getcwdu` to :func:`os.getcwd`. + +.. 2to3fixer:: has_key + + Changes ``dict.has_key(key)`` to ``key in dict``. + +.. 2to3fixer:: idioms + + This optional fixer preforms several transformations that make Python code + more idiomatic. Type comparisions like ``type(x) is SomeClass`` and + ``type(x) == SomeClass`` are converted to ``isinstance(x, SomeClass)``. + ``while 1`` becomes ``while True``. This fixer also tries to make use of + :func:`sorted` in appropiate places. For example, this block :: + + L = list(some_iterable) + L.sort() + + is changed to :: + + L = sorted(some_iterable) + +.. 2to3fixer:: import + + Detects sibling imports and converts them to relative imports. + +.. 2to3fixer:: imports + + Handles module renames in the standard library. + +.. 2to3fixer:: imports2 + + Handles other modules renames in the standard library. It is separate from + the :2to3fixer:`imports` fixer only because of technical limitations. + +.. 2to3fixer:: input + + Converts ``input(prompt)`` to ``eval(input(prompt))`` + +.. 2to3fixer:: intern + + Converts :func:`intern` to :func:`sys.intern`. + +.. 2to3fixer:: isinstance + + Fixes duplicate types in the second argument of :func:`isinstance`. For + example, ``isinstance(x, (int, int))`` is converted to ``isinstance(x, + (int))``. + +.. 2to3fixer:: itertools_imports + + Removes imports of :func:`itertools.ifilter`, :func:`itertools.izip`, and + :func:`itertools.imap`. Imports of :func:`itertools.ifilterfalse` are also + changed to :func:`itertools.filterfalse`. + +.. 2to3fixer:: itertools + + Changes usage of :func:`itertools.ifilter`, :func:`itertools.izip`, and + :func:`itertools.imap` to their builtin equivalents. + :func:`itertools.ifilterfalse` is changed to :func:`itertools.filterfalse`. + +.. 2to3fixer:: long + + Strips the ``L`` prefix on long literals and renames :class:`long` to + :class:`int`. + +.. 2to3fixer:: map + + Wraps :func:`map` in a :class:`list` call. It also changes ``map(None, x)`` + to ``list(x)``. Using ``from future_builtins import map`` disables this + fixer. + +.. 2to3fixer:: metaclass + + Converts the old metaclass syntax (``__metaclass__ = Meta`` in the class + body) to the new (``class X(metaclass=Meta)``). + +.. 2to3fixer:: methodattrs + + Fixes old method attribute names. For example, ``meth.im_func`` is converted + to ``meth.__func__``. + +.. 2to3fixer:: ne + + Converts the old not-equal syntax, ``<>``, to ``!=``. + +.. 2to3fixer:: next + + Converts the use of iterator's :meth:`next` methods to the :func:`next` + function. It also renames :meth:`next` methods to :meth:`~object.__next__`. + +.. 2to3fixer:: nonzero + + Renames :meth:`~object.__nonzero__` to :meth:`~object.__bool__`. + +.. 2to3fixer:: numliterals + + Converts octal literals into the new syntax. + +.. 2to3fixer:: paren + + Add extra parenthesis where they are required in list comprehensions. For + example, ``[x for x in 1, 2]`` becomes ``[x for x in (1, 2)]``. + +.. 2to3fixer:: print + + Converts the :keyword:`print` statement to the :func:`print` function. + +.. 2to3fixer:: raises + + Converts ``raise E, V`` to ``raise E(V)``, and ``raise E, V, T`` to ``raise + E(V).with_traceback(T)``. If ``E`` is a tuple, the translation will be + incorrect because substituting tuples for exceptions has been removed in 3.0. + +.. 2to3fixer:: raw_input + + Converts :func:`raw_input` to :func:`input`. + +.. 2to3fixer:: reduce + + Handles the move of :func:`reduce` to :func:`functools.reduce`. + +.. 2to3fixer:: renames + + Changes :data:`sys.maxint` to :data:`sys.maxsize`. + +.. 2to3fixer:: repr + + Replaces backtick repr with the :func:`repr` function. + +.. 2to3fixer:: set_literal + + Replaces use of the :class:`set` constructor with set literals. This fixer + is optional. + +.. 2to3fixer:: standard_error + + Renames :exc:`StandardError` to :exc:`Exception`. + +.. 2to3fixer:: sys_exc + + Changes the deprecated :data:`sys.exc_value`, :data:`sys.exc_type`, + :data:`sys.exc_traceback` to use :func:`sys.exc_info`. + +.. 2to3fixer:: throw + + Fixes the API change in generator's :meth:`throw` method. + +.. 2to3fixer:: tuple_params + + Removes implicit tuple parameter unpacking. This fixer inserts temporary + variables. + +.. 2to3fixer:: types + + Fixes code broken from the removal of some members in the :mod:`types` + module. + +.. 2to3fixer:: unicode + + Renames :class:`unicode` to :class:`str`. + +.. 2to3fixer:: urllib + + Handles the rename of :mod:`urllib` and :mod:`urllib2` to the :mod:`urllib` + package. + +.. 2to3fixer:: ws_comma + + Removes excess whitespace from comma separated items. This fixer is + optional. + +.. 2to3fixer:: xrange + + Renames :func:`xrange` to :func:`range` and wraps existing :func:`range` + calls with :class:`list`. + +.. 2to3fixer:: xreadlines + + Changes ``for x in file.xreadlines()`` to ``for x in file``. + +.. 2to3fixer:: zip + + Wraps :func:`zip` usage in a :class:`list` call. This is disabled when + ``from future_builtins import zip`` appears. :mod:`lib2to3` - 2to3's library Modified: python/branches/py3k/Doc/library/stdtypes.rst ============================================================================== --- python/branches/py3k/Doc/library/stdtypes.rst (original) +++ python/branches/py3k/Doc/library/stdtypes.rst Fri Feb 13 03:50:59 2009 @@ -2061,6 +2061,11 @@ Flush the internal buffer, like ``stdio``'s :cfunc:`fflush`. This may be a no-op on some file-like objects. + .. note:: + + :meth:`flush` does not necessarily write the file's data to disk. Use + :meth:`flush` followed by :func:`os.fsync` to ensure this behavior. + .. method:: file.fileno() Modified: python/branches/py3k/Doc/tools/sphinxext/pyspecific.py ============================================================================== --- python/branches/py3k/Doc/tools/sphinxext/pyspecific.py (original) +++ python/branches/py3k/Doc/tools/sphinxext/pyspecific.py Fri Feb 13 03:50:59 2009 @@ -122,3 +122,4 @@ app.add_builder(suspicious.CheckSuspiciousMarkupBuilder) app.add_description_unit('opcode', 'opcode', '%s (opcode)', parse_opcode_signature) + app.add_description_unit('2to3fixer', '2to3fixer', '%s (2to3 fixer)') Modified: python/branches/py3k/Include/fileobject.h ============================================================================== --- python/branches/py3k/Include/fileobject.h (original) +++ python/branches/py3k/Include/fileobject.h Fri Feb 13 03:50:59 2009 @@ -30,6 +30,17 @@ PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int); PyAPI_DATA(PyTypeObject) PyStdPrinter_Type; +#if defined _MSC_VER && _MSC_VER >= 1400 +/* A routine to check if a file descriptor is valid on Windows. Returns 0 + * and sets errno to EBADF if it isn't. This is to avoid Assertions + * from various functions in the Windows CRT beginning with + * Visual Studio 2005 + */ +int _PyVerify_fd(int fd); +#else +#define _PyVerify_fd(A) (1) /* dummy */ +#endif + #ifdef __cplusplus } #endif Modified: python/branches/py3k/Lib/logging/__init__.py ============================================================================== --- python/branches/py3k/Lib/logging/__init__.py (original) +++ python/branches/py3k/Lib/logging/__init__.py Fri Feb 13 03:50:59 2009 @@ -758,17 +758,19 @@ """ try: msg = self.format(record) + stream = self.stream fs = "%s\n" if not _unicode: #if no unicode support... - self.stream.write(fs % msg) + stream.write(fs % msg) else: try: - if getattr(self.stream, 'encoding', None) is not None: - self.stream.write(fs % msg.encode(self.stream.encoding)) + if (isinstance(msg, unicode) or + getattr(stream, 'encoding', None) is None): + stream.write(fs % msg) else: - self.stream.write(fs % msg) + stream.write(fs % msg.encode(stream.encoding)) except UnicodeError: - self.stream.write(fs % msg.encode("UTF-8")) + stream.write(fs % msg.encode("UTF-8")) self.flush() except (KeyboardInterrupt, SystemExit): raise 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 Feb 13 03:50:59 2009 @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2001-2004 by Vinay Sajip. All Rights Reserved. +# Copyright 2001-2009 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, @@ -18,13 +18,14 @@ """Test harness for the logging module. Run all tests. -Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved. +Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved. """ import logging import logging.handlers import logging.config +import codecs import copy import pickle import io @@ -860,6 +861,7 @@ ('foo', 'DEBUG', '3'), ]) + class EncodingTest(BaseTest): def test_encoding_plain_file(self): # In Python 2.x, a plain file object is treated as having no encoding. @@ -886,6 +888,27 @@ if os.path.isfile(fn): os.remove(fn) + def test_encoding_cyrillic_unicode(self): + log = logging.getLogger("test") + #Get a message in Unicode: Do svidanya in Cyrillic (meaning goodbye) + message = '\u0434\u043e \u0441\u0432\u0438\u0434\u0430\u043d\u0438\u044f' + #Ensure it's written in a Cyrillic encoding + writer_class = codecs.getwriter('cp1251') + stream = io.BytesIO() + writer = writer_class(stream, 'strict') + handler = logging.StreamHandler(writer) + log.addHandler(handler) + try: + log.warning(message) + finally: + log.removeHandler(handler) + handler.close() + # check we wrote exactly those bytes, ignoring trailing \n etc + s = stream.getvalue() + #Compare against what the data should be when encoded in CP-1251 + self.assertEqual(s, b'\xe4\xee \xf1\xe2\xe8\xe4\xe0\xed\xe8\xff\n') + + class WarningsTest(BaseTest): def test_warnings(self): logging.captureWarnings(True) 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 Fri Feb 13 03:50:59 2009 @@ -576,16 +576,18 @@ self.assertRaises(WindowsError, os.chdir, support.TESTFN) def test_mkdir(self): - self.assertRaises(WindowsError, os.chdir, support.TESTFN) + f = open(test_support.TESTFN, "w") + try: + self.assertRaises(WindowsError, os.mkdir, support.TESTFN) + finally: + f.close() + os.unlink(test_support.TESTFN) def test_utime(self): self.assertRaises(WindowsError, os.utime, support.TESTFN, None) - def test_access(self): - self.assertRaises(WindowsError, os.utime, support.TESTFN, 0) - def test_chmod(self): - self.assertRaises(WindowsError, os.utime, support.TESTFN, 0) + self.assertRaises(WindowsError, os.chmod, support.TESTFN, 0) class TestInvalidFD(unittest.TestCase): singles = ["fchdir", "dup", "fdopen", "fdatasync", "fstat", Modified: python/branches/py3k/Lib/test/test_socket.py ============================================================================== --- python/branches/py3k/Lib/test/test_socket.py (original) +++ python/branches/py3k/Lib/test/test_socket.py Fri Feb 13 03:50:59 2009 @@ -398,6 +398,14 @@ # Check that setting it to an invalid type raises TypeError self.assertRaises(TypeError, socket.setdefaulttimeout, "spam") + def testIPv4_inet_aton_fourbytes(self): + if not hasattr(socket, 'inet_aton'): + return # No inet_aton, nothing to check + # Test that issue1008086 and issue767150 are fixed. + # It must return 4 bytes. + self.assertEquals(b'\x00'*4, socket.inet_aton('0.0.0.0')) + self.assertEquals(b'\xff'*4, socket.inet_aton('255.255.255.255')) + def testIPv4toString(self): if not hasattr(socket, 'inet_pton'): return # No inet_pton() on this platform Modified: python/branches/py3k/Modules/_fileio.c ============================================================================== --- python/branches/py3k/Modules/_fileio.c (original) +++ python/branches/py3k/Modules/_fileio.c Fri Feb 13 03:50:59 2009 @@ -146,7 +146,7 @@ { #if defined(HAVE_FSTAT) struct stat buf; - if (fstat(fd, &buf) < 0 && errno == EBADF) { + if (!_PyVerify_fd(fd) || (fstat(fd, &buf) < 0 && errno == EBADF)) { PyObject *exc; char *msg = strerror(EBADF); exc = PyObject_CallFunction(PyExc_OSError, "(is)", Modified: python/branches/py3k/Modules/socketmodule.c ============================================================================== --- python/branches/py3k/Modules/socketmodule.c (original) +++ python/branches/py3k/Modules/socketmodule.c Fri Feb 13 03:50:59 2009 @@ -3567,8 +3567,11 @@ #endif #if !defined(HAVE_INET_ATON) || defined(USE_INET_ATON_WEAKLINK) +#if (SIZEOF_INT != 4) +#error "Not sure if in_addr_t exists and int is not 32-bits." +#endif /* Have to use inet_addr() instead */ - unsigned long packed_addr; + unsigned int packed_addr; #endif char *ip_addr; @@ -5090,7 +5093,10 @@ inet_pton(int af, const char *src, void *dst) { if (af == AF_INET) { - long packed_addr; +#if (SIZEOF_INT != 4) +#error "Not sure if in_addr_t exists and int is not 32-bits." +#endif + unsigned int packed_addr; packed_addr = inet_addr(src); if (packed_addr == INADDR_NONE) return 0; Modified: python/branches/py3k/Objects/exceptions.c ============================================================================== --- python/branches/py3k/Objects/exceptions.c (original) +++ python/branches/py3k/Objects/exceptions.c Fri Feb 13 03:50:59 2009 @@ -1776,28 +1776,6 @@ if (PyDict_SetItemString(bdict, # TYPE, PyExc_ ## TYPE)) \ Py_FatalError("Module dictionary insertion problem."); -#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__) -/* crt variable checking in VisualStudio .NET 2005 */ -#include - -static int prevCrtReportMode; -static _invalid_parameter_handler prevCrtHandler; - -/* Invalid parameter handler. Sets a ValueError exception */ -static void -InvalidParameterHandler( - const wchar_t * expression, - const wchar_t * function, - const wchar_t * file, - unsigned int line, - uintptr_t pReserved) -{ - /* Do nothing, allow execution to continue. Usually this - * means that the CRT will set errno to EINVAL - */ -} -#endif - void _PyExc_Init(void) @@ -1949,13 +1927,6 @@ } Py_DECREF(bltinmod); - -#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__) - /* Set CRT argument error handler */ - prevCrtHandler = _set_invalid_parameter_handler(InvalidParameterHandler); - /* turn off assertions in debug mode */ - prevCrtReportMode = _CrtSetReportMode(_CRT_ASSERT, 0); -#endif } void @@ -1963,9 +1934,4 @@ { Py_XDECREF(PyExc_MemoryErrorInst); PyExc_MemoryErrorInst = NULL; -#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__) - /* reset CRT error handling */ - _set_invalid_parameter_handler(prevCrtHandler); - _CrtSetReportMode(_CRT_ASSERT, prevCrtReportMode); -#endif } From python-checkins at python.org Fri Feb 13 04:00:01 2009 From: python-checkins at python.org (gregory.p.smith) Date: Fri, 13 Feb 2009 04:00:01 +0100 (CET) Subject: [Python-checkins] r69561 - in python/trunk: Lib/test/test_hashlib.py Misc/NEWS Modules/_hashopenssl.c Modules/hashlib.h Modules/md5.c Modules/md5.h Modules/md5module.c Modules/sha256module.c Modules/sha512module.c Modules/shamodule.c Message-ID: <20090213030001.0DA541E4002@bag.python.org> Author: gregory.p.smith Date: Fri Feb 13 04:00:00 2009 New Revision: 69561 Log: - 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). (backported from a py3k branch) Added: python/trunk/Modules/hashlib.h Modified: python/trunk/Lib/test/test_hashlib.py python/trunk/Misc/NEWS python/trunk/Modules/_hashopenssl.c python/trunk/Modules/md5.c python/trunk/Modules/md5.h python/trunk/Modules/md5module.c python/trunk/Modules/sha256module.c python/trunk/Modules/sha512module.c python/trunk/Modules/shamodule.c Modified: python/trunk/Lib/test/test_hashlib.py ============================================================================== --- python/trunk/Lib/test/test_hashlib.py (original) +++ python/trunk/Lib/test/test_hashlib.py Fri Feb 13 04:00:00 2009 @@ -39,11 +39,11 @@ h = hashlib.new(name) self.assert_(hexstr(h.digest()) == h.hexdigest()) - def test_large_update(self): aas = 'a' * 128 bees = 'b' * 127 cees = 'c' * 126 + abcs = aas + bees + cees for name in self.supported_hash_names: m1 = hashlib.new(name) @@ -52,8 +52,11 @@ m1.update(cees) m2 = hashlib.new(name) - m2.update(aas + bees + cees) - self.assertEqual(m1.digest(), m2.digest()) + m2.update(abcs) + self.assertEqual(m1.digest(), m2.digest(), name+' update problem.') + + m3 = hashlib.new(name, abcs) + self.assertEqual(m1.digest(), m3.digest(), name+' new problem.') def check(self, name, data, digest): # test the direct constructors @@ -63,6 +66,18 @@ computed = hashlib.new(name, data).hexdigest() self.assert_(computed == digest) + def check_no_unicode(self, algorithm_name): + # Unicode objects are not allowed as input. + self.assertRaises(TypeError, getattr(hashlib, algorithm_name), u'spam') + self.assertRaises(TypeError, hashlib.new, algorithm_name, u'spam') + + def test_no_unicode(self): + self.check_no_unicode('md5') + self.check_no_unicode('sha1') + self.check_no_unicode('sha224') + self.check_no_unicode('sha256') + self.check_no_unicode('sha384') + self.check_no_unicode('sha512') def test_case_md5_0(self): self.check('md5', '', 'd41d8cd98f00b204e9800998ecf8427e') Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Feb 13 04:00:00 2009 @@ -508,6 +508,10 @@ Extension Modules ----------------- +- 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). + - Issue #4397: Fix occasional test_socket failure on OS X. - Issue #4279: Fix build of parsermodule under Cygwin. Modified: python/trunk/Modules/_hashopenssl.c ============================================================================== --- python/trunk/Modules/_hashopenssl.c (original) +++ python/trunk/Modules/_hashopenssl.c Fri Feb 13 04:00:00 2009 @@ -1,7 +1,7 @@ /* Module that wraps all OpenSSL hash algorithms */ /* - * Copyright (C) 2005 Gregory P. Smith (greg at krypto.org) + * Copyright (C) 2005-2007 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: @@ -15,6 +15,7 @@ #include "Python.h" #include "structmember.h" +#include "hashlib.h" /* EVP is the preferred interface to hashing in OpenSSL */ #include @@ -30,6 +31,11 @@ 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?) + */ } EVPobject; @@ -160,24 +166,30 @@ static PyObject * EVP_update(EVPobject *self, PyObject *args) { - unsigned char *cp; - Py_ssize_t len; + PyObject *obj; + Py_buffer view; - if (!PyArg_ParseTuple(args, "s#:update", &cp, &len)) + if (!PyArg_ParseTuple(args, "O:update", &obj)) return NULL; - if (len > 0 && len <= MUNCH_SIZE) { - EVP_DigestUpdate(&self->ctx, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t, - unsigned int)); + 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)); } else { - Py_ssize_t offset = 0; - while (len) { + 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 + offset, process); + EVP_DigestUpdate(&self->ctx, cp, process); len -= process; - offset += process; + cp += process; } } + + PyBuffer_Release(&view); + Py_INCREF(Py_None); return Py_None; } @@ -241,24 +253,31 @@ { static char *kwlist[] = {"name", "string", NULL}; PyObject *name_obj = NULL; + PyObject *data_obj = NULL; + Py_buffer view; char *nameStr; - unsigned char *cp = NULL; - Py_ssize_t len = 0; const EVP_MD *digest; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|s#:HASH", kwlist, - &name_obj, &cp, &len)) { + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:HASH", kwlist, + &name_obj, &data_obj)) { return -1; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view, -1); + if (!PyArg_Parse(name_obj, "s", &nameStr)) { PyErr_SetString(PyExc_TypeError, "name must be a string"); + if (data_obj) + PyBuffer_Release(&view); return -1; } digest = EVP_get_digestbyname(nameStr); if (!digest) { PyErr_SetString(PyExc_ValueError, "unknown hash function"); + if (data_obj) + PyBuffer_Release(&view); return -1; } EVP_DigestInit(&self->ctx, digest); @@ -266,21 +285,23 @@ self->name = name_obj; Py_INCREF(self->name); - if (cp && len) { - if (len > 0 && len <= MUNCH_SIZE) { - EVP_DigestUpdate(&self->ctx, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t, - unsigned int)); + 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)); } else { - Py_ssize_t offset = 0; - while (len) { + 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 + offset, process); + EVP_DigestUpdate(&self->ctx, cp, process); len -= process; - offset += process; + cp += process; } } + PyBuffer_Release(&view); } - + return 0; } #endif @@ -373,7 +394,7 @@ unsigned int)); } else { Py_ssize_t offset = 0; - while (len) { + while (len > 0) { unsigned int process = len > MUNCH_SIZE ? MUNCH_SIZE : len; EVP_DigestUpdate(&self->ctx, cp + offset, process); len -= process; @@ -400,13 +421,14 @@ { static char *kwlist[] = {"name", "string", NULL}; PyObject *name_obj = NULL; + PyObject *data_obj = NULL; + Py_buffer view = { 0 }; + PyObject *ret_obj; char *name; const EVP_MD *digest; - unsigned char *cp = NULL; - Py_ssize_t len = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "O|s#:new", kwlist, - &name_obj, &cp, &len)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "O|O:new", kwlist, + &name_obj, &data_obj)) { return NULL; } @@ -415,9 +437,17 @@ return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view, NULL); + digest = EVP_get_digestbyname(name); - return EVPnew(name_obj, digest, NULL, cp, len); + ret_obj = EVPnew(name_obj, digest, NULL, (unsigned char*)view.buf, + Py_SAFE_DOWNCAST(view.len, Py_ssize_t, unsigned int)); + + if (data_obj) + PyBuffer_Release(&view); + return ret_obj; } /* @@ -431,18 +461,27 @@ static PyObject * \ EVP_new_ ## NAME (PyObject *self, PyObject *args) \ { \ - unsigned char *cp = NULL; \ - Py_ssize_t len = 0; \ + PyObject *data_obj = NULL; \ + Py_buffer view = { 0 }; \ + PyObject *ret_obj; \ \ - if (!PyArg_ParseTuple(args, "|s#:" #NAME , &cp, &len)) { \ + if (!PyArg_ParseTuple(args, "|O:" #NAME , &data_obj)) { \ return NULL; \ } \ \ - return EVPnew( \ - CONST_ ## NAME ## _name_obj, \ - NULL, \ - CONST_new_ ## NAME ## _ctx_p, \ - cp, len); \ + if (data_obj) \ + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view, NULL); \ + \ + ret_obj = EVPnew( \ + CONST_ ## NAME ## _name_obj, \ + NULL, \ + CONST_new_ ## NAME ## _ctx_p, \ + (unsigned char*)view.buf, \ + Py_SAFE_DOWNCAST(view.len, Py_ssize_t, unsigned int)); \ + \ + if (data_obj) \ + PyBuffer_Release(&view); \ + return ret_obj; \ } /* a PyMethodDef structure for the constructor */ Added: python/trunk/Modules/hashlib.h ============================================================================== --- (empty file) +++ python/trunk/Modules/hashlib.h Fri Feb 13 04:00:00 2009 @@ -0,0 +1,28 @@ +/* Common code for use by all hashlib related modules. */ + +/* + * Given a PyObject* obj, fill in the Py_buffer* viewp with the result + * of PyObject_GetBuffer. Sets and exception and issues a returns + * on any errors. + */ +#define GET_BUFFER_VIEW_OR_ERROUT(obj, viewp, error_return) do { \ + if (PyUnicode_Check((obj))) { \ + PyErr_SetString(PyExc_TypeError, \ + "Unicode-objects must be encoded before hashing");\ + return error_return; \ + } \ + if (!PyObject_CheckBuffer((obj))) { \ + PyErr_SetString(PyExc_TypeError, \ + "object supporting the buffer API required"); \ + return error_return; \ + } \ + if (PyObject_GetBuffer((obj), (viewp), PyBUF_SIMPLE) == -1) { \ + return error_return; \ + } \ + if ((viewp)->ndim > 1) { \ + PyErr_SetString(PyExc_BufferError, \ + "Buffer must be single dimension"); \ + PyBuffer_Release((viewp)); \ + return error_return; \ + } \ + } while(0); Modified: python/trunk/Modules/md5.c ============================================================================== --- python/trunk/Modules/md5.c (original) +++ python/trunk/Modules/md5.c Fri Feb 13 04:00:00 2009 @@ -321,10 +321,10 @@ } void -md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes) +md5_append(md5_state_t *pms, const md5_byte_t *data, unsigned int nbytes) { const md5_byte_t *p = data; - int left = nbytes; + unsigned int left = nbytes; int offset = (pms->count[0] >> 3) & 63; md5_word_t nbits = (md5_word_t)(nbytes << 3); @@ -333,7 +333,7 @@ /* this special case is handled recursively */ if (nbytes > INT_MAX - offset) { - int overlap; + unsigned int overlap; /* handle the append in two steps to prevent overflow */ overlap = 64 - offset; @@ -351,7 +351,7 @@ /* Process an initial partial block. */ if (offset) { - int copy = (offset + nbytes > 64 ? 64 - offset : nbytes); + unsigned int copy = (offset + nbytes > 64 ? 64 - offset : nbytes); memcpy(pms->buf + offset, p, copy); if (offset + copy < 64) Modified: python/trunk/Modules/md5.h ============================================================================== --- python/trunk/Modules/md5.h (original) +++ python/trunk/Modules/md5.h Fri Feb 13 04:00:00 2009 @@ -79,7 +79,7 @@ void md5_init(md5_state_t *pms); /* Append a string to the message. */ -void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes); +void md5_append(md5_state_t *pms, const md5_byte_t *data, unsigned int nbytes); /* Finish the message and return the digest. */ void md5_finish(md5_state_t *pms, md5_byte_t digest[16]); Modified: python/trunk/Modules/md5module.c ============================================================================== --- python/trunk/Modules/md5module.c (original) +++ python/trunk/Modules/md5module.c Fri Feb 13 04:00:00 2009 @@ -12,6 +12,7 @@ #include "Python.h" #include "structmember.h" #include "md5.h" +#include "hashlib.h" typedef struct { PyObject_HEAD @@ -50,14 +51,18 @@ static PyObject * md5_update(md5object *self, PyObject *args) { - unsigned char *cp; - int len; + PyObject *data_obj; + Py_buffer view; - if (!PyArg_ParseTuple(args, "s#:update", &cp, &len)) + if (!PyArg_ParseTuple(args, "O:update", &data_obj)) return NULL; - md5_append(&self->md5, cp, len); + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view, NULL); + md5_append(&self->md5, (unsigned char*)view.buf, + Py_SAFE_DOWNCAST(view.len, Py_ssize_t, unsigned int)); + + PyBuffer_Release(&view); Py_INCREF(Py_None); return Py_None; } @@ -261,18 +266,25 @@ MD5_new(PyObject *self, PyObject *args) { md5object *md5p; - unsigned char *cp = NULL; - int len = 0; + PyObject *data_obj = NULL; + Py_buffer view; - if (!PyArg_ParseTuple(args, "|s#:new", &cp, &len)) + if (!PyArg_ParseTuple(args, "|O:new", &data_obj)) return NULL; - if ((md5p = newmd5object()) == NULL) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view, NULL); + + if ((md5p = newmd5object()) == NULL) { + PyBuffer_Release(&view); return NULL; + } - if (cp) - md5_append(&md5p->md5, cp, len); + if (data_obj) { + md5_append(&md5p->md5, (unsigned char*)view.buf, + Py_SAFE_DOWNCAST(view.len, Py_ssize_t, unsigned int)); + } + PyBuffer_Release(&view); return (PyObject *)md5p; } Modified: python/trunk/Modules/sha256module.c ============================================================================== --- python/trunk/Modules/sha256module.c (original) +++ python/trunk/Modules/sha256module.c Fri Feb 13 04:00:00 2009 @@ -18,6 +18,7 @@ #include "Python.h" #include "structmember.h" +#include "hashlib.h" /* Endianness testing and definitions */ @@ -480,14 +481,17 @@ static PyObject * SHA256_update(SHAobject *self, PyObject *args) { - unsigned char *cp; - int len; + PyObject *obj; + Py_buffer buf; - if (!PyArg_ParseTuple(args, "s#:update", &cp, &len)) + if (!PyArg_ParseTuple(args, "O:update", &obj)) return NULL; - sha_update(self, cp, len); + GET_BUFFER_VIEW_OR_ERROUT(obj, &buf, NULL); + sha_update(self, buf.buf, buf.len); + + PyBuffer_Release(&buf); Py_INCREF(Py_None); return Py_None; } @@ -614,14 +618,17 @@ { static char *kwlist[] = {"string", NULL}; SHAobject *new; - unsigned char *cp = NULL; - int len; + PyObject *data_obj = NULL; + Py_buffer buf; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s#:new", kwlist, - &cp, &len)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf, NULL); + if ((new = newSHA256object()) == NULL) return NULL; @@ -631,8 +638,10 @@ Py_DECREF(new); return NULL; } - if (cp) - sha_update(new, cp, len); + if (data_obj) { + sha_update(new, buf.buf, buf.len); + PyBuffer_Release(&buf); + } return (PyObject *)new; } @@ -645,14 +654,17 @@ { static char *kwlist[] = {"string", NULL}; SHAobject *new; - unsigned char *cp = NULL; - int len; + PyObject *data_obj = NULL; + Py_buffer buf; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s#:new", kwlist, - &cp, &len)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf, NULL); + if ((new = newSHA224object()) == NULL) return NULL; @@ -662,8 +674,10 @@ Py_DECREF(new); return NULL; } - if (cp) - sha_update(new, cp, len); + if (data_obj) { + sha_update(new, buf.buf, buf.len); + PyBuffer_Release(&buf); + } return (PyObject *)new; } Modified: python/trunk/Modules/sha512module.c ============================================================================== --- python/trunk/Modules/sha512module.c (original) +++ python/trunk/Modules/sha512module.c Fri Feb 13 04:00:00 2009 @@ -18,6 +18,7 @@ #include "Python.h" #include "structmember.h" +#include "hashlib.h" #ifdef PY_LONG_LONG /* If no PY_LONG_LONG, don't compile anything! */ @@ -546,14 +547,17 @@ static PyObject * SHA512_update(SHAobject *self, PyObject *args) { - unsigned char *cp; - int len; + PyObject *obj; + Py_buffer buf; - if (!PyArg_ParseTuple(args, "s#:update", &cp, &len)) + if (!PyArg_ParseTuple(args, "O:update", &obj)) return NULL; - sha512_update(self, cp, len); + GET_BUFFER_VIEW_OR_ERROUT(obj, &buf, NULL); + sha512_update(self, buf.buf, buf.len); + + PyBuffer_Release(&buf); Py_INCREF(Py_None); return Py_None; } @@ -680,14 +684,17 @@ { static char *kwlist[] = {"string", NULL}; SHAobject *new; - unsigned char *cp = NULL; - int len; + PyObject *data_obj = NULL; + Py_buffer buf; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s#:new", kwlist, - &cp, &len)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf, NULL); + if ((new = newSHA512object()) == NULL) return NULL; @@ -697,8 +704,10 @@ Py_DECREF(new); return NULL; } - if (cp) - sha512_update(new, cp, len); + if (data_obj) { + sha512_update(new, buf.buf, buf.len); + PyBuffer_Release(&buf); + } return (PyObject *)new; } @@ -711,14 +720,17 @@ { static char *kwlist[] = {"string", NULL}; SHAobject *new; - unsigned char *cp = NULL; - int len; + PyObject *data_obj = NULL; + Py_buffer buf; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s#:new", kwlist, - &cp, &len)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf, NULL); + if ((new = newSHA384object()) == NULL) return NULL; @@ -728,8 +740,10 @@ Py_DECREF(new); return NULL; } - if (cp) - sha512_update(new, cp, len); + if (data_obj) { + sha512_update(new, buf.buf, buf.len); + PyBuffer_Release(&buf); + } return (PyObject *)new; } Modified: python/trunk/Modules/shamodule.c ============================================================================== --- python/trunk/Modules/shamodule.c (original) +++ python/trunk/Modules/shamodule.c Fri Feb 13 04:00:00 2009 @@ -17,6 +17,7 @@ #include "Python.h" #include "structmember.h" +#include "hashlib.h" /* Endianness testing and definitions */ @@ -236,9 +237,9 @@ /* update the SHA digest */ static void -sha_update(SHAobject *sha_info, SHA_BYTE *buffer, int count) +sha_update(SHAobject *sha_info, SHA_BYTE *buffer, unsigned int count) { - int i; + unsigned int i; SHA_INT32 clo; clo = sha_info->count_lo + ((SHA_INT32) count << 3); @@ -428,14 +429,18 @@ static PyObject * SHA_update(SHAobject *self, PyObject *args) { - unsigned char *cp; - int len; + PyObject *data_obj; + Py_buffer view; - if (!PyArg_ParseTuple(args, "s#:update", &cp, &len)) + if (!PyArg_ParseTuple(args, "O:update", &data_obj)) return NULL; - sha_update(self, cp, len); + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view, NULL); + + sha_update(self, (unsigned char*)view.buf, + Py_SAFE_DOWNCAST(view.len, Py_ssize_t, unsigned int)); + PyBuffer_Release(&view); Py_INCREF(Py_None); return Py_None; } @@ -535,26 +540,34 @@ { static char *kwlist[] = {"string", NULL}; SHAobject *new; - unsigned char *cp = NULL; - int len; + PyObject *data_obj = NULL; + Py_buffer view; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s#:new", kwlist, - &cp, &len)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } - if ((new = newSHAobject()) == NULL) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view, NULL); + + if ((new = newSHAobject()) == NULL) { + PyBuffer_Release(&view); return NULL; + } sha_init(new); if (PyErr_Occurred()) { Py_DECREF(new); + PyBuffer_Release(&view); return NULL; } - if (cp) - sha_update(new, cp, len); + if (data_obj) { + sha_update(new, (unsigned char*)view.buf, + Py_SAFE_DOWNCAST(view.len, Py_ssize_t, unsigned int)); + } + PyBuffer_Release(&view); return (PyObject *)new; } From buildbot at python.org Fri Feb 13 04:15:43 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 03:15:43 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090213031543.3DE8B1E4002@bag.python.org> The Buildbot has detected a new failure of OS X x86 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/142 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: gregory.p.smith BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_ftplib.py", line 203, in run asyncore.loop(timeout=0.1, count=1) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asyncore.py", line 204, in loop poll_fun(timeout, map) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asyncore.py", line 141, in poll read(obj) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asyncore.py", line 78, in read obj.handle_error() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asyncore.py", line 74, in read obj.handle_read_event() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asyncore.py", line 413, in handle_read_event self.handle_read() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asynchat.py", line 112, in handle_read self.handle_error() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asynchat.py", line 110, in handle_read data = self.recv (self.ac_in_buffer_size) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asyncore.py", line 362, in recv data = self.socket.recv(buffer_size) error: [Errno 9] Bad file descriptor Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_ftplib.py", line 203, in run asyncore.loop(timeout=0.1, count=1) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asyncore.py", line 204, in loop poll_fun(timeout, map) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/asyncore.py", line 130, in poll r, w, e = select.select(r, w, e, timeout) error: (9, 'Bad file descriptor') make: *** [buildbottest] Abort trap sincerely, -The Buildbot From buildbot at python.org Fri Feb 13 04:32:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 03:32:30 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090213033230.8D6311E4002@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/268 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_modulefinder ====================================================================== ERROR: test_absolute_imports (test.test_modulefinder.ModuleFinderTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_modulefinder.py", line 264, in test_absolute_imports self._do_test(absolute_import_test) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_modulefinder.py", line 226, in _do_test mf.import_hook(import_this) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/modulefinder.py", line 126, in import_hook parent = self.determine_parent(caller, level=level) AttributeError: 'ModuleFinder' object has no attribute 'determine_parent' ====================================================================== ERROR: test_maybe (test.test_modulefinder.ModuleFinderTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_modulefinder.py", line 256, in test_maybe self._do_test(maybe_test) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_modulefinder.py", line 226, in _do_test mf.import_hook(import_this) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/modulefinder.py", line 126, in import_hook parent = self.determine_parent(caller, level=level) AttributeError: 'ModuleFinder' object has no attribute 'determine_parent' ====================================================================== ERROR: test_maybe_new (test.test_modulefinder.ModuleFinderTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_modulefinder.py", line 261, in test_maybe_new self._do_test(maybe_test_new) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_modulefinder.py", line 226, in _do_test mf.import_hook(import_this) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/modulefinder.py", line 126, in import_hook parent = self.determine_parent(caller, level=level) AttributeError: 'ModuleFinder' object has no attribute 'determine_parent' ====================================================================== ERROR: test_package (test.test_modulefinder.ModuleFinderTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_modulefinder.py", line 253, in test_package self._do_test(package_test) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_modulefinder.py", line 226, in _do_test mf.import_hook(import_this) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/modulefinder.py", line 126, in import_hook parent = self.determine_parent(caller, level=level) AttributeError: 'ModuleFinder' object has no attribute 'determine_parent' ====================================================================== ERROR: test_relative_imports (test.test_modulefinder.ModuleFinderTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_modulefinder.py", line 267, in test_relative_imports self._do_test(relative_import_test) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_modulefinder.py", line 226, in _do_test mf.import_hook(import_this) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/modulefinder.py", line 126, in import_hook parent = self.determine_parent(caller, level=level) AttributeError: 'ModuleFinder' object has no attribute 'determine_parent' ====================================================================== ERROR: test_relative_imports_2 (test.test_modulefinder.ModuleFinderTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_modulefinder.py", line 270, in test_relative_imports_2 self._do_test(relative_import_test_2) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_modulefinder.py", line 226, in _do_test mf.import_hook(import_this) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/modulefinder.py", line 126, in import_hook parent = self.determine_parent(caller, level=level) AttributeError: 'ModuleFinder' object has no attribute 'determine_parent' ====================================================================== ERROR: test_relative_imports_3 (test.test_modulefinder.ModuleFinderTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_modulefinder.py", line 273, in test_relative_imports_3 self._do_test(relative_import_test_3) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_modulefinder.py", line 226, in _do_test mf.import_hook(import_this) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/modulefinder.py", line 126, in import_hook parent = self.determine_parent(caller, level=level) AttributeError: 'ModuleFinder' object has no attribute 'determine_parent' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 13 04:43:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 03:43:50 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090213034350.A4BA91E4002@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/279 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_posix test_subprocess ====================================================================== 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From buildbot at python.org Fri Feb 13 04:48:02 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 03:48:02 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc trunk Message-ID: <20090213034802.C13B41E4029@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/140 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: sincerely, -The Buildbot From buildbot at python.org Fri Feb 13 05:09:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 04:09:22 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090213040923.3B8921E4002@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/144 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: gregory.p.smith 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 Fri Feb 13 10:08:35 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 13 Feb 2009 10:08:35 +0100 (CET) Subject: [Python-checkins] r69562 - python/trunk/Doc/tools/sphinxext/indexsidebar.html Message-ID: <20090213090835.285CC1E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 13 10:08:34 2009 New Revision: 69562 Log: Add links to the other versions we have in stock. 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 Fri Feb 13 10:08:34 2009 @@ -1,5 +1,13 @@

Download

Download these documents

+

Docs for other versions

+ +

Other resources

From python-checkins at python.org Fri Feb 13 10:09:58 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 13 Feb 2009 10:09:58 +0100 (CET) Subject: [Python-checkins] r69563 - in python/branches/release26-maint: Doc/tools/sphinxext/indexsidebar.html Message-ID: <20090213090958.EE5851E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 13 10:09:58 2009 New Revision: 69563 Log: Merged revisions 69562 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69562 | georg.brandl | 2009-02-13 10:08:34 +0100 (Fr, 13 Feb 2009) | 2 lines Add links to the other versions we have in stock. ........ 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 Fri Feb 13 10:09:58 2009 @@ -1,5 +1,13 @@

Download

Download these documents

+

Docs for other versions

+ +

Other resources

From python-checkins at python.org Fri Feb 13 10:11:25 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 13 Feb 2009 10:11:25 +0100 (CET) Subject: [Python-checkins] r69564 - python/branches/release26-maint/Doc/tools/sphinxext/indexsidebar.html Message-ID: <20090213091125.4FE001E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 13 10:11:25 2009 New Revision: 69564 Log: Fix. Modified: 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 Fri Feb 13 10:11:25 2009 @@ -3,7 +3,7 @@

Docs for other versions

From python-checkins at python.org Fri Feb 13 10:11:32 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 13 Feb 2009 10:11:32 +0100 (CET) Subject: [Python-checkins] r69565 - in python/branches/py3k: Doc/tools/sphinxext/indexsidebar.html Message-ID: <20090213091132.633561E4018@bag.python.org> Author: georg.brandl Date: Fri Feb 13 10:11:32 2009 New Revision: 69565 Log: Merged revisions 69562 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69562 | georg.brandl | 2009-02-13 10:08:34 +0100 (Fr, 13 Feb 2009) | 2 lines Add links to the other versions we have in stock. ........ 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 Fri Feb 13 10:11:32 2009 @@ -1,5 +1,13 @@

Download

Download these documents

+

Docs for other versions

+ +

Other resources

From python-checkins at python.org Fri Feb 13 10:12:33 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 13 Feb 2009 10:12:33 +0100 (CET) Subject: [Python-checkins] r69566 - in python/trunk/Doc: ACKS.txt distutils/setupscript.rst Message-ID: <20090213091233.B40011E400C@bag.python.org> Author: tarek.ziade Date: Fri Feb 13 10:12:33 2009 New Revision: 69566 Log: #5158: added documentation on the depends option in distutils extensions Modified: python/trunk/Doc/ACKS.txt python/trunk/Doc/distutils/setupscript.rst Modified: python/trunk/Doc/ACKS.txt ============================================================================== --- python/trunk/Doc/ACKS.txt (original) +++ python/trunk/Doc/ACKS.txt Fri Feb 13 10:12:33 2009 @@ -18,6 +18,7 @@ * Oliver Andrich * Heidi Annexstad * Jes?s Cea Avi?n + * Manuel Balsera * Daniel Barclay * Chris Barker * Don Bashford Modified: python/trunk/Doc/distutils/setupscript.rst ============================================================================== --- python/trunk/Doc/distutils/setupscript.rst (original) +++ python/trunk/Doc/distutils/setupscript.rst Fri Feb 13 10:12:33 2009 @@ -347,6 +347,10 @@ building compiled extensions: Distutils will automatically add ``initmodule`` to the list of exported symbols. +The :option:`depends` option is a list of files that the extension depends on +(for example header files). The build command will call the compiler on the +sources to rebuild extension if any on this files has been modified since the +previous build. Relationships between Distributions and Packages ================================================ From python-checkins at python.org Fri Feb 13 10:13:24 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 13 Feb 2009 10:13:24 +0100 (CET) Subject: [Python-checkins] r69567 - python/branches/release26-maint Message-ID: <20090213091324.4B3FA1E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 13 10:13:24 2009 New Revision: 69567 Log: Blocked revisions 69566 via svnmerge ........ r69566 | tarek.ziade | 2009-02-13 10:12:33 +0100 (Fri, 13 Feb 2009) | 1 line #5158: added documentation on the depends option in distutils extensions ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri Feb 13 10:15:20 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 13 Feb 2009 10:15:20 +0100 (CET) Subject: [Python-checkins] r69568 - in python/branches/py3k: Doc/ACKS.txt Doc/distutils/setupscript.rst Message-ID: <20090213091520.C9E511E4019@bag.python.org> Author: tarek.ziade Date: Fri Feb 13 10:15:20 2009 New Revision: 69568 Log: Merged revisions 69566 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69566 | tarek.ziade | 2009-02-13 10:12:33 +0100 (Fri, 13 Feb 2009) | 1 line #5158: added documentation on the depends option in distutils extensions ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/ACKS.txt python/branches/py3k/Doc/distutils/setupscript.rst Modified: python/branches/py3k/Doc/ACKS.txt ============================================================================== --- python/branches/py3k/Doc/ACKS.txt (original) +++ python/branches/py3k/Doc/ACKS.txt Fri Feb 13 10:15:20 2009 @@ -18,6 +18,7 @@ * Oliver Andrich * Heidi Annexstad * Jes?s Cea Avi?n + * Manuel Balsera * Daniel Barclay * Chris Barker * Don Bashford Modified: python/branches/py3k/Doc/distutils/setupscript.rst ============================================================================== --- python/branches/py3k/Doc/distutils/setupscript.rst (original) +++ python/branches/py3k/Doc/distutils/setupscript.rst Fri Feb 13 10:15:20 2009 @@ -347,6 +347,10 @@ building compiled extensions: Distutils will automatically add ``initmodule`` to the list of exported symbols. +The :option:`depends` option is a list of files that the extension depends on +(for example header files). The build command will call the compiler on the +sources to rebuild extension if any on this files has been modified since the +previous build. Relationships between Distributions and Packages ================================================ From python-checkins at python.org Fri Feb 13 10:16:28 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 13 Feb 2009 10:16:28 +0100 (CET) Subject: [Python-checkins] r69569 - python/branches/release30-maint Message-ID: <20090213091628.39A571E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 13 10:16:28 2009 New Revision: 69569 Log: Blocked revisions 69568 via svnmerge ................ r69568 | tarek.ziade | 2009-02-13 10:15:20 +0100 (Fri, 13 Feb 2009) | 9 lines Merged revisions 69566 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69566 | tarek.ziade | 2009-02-13 10:12:33 +0100 (Fri, 13 Feb 2009) | 1 line #5158: added documentation on the depends option in distutils extensions ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Fri Feb 13 11:01:36 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 10:01:36 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090213100137.055C81E4002@bag.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/254 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,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 Fri Feb 13 11:13:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 10:13:35 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090213101335.6E3101E4002@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/119 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: georg.brandl,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Fri Feb 13 11:40:14 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 13 Feb 2009 11:40:14 +0100 (CET) Subject: [Python-checkins] r69570 - python/trunk/Doc/library/urllib2.rst Message-ID: <20090213104014.AA6ED1E403D@bag.python.org> Author: georg.brandl Date: Fri Feb 13 11:40:14 2009 New Revision: 69570 Log: #4894: document "newurl" parameter to redirect_request(). Modified: python/trunk/Doc/library/urllib2.rst Modified: python/trunk/Doc/library/urllib2.rst ============================================================================== --- python/trunk/Doc/library/urllib2.rst (original) +++ python/trunk/Doc/library/urllib2.rst Fri Feb 13 11:40:14 2009 @@ -602,14 +602,15 @@ precise meanings of the various redirection codes. -.. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs) +.. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs, newurl) Return a :class:`Request` or ``None`` in response to a redirect. This is called by the default implementations of the :meth:`http_error_30\*` methods when a redirection is received from the server. If a redirection should take place, return a new :class:`Request` to allow :meth:`http_error_30\*` to perform the - redirect. Otherwise, raise :exc:`HTTPError` if no other handler should try to - handle this URL, or return ``None`` if you can't but another handler might. + redirect to *newurl*. Otherwise, raise :exc:`HTTPError` if no other handler + should try to handle this URL, or return ``None`` if you can't but another + handler might. .. note:: @@ -622,8 +623,8 @@ .. method:: HTTPRedirectHandler.http_error_301(req, fp, code, msg, hdrs) - Redirect to the ``Location:`` URL. This method is called by the parent - :class:`OpenerDirector` when getting an HTTP 'moved permanently' response. + Redirect to the ``Location:`` or ``URI:`` URL. This method is called by the + parent :class:`OpenerDirector` when getting an HTTP 'moved permanently' response. .. method:: HTTPRedirectHandler.http_error_302(req, fp, code, msg, hdrs) From python-checkins at python.org Fri Feb 13 11:40:43 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 13 Feb 2009 11:40:43 +0100 (CET) Subject: [Python-checkins] r69571 - python/branches/py3k/Doc/library/urllib.request.rst Message-ID: <20090213104043.BB7241E4027@bag.python.org> Author: georg.brandl Date: Fri Feb 13 11:40:43 2009 New Revision: 69571 Log: #4894: document "newurl" parameter to redirect_request(). Modified: python/branches/py3k/Doc/library/urllib.request.rst Modified: python/branches/py3k/Doc/library/urllib.request.rst ============================================================================== --- python/branches/py3k/Doc/library/urllib.request.rst (original) +++ python/branches/py3k/Doc/library/urllib.request.rst Fri Feb 13 11:40:43 2009 @@ -741,14 +741,15 @@ precise meanings of the various redirection codes. -.. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs) +.. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs, newurl) Return a :class:`Request` or ``None`` in response to a redirect. This is called by the default implementations of the :meth:`http_error_30\*` methods when a redirection is received from the server. If a redirection should take place, return a new :class:`Request` to allow :meth:`http_error_30\*` to perform the - redirect. Otherwise, raise :exc:`HTTPError` if no other handler should try to - handle this URL, or return ``None`` if you can't but another handler might. + redirect to *newurl*. Otherwise, raise :exc:`HTTPError` if no other handler + should try to handle this URL, or return ``None`` if you can't but another + handler might. .. note:: @@ -761,8 +762,8 @@ .. method:: HTTPRedirectHandler.http_error_301(req, fp, code, msg, hdrs) - Redirect to the ``Location:`` URL. This method is called by the parent - :class:`OpenerDirector` when getting an HTTP 'moved permanently' response. + Redirect to the ``Location:`` or ``URI:`` URL. This method is called by the + parent :class:`OpenerDirector` when getting an HTTP 'moved permanently' response. .. method:: HTTPRedirectHandler.http_error_302(req, fp, code, msg, hdrs) From python-checkins at python.org Fri Feb 13 11:42:52 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 13 Feb 2009 11:42:52 +0100 (CET) Subject: [Python-checkins] r69572 - python/branches/py3k Message-ID: <20090213104252.DBE0C1E402E@bag.python.org> Author: georg.brandl Date: Fri Feb 13 11:42:52 2009 New Revision: 69572 Log: Blocked revisions 69570 via svnmerge ........ r69570 | georg.brandl | 2009-02-13 11:40:14 +0100 (Fr, 13 Feb 2009) | 1 line #4894: document "newurl" parameter to redirect_request(). ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Fri Feb 13 11:44:17 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 13 Feb 2009 11:44:17 +0100 (CET) Subject: [Python-checkins] r69573 - python/trunk/Doc/reference/datamodel.rst Message-ID: <20090213104417.879B61E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 13 11:44:17 2009 New Revision: 69573 Log: #3734: document complex coercing behavior better. 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 Fri Feb 13 11:44:17 2009 @@ -2252,7 +2252,8 @@ In the current implementation, the built-in numeric types :class:`int`, :class:`long` and :class:`float` do not use coercion; the type :class:`complex` - however does use it. The difference can become apparent when subclassing these + however does use coercion for binary operators and rich comparisons, despite + the above rules. The difference can become apparent when subclassing these types. Over time, the type :class:`complex` may be fixed to avoid coercion. All these types implement a :meth:`__coerce__` method, for use by the built-in :func:`coerce` function. From python-checkins at python.org Fri Feb 13 11:44:29 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 13 Feb 2009 11:44:29 +0100 (CET) Subject: [Python-checkins] r69574 - python/branches/py3k Message-ID: <20090213104429.26EBF1E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 13 11:44:28 2009 New Revision: 69574 Log: Blocked revisions 69573 via svnmerge ........ r69573 | georg.brandl | 2009-02-13 11:44:17 +0100 (Fr, 13 Feb 2009) | 1 line #3734: document complex coercing behavior better. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Fri Feb 13 11:50:01 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 13 Feb 2009 11:50:01 +0100 (CET) Subject: [Python-checkins] r69575 - in python/branches/py3k/Lib: test/test_xmlrpc.py xmlrpc/client.py Message-ID: <20090213105001.B71C71E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 13 11:50:01 2009 New Revision: 69575 Log: part of #3613: fix get_host_info() usage of base64.encodestring(). Modified: python/branches/py3k/Lib/test/test_xmlrpc.py python/branches/py3k/Lib/xmlrpc/client.py 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 Feb 13 11:50:01 2009 @@ -135,6 +135,14 @@ xmlrpclib.loads(strg)[0][0]) self.assertRaises(TypeError, xmlrpclib.dumps, (arg1,)) + def test_get_host_info(self): + # see bug #3613, this raised a TypeError + transp = xmlrpc.client.Transport() + self.assertEquals(transp.get_host_info("user at host.tld"), + ('host.tld', + [('Authorization', 'Basic dXNlcg==')], {})) + + class HelperTestCase(unittest.TestCase): def test_escape(self): self.assertEqual(xmlrpclib.escape("a&b"), "a&b") Modified: python/branches/py3k/Lib/xmlrpc/client.py ============================================================================== --- python/branches/py3k/Lib/xmlrpc/client.py (original) +++ python/branches/py3k/Lib/xmlrpc/client.py Fri Feb 13 11:50:01 2009 @@ -1161,7 +1161,8 @@ if auth: import base64 - auth = base64.encodestring(urllib.parse.unquote(auth)) + auth = urllib.parse.unquote_to_bytes(auth) + auth = base64.encodestring(auth).decode("utf-8") auth = "".join(auth.split()) # get rid of whitespace extra_headers = [ ("Authorization", "Basic " + auth) From python-checkins at python.org Fri Feb 13 11:56:50 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 13 Feb 2009 11:56:50 +0100 (CET) Subject: [Python-checkins] r69576 - python/trunk/Doc/library/base64.rst Message-ID: <20090213105650.850281E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 13 11:56:50 2009 New Revision: 69576 Log: #1661108: note that urlsafe encoded string can contain "=". Modified: python/trunk/Doc/library/base64.rst Modified: python/trunk/Doc/library/base64.rst ============================================================================== --- python/trunk/Doc/library/base64.rst (original) +++ python/trunk/Doc/library/base64.rst Fri Feb 13 11:56:50 2009 @@ -63,7 +63,8 @@ .. function:: urlsafe_b64encode(s) Encode string *s* using a URL-safe alphabet, which substitutes ``-`` instead of - ``+`` and ``_`` instead of ``/`` in the standard Base64 alphabet. + ``+`` and ``_`` instead of ``/`` in the standard Base64 alphabet. The result + can still contain ``=``. .. function:: urlsafe_b64decode(s) From python-checkins at python.org Fri Feb 13 12:01:07 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 13 Feb 2009 12:01:07 +0100 (CET) Subject: [Python-checkins] r69577 - in python/branches/py3k: Lib/test/test_struct.py Modules/_struct.c Message-ID: <20090213110107.C2B041E403B@bag.python.org> Author: georg.brandl Date: Fri Feb 13 12:01:07 2009 New Revision: 69577 Log: #3694: fix an "XXX undetected error" leak in struct. Modified: python/branches/py3k/Lib/test/test_struct.py python/branches/py3k/Modules/_struct.c Modified: python/branches/py3k/Lib/test/test_struct.py ============================================================================== --- python/branches/py3k/Lib/test/test_struct.py (original) +++ python/branches/py3k/Lib/test/test_struct.py Fri Feb 13 12:01:07 2009 @@ -524,6 +524,10 @@ self.assertRaises(struct.error, s.pack_into, small_buf, 0, test_string) self.assertRaises(struct.error, s.pack_into, small_buf, 2, test_string) + # Test bogus offset (issue 3694) + sb = small_buf + self.assertRaises(TypeError, struct.pack_into, b'1', sb, None) + def test_pack_into_fn(self): test_string = b'Reykjavik rocks, eow!' writable_buf = array.array('b', b' '*100) Modified: python/branches/py3k/Modules/_struct.c ============================================================================== --- python/branches/py3k/Modules/_struct.c (original) +++ python/branches/py3k/Modules/_struct.c Fri Feb 13 12:01:07 2009 @@ -1785,7 +1785,7 @@ assert( buffer_len >= 0 ); /* Extract the offset from the first argument */ - offset = PyLong_AsSsize_t(PyTuple_GET_ITEM(args, 1)); + offset = PyNumber_AsSsize_t(PyTuple_GET_ITEM(args, 1), PyExc_IndexError); if (offset == -1 && PyErr_Occurred()) return NULL; From python-checkins at python.org Fri Feb 13 12:03:59 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 13 Feb 2009 12:03:59 +0100 (CET) Subject: [Python-checkins] r69578 - python/trunk/Lib/test/test_struct.py Message-ID: <20090213110359.B17291E407A@bag.python.org> Author: georg.brandl Date: Fri Feb 13 12:03:59 2009 New Revision: 69578 Log: #3694: add test for fix committed in r66693. Modified: python/trunk/Lib/test/test_struct.py Modified: python/trunk/Lib/test/test_struct.py ============================================================================== --- python/trunk/Lib/test/test_struct.py (original) +++ python/trunk/Lib/test/test_struct.py Fri Feb 13 12:03:59 2009 @@ -512,6 +512,10 @@ self.assertRaises(struct.error, s.pack_into, small_buf, 0, test_string) self.assertRaises(struct.error, s.pack_into, small_buf, 2, test_string) + # Test bogus offset (issue 3694) + sb = small_buf + self.assertRaises(TypeError, struct.pack_into, b'1', sb, None) + def test_pack_into_fn(self): test_string = 'Reykjavik rocks, eow!' writable_buf = array.array('c', ' '*100) From python-checkins at python.org Fri Feb 13 12:07:00 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 13 Feb 2009 12:07:00 +0100 (CET) Subject: [Python-checkins] r69579 - python/trunk/Objects/unicodeobject.c Message-ID: <20090213110700.3C3881E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 13 12:06:59 2009 New Revision: 69579 Log: Fix warnings GCC emits where the argument of PyErr_Format is a single variable. Modified: python/trunk/Objects/unicodeobject.c Modified: python/trunk/Objects/unicodeobject.c ============================================================================== --- python/trunk/Objects/unicodeobject.c (original) +++ python/trunk/Objects/unicodeobject.c Fri Feb 13 12:06:59 2009 @@ -1385,7 +1385,7 @@ if (restuple == NULL) goto onError; if (!PyTuple_Check(restuple)) { - PyErr_Format(PyExc_TypeError, &argparse[4]); + PyErr_SetString(PyExc_TypeError, &argparse[4]); goto onError; } if (!PyArg_ParseTuple(restuple, argparse, &PyUnicode_Type, &repunicode, &newpos)) @@ -3440,7 +3440,7 @@ if (restuple == NULL) return NULL; if (!PyTuple_Check(restuple)) { - PyErr_Format(PyExc_TypeError, &argparse[4]); + PyErr_SetString(PyExc_TypeError, &argparse[4]); Py_DECREF(restuple); return NULL; } @@ -4712,7 +4712,7 @@ if (restuple == NULL) return NULL; if (!PyTuple_Check(restuple)) { - PyErr_Format(PyExc_TypeError, &argparse[4]); + PyErr_SetString(PyExc_TypeError, &argparse[4]); Py_DECREF(restuple); return NULL; } From python-checkins at python.org Fri Feb 13 12:10:04 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 13 Feb 2009 12:10:04 +0100 (CET) Subject: [Python-checkins] r69580 - python/trunk/Modules/_ctypes/_ctypes.c Message-ID: <20090213111004.EE43C1E400C@bag.python.org> Author: georg.brandl Date: Fri Feb 13 12:10:04 2009 New Revision: 69580 Log: Fix warnings GCC emits where the argument of PyErr_Format is a single variable. 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 Fri Feb 13 12:10:04 2009 @@ -599,13 +599,14 @@ #else address = (void *)ctypes_dlsym(handle, name); if (!address) { - PyErr_Format(PyExc_ValueError, #ifdef __CYGWIN__ /* dlerror() isn't very helpful on cygwin */ + PyErr_Format(PyExc_ValueError, "symbol '%s' not found (%s) ", - name, + name); +#else + PyErr_SetString(PyExc_ValueError, ctypes_dlerror()); #endif - ctypes_dlerror()); return NULL; } #endif @@ -3283,13 +3284,14 @@ #else address = (PPROC)ctypes_dlsym(handle, name); if (!address) { - PyErr_Format(PyExc_AttributeError, #ifdef __CYGWIN__ /* dlerror() isn't very helpful on cygwin */ + PyErr_Format(PyExc_AttributeError, "function '%s' not found (%s) ", - name, + name); +#else + PyErr_SetString(PyExc_AttributeError, ctypes_dlerror()); #endif - ctypes_dlerror()); return NULL; } #endif From python-checkins at python.org Fri Feb 13 12:10:15 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 13 Feb 2009 12:10:15 +0100 (CET) Subject: [Python-checkins] r69581 - python/branches/py3k Message-ID: <20090213111015.78C6C1E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 13 12:10:15 2009 New Revision: 69581 Log: Blocked revisions 69578 via svnmerge ........ r69578 | georg.brandl | 2009-02-13 12:03:59 +0100 (Fr, 13 Feb 2009) | 1 line #3694: add test for fix committed in r66693. ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Fri Feb 13 12:45:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 11:45:30 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090213114530.861DD1E4002@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/350 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: sincerely, -The Buildbot From buildbot at python.org Fri Feb 13 13:08:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 12:08:40 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090213120840.BEC011E4024@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/281 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 buildbot at python.org Fri Feb 13 14:24:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 13:24:29 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090213132430.110C81E4002@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/271 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 nnorwitz at gmail.com Fri Feb 13 14:46:23 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 13 Feb 2009 08:46:23 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090213134623.GA30609@python.psfb.org> svn update tools/sphinx svn: PROPFIND request failed on '/projects/doctools/trunk/sphinx' svn: PROPFIND of '/projects/doctools/trunk/sphinx': could not connect to server (http://svn.python.org) make: *** [update] Error 1 From python-checkins at python.org Fri Feb 13 14:52:33 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 13 Feb 2009 14:52:33 +0100 (CET) Subject: [Python-checkins] r69582 - in python/trunk: Misc/NEWS Objects/object.c Message-ID: <20090213135233.7776A1E4002@bag.python.org> Author: antoine.pitrou Date: Fri Feb 13 14:52:33 2009 New Revision: 69582 Log: Issue #5186: Reduce hash collisions for objects with no __hash__ method by rotating the object pointer by 4 bits to the right. Modified: python/trunk/Misc/NEWS python/trunk/Objects/object.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Feb 13 14:52:33 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #5186: Reduce hash collisions for objects with no __hash__ method by + rotating the object pointer by 4 bits to the right. + - 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/trunk/Objects/object.c ============================================================================== --- python/trunk/Objects/object.c (original) +++ python/trunk/Objects/object.c Fri Feb 13 14:52:33 2009 @@ -1072,23 +1072,15 @@ long _Py_HashPointer(void *p) { -#if SIZEOF_LONG >= SIZEOF_VOID_P - return (long)p; -#else - /* convert to a Python long and hash that */ - PyObject* longobj; long x; - - if ((longobj = PyLong_FromVoidPtr(p)) == NULL) { - x = -1; - goto finally; - } - x = PyObject_Hash(longobj); - -finally: - Py_XDECREF(longobj); + size_t y = (size_t)p; + /* bottom 3 or 4 bits are likely to be 0; rotate y by 4 to avoid + excessive hash collisions for dicts and sets */ + y = (y >> 4) | (y << 8*SIZEOF_VOID_P - 4); + x = (long)y; + if (x == -1) + x = -2; return x; -#endif } long From python-checkins at python.org Fri Feb 13 14:57:40 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 13 Feb 2009 14:57:40 +0100 (CET) Subject: [Python-checkins] r69583 - python/trunk/Objects/object.c Message-ID: <20090213135740.A819F1E4002@bag.python.org> Author: antoine.pitrou Date: Fri Feb 13 14:57:40 2009 New Revision: 69583 Log: Fix compiler warning (gcc) Modified: python/trunk/Objects/object.c Modified: python/trunk/Objects/object.c ============================================================================== --- python/trunk/Objects/object.c (original) +++ python/trunk/Objects/object.c Fri Feb 13 14:57:40 2009 @@ -1076,7 +1076,7 @@ size_t y = (size_t)p; /* bottom 3 or 4 bits are likely to be 0; rotate y by 4 to avoid excessive hash collisions for dicts and sets */ - y = (y >> 4) | (y << 8*SIZEOF_VOID_P - 4); + y = (y >> 4) | (y << (8 * SIZEOF_VOID_P - 4)); x = (long)y; if (x == -1) x = -2; From python-checkins at python.org Fri Feb 13 15:01:05 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 13 Feb 2009 15:01:05 +0100 (CET) Subject: [Python-checkins] r69584 - in python/branches/py3k: Misc/NEWS Objects/object.c Message-ID: <20090213140105.CFE261E4002@bag.python.org> Author: antoine.pitrou Date: Fri Feb 13 15:01:05 2009 New Revision: 69584 Log: Merged revisions 69582-69583 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69582 | antoine.pitrou | 2009-02-13 14:52:33 +0100 (ven., 13 f?vr. 2009) | 4 lines Issue #5186: Reduce hash collisions for objects with no __hash__ method by rotating the object pointer by 4 bits to the right. ........ r69583 | antoine.pitrou | 2009-02-13 14:57:40 +0100 (ven., 13 f?vr. 2009) | 3 lines Fix compiler warning (gcc) ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/object.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri Feb 13 15:01:05 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #5186: Reduce hash collisions for objects with no __hash__ method by + rotating the object pointer by 4 bits to the right. + - 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/py3k/Objects/object.c ============================================================================== --- python/branches/py3k/Objects/object.c (original) +++ python/branches/py3k/Objects/object.c Fri Feb 13 15:01:05 2009 @@ -699,23 +699,15 @@ long _Py_HashPointer(void *p) { -#if SIZEOF_LONG >= SIZEOF_VOID_P - return (long)p; -#else - /* convert to a Python long and hash that */ - PyObject* longobj; long x; - - if ((longobj = PyLong_FromVoidPtr(p)) == NULL) { - x = -1; - goto finally; - } - x = PyObject_Hash(longobj); - -finally: - Py_XDECREF(longobj); + size_t y = (size_t)p; + /* bottom 3 or 4 bits are likely to be 0; rotate y by 4 to avoid + excessive hash collisions for dicts and sets */ + y = (y >> 4) | (y << (8 * SIZEOF_VOID_P - 4)); + x = (long)y; + if (x == -1) + x = -2; return x; -#endif } long From buildbot at python.org Fri Feb 13 15:24:21 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 14:24:21 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090213142421.EE2AF1E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/637 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_ftplib.py", line 203, in run asyncore.loop(timeout=0.1, count=1) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 204, in loop poll_fun(timeout, map) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 141, in poll read(obj) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 78, in read obj.handle_error() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 74, in read obj.handle_read_event() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 413, in handle_read_event self.handle_read() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_ssl.py", line 408, in handle_read self.send(data.lower()) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 519, in send self.initiate_send() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 506, in initiate_send num_sent = dispatcher.send(self, self.out_buffer[:512]) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 349, in send result = self.socket.send(data) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/socket.py", line 165, in _dummy raise error(EBADF, 'Bad file descriptor') error: [Errno 9] Bad file descriptor 2 tests failed: test_ftplib test_popen2 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 13 15:40:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 14:40:05 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090213144006.843741E4002@bag.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/258 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_codecmaps_kr make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 13 15:54:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 14:54:18 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090213145418.C4CF41E4002@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/352 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 BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Fri Feb 13 16:06:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 15:06:13 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090213150614.6161A1E4002@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/283 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: 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.x.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From amauryfa at gmail.com Fri Feb 13 16:52:02 2009 From: amauryfa at gmail.com (Amaury Forgeot d'Arc) Date: Fri, 13 Feb 2009 16:52:02 +0100 Subject: [Python-checkins] r69551 - python/trunk/Lib/distutils/tests/test_build_ext.py In-Reply-To: <94bdd2610902121448m3c5fce1cjcc158a618fff62b@mail.gmail.com> References: <20090212205623.5DBFD1E4002@bag.python.org> <94bdd2610902121448m3c5fce1cjcc158a618fff62b@mail.gmail.com> Message-ID: On Thu, Feb 12, 2009 at 23:48, Tarek Ziad? wrote: > I have just seen that someone else fixed the leak here when I was > merging my fix in py3k > > http://bugs.python.org/issue4373 > > I came up with another fix, shown below. I think my patch is simpler, > > I'd like to : > > - change the one in py3k so it is similar > - add Amaury's explanation in setUp > > Opinions ? Your patch seems to reuse the same file on every iteration. Will it works on Windows? And, isn't __file__ referring to the python Lib directory? It is not always writable. -- Amaury Forgeot d'Arc From python-checkins at python.org Fri Feb 13 17:13:17 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 13 Feb 2009 17:13:17 +0100 (CET) Subject: [Python-checkins] r69585 - python/trunk/Lib/distutils/tests/test_build_ext.py Message-ID: <20090213161317.204971E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 13 17:13:16 2009 New Revision: 69585 Log: reverted leak fix, to use the one done in py3k branch (r67382) 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 Fri Feb 13 17:13:16 2009 @@ -1,5 +1,6 @@ import sys import os +import tempfile import shutil from StringIO import StringIO @@ -10,6 +11,10 @@ import unittest from test import test_support +# http://bugs.python.org/issue4373 +# Don't load the xx module more than once. +ALREADY_TESTED = False + def _get_source_filename(): srcdir = sysconfig.get_config_var('srcdir') return os.path.join(srcdir, 'Modules', 'xxmodule.c') @@ -18,13 +23,13 @@ def setUp(self): # Create a simple test environment # Note that we're making changes to sys.path - self.tmp_dir = os.path.join(os.path.dirname(__file__), 'xx') - os.mkdir(self.tmp_dir) + self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_") self.sys_path = sys.path[:] sys.path.append(self.tmp_dir) shutil.copy(_get_source_filename(), self.tmp_dir) def test_build_ext(self): + global ALREADY_TESTED xx_c = os.path.join(self.tmp_dir, 'xxmodule.c') xx_ext = Extension('xx', [xx_c]) dist = Distribution({'name': 'xx', 'ext_modules': [xx_ext]}) @@ -47,6 +52,11 @@ finally: sys.stdout = old_stdout + if ALREADY_TESTED: + return + else: + ALREADY_TESTED = True + import xx for attr in ('error', 'foo', 'new', 'roj'): From python-checkins at python.org Fri Feb 13 17:20:24 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 13 Feb 2009 17:20:24 +0100 (CET) Subject: [Python-checkins] r69586 - in python/branches/release26-maint: Lib/distutils/tests/test_build_ext.py Message-ID: <20090213162024.C5A911E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 13 17:20:24 2009 New Revision: 69586 Log: Merged revisions 69585 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69585 | tarek.ziade | 2009-02-13 17:13:16 +0100 (Fri, 13 Feb 2009) | 1 line reverted leak fix, to use the one done in py3k branch (r67382) ........ 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 Fri Feb 13 17:20:24 2009 @@ -1,5 +1,6 @@ import sys import os +import tempfile import shutil from StringIO import StringIO @@ -10,12 +11,15 @@ import unittest from test import test_support +# http://bugs.python.org/issue4373 +# Don't load the xx module more than once. +ALREADY_TESTED = False + class BuildExtTestCase(unittest.TestCase): def setUp(self): # Create a simple test environment # Note that we're making changes to sys.path - self.tmp_dir = os.path.join(os.path.dirname(__file__), 'xx') - os.mkdir(self.tmp_dir) + self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_") self.sys_path = sys.path[:] sys.path.append(self.tmp_dir) @@ -23,6 +27,7 @@ shutil.copy(xx_c, self.tmp_dir) def test_build_ext(self): + global ALREADY_TESTED xx_c = os.path.join(self.tmp_dir, 'xxmodule.c') xx_ext = Extension('xx', [xx_c]) dist = Distribution({'name': 'xx', 'ext_modules': [xx_ext]}) @@ -45,6 +50,11 @@ finally: sys.stdout = old_stdout + if ALREADY_TESTED: + return + else: + ALREADY_TESTED = True + import xx for attr in ('error', 'foo', 'new', 'roj'): From python-checkins at python.org Fri Feb 13 17:23:57 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 13 Feb 2009 17:23:57 +0100 (CET) Subject: [Python-checkins] r69587 - in python/branches/py3k: Lib/distutils/tests/test_build_ext.py Message-ID: <20090213162357.BB2161E4081@bag.python.org> Author: tarek.ziade Date: Fri Feb 13 17:23:57 2009 New Revision: 69587 Log: Merged revisions 69585 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69585 | tarek.ziade | 2009-02-13 17:13:16 +0100 (Fri, 13 Feb 2009) | 1 line reverted leak fix, to use the one done in py3k branch (r67382) ........ 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 Fri Feb 13 17:23:57 2009 @@ -1,5 +1,6 @@ import sys import os +import tempfile import shutil from io import StringIO @@ -22,8 +23,7 @@ def setUp(self): # Create a simple test environment # Note that we're making changes to sys.path - self.tmp_dir = os.path.join(os.path.dirname(__file__), 'xx') - os.mkdir(self.tmp_dir) + self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_") self.sys_path = sys.path[:] sys.path.append(self.tmp_dir) shutil.copy(_get_source_filename(), self.tmp_dir) From python-checkins at python.org Fri Feb 13 17:26:35 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 13 Feb 2009 17:26:35 +0100 (CET) Subject: [Python-checkins] r69588 - in python/branches/release30-maint: Lib/distutils/tests/test_build_ext.py Message-ID: <20090213162635.53DCE1E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 13 17:26:35 2009 New Revision: 69588 Log: Merged revisions 69587 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69587 | tarek.ziade | 2009-02-13 17:23:57 +0100 (Fri, 13 Feb 2009) | 9 lines Merged revisions 69585 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69585 | tarek.ziade | 2009-02-13 17:13:16 +0100 (Fri, 13 Feb 2009) | 1 line reverted leak fix, to use the one done in py3k branch (r67382) ........ ................ 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 Fri Feb 13 17:26:35 2009 @@ -1,5 +1,6 @@ import sys import os +import tempfile import shutil from io import StringIO @@ -18,8 +19,7 @@ def setUp(self): # Create a simple test environment # Note that we're making changes to sys.path - self.tmp_dir = os.path.join(os.path.dirname(__file__), 'xx') - os.mkdir(self.tmp_dir) + self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_") self.sys_path = sys.path[:] sys.path.append(self.tmp_dir) From ziade.tarek at gmail.com Fri Feb 13 17:38:17 2009 From: ziade.tarek at gmail.com (=?ISO-8859-1?Q?Tarek_Ziad=E9?=) Date: Fri, 13 Feb 2009 17:38:17 +0100 Subject: [Python-checkins] r69551 - python/trunk/Lib/distutils/tests/test_build_ext.py In-Reply-To: References: <20090212205623.5DBFD1E4002@bag.python.org> <94bdd2610902121448m3c5fce1cjcc158a618fff62b@mail.gmail.com> Message-ID: <94bdd2610902130838r304bb563i131c01fddca570b8@mail.gmail.com> On Fri, Feb 13, 2009 at 4:52 PM, Amaury Forgeot d'Arc wrote: > On Thu, Feb 12, 2009 at 23:48, Tarek Ziad? wrote: >> I have just seen that someone else fixed the leak here when I was >> merging my fix in py3k >> >> http://bugs.python.org/issue4373 >> >> I came up with another fix, shown below. I think my patch is simpler, >> >> I'd like to : >> >> - change the one in py3k so it is similar >> - add Amaury's explanation in setUp >> >> Opinions ? > > Your patch seems to reuse the same file on every iteration. Will it > works on Windows? The only part where I might fail on Windows is when shutil.rmtree is called, so it's not the right way, thanks for the feedback. I have reverted that, > And, isn't __file__ referring to the python Lib directory? It is not > always writable. > Usually, I write temporary files for tests inside the tests folder, os.path.dirname(__file__) in that case refers to the tests dir. Does it mean we might run the tests on a Python installation where this folder might not be writable ? If so, I need to change that practice > -- > Amaury Forgeot d'Arc > -- Tarek Ziad? | Association AfPy | www.afpy.org Blog FR | http://programmation-python.org Blog EN | http://tarekziade.wordpress.com/ From buildbot at python.org Fri Feb 13 17:57:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 16:57:28 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090213165728.4A7661E400C@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/148 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 nnorwitz at gmail.com Fri Feb 13 18:36:24 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 13 Feb 2009 12:36:24 -0500 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090213173624.GA483@python.psfb.org> svn update tools/sphinx svn: PROPFIND request failed on '/projects/doctools/trunk/sphinx' svn: PROPFIND of '/projects/doctools/trunk/sphinx': could not connect to server (http://svn.python.org) make: *** [update] Error 1 From buildbot at python.org Fri Feb 13 19:44:42 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 18:44:42 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090213184442.DCC141E4002@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/154 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 Fri Feb 13 21:11:34 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 13 Feb 2009 21:11:34 +0100 (CET) Subject: [Python-checkins] r69589 - python/trunk/PCbuild/sqlite3.vcproj Message-ID: <20090213201134.5DACD1E4011@bag.python.org> Author: martin.v.loewis Date: Fri Feb 13 21:11:34 2009 New Revision: 69589 Log: Move amd64 properties further to the top, so that they override the linker options correctly. Modified: python/trunk/PCbuild/sqlite3.vcproj Modified: python/trunk/PCbuild/sqlite3.vcproj ============================================================================== --- python/trunk/PCbuild/sqlite3.vcproj (original) +++ python/trunk/PCbuild/sqlite3.vcproj Fri Feb 13 21:11:34 2009 @@ -82,7 +82,7 @@ @@ -327,7 +327,7 @@ @@ -449,7 +449,7 @@ From python-checkins at python.org Fri Feb 13 21:26:16 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 13 Feb 2009 21:26:16 +0100 (CET) Subject: [Python-checkins] r69591 - python/trunk/PCbuild/build_tkinter.py Message-ID: <20090213202616.B17E81E4002@bag.python.org> Author: martin.v.loewis Date: Fri Feb 13 21:26:16 2009 New Revision: 69591 Log: Update Tix build procedure. Modified: python/trunk/PCbuild/build_tkinter.py Modified: python/trunk/PCbuild/build_tkinter.py ============================================================================== --- python/trunk/PCbuild/build_tkinter.py (original) +++ python/trunk/PCbuild/build_tkinter.py Fri Feb 13 21:26:16 2009 @@ -52,18 +52,18 @@ if 1: os.chdir(os.path.join(ROOT, TK, "win")) if clean: - nmake("makefile.vc", "clean", TCLDIR=tcldir) - nmake("makefile.vc", TCLDIR=tcldir, MACHINE=machine) - nmake("makefile.vc", "install", TCLDIR=tcldir, INSTALLDIR=dest, MACHINE=machine) + nmake("makefile.vc", "clean", DEBUG=0, TCLDIR=tcldir) + nmake("makefile.vc", DEBUG=0, MACHINE=machine) + nmake("makefile.vc", "install", DEBUG=0, INSTALLDIR=dest, MACHINE=machine) # TIX if 1: # python9.mak is available at http://svn.python.org os.chdir(os.path.join(ROOT, TIX, "win")) if clean: - nmake("python9.mak", "clean") - nmake("python9.mak", MACHINE=machine, INSTALL_DIR=dest) - nmake("python9.mak", "install", INSTALL_DIR=dest) + nmake("python.mak", "clean") + nmake("python.mak", MACHINE=machine, INSTALL_DIR=dest) + nmake("python.mak", "install", INSTALL_DIR=dest) def main(): if len(sys.argv) < 2 or sys.argv[1] not in ("Win32", "AMD64"): From python-checkins at python.org Fri Feb 13 21:27:39 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 13 Feb 2009 21:27:39 +0100 (CET) Subject: [Python-checkins] r69592 - python/branches/py3k/Tools/msi/uuids.py Message-ID: <20090213202739.775401E4002@bag.python.org> Author: martin.v.loewis Date: Fri Feb 13 21:27:39 2009 New Revision: 69592 Log: Fix typos in version numbers. 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 Fri Feb 13 21:27:39 2009 @@ -63,8 +63,8 @@ '3.0.122': '{f707b8e9-a257-4045-818e-4923fc20fbb6}', # 3.0c2 '3.0.123': '{5e7208f1-8643-4ea2-ab5e-4644887112e3}', # 3.0c3 '3.0.150': '{e0e56e21-55de-4f77-a109-1baa72348743}', # 3.0.0 - '3.1.1121':'{d35b1ea5-3d70-4872-bf7e-cd066a77a9c9}', # 3.0.1c1 - '3.1.1150':'{de2f2d9c-53e2-40ee-8209-74da63cb060e}', # 3.0.1 - '3.1.2121':'{cef79e7f-9809-49e2-afd2-e24148d7c855}', # 3.0.2c1 - '3.1.2150':'{0cf3b95a-8382-4607-9779-c36407ff362c}', # 3.0.2 + '3.0.1121':'{d35b1ea5-3d70-4872-bf7e-cd066a77a9c9}', # 3.0.1c1 + '3.0.1150':'{de2f2d9c-53e2-40ee-8209-74da63cb060e}', # 3.0.1 + '3.0.2121':'{cef79e7f-9809-49e2-afd2-e24148d7c855}', # 3.0.2c1 + '3.0.2150':'{0cf3b95a-8382-4607-9779-c36407ff362c}', # 3.0.2 } From buildbot at python.org Fri Feb 13 21:48:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 20:48:31 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090213204831.D3BA51E4002@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/870 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: sincerely, -The Buildbot From python-checkins at python.org Fri Feb 13 21:51:48 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 13 Feb 2009 21:51:48 +0100 (CET) Subject: [Python-checkins] r69593 - python/trunk/Tools/msi/merge.py Message-ID: <20090213205148.A714C1E400C@bag.python.org> Author: martin.v.loewis Date: Fri Feb 13 21:51:48 2009 New Revision: 69593 Log: Add optional code signing after merging. Modified: python/trunk/Tools/msi/merge.py Modified: python/trunk/Tools/msi/merge.py ============================================================================== --- python/trunk/Tools/msi/merge.py (original) +++ python/trunk/Tools/msi/merge.py Fri Feb 13 21:51:48 2009 @@ -1,5 +1,6 @@ import msilib,os,win32com,tempfile,sys PCBUILD="PCBuild" +certname = None from config import * Win64 = "amd64" in PCBUILD @@ -76,3 +77,8 @@ db.Commit() merge(msi, "SharedCRT", "TARGETDIR", modules) + +# certname (from config.py) should be (a substring of) +# the certificate subject, e.g. "Python Software Foundation" +if certname: + os.system('signtool sign /n "%s" /t http://timestamp.verisign.com/scripts/timestamp.dll %s' % (certname, msi)) From buildbot at python.org Fri Feb 13 22:01:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 21:01:22 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090213210123.654E71E4002@bag.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/260 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_doctest make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 13 22:02:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 21:02:22 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090213210222.CD84D1E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/640 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 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 "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_poplib.py", line 131, in run asyncore.loop(timeout=0.1, count=1) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 204, in loop poll_fun(timeout, map) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 141, in poll read(obj) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 78, in read obj.handle_error() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 74, in read obj.handle_read_event() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 413, in handle_read_event self.handle_read() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_ssl.py", line 408, in handle_read self.send(data.lower()) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 519, in send self.initiate_send() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 506, in initiate_send num_sent = dispatcher.send(self, self.out_buffer[:512]) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 349, in send result = self.socket.send(data) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/socket.py", line 165, in _dummy raise error(EBADF, 'Bad file descriptor') error: [Errno 9] Bad file descriptor sincerely, -The Buildbot From buildbot at python.org Fri Feb 13 22:24:33 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 21:24:33 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090213212433.2FA461E4002@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/285 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_posix test_subprocess ====================================================================== 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From buildbot at python.org Fri Feb 13 23:00:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 22:00:37 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090213220037.655CE1E4002@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/274 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_pipes make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Feb 13 23:22:03 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 13 Feb 2009 23:22:03 +0100 (CET) Subject: [Python-checkins] r69594 - in python/trunk: Lib/distutils/tests/test_util.py Misc/NEWS Message-ID: <20090213222203.8A03F1E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 13 23:22:03 2009 New Revision: 69594 Log: Issue #2461: added tests for distutils.util Added: python/trunk/Lib/distutils/tests/test_util.py (contents, props changed) Modified: python/trunk/Misc/NEWS Added: python/trunk/Lib/distutils/tests/test_util.py ============================================================================== --- (empty file) +++ python/trunk/Lib/distutils/tests/test_util.py Fri Feb 13 23:22:03 2009 @@ -0,0 +1,213 @@ +"""Tests for distutils.util.""" +# not covered yet: +# - byte_compile +# +import os +import sys +import unittest + +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 import util # used to patch _environ_checked + +class utilTestCase(unittest.TestCase): + + def setUp(self): + # saving the environment + self.name = os.name + self.platform = sys.platform + self.version = sys.version + self.sep = os.sep + self.environ = os.environ + self.join = os.path.join + self.isabs = os.path.isabs + self.splitdrive = os.path.splitdrive + + # patching os.uname + if hasattr(os, 'uname'): + self.uname = os.uname + self._uname = os.uname() + os.uname = self._get_uname + else: + self.uname = None + self._uname = None + + def tearDown(self): + # getting back tne environment + os.name = self.name + sys.platform = self.platform + sys.version = self.version + os.sep = self.sep + os.environ = self.environ + os.path.join = self.join + os.path.isabs = self.isabs + os.path.splitdrive = self.splitdrive + if self.uname is not None: + os.uname = self.uname + + def _set_uname(self, uname): + self._uname = uname + + def _get_uname(self): + return self._uname + + def test_get_platform(self): + + # windows XP, 32bits + os.name = 'nt' + sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) ' + '[MSC v.1310 32 bit (Intel)]') + sys.platform = 'win32' + self.assertEquals(get_platform(), 'win32') + + # windows XP, amd64 + os.name = 'nt' + sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) ' + '[MSC v.1310 32 bit (Amd64)]') + sys.platform = 'win32' + self.assertEquals(get_platform(), 'win-amd64') + + # windows XP, itanium + os.name = 'nt' + sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) ' + '[MSC v.1310 32 bit (Itanium)]') + sys.platform = 'win32' + self.assertEquals(get_platform(), 'win-ia64') + + # macbook + os.name = 'posix' + sys.version = ('2.5 (r25:51918, Sep 19 2006, 08:49:13) ' + '\n[GCC 4.0.1 (Apple Computer, Inc. build 5341)]') + sys.platform = 'darwin' + self._set_uname(('Darwin', 'macziade', '8.11.1', + ('Darwin Kernel Version 8.11.1: ' + 'Wed Oct 10 18:23:28 PDT 2007; ' + 'root:xnu-792.25.20~1/RELEASE_I386'), 'i386')) + + self.assertEquals(get_platform(), 'macosx-10.3-i386') + + # linux debian sarge + os.name = 'posix' + sys.version = ('2.3.5 (#1, Jul 4 2007, 17:28:59) ' + '\n[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)]') + sys.platform = 'linux2' + self._set_uname(('Linux', 'aglae', '2.6.21.1dedibox-r7', + '#1 Mon Apr 30 17:25:38 CEST 2007', 'i686')) + + self.assertEquals(get_platform(), 'linux-i686') + + # XXX more platforms to tests here + + def test_convert_path(self): + # linux/mac + os.sep = '/' + def _join(path): + return '/'.join(path) + os.path.join = _join + + self.assertEquals(convert_path('/home/to/my/stuff'), + '/home/to/my/stuff') + + # win + os.sep = '\\' + def _join(*path): + return '\\'.join(path) + os.path.join = _join + + self.assertRaises(ValueError, convert_path, '/home/to/my/stuff') + self.assertRaises(ValueError, convert_path, 'home/to/my/stuff/') + + self.assertEquals(convert_path('home/to/my/stuff'), + 'home\\to\\my\\stuff') + self.assertEquals(convert_path('.'), + os.curdir) + + def test_change_root(self): + # linux/mac + os.name = 'posix' + def _isabs(path): + return path[0] == '/' + os.path.isabs = _isabs + + self.assertEquals(change_root('/root', '/old/its/here'), + '/root/old/its/here') + self.assertEquals(change_root('/root', 'its/here'), + '/root/its/here') + + # windows + os.name = 'nt' + def _isabs(path): + return path.startswith('c:\\') + os.path.isabs = _isabs + def _splitdrive(path): + if path.startswith('c:'): + return ('', path.replace('c:', '')) + return ('', path) + os.path.splitdrive = _splitdrive + def _join(*path): + return '\\'.join(path) + os.path.join = _join + + self.assertEquals(change_root('c:\\root', 'c:\\old\\its\\here'), + 'c:\\root\\old\\its\\here') + self.assertEquals(change_root('c:\\root', 'its\\here'), + 'c:\\root\\its\\here') + + # BugsBunny os (it's a great os) + os.name = 'BugsBunny' + self.assertRaises(DistutilsPlatformError, + change_root, 'c:\\root', 'its\\here') + + # XXX platforms to be covered: os2, mac + + def test_check_environ(self): + util._environ_checked = 0 + + # 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]) + else: + check_environ() + + self.assertEquals(os.environ['PLAT'], get_platform()) + self.assertEquals(util._environ_checked, 1) + + def test_split_quoted(self): + self.assertEquals(split_quoted('""one"" "two" \'three\' \\four'), + ['one', 'two', 'three', 'four']) + + def test_strtobool(self): + yes = ('y', 'Y', 'yes', 'True', 't', 'true', 'True', 'On', 'on', '1') + no = ('n', 'no', 'f', 'false', 'off', '0', 'Off', 'No', 'N') + + for y in yes: + self.assert_(strtobool(y)) + + for n in no: + self.assert_(not strtobool(n)) + + def test_rfc822_escape(self): + header = 'I am a\npoor\nlonesome\nheader\n' + res = rfc822_escape(header) + wanted = ('I am a%(8s)spoor%(8s)slonesome%(8s)s' + 'header%(8s)s') % {'8s': '\n'+8*' '} + self.assertEquals(res, wanted) + +def test_suite(): + return unittest.makeSuite(utilTestCase) + +if __name__ == "__main__": + unittest.main(defaultTest="test_suite") Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Feb 13 23:22:03 2009 @@ -155,6 +155,8 @@ Library ------- +- Issue #2461: added tests for distutils.util + - Issue #1008086: Fixed socket.inet_aton() to always return 4 bytes even on LP64 platforms (most 64-bit Linux, bsd, unix systems). From python-checkins at python.org Fri Feb 13 23:22:58 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 13 Feb 2009 23:22:58 +0100 (CET) Subject: [Python-checkins] r69595 - python/branches/release26-maint Message-ID: <20090213222258.8EF951E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 13 23:22:58 2009 New Revision: 69595 Log: Blocked revisions 69594 via svnmerge ........ r69594 | tarek.ziade | 2009-02-13 23:22:03 +0100 (Fri, 13 Feb 2009) | 1 line Issue #2461: added tests for distutils.util ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri Feb 13 23:26:15 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 13 Feb 2009 23:26:15 +0100 (CET) Subject: [Python-checkins] r69596 - in python/branches/py3k: Lib/distutils/tests/test_util.py Misc/NEWS Message-ID: <20090213222615.913591E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 13 23:26:15 2009 New Revision: 69596 Log: Merged revisions 69594 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69594 | tarek.ziade | 2009-02-13 23:22:03 +0100 (Fri, 13 Feb 2009) | 1 line Issue #2461: added tests for distutils.util ........ Added: python/branches/py3k/Lib/distutils/tests/test_util.py - copied unchanged from r69594, /python/trunk/Lib/distutils/tests/test_util.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri Feb 13 23:26:15 2009 @@ -166,6 +166,8 @@ Library ------- +- Issue #2461: added tests for distutils.util + - Issue #4998: The memory saving effect of __slots__ had been lost on Fractions which inherited from numbers.py which did not have __slots__ defined. The numbers hierarchy now has its own __slots__ declarations. From python-checkins at python.org Fri Feb 13 23:27:40 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 13 Feb 2009 23:27:40 +0100 (CET) Subject: [Python-checkins] r69597 - python/branches/release30-maint Message-ID: <20090213222740.EF2EF1E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 13 23:27:40 2009 New Revision: 69597 Log: Blocked revisions 69596 via svnmerge ................ r69596 | tarek.ziade | 2009-02-13 23:26:15 +0100 (Fri, 13 Feb 2009) | 9 lines Merged revisions 69594 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69594 | tarek.ziade | 2009-02-13 23:22:03 +0100 (Fri, 13 Feb 2009) | 1 line Issue #2461: added tests for distutils.util ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Fri Feb 13 23:47:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 22:47:47 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090213224749.33AA01E4002@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/873 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_platform (distutils.tests.test_util.utilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/distutils/tests/test_util.py", line 95, in test_get_platform self.assertEquals(get_platform(), 'macosx-10.3-i386') AssertionError: 'darwin-8.11.1-i386' != 'macosx-10.3-i386' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 13 23:51:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 22:51:28 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090213225128.93E9E1E4002@bag.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/1864 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 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_platform (distutils.tests.test_util.utilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/distutils/tests/test_util.py", line 95, in test_get_platform self.assertEquals(get_platform(), 'macosx-10.3-i386') AssertionError: 'darwin-8.11.1-i386' != 'macosx-10.3-i386' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Feb 14 00:00:43 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 14 Feb 2009 00:00:43 +0100 (CET) Subject: [Python-checkins] r69598 - in python/trunk: Lib/distutils/command/build_scripts.py Lib/distutils/tests/test_build_scripts.py Misc/NEWS Message-ID: <20090213230043.866191E4002@bag.python.org> Author: tarek.ziade Date: Sat Feb 14 00:00:43 2009 New Revision: 69598 Log: Fixed #4524: distutils build_script command failed with --with-suffix=3 Modified: python/trunk/Lib/distutils/command/build_scripts.py python/trunk/Lib/distutils/tests/test_build_scripts.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/command/build_scripts.py ============================================================================== --- python/trunk/Lib/distutils/command/build_scripts.py (original) +++ python/trunk/Lib/distutils/command/build_scripts.py Sat Feb 14 00:00:43 2009 @@ -102,8 +102,8 @@ outf.write("#!%s%s\n" % (os.path.join( sysconfig.get_config_var("BINDIR"), - "python" + sysconfig.get_config_var("VERSION") - + sysconfig.get_config_var("EXE")), + "python%s%s" % (sysconfig.get_config_var("VERSION"), + sysconfig.get_config_var("EXE"))), post_interp)) outf.writelines(f.readlines()) outf.close() Modified: python/trunk/Lib/distutils/tests/test_build_scripts.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_build_scripts.py (original) +++ python/trunk/Lib/distutils/tests/test_build_scripts.py Sat Feb 14 00:00:43 2009 @@ -5,6 +5,7 @@ from distutils.command.build_scripts import build_scripts from distutils.core import Distribution +from distutils import sysconfig from distutils.tests import support @@ -73,6 +74,33 @@ f.write(text) f.close() + def test_version_int(self): + source = self.mkdtemp() + target = self.mkdtemp() + expected = self.write_sample_scripts(source) + + + cmd = self.get_build_scripts_cmd(target, + [os.path.join(source, fn) + for fn in expected]) + cmd.finalize_options() + + # http://bugs.python.org/issue4524 + # + # On linux-g++-32 with command line `./configure --enable-ipv6 + # --with-suffix=3`, python is compiled okay but the build scripts + # failed when writing the name of the executable + old = sysconfig._config_vars.get('VERSION') + sysconfig._config_vars['VERSION'] = 4 + try: + cmd.run() + finally: + if old is not None: + sysconfig._config_vars['VERSION'] = old + + built = os.listdir(target) + for name in expected: + self.assert_(name in built) def test_suite(): return unittest.makeSuite(BuildScriptsTestCase) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Feb 14 00:00:43 2009 @@ -155,6 +155,9 @@ Library ------- +- Issue #4524: distutils build_script command failed with --with-suffix=3. + Initial patch by Amaury Forgeot d'Arc. + - Issue #2461: added tests for distutils.util - Issue #1008086: Fixed socket.inet_aton() to always return 4 bytes even on From python-checkins at python.org Sat Feb 14 00:02:45 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 14 Feb 2009 00:02:45 +0100 (CET) Subject: [Python-checkins] r69599 - in python/branches/release26-maint: Lib/distutils/command/build_scripts.py Lib/distutils/tests/test_build_scripts.py Misc/NEWS Message-ID: <20090213230245.70B881E4002@bag.python.org> Author: tarek.ziade Date: Sat Feb 14 00:02:44 2009 New Revision: 69599 Log: Merged revisions 69598 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69598 | tarek.ziade | 2009-02-14 00:00:43 +0100 (Sat, 14 Feb 2009) | 1 line Fixed #4524: distutils build_script command failed with --with-suffix=3 ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/distutils/command/build_scripts.py python/branches/release26-maint/Lib/distutils/tests/test_build_scripts.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/distutils/command/build_scripts.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/command/build_scripts.py (original) +++ python/branches/release26-maint/Lib/distutils/command/build_scripts.py Sat Feb 14 00:02:44 2009 @@ -104,8 +104,8 @@ outf.write("#!%s%s\n" % (os.path.join( sysconfig.get_config_var("BINDIR"), - "python" + sysconfig.get_config_var("VERSION") - + sysconfig.get_config_var("EXE")), + "python%s%s" % (sysconfig.get_config_var("VERSION"), + sysconfig.get_config_var("EXE"))), post_interp)) outf.writelines(f.readlines()) outf.close() Modified: python/branches/release26-maint/Lib/distutils/tests/test_build_scripts.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/tests/test_build_scripts.py (original) +++ python/branches/release26-maint/Lib/distutils/tests/test_build_scripts.py Sat Feb 14 00:02:44 2009 @@ -5,6 +5,7 @@ from distutils.command.build_scripts import build_scripts from distutils.core import Distribution +from distutils import sysconfig from distutils.tests import support @@ -73,6 +74,33 @@ f.write(text) f.close() + def test_version_int(self): + source = self.mkdtemp() + target = self.mkdtemp() + expected = self.write_sample_scripts(source) + + + cmd = self.get_build_scripts_cmd(target, + [os.path.join(source, fn) + for fn in expected]) + cmd.finalize_options() + + # http://bugs.python.org/issue4524 + # + # On linux-g++-32 with command line `./configure --enable-ipv6 + # --with-suffix=3`, python is compiled okay but the build scripts + # failed when writing the name of the executable + old = sysconfig._config_vars.get('VERSION') + sysconfig._config_vars['VERSION'] = 4 + try: + cmd.run() + finally: + if old is not None: + sysconfig._config_vars['VERSION'] = old + + built = os.listdir(target) + for name in expected: + self.assert_(name in built) def test_suite(): return unittest.makeSuite(BuildScriptsTestCase) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sat Feb 14 00:02:44 2009 @@ -80,6 +80,9 @@ Library ------- +- Issue #4524: distutils build_script command failed with --with-suffix=3. + Initial patch by Amaury Forgeot d'Arc. + - Issue #4998: The memory saving effect of __slots__ had been lost on Fractions which inherited from numbers.py which did not have __slots__ defined. The numbers hierarchy now has its own __slots__ declarations. From python-checkins at python.org Sat Feb 14 00:04:17 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 14 Feb 2009 00:04:17 +0100 (CET) Subject: [Python-checkins] r69600 - in python/branches/py3k: Lib/distutils/command/build_scripts.py Lib/distutils/tests/test_build_scripts.py Misc/NEWS Message-ID: <20090213230417.B164C1E4002@bag.python.org> Author: tarek.ziade Date: Sat Feb 14 00:04:17 2009 New Revision: 69600 Log: Merged revisions 69598 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69598 | tarek.ziade | 2009-02-14 00:00:43 +0100 (Sat, 14 Feb 2009) | 1 line Fixed #4524: distutils build_script command failed with --with-suffix=3 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/command/build_scripts.py python/branches/py3k/Lib/distutils/tests/test_build_scripts.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/distutils/command/build_scripts.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/build_scripts.py (original) +++ python/branches/py3k/Lib/distutils/command/build_scripts.py Sat Feb 14 00:04:17 2009 @@ -104,8 +104,8 @@ outf.write("#!%s%s\n" % (os.path.join( sysconfig.get_config_var("BINDIR"), - "python" + sysconfig.get_config_var("VERSION") - + sysconfig.get_config_var("EXE")), + "python%s%s" % (sysconfig.get_config_var("VERSION"), + sysconfig.get_config_var("EXE"))), post_interp)) outf.writelines(f.readlines()) outf.close() Modified: python/branches/py3k/Lib/distutils/tests/test_build_scripts.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_build_scripts.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_build_scripts.py Sat Feb 14 00:04:17 2009 @@ -5,6 +5,7 @@ from distutils.command.build_scripts import build_scripts from distutils.core import Distribution +from distutils import sysconfig from distutils.tests import support @@ -73,6 +74,33 @@ f.write(text) f.close() + def test_version_int(self): + source = self.mkdtemp() + target = self.mkdtemp() + expected = self.write_sample_scripts(source) + + + cmd = self.get_build_scripts_cmd(target, + [os.path.join(source, fn) + for fn in expected]) + cmd.finalize_options() + + # http://bugs.python.org/issue4524 + # + # On linux-g++-32 with command line `./configure --enable-ipv6 + # --with-suffix=3`, python is compiled okay but the build scripts + # failed when writing the name of the executable + old = sysconfig._config_vars.get('VERSION') + sysconfig._config_vars['VERSION'] = 4 + try: + cmd.run() + finally: + if old is not None: + sysconfig._config_vars['VERSION'] = old + + built = os.listdir(target) + for name in expected: + self.assert_(name in built) def test_suite(): return unittest.makeSuite(BuildScriptsTestCase) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Feb 14 00:04:17 2009 @@ -166,6 +166,9 @@ Library ------- +- Issue #4524: distutils build_script command failed with --with-suffix=3. + Initial patch by Amaury Forgeot d'Arc. + - Issue #2461: added tests for distutils.util - Issue #4998: The memory saving effect of __slots__ had been lost on Fractions From buildbot at python.org Sat Feb 14 00:04:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 23:04:54 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090213230454.931D71E4002@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/4638 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_platform (distutils.tests.test_util.utilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/distutils/tests/test_util.py", line 95, in test_get_platform self.assertEquals(get_platform(), 'macosx-10.3-i386') AssertionError: 'darwin-8.11.1-i386' != 'macosx-10.3-i386' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From mal at egenix.com Sat Feb 14 00:06:02 2009 From: mal at egenix.com (M.-A. Lemburg) Date: Sat, 14 Feb 2009 00:06:02 +0100 Subject: [Python-checkins] r69594 - in python/trunk: Lib/distutils/tests/test_util.py Misc/NEWS In-Reply-To: <20090213222203.8A03F1E4002@bag.python.org> References: <20090213222203.8A03F1E4002@bag.python.org> Message-ID: <4995FCDA.1080509@egenix.com> Hi Tarek, On 2009-02-13 23:22, tarek.ziade wrote: > Author: tarek.ziade > Date: Fri Feb 13 23:22:03 2009 > New Revision: 69594 > > Log: > Issue #2461: added tests for distutils.util > > Added: > python/trunk/Lib/distutils/tests/test_util.py (contents, props changed) > Modified: > python/trunk/Misc/NEWS > > Added: python/trunk/Lib/distutils/tests/test_util.py > ============================================================================== >... > + # macbook > + os.name = 'posix' > + sys.version = ('2.5 (r25:51918, Sep 19 2006, 08:49:13) ' > + '\n[GCC 4.0.1 (Apple Computer, Inc. build 5341)]') > + sys.platform = 'darwin' > + self._set_uname(('Darwin', 'macziade', '8.11.1', > + ('Darwin Kernel Version 8.11.1: ' > + 'Wed Oct 10 18:23:28 PDT 2007; ' > + 'root:xnu-792.25.20~1/RELEASE_I386'), 'i386')) > + > + self.assertEquals(get_platform(), 'macosx-10.3-i386') The above test won't work on non-Mac OS X platforms, since distutils does some funky stuff with the os.environ and system files which results in the conversion to macosx-10.3 not to work on non-Mac platforms. Even on Macs, it makes a difference whether you have MACOSX_DEPLOYMENT_TARGET set to 10.3, 10.4 or 10.5. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 14 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/ ________________________________________________________________________ ::: 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 Sat Feb 14 00:07:18 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 14 Feb 2009 00:07:18 +0100 (CET) Subject: [Python-checkins] r69601 - in python/branches/release30-maint: Lib/distutils/command/build_scripts.py Lib/distutils/tests/test_build_scripts.py Misc/NEWS Message-ID: <20090213230718.E3D051E400C@bag.python.org> Author: tarek.ziade Date: Sat Feb 14 00:07:18 2009 New Revision: 69601 Log: Merged revisions 69600 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69600 | tarek.ziade | 2009-02-14 00:04:17 +0100 (Sat, 14 Feb 2009) | 9 lines Merged revisions 69598 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69598 | tarek.ziade | 2009-02-14 00:00:43 +0100 (Sat, 14 Feb 2009) | 1 line Fixed #4524: distutils build_script command failed with --with-suffix=3 ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/distutils/command/build_scripts.py python/branches/release30-maint/Lib/distutils/tests/test_build_scripts.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/distutils/command/build_scripts.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/command/build_scripts.py (original) +++ python/branches/release30-maint/Lib/distutils/command/build_scripts.py Sat Feb 14 00:07:18 2009 @@ -104,8 +104,8 @@ outf.write("#!%s%s\n" % (os.path.join( sysconfig.get_config_var("BINDIR"), - "python" + sysconfig.get_config_var("VERSION") - + sysconfig.get_config_var("EXE")), + "python%s%s" % (sysconfig.get_config_var("VERSION"), + sysconfig.get_config_var("EXE"))), post_interp)) outf.writelines(f.readlines()) outf.close() Modified: python/branches/release30-maint/Lib/distutils/tests/test_build_scripts.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/tests/test_build_scripts.py (original) +++ python/branches/release30-maint/Lib/distutils/tests/test_build_scripts.py Sat Feb 14 00:07:18 2009 @@ -5,6 +5,7 @@ from distutils.command.build_scripts import build_scripts from distutils.core import Distribution +from distutils import sysconfig from distutils.tests import support @@ -73,6 +74,33 @@ f.write(text) f.close() + def test_version_int(self): + source = self.mkdtemp() + target = self.mkdtemp() + expected = self.write_sample_scripts(source) + + + cmd = self.get_build_scripts_cmd(target, + [os.path.join(source, fn) + for fn in expected]) + cmd.finalize_options() + + # http://bugs.python.org/issue4524 + # + # On linux-g++-32 with command line `./configure --enable-ipv6 + # --with-suffix=3`, python is compiled okay but the build scripts + # failed when writing the name of the executable + old = sysconfig._config_vars.get('VERSION') + sysconfig._config_vars['VERSION'] = 4 + try: + cmd.run() + finally: + if old is not None: + sysconfig._config_vars['VERSION'] = old + + built = os.listdir(target) + for name in expected: + self.assert_(name in built) def test_suite(): return unittest.makeSuite(BuildScriptsTestCase) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat Feb 14 00:07:18 2009 @@ -116,6 +116,9 @@ Library ------- +- Issue #4524: distutils build_script command failed with --with-suffix=3. + Initial patch by Amaury Forgeot d'Arc. + - Issue #4998: The memory saving effect of __slots__ had been lost on Fractions which inherited from numbers.py which did not have __slots__ defined. The numbers hierarchy now has its own __slots__ declarations. From ziade.tarek at gmail.com Sat Feb 14 00:17:54 2009 From: ziade.tarek at gmail.com (=?ISO-8859-1?Q?Tarek_Ziad=E9?=) Date: Sat, 14 Feb 2009 00:17:54 +0100 Subject: [Python-checkins] r69594 - in python/trunk: Lib/distutils/tests/test_util.py Misc/NEWS In-Reply-To: <4995FCDA.1080509@egenix.com> References: <20090213222203.8A03F1E4002@bag.python.org> <4995FCDA.1080509@egenix.com> Message-ID: <94bdd2610902131517p6e3f7c4ev129413f3cb7903fc@mail.gmail.com> On Sat, Feb 14, 2009 at 12:06 AM, M.-A. Lemburg wrote: > Hi Tarek, > > On 2009-02-13 23:22, tarek.ziade wrote: >> Author: tarek.ziade >> Date: Fri Feb 13 23:22:03 2009 >> New Revision: 69594 >> >> Log: >> Issue #2461: added tests for distutils.util >> >> Added: >> python/trunk/Lib/distutils/tests/test_util.py (contents, props changed) >> Modified: >> python/trunk/Misc/NEWS >> >> Added: python/trunk/Lib/distutils/tests/test_util.py >> ============================================================================== >>... >> + # macbook >> + os.name = 'posix' >> + sys.version = ('2.5 (r25:51918, Sep 19 2006, 08:49:13) ' >> + '\n[GCC 4.0.1 (Apple Computer, Inc. build 5341)]') >> + sys.platform = 'darwin' >> + self._set_uname(('Darwin', 'macziade', '8.11.1', >> + ('Darwin Kernel Version 8.11.1: ' >> + 'Wed Oct 10 18:23:28 PDT 2007; ' >> + 'root:xnu-792.25.20~1/RELEASE_I386'), 'i386')) >> + >> + self.assertEquals(get_platform(), 'macosx-10.3-i386') > > The above test won't work on non-Mac OS X platforms, since distutils > does some funky stuff with the os.environ and system files which > results in the conversion to macosx-10.3 not to work on non-Mac > platforms. > > Even on Macs, it makes a difference whether you have MACOSX_DEPLOYMENT_TARGET > set to 10.3, 10.4 or 10.5. > Hi Marc-Andr?, right thanks, I have just switched to windows and work on the environ Tarek From buildbot at python.org Sat Feb 14 00:19:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 23:19:15 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090213231915.BEEFE1E4002@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/355 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_platform (distutils.tests.test_util.utilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/distutils/tests/test_util.py", line 95, in test_get_platform self.assertEquals(get_platform(), 'macosx-10.3-i386') AssertionError: 'darwin-8.11.1-i386' != 'macosx-10.3-i386' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Feb 14 00:41:57 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 14 Feb 2009 00:41:57 +0100 (CET) Subject: [Python-checkins] r69602 - python/trunk/Lib/distutils/tests/test_util.py Message-ID: <20090213234157.76FD31E4002@bag.python.org> Author: tarek.ziade Date: Sat Feb 14 00:41:57 2009 New Revision: 69602 Log: fix the environ for distutils test_util Modified: python/trunk/Lib/distutils/tests/test_util.py 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 Feb 14 00:41:57 2009 @@ -35,11 +35,12 @@ if hasattr(os, 'uname'): self.uname = os.uname self._uname = os.uname() - os.uname = self._get_uname else: self.uname = None self._uname = None + os.uname = self._get_uname + def tearDown(self): # getting back tne environment os.name = self.name @@ -91,6 +92,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.assertEquals(get_platform(), 'macosx-10.3-i386') @@ -136,6 +138,9 @@ def _isabs(path): return path[0] == '/' os.path.isabs = _isabs + def _join(*path): + return '/'.join(path) + os.path.join = _join self.assertEquals(change_root('/root', '/old/its/here'), '/root/old/its/here') From python-checkins at python.org Sat Feb 14 00:48:11 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 14 Feb 2009 00:48:11 +0100 (CET) Subject: [Python-checkins] r69603 - in python/branches/py3k: Lib/distutils/tests/test_util.py Message-ID: <20090213234811.D350E1E4002@bag.python.org> Author: tarek.ziade Date: Sat Feb 14 00:48:11 2009 New Revision: 69603 Log: Merged revisions 69602 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69602 | tarek.ziade | 2009-02-14 00:41:57 +0100 (Sat, 14 Feb 2009) | 1 line fix the environ for distutils test_util ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_util.py 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 Feb 14 00:48:11 2009 @@ -35,11 +35,12 @@ if hasattr(os, 'uname'): self.uname = os.uname self._uname = os.uname() - os.uname = self._get_uname else: self.uname = None self._uname = None + os.uname = self._get_uname + def tearDown(self): # getting back tne environment os.name = self.name @@ -91,6 +92,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.assertEquals(get_platform(), 'macosx-10.3-i386') @@ -136,6 +138,9 @@ def _isabs(path): return path[0] == '/' os.path.isabs = _isabs + def _join(*path): + return '/'.join(path) + os.path.join = _join self.assertEquals(change_root('/root', '/old/its/here'), '/root/old/its/here') From buildbot at python.org Sat Feb 14 00:50:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 13 Feb 2009 23:50:14 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090213235014.3D0DA1E4002@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/309 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_distutils ====================================================================== FAIL: test_get_platform (distutils.tests.test_util.utilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/distutils/tests/test_util.py", line 95, in test_get_platform self.assertEquals(get_platform(), 'macosx-10.3-i386') AssertionError: 'darwin-8.11.1-i386' != 'macosx-10.3-i386' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Feb 14 01:25:56 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 14 Feb 2009 01:25:56 +0100 (CET) Subject: [Python-checkins] r69604 - in python/trunk: Doc/library/itertools.rst Lib/test/test_itertools.py Modules/itertoolsmodule.c Message-ID: <20090214002556.D94231E4020@bag.python.org> Author: raymond.hettinger Date: Sat Feb 14 01:25:51 2009 New Revision: 69604 Log: Add keyword argument support to itertools.count(). Modified: python/trunk/Doc/library/itertools.rst python/trunk/Lib/test/test_itertools.py python/trunk/Modules/itertoolsmodule.c Modified: python/trunk/Doc/library/itertools.rst ============================================================================== --- python/trunk/Doc/library/itertools.rst (original) +++ python/trunk/Doc/library/itertools.rst Sat Feb 14 01:25:51 2009 @@ -200,20 +200,20 @@ .. versionadded:: 2.7 -.. function:: count(n=0, step=1) +.. function:: count(start=0, step=1) Make an iterator that returns evenly spaced values starting with *n*. Often used as an argument to :func:`imap` to generate consecutive data points. Also, used with :func:`izip` to add sequence numbers. Equivalent to:: - def count(n=0, step=1): + def count(start=0, step=1): # count(10) --> 10 11 12 13 14 ... # count(2.5, 0.5) -> 3.5 3.0 4.5 ... + n = start while True: yield n n += step - .. versionchanged:: 2.7 added *step* argument and allowed non-integer arguments. Modified: python/trunk/Lib/test/test_itertools.py ============================================================================== --- python/trunk/Lib/test/test_itertools.py (original) +++ python/trunk/Lib/test/test_itertools.py Sat Feb 14 01:25:51 2009 @@ -347,6 +347,8 @@ def test_count_with_stride(self): self.assertEqual(zip('abc',count(2,3)), [('a', 2), ('b', 5), ('c', 8)]) + self.assertEqual(zip('abc',count(start=2,step=3)), + [('a', 2), ('b', 5), ('c', 8)]) self.assertEqual(zip('abc',count(2,0)), [('a', 2), ('b', 2), ('c', 2)]) self.assertEqual(zip('abc',count(2,1)), [('a', 2), ('b', 3), ('c', 4)]) self.assertEqual(take(20, count(maxsize-15, 3)), take(20, range(maxsize-15, maxsize+100, 3))) Modified: python/trunk/Modules/itertoolsmodule.c ============================================================================== --- python/trunk/Modules/itertoolsmodule.c (original) +++ python/trunk/Modules/itertoolsmodule.c Sat Feb 14 01:25:51 2009 @@ -3233,11 +3233,10 @@ Py_ssize_t cnt = 0; PyObject *long_cnt = NULL; PyObject *long_step = NULL; + static char *kwlist[] = {"start", "step", 0}; - if (type == &count_type && !_PyArg_NoKeywords("count()", kwds)) - return NULL; - - if (!PyArg_UnpackTuple(args, "count", 0, 2, &long_cnt, &long_step)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OO:count", + kwlist, &long_cnt, &long_step)) return NULL; if (long_cnt != NULL && !PyNumber_Check(long_cnt) || @@ -3353,10 +3352,10 @@ } PyDoc_STRVAR(count_doc, - "count([firstval[, step]]) --> count object\n\ + "count([start[, step]]) --> count object\n\ \n\ Return a count object whose .next() method returns consecutive\n\ -integers starting from zero or, if specified, from firstval.\n\ +integers starting from zero or, if specified, from start.\n\ If step is specified, counts by that interval. Equivalent to:\n\n\ def count(firstval=0, step=1):\n\ x = firstval\n\ From python-checkins at python.org Sat Feb 14 01:26:50 2009 From: python-checkins at python.org (barry.warsaw) Date: Sat, 14 Feb 2009 01:26:50 +0100 (CET) Subject: [Python-checkins] r69605 - sandbox/trunk/release/release.py Message-ID: <20090214002650.1F13B1E4002@bag.python.org> Author: barry.warsaw Date: Sat Feb 14 01:26:49 2009 New Revision: 69605 Log: Python 3 doesn't have opcodes_targets.h. Modified: sandbox/trunk/release/release.py Modified: sandbox/trunk/release/release.py ============================================================================== --- sandbox/trunk/release/release.py (original) +++ sandbox/trunk/release/release.py Sat Feb 14 01:26:49 2009 @@ -22,6 +22,7 @@ from string import Template from urlparse import urlsplit, urlunsplit +COMMASPACE = ', ' SPACE = ' ' tag_cre = re.compile(r'(\d+)(?:\.(\d+)(?:\.(\d+))?)?(?:([ab]|rc)(\d+))?') @@ -261,9 +262,15 @@ os.unlink(name) except OSError: pass - print 'Touching Python-ast.h, Python-ast.c, and opcode_targets.h' - for name in ('Include/Python-ast.h', 'Python/Python-ast.c', - 'opcode_targets.h'): + # Touch a few files that get generated so they're up-to-date in + # the tarball. + touchables = ['Include/Python-ast.h', 'Python/Python-ast.c'] + if tag.major < 3: + # This file isn't in Python 3.x + touchables.append('opcode_targets.h') + print 'Touching:', COMMASPACE.join(name.rsplit('/', 1)[-1] + for name in touchables) + for name in touchables: os.utime(name, None) docdist = build_docs() From buildbot at python.org Sat Feb 14 02:03:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 14 Feb 2009 01:03:54 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090214010354.E2DFC1E4002@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/152 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_distutils ====================================================================== FAIL: test_get_platform (distutils.tests.test_util.utilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/distutils/tests/test_util.py", line 95, in test_get_platform self.assertEquals(get_platform(), 'macosx-10.3-i386') AssertionError: 'darwin-8.11.1-i386' != 'macosx-10.3-i386' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 14 02:49:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 14 Feb 2009 01:49:23 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.6 Message-ID: <20090214014924.633D51E4002@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/85 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') ====================================================================== 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: barry.warsaw Date: Sat Feb 14 03:22:24 2009 New Revision: 69606 Log: Post release cleaup. Modified: python/branches/release30-maint/Include/patchlevel.h python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Include/patchlevel.h ============================================================================== --- python/branches/release30-maint/Include/patchlevel.h (original) +++ python/branches/release30-maint/Include/patchlevel.h Sat Feb 14 03:22:24 2009 @@ -23,7 +23,7 @@ #define PY_RELEASE_SERIAL 0 /* Version as a string */ -#define PY_VERSION "3.0.1" +#define PY_VERSION "3.0.1+" /*--end constants--*/ /* Subversion Revision number of this file (not of the repository) */ Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat Feb 14 03:22:24 2009 @@ -4,6 +4,18 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) +What's New in Python 3.0.2? +=========================== + +*Release date: XX-XXX-2009* + +Core and Builtins +----------------- + +Library +------- + + What's New in Python 3.0.1? =========================== From buildbot at python.org Sat Feb 14 03:53:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 14 Feb 2009 02:53:35 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090214025335.516401E4002@bag.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/128 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: barry.warsaw 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 Feb 14 04:03:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 14 Feb 2009 03:03:20 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090214030321.534721E4002@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/156 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 Sat Feb 14 05:21:49 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 14 Feb 2009 05:21:49 +0100 (CET) Subject: [Python-checkins] r69607 - in python/branches/py3k: Doc/library/itertools.rst Lib/test/test_itertools.py Modules/itertoolsmodule.c Message-ID: <20090214042149.525121E4002@bag.python.org> Author: raymond.hettinger Date: Sat Feb 14 05:21:49 2009 New Revision: 69607 Log: Add keyword argument support to itertools.count(). Modified: python/branches/py3k/Doc/library/itertools.rst python/branches/py3k/Lib/test/test_itertools.py python/branches/py3k/Modules/itertoolsmodule.c Modified: python/branches/py3k/Doc/library/itertools.rst ============================================================================== --- python/branches/py3k/Doc/library/itertools.rst (original) +++ python/branches/py3k/Doc/library/itertools.rst Sat Feb 14 05:21:49 2009 @@ -194,15 +194,16 @@ .. versionadded:: 3.1 -.. function:: count(n=0, step=1) +.. function:: count(start=0, step=1) Make an iterator that returns evenly spaced values starting with *n*. Often used as an argument to :func:`map` to generate consecutive data points. Also, used with :func:`zip` to add sequence numbers. Equivalent to:: - def count(n=0, step=1): + def count(start=0, step=1): # count(10) --> 10 11 12 13 14 ... # count(2.5, 0.5) -> 3.5 3.0 4.5 ... + n = start while True: yield n n += step Modified: python/branches/py3k/Lib/test/test_itertools.py ============================================================================== --- python/branches/py3k/Lib/test/test_itertools.py (original) +++ python/branches/py3k/Lib/test/test_itertools.py Sat Feb 14 05:21:49 2009 @@ -355,6 +355,7 @@ self.assertEqual(lzip('abc',count(2,3)), [('a', 2), ('b', 5), ('c', 8)]) self.assertEqual(lzip('abc',count(2,0)), [('a', 2), ('b', 2), ('c', 2)]) self.assertEqual(lzip('abc',count(2,1)), [('a', 2), ('b', 3), ('c', 4)]) + self.assertEqual(lzip('abc',count(2,3)), [('a', 2), ('b', 5), ('c', 8)]) self.assertEqual(take(20, count(maxsize-15, 3)), take(20, range(maxsize-15, maxsize+100, 3))) self.assertEqual(take(20, count(-maxsize-15, 3)), take(20, range(-maxsize-15,-maxsize+100, 3))) self.assertEqual(take(3, count(2, 3.25-4j)), [2, 5.25-4j, 8.5-8j]) Modified: python/branches/py3k/Modules/itertoolsmodule.c ============================================================================== --- python/branches/py3k/Modules/itertoolsmodule.c (original) +++ python/branches/py3k/Modules/itertoolsmodule.c Sat Feb 14 05:21:49 2009 @@ -2916,11 +2916,10 @@ Py_ssize_t cnt = 0; PyObject *long_cnt = NULL; PyObject *long_step = NULL; + static char *kwlist[] = {"start", "step", 0}; - if (type == &count_type && !_PyArg_NoKeywords("count()", kwds)) - return NULL; - - if (!PyArg_UnpackTuple(args, "count", 0, 2, &long_cnt, &long_step)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OO:count", + kwlist, &long_cnt, &long_step)) return NULL; if (long_cnt != NULL && !PyNumber_Check(long_cnt) || @@ -3027,10 +3026,10 @@ } PyDoc_STRVAR(count_doc, - "count([firstval[, step]]) --> count object\n\ + "count([start[, step]]) --> count object\n\ \n\ Return a count object whose .__next__() method returns consecutive\n\ -integers starting from zero or, if specified, from firstval.\n\ +integers starting from zero or, if specified, from start.\n\ If step is specified, counts by that interval. Equivalent to:\n\n\ def count(firstval=0, step=1):\n\ x = firstval\n\ From g.brandl at gmx.net Sat Feb 14 10:47:15 2009 From: g.brandl at gmx.net (Georg Brandl) Date: Sat, 14 Feb 2009 10:47:15 +0100 Subject: [Python-checkins] r69605 - sandbox/trunk/release/release.py In-Reply-To: <20090214002650.1F13B1E4002@bag.python.org> References: <20090214002650.1F13B1E4002@bag.python.org> Message-ID: barry.warsaw schrieb: > Author: barry.warsaw > Date: Sat Feb 14 01:26:49 2009 > New Revision: 69605 > > Log: > Python 3 doesn't have opcodes_targets.h. On the contrary, opcode_targets.h is *only* present on 3.x (but only on the trunk). Also it is in Python/, not on the toplevel. 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 Sat Feb 14 09:55:22 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 14 Feb 2009 09:55:22 +0100 (CET) Subject: [Python-checkins] r69608 - python/branches/release30-maint/Misc/build.sh Message-ID: <20090214085522.34A661E4002@bag.python.org> Author: georg.brandl Date: Sat Feb 14 09:55:22 2009 New Revision: 69608 Log: Adapt doc build directory. Modified: python/branches/release30-maint/Misc/build.sh Modified: python/branches/release30-maint/Misc/build.sh ============================================================================== --- python/branches/release30-maint/Misc/build.sh (original) +++ python/branches/release30-maint/Misc/build.sh Sat Feb 14 09:55:22 2009 @@ -50,7 +50,7 @@ #FAILURE_CC="optional--uncomment and set to desired address" REMOTE_SYSTEM="neal at dinsdale.python.org" -REMOTE_DIR="/data/ftp.python.org/pub/www.python.org/doc/3.0" +REMOTE_DIR="/data/ftp.python.org/pub/www.python.org/doc/3.0.1" RESULT_FILE="$DIR/build/index.html" INSTALL_DIR="/tmp/python-test-3.0/local" RSYNC_OPTS="-aC -e ssh" From python-checkins at python.org Sat Feb 14 15:10:24 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 14 Feb 2009 15:10:24 +0100 (CET) Subject: [Python-checkins] r69609 - in python/trunk: Lib/distutils/tests/support.py Lib/distutils/tests/test_build_ext.py Lib/distutils/tests/test_config.py Lib/distutils/tests/test_dir_util.py Lib/distutils/tests/test_dist.py Lib/distutils/tests/test_file_util.py Lib/distutils/tests/test_sdist.py Misc/NEWS Message-ID: <20090214141024.338A21E400C@bag.python.org> Author: tarek.ziade Date: Sat Feb 14 15:10:23 2009 New Revision: 69609 Log: Fix for #5257: refactored all tests in distutils, so they use a temporary directory. Modified: python/trunk/Lib/distutils/tests/support.py python/trunk/Lib/distutils/tests/test_build_ext.py python/trunk/Lib/distutils/tests/test_config.py python/trunk/Lib/distutils/tests/test_dir_util.py python/trunk/Lib/distutils/tests/test_dist.py python/trunk/Lib/distutils/tests/test_file_util.py python/trunk/Lib/distutils/tests/test_sdist.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/tests/support.py ============================================================================== --- python/trunk/Lib/distutils/tests/support.py (original) +++ python/trunk/Lib/distutils/tests/support.py Sat Feb 14 15:10:23 2009 @@ -1,5 +1,5 @@ """Support code for distutils test cases.""" - +import os import shutil import tempfile @@ -31,7 +31,7 @@ super(TempdirManager, self).tearDown() while self.tempdirs: d = self.tempdirs.pop() - shutil.rmtree(d) + shutil.rmtree(d, os.name in ('nt', 'cygwin')) def mkdtemp(self): """Create a temporary directory that will be cleaned up. 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 Feb 14 15:10:23 2009 @@ -7,6 +7,7 @@ from distutils.core import Extension, Distribution from distutils.command.build_ext import build_ext from distutils import sysconfig +from distutils.tests import support import unittest from test import test_support @@ -19,11 +20,12 @@ srcdir = sysconfig.get_config_var('srcdir') return os.path.join(srcdir, 'Modules', 'xxmodule.c') -class BuildExtTestCase(unittest.TestCase): +class BuildExtTestCase(support.TempdirManager, unittest.TestCase): def setUp(self): # Create a simple test environment # Note that we're making changes to sys.path - self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_") + support.TempdirManager.setUp(self) + self.tmp_dir = self.mkdtemp() self.sys_path = sys.path[:] sys.path.append(self.tmp_dir) shutil.copy(_get_source_filename(), self.tmp_dir) @@ -74,8 +76,7 @@ # Get everything back to normal test_support.unload('xx') 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') + support.TempdirManager.tearDown(self) def test_solaris_enable_shared(self): dist = Distribution({'name': 'xx'}) 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 Sat Feb 14 15:10:23 2009 @@ -2,6 +2,8 @@ import sys import os import unittest +import tempfile +import shutil from distutils.core import PyPIRCCommand from distutils.core import Distribution @@ -49,13 +51,15 @@ def setUp(self): """Patches the environment.""" + support.TempdirManager.setUp(self) + if os.environ.has_key('HOME'): self._old_home = os.environ['HOME'] else: self._old_home = None - curdir = os.path.dirname(__file__) - os.environ['HOME'] = curdir - self.rc = os.path.join(curdir, '.pypirc') + self.tmp_dir = self.mkdtemp() + os.environ['HOME'] = self.tmp_dir + self.rc = os.path.join(self.tmp_dir, '.pypirc') self.dist = Distribution() class command(PyPIRCCommand): @@ -74,9 +78,8 @@ del os.environ['HOME'] else: os.environ['HOME'] = self._old_home - if os.path.exists(self.rc): - os.remove(self.rc) set_threshold(self.old_threshold) + support.TempdirManager.tearDown(self) def test_server_registration(self): # This test makes sure PyPIRCCommand knows how to: 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 Sat Feb 14 15:10:23 2009 @@ -9,8 +9,9 @@ from distutils.dir_util import copy_tree from distutils import log +from distutils.tests import support -class DirUtilTestCase(unittest.TestCase): +class DirUtilTestCase(support.TempdirManager, unittest.TestCase): def _log(self, msg, *args): if len(args) > 0: @@ -19,18 +20,18 @@ self._logs.append(msg) def setUp(self): + support.TempdirManager.setUp(self) self._logs = [] - self.root_target = os.path.join(os.path.dirname(__file__), 'deep') + tmp_dir = self.mkdtemp() + self.root_target = os.path.join(tmp_dir, 'deep') self.target = os.path.join(self.root_target, 'here') - self.target2 = os.path.join(os.path.dirname(__file__), 'deep2') + self.target2 = os.path.join(tmp_dir, 'deep2') self.old_log = log.info log.info = self._log def tearDown(self): - for target in (self.target, self.target2): - if os.path.exists(target): - shutil.rmtree(target) log.info = self.old_log + support.TempdirManager.tearDown(self) def test_mkpath_remove_tree_verbosity(self): 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 Sat Feb 14 15:10:23 2009 @@ -11,7 +11,7 @@ import warnings from test.test_support import TESTFN - +from distutils.tests import support class test_dist(distutils.cmd.Command): """Sample distutils extension command.""" @@ -36,14 +36,16 @@ return self._config_files -class DistributionTestCase(unittest.TestCase): +class DistributionTestCase(support.TempdirManager, unittest.TestCase): def setUp(self): + support.TempdirManager.setUp(self) self.argv = sys.argv[:] del sys.argv[1:] def tearDown(self): sys.argv[:] = self.argv + support.TempdirManager.tearDown(self) def create_distribution(self, configfiles=()): d = TestDistribution() @@ -100,7 +102,8 @@ def test_write_pkg_file(self): # Check DistributionMetadata handling of Unicode fields - my_file = os.path.join(os.path.dirname(__file__), 'f') + tmp_dir = self.mkdtemp() + my_file = os.path.join(tmp_dir, 'f') klass = distutils.dist.Distribution dist = klass(attrs={'author': u'Mister Caf?', @@ -113,11 +116,7 @@ # let's make sure the file can be written # with Unicode fields. they are encoded with # PKG_INFO_ENCODING - try: - dist.metadata.write_pkg_file(open(my_file, 'w')) - finally: - if os.path.exists(my_file): - os.remove(my_file) + dist.metadata.write_pkg_file(open(my_file, 'w')) # regular ascii is of course always usable dist = klass(attrs={'author': 'Mister Cafe', @@ -126,11 +125,8 @@ 'description': 'Cafe torrefie', 'long_description': 'Hehehe'}) - try: - dist.metadata.write_pkg_file(open(my_file, 'w')) - finally: - if os.path.exists(my_file): - os.remove(my_file) + my_file2 = os.path.join(tmp_dir, 'f2') + dist.metadata.write_pkg_file(open(my_file, 'w')) def test_empty_options(self): # an empty options dictionary should not stay in the @@ -155,7 +151,7 @@ self.assertEquals(len(warns), 0) -class MetadataTestCase(unittest.TestCase): +class MetadataTestCase(support.TempdirManager, unittest.TestCase): def test_simple_metadata(self): attrs = {"name": "package", @@ -254,8 +250,8 @@ else: user_filename = "pydistutils.cfg" - curdir = os.path.dirname(__file__) - user_filename = os.path.join(curdir, user_filename) + temp_dir = self.mkdtemp() + user_filename = os.path.join(temp_dir, user_filename) f = open(user_filename, 'w') f.write('.') f.close() @@ -265,7 +261,7 @@ # linux-style if sys.platform in ('linux', 'darwin'): - os.environ['HOME'] = curdir + os.environ['HOME'] = temp_dir files = dist.find_config_files() self.assert_(user_filename in files) 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 Sat Feb 14 15:10:23 2009 @@ -5,8 +5,9 @@ from distutils.file_util import move_file from distutils import log +from distutils.tests import support -class FileUtilTestCase(unittest.TestCase): +class FileUtilTestCase(support.TempdirManager, unittest.TestCase): def _log(self, msg, *args): if len(args) > 0: @@ -15,24 +16,20 @@ self._logs.append(msg) def setUp(self): + support.TempdirManager.setUp(self) self._logs = [] self.old_log = log.info log.info = self._log - self.source = os.path.join(os.path.dirname(__file__), 'f1') - self.target = os.path.join(os.path.dirname(__file__), 'f2') - self.target_dir = os.path.join(os.path.dirname(__file__), 'd1') + tmp_dir = self.mkdtemp() + self.source = os.path.join(tmp_dir, 'f1') + self.target = os.path.join(tmp_dir, 'f2') + self.target_dir = os.path.join(tmp_dir, 'd1') def tearDown(self): log.info = self.old_log - for f in (self.source, self.target, self.target_dir): - if os.path.exists(f): - if os.path.isfile(f): - os.remove(f) - else: - shutil.rmtree(f) + support.TempdirManager.tearDown(self) def test_move_file_verbosity(self): - f = open(self.source, 'w') f.write('some content') f.close() 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 Feb 14 15:10:23 2009 @@ -5,6 +5,7 @@ import zipfile from os.path import join import sys +import tempfile from distutils.command.sdist import sdist from distutils.core import Distribution @@ -12,9 +13,6 @@ from distutils.errors import DistutilsExecError from distutils.spawn import find_executable -CURDIR = os.path.dirname(__file__) -TEMP_PKG = join(CURDIR, 'temppkg') - SETUP_PY = """ from distutils.core import setup import somecode @@ -29,28 +27,25 @@ class sdistTestCase(PyPIRCCommandTestCase): def setUp(self): + # PyPIRCCommandTestCase creates a temp dir already + # and put it in self.tmp_dir PyPIRCCommandTestCase.setUp(self) + # setting up an environment self.old_path = os.getcwd() + os.mkdir(join(self.tmp_dir, 'somecode')) + os.mkdir(join(self.tmp_dir, 'dist')) + # creating a MANIFEST, a package, and a README + self._write(join(self.tmp_dir, 'MANIFEST.in'), MANIFEST_IN) + self._write(join(self.tmp_dir, 'README'), 'xxx') + self._write(join(self.tmp_dir, 'somecode', '__init__.py'), '#') + self._write(join(self.tmp_dir, 'setup.py'), SETUP_PY) + os.chdir(self.tmp_dir) def tearDown(self): + # back to normal os.chdir(self.old_path) - if os.path.exists(TEMP_PKG): - shutil.rmtree(TEMP_PKG) PyPIRCCommandTestCase.tearDown(self) - def _init_tmp_pkg(self): - if os.path.exists(TEMP_PKG): - shutil.rmtree(TEMP_PKG) - os.mkdir(TEMP_PKG) - os.mkdir(join(TEMP_PKG, 'somecode')) - os.mkdir(join(TEMP_PKG, 'dist')) - # creating a MANIFEST, a package, and a README - self._write(join(TEMP_PKG, 'MANIFEST.in'), MANIFEST_IN) - self._write(join(TEMP_PKG, 'README'), 'xxx') - self._write(join(TEMP_PKG, 'somecode', '__init__.py'), '#') - self._write(join(TEMP_PKG, 'setup.py'), SETUP_PY) - os.chdir(TEMP_PKG) - def _write(self, path, content): f = open(path, 'w') try: @@ -62,18 +57,17 @@ # this test creates a package with some vcs dirs in it # and launch sdist to make sure they get pruned # on all systems - self._init_tmp_pkg() # creating VCS directories with some files in them - os.mkdir(join(TEMP_PKG, 'somecode', '.svn')) - self._write(join(TEMP_PKG, 'somecode', '.svn', 'ok.py'), 'xxx') + os.mkdir(join(self.tmp_dir, 'somecode', '.svn')) + self._write(join(self.tmp_dir, 'somecode', '.svn', 'ok.py'), 'xxx') - os.mkdir(join(TEMP_PKG, 'somecode', '.hg')) - self._write(join(TEMP_PKG, 'somecode', '.hg', + os.mkdir(join(self.tmp_dir, 'somecode', '.hg')) + self._write(join(self.tmp_dir, 'somecode', '.hg', 'ok'), 'xxx') - os.mkdir(join(TEMP_PKG, 'somecode', '.git')) - self._write(join(TEMP_PKG, 'somecode', '.git', + os.mkdir(join(self.tmp_dir, 'somecode', '.git')) + self._write(join(self.tmp_dir, 'somecode', '.git', 'ok'), 'xxx') # now building a sdist @@ -96,7 +90,7 @@ cmd.run() # now let's check what we have - dist_folder = join(TEMP_PKG, 'dist') + dist_folder = join(self.tmp_dir, 'dist') files = os.listdir(dist_folder) self.assertEquals(files, ['fake-1.0.zip']) @@ -116,8 +110,6 @@ find_executable('gzip') is None): return - self._init_tmp_pkg() - # now building a sdist dist = Distribution() dist.script_name = 'setup.py' @@ -137,7 +129,7 @@ cmd.run() # making sure we have two files - dist_folder = join(TEMP_PKG, 'dist') + dist_folder = join(self.tmp_dir, 'dist') result = os.listdir(dist_folder) result.sort() self.assertEquals(result, Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Feb 14 15:10:23 2009 @@ -155,6 +155,9 @@ Library ------- +- Issue #5257: refactored all tests in distutils, so they use + support.TempdirManager, to avoid writing in the tests directory. + - Issue #4524: distutils build_script command failed with --with-suffix=3. Initial patch by Amaury Forgeot d'Arc. From python-checkins at python.org Sat Feb 14 15:12:31 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 14 Feb 2009 15:12:31 +0100 (CET) Subject: [Python-checkins] r69610 - python/trunk/Lib/distutils/tests/test_dist.py Message-ID: <20090214141231.099DF1E4002@bag.python.org> Author: tarek.ziade Date: Sat Feb 14 15:12:30 2009 New Revision: 69610 Log: Replace variable Modified: python/trunk/Lib/distutils/tests/test_dist.py 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 Sat Feb 14 15:12:30 2009 @@ -268,7 +268,7 @@ # win32-style if sys.platform == 'win32': # home drive should be found - os.environ['HOME'] = curdir + os.environ['HOME'] = temp_dir files = dist.find_config_files() self.assert_(user_filename in files, '%r not found in %r' % (user_filename, files)) From python-checkins at python.org Sat Feb 14 15:13:50 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 14 Feb 2009 15:13:50 +0100 (CET) Subject: [Python-checkins] r69611 - python/branches/release26-maint Message-ID: <20090214141350.5BBBD1E4002@bag.python.org> Author: tarek.ziade Date: Sat Feb 14 15:13:50 2009 New Revision: 69611 Log: Blocked revisions 69609 via svnmerge ........ r69609 | tarek.ziade | 2009-02-14 15:10:23 +0100 (Sat, 14 Feb 2009) | 1 line Fix for #5257: refactored all tests in distutils, so they use a temporary directory. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sat Feb 14 15:14:10 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 14 Feb 2009 15:14:10 +0100 (CET) Subject: [Python-checkins] r69612 - python/branches/release26-maint Message-ID: <20090214141410.D15D71E4002@bag.python.org> Author: tarek.ziade Date: Sat Feb 14 15:14:10 2009 New Revision: 69612 Log: Blocked revisions 69610 via svnmerge ........ r69610 | tarek.ziade | 2009-02-14 15:12:30 +0100 (Sat, 14 Feb 2009) | 1 line Replace variable ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sat Feb 14 15:35:52 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 14 Feb 2009 15:35:52 +0100 (CET) Subject: [Python-checkins] r69613 - in python/branches/py3k: Lib/distutils/tests/support.py Lib/distutils/tests/test_build_ext.py Lib/distutils/tests/test_config.py Lib/distutils/tests/test_dir_util.py Lib/distutils/tests/test_dist.py Lib/distutils/tests/test_file_util.py Lib/distutils/tests/test_sdist.py Misc/NEWS Message-ID: <20090214143552.3DE1C1E4002@bag.python.org> Author: tarek.ziade Date: Sat Feb 14 15:35:51 2009 New Revision: 69613 Log: Merged revisions 69609 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69609 | tarek.ziade | 2009-02-14 15:10:23 +0100 (Sat, 14 Feb 2009) | 1 line Fix for #5257: refactored all tests in distutils, so they use a temporary directory. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/support.py python/branches/py3k/Lib/distutils/tests/test_build_ext.py python/branches/py3k/Lib/distutils/tests/test_config.py python/branches/py3k/Lib/distutils/tests/test_dir_util.py python/branches/py3k/Lib/distutils/tests/test_dist.py python/branches/py3k/Lib/distutils/tests/test_file_util.py python/branches/py3k/Lib/distutils/tests/test_sdist.py python/branches/py3k/Misc/NEWS 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 Feb 14 15:35:51 2009 @@ -1,5 +1,5 @@ """Support code for distutils test cases.""" - +import os import shutil import tempfile @@ -31,7 +31,7 @@ super().tearDown() while self.tempdirs: d = self.tempdirs.pop() - shutil.rmtree(d) + shutil.rmtree(d, os.name in ('nt', 'cygwin')) def mkdtemp(self): """Create a temporary directory that will be cleaned up. 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 Feb 14 15:35:51 2009 @@ -7,6 +7,7 @@ from distutils.core import Extension, Distribution from distutils.command.build_ext import build_ext from distutils import sysconfig +from distutils.tests.support import TempdirManager import unittest from test import support @@ -19,11 +20,12 @@ srcdir = sysconfig.get_config_var('srcdir') return os.path.join(srcdir, 'Modules', 'xxmodule.c') -class BuildExtTestCase(unittest.TestCase): +class BuildExtTestCase(TempdirManager, unittest.TestCase): def setUp(self): # Create a simple test environment # Note that we're making changes to sys.path - self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_") + TempdirManager.setUp(self) + self.tmp_dir = self.mkdtemp() self.sys_path = sys.path[:] sys.path.append(self.tmp_dir) shutil.copy(_get_source_filename(), self.tmp_dir) @@ -74,8 +76,7 @@ # Get everything back to normal support.unload('xx') 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') + TempdirManager.tearDown(self) def test_solaris_enable_shared(self): dist = Distribution({'name': 'xx'}) 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 Sat Feb 14 15:35:51 2009 @@ -2,6 +2,7 @@ import sys import os import unittest +import tempfile from distutils.core import PyPIRCCommand from distutils.core import Distribution @@ -49,13 +50,15 @@ def setUp(self): """Patches the environment.""" + support.TempdirManager.setUp(self) + if 'HOME' in os.environ: self._old_home = os.environ['HOME'] else: self._old_home = None - curdir = os.path.dirname(__file__) - os.environ['HOME'] = curdir - self.rc = os.path.join(curdir, '.pypirc') + self.tmp_dir = self.mkdtemp() + os.environ['HOME'] = self.tmp_dir + self.rc = os.path.join(self.tmp_dir, '.pypirc') self.dist = Distribution() class command(PyPIRCCommand): @@ -74,9 +77,8 @@ del os.environ['HOME'] else: os.environ['HOME'] = self._old_home - if os.path.exists(self.rc): - os.remove(self.rc) set_threshold(self.old_threshold) + support.TempdirManager.tearDown(self) def test_server_registration(self): # This test makes sure PyPIRCCommand knows how to: 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 Sat Feb 14 15:35:51 2009 @@ -9,8 +9,9 @@ from distutils.dir_util import copy_tree from distutils import log +from distutils.tests import support -class DirUtilTestCase(unittest.TestCase): +class DirUtilTestCase(support.TempdirManager, unittest.TestCase): def _log(self, msg, *args): if len(args) > 0: @@ -19,18 +20,18 @@ self._logs.append(msg) def setUp(self): + support.TempdirManager.setUp(self) self._logs = [] - self.root_target = os.path.join(os.path.dirname(__file__), 'deep') + tmp_dir = self.mkdtemp() + self.root_target = os.path.join(tmp_dir, 'deep') self.target = os.path.join(self.root_target, 'here') - self.target2 = os.path.join(os.path.dirname(__file__), 'deep2') + self.target2 = os.path.join(tmp_dir, 'deep2') self.old_log = log.info log.info = self._log def tearDown(self): - for target in (self.target, self.target2): - if os.path.exists(target): - shutil.rmtree(target) log.info = self.old_log + support.TempdirManager.tearDown(self) def test_mkpath_remove_tree_verbosity(self): 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 Sat Feb 14 15:35:51 2009 @@ -9,6 +9,7 @@ import warnings from test.support import TESTFN +from distutils.tests import support class test_dist(distutils.cmd.Command): @@ -120,7 +121,7 @@ self.assertEquals(len(warns), 0) -class MetadataTestCase(unittest.TestCase): +class MetadataTestCase(support.TempdirManager, unittest.TestCase): def test_simple_metadata(self): attrs = {"name": "package", @@ -219,8 +220,8 @@ else: user_filename = "pydistutils.cfg" - curdir = os.path.dirname(__file__) - user_filename = os.path.join(curdir, user_filename) + temp_dir = self.mkdtemp() + user_filename = os.path.join(temp_dir, user_filename) f = open(user_filename, 'w') f.write('.') f.close() @@ -230,14 +231,14 @@ # linux-style if sys.platform in ('linux', 'darwin'): - os.environ['HOME'] = curdir + os.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'] = curdir + os.environ['HOME'] = temp_dir files = dist.find_config_files() self.assert_(user_filename in files, '%r not found in %r' % (user_filename, files)) 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 Sat Feb 14 15:35:51 2009 @@ -5,8 +5,9 @@ from distutils.file_util import move_file from distutils import log +from distutils.tests import support -class FileUtilTestCase(unittest.TestCase): +class FileUtilTestCase(support.TempdirManager, unittest.TestCase): def _log(self, msg, *args): if len(args) > 0: @@ -15,24 +16,20 @@ self._logs.append(msg) def setUp(self): + support.TempdirManager.setUp(self) self._logs = [] self.old_log = log.info log.info = self._log - self.source = os.path.join(os.path.dirname(__file__), 'f1') - self.target = os.path.join(os.path.dirname(__file__), 'f2') - self.target_dir = os.path.join(os.path.dirname(__file__), 'd1') + tmp_dir = self.mkdtemp() + self.source = os.path.join(tmp_dir, 'f1') + self.target = os.path.join(tmp_dir, 'f2') + self.target_dir = os.path.join(tmp_dir, 'd1') def tearDown(self): log.info = self.old_log - for f in (self.source, self.target, self.target_dir): - if os.path.exists(f): - if os.path.isfile(f): - os.remove(f) - else: - shutil.rmtree(f) + support.TempdirManager.tearDown(self) def test_move_file_verbosity(self): - f = open(self.source, 'w') f.write('some content') f.close() 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 Feb 14 15:35:51 2009 @@ -5,6 +5,7 @@ import zipfile from os.path import join import sys +import tempfile from distutils.command.sdist import sdist from distutils.core import Distribution @@ -12,9 +13,6 @@ from distutils.errors import DistutilsExecError from distutils.spawn import find_executable -CURDIR = os.path.dirname(__file__) -TEMP_PKG = join(CURDIR, 'temppkg') - SETUP_PY = """ from distutils.core import setup import somecode @@ -29,28 +27,25 @@ class sdistTestCase(PyPIRCCommandTestCase): def setUp(self): + # PyPIRCCommandTestCase creates a temp dir already + # and put it in self.tmp_dir PyPIRCCommandTestCase.setUp(self) + # setting up an environment self.old_path = os.getcwd() + os.mkdir(join(self.tmp_dir, 'somecode')) + os.mkdir(join(self.tmp_dir, 'dist')) + # creating a MANIFEST, a package, and a README + self._write(join(self.tmp_dir, 'MANIFEST.in'), MANIFEST_IN) + self._write(join(self.tmp_dir, 'README'), 'xxx') + self._write(join(self.tmp_dir, 'somecode', '__init__.py'), '#') + self._write(join(self.tmp_dir, 'setup.py'), SETUP_PY) + os.chdir(self.tmp_dir) def tearDown(self): + # back to normal os.chdir(self.old_path) - if os.path.exists(TEMP_PKG): - shutil.rmtree(TEMP_PKG) PyPIRCCommandTestCase.tearDown(self) - def _init_tmp_pkg(self): - if os.path.exists(TEMP_PKG): - shutil.rmtree(TEMP_PKG) - os.mkdir(TEMP_PKG) - os.mkdir(join(TEMP_PKG, 'somecode')) - os.mkdir(join(TEMP_PKG, 'dist')) - # creating a MANIFEST, a package, and a README - self._write(join(TEMP_PKG, 'MANIFEST.in'), MANIFEST_IN) - self._write(join(TEMP_PKG, 'README'), 'xxx') - self._write(join(TEMP_PKG, 'somecode', '__init__.py'), '#') - self._write(join(TEMP_PKG, 'setup.py'), SETUP_PY) - os.chdir(TEMP_PKG) - def _write(self, path, content): f = open(path, 'w') try: @@ -62,18 +57,17 @@ # this test creates a package with some vcs dirs in it # and launch sdist to make sure they get pruned # on all systems - self._init_tmp_pkg() # creating VCS directories with some files in them - os.mkdir(join(TEMP_PKG, 'somecode', '.svn')) - self._write(join(TEMP_PKG, 'somecode', '.svn', 'ok.py'), 'xxx') + os.mkdir(join(self.tmp_dir, 'somecode', '.svn')) + self._write(join(self.tmp_dir, 'somecode', '.svn', 'ok.py'), 'xxx') - os.mkdir(join(TEMP_PKG, 'somecode', '.hg')) - self._write(join(TEMP_PKG, 'somecode', '.hg', + os.mkdir(join(self.tmp_dir, 'somecode', '.hg')) + self._write(join(self.tmp_dir, 'somecode', '.hg', 'ok'), 'xxx') - os.mkdir(join(TEMP_PKG, 'somecode', '.git')) - self._write(join(TEMP_PKG, 'somecode', '.git', + os.mkdir(join(self.tmp_dir, 'somecode', '.git')) + self._write(join(self.tmp_dir, 'somecode', '.git', 'ok'), 'xxx') # now building a sdist @@ -96,7 +90,7 @@ cmd.run() # now let's check what we have - dist_folder = join(TEMP_PKG, 'dist') + dist_folder = join(self.tmp_dir, 'dist') files = os.listdir(dist_folder) self.assertEquals(files, ['fake-1.0.zip']) @@ -116,8 +110,6 @@ find_executable('gzip') is None): return - self._init_tmp_pkg() - # now building a sdist dist = Distribution() dist.script_name = 'setup.py' @@ -137,7 +129,7 @@ cmd.run() # making sure we have two files - dist_folder = join(TEMP_PKG, 'dist') + dist_folder = join(self.tmp_dir, 'dist') result = os.listdir(dist_folder) result.sort() self.assertEquals(result, Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Feb 14 15:35:51 2009 @@ -166,6 +166,9 @@ Library ------- +- Issue #5257: refactored all tests in distutils, so they use + support.TempdirManager, to avoid writing in the tests directory. + - Issue #4524: distutils build_script command failed with --with-suffix=3. Initial patch by Amaury Forgeot d'Arc. From python-checkins at python.org Sat Feb 14 15:36:39 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 14 Feb 2009 15:36:39 +0100 (CET) Subject: [Python-checkins] r69614 - python/branches/py3k Message-ID: <20090214143639.0FE501E4002@bag.python.org> Author: tarek.ziade Date: Sat Feb 14 15:36:38 2009 New Revision: 69614 Log: Blocked revisions 69610 via svnmerge ........ r69610 | tarek.ziade | 2009-02-14 15:12:30 +0100 (Sat, 14 Feb 2009) | 1 line Replace variable ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat Feb 14 15:38:01 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 14 Feb 2009 15:38:01 +0100 (CET) Subject: [Python-checkins] r69615 - python/branches/release30-maint Message-ID: <20090214143801.A0AF91E400C@bag.python.org> Author: tarek.ziade Date: Sat Feb 14 15:38:01 2009 New Revision: 69615 Log: Blocked revisions 69613 via svnmerge ................ r69613 | tarek.ziade | 2009-02-14 15:35:51 +0100 (Sat, 14 Feb 2009) | 9 lines Merged revisions 69609 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69609 | tarek.ziade | 2009-02-14 15:10:23 +0100 (Sat, 14 Feb 2009) | 1 line Fix for #5257: refactored all tests in distutils, so they use a temporary directory. ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sat Feb 14 15:51:10 2009 From: python-checkins at python.org (barry.warsaw) Date: Sat, 14 Feb 2009 15:51:10 +0100 (CET) Subject: [Python-checkins] r69616 - sandbox/trunk/release/release.py Message-ID: <20090214145110.73DE51E4002@bag.python.org> Author: barry.warsaw Date: Sat Feb 14 15:51:09 2009 New Revision: 69616 Log: opcode_targets.h is only in Python 3.1. Modified: sandbox/trunk/release/release.py Modified: sandbox/trunk/release/release.py ============================================================================== --- sandbox/trunk/release/release.py (original) +++ sandbox/trunk/release/release.py Sat Feb 14 15:51:09 2009 @@ -265,9 +265,9 @@ # Touch a few files that get generated so they're up-to-date in # the tarball. touchables = ['Include/Python-ast.h', 'Python/Python-ast.c'] - if tag.major < 3: - # This file isn't in Python 3.x - touchables.append('opcode_targets.h') + if os.path.exists('Python/opcode_targets.h'): + # This file isn't in Python < 3.1 + touchables.append('Python/opcode_targets.h') print 'Touching:', COMMASPACE.join(name.rsplit('/', 1)[-1] for name in touchables) for name in touchables: From barry at python.org Sat Feb 14 15:51:22 2009 From: barry at python.org (Barry Warsaw) Date: Sat, 14 Feb 2009 09:51:22 -0500 Subject: [Python-checkins] r69605 - sandbox/trunk/release/release.py In-Reply-To: References: <20090214002650.1F13B1E4002@bag.python.org> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Feb 14, 2009, at 4:47 AM, Georg Brandl wrote: > barry.warsaw schrieb: >> Author: barry.warsaw >> Date: Sat Feb 14 01:26:49 2009 >> New Revision: 69605 >> >> Log: >> Python 3 doesn't have opcodes_targets.h. > > On the contrary, opcode_targets.h is *only* present on 3.x (but only > on the trunk). > > Also it is in Python/, not on the toplevel. Fixed thanks. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iQCVAwUBSZbaanEjvBPtnXfVAQLYEQP9HK1EmpOGwvdCfbeL1mc/raa5dp6p1szD cBp7byD7nWkkLSRctZkTMoumGcNhNV3K/woMKT/jOGxd1dSw2Tf2BmgKxmWMeMUv B+oms0AgWKLYCF6KKr6JevHNnrFbPFQjhZ3JPIoIKy4RiArwS5PwnBvddfecawyu 3oscl37gOxk= =Kqvp -----END PGP SIGNATURE----- From buildbot at python.org Sat Feb 14 15:53:21 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 14 Feb 2009 14:53:21 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090214145321.80EE81E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/645 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 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 Sat Feb 14 16:20:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 14 Feb 2009 15:20:28 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090214152028.85F881E401C@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/123 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: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_asynchat make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 14 16:25:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 14 Feb 2009 15:25:14 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090214152515.A84A21E4002@bag.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/265 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_codecencodings_tw make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 14 16:58:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 14 Feb 2009 15:58:15 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090214155815.75B9C1E4002@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/289 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: 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.x.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From buildbot at python.org Sat Feb 14 17:08:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 14 Feb 2009 16:08:28 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090214160828.9B71F1E4002@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/117 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 buildbot at python.org Sat Feb 14 17:47:51 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 14 Feb 2009 16:47:51 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090214164751.BA0851E4002@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/158 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: georg.brandl,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 Sat Feb 14 17:51:03 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 14 Feb 2009 17:51:03 +0100 (CET) Subject: [Python-checkins] r69617 - python/trunk/Lib/test/test_pep263.py Message-ID: <20090214165103.EB13E1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 14 17:51:03 2009 New Revision: 69617 Log: we're no longer using CVS, so this doesn't have to be binary Modified: python/trunk/Lib/test/test_pep263.py (contents, props changed) Modified: python/trunk/Lib/test/test_pep263.py ============================================================================== Binary files. No diff available. From python-checkins at python.org Sat Feb 14 18:00:18 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 14 Feb 2009 18:00:18 +0100 (CET) Subject: [Python-checkins] r69618 - in python/branches/py3k: Lib/test/test_pep263.py Message-ID: <20090214170018.EF1EE1E4021@bag.python.org> Author: benjamin.peterson Date: Sat Feb 14 18:00:16 2009 New Revision: 69618 Log: Merged revisions 69617 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69617 | benjamin.peterson | 2009-02-14 10:51:03 -0600 (Sat, 14 Feb 2009) | 1 line we're no longer using CVS, so this doesn't have to be binary ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_pep263.py (contents, props changed) Modified: python/branches/py3k/Lib/test/test_pep263.py ============================================================================== Binary files. No diff available. From python-checkins at python.org Sat Feb 14 18:00:51 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 14 Feb 2009 18:00:51 +0100 (CET) Subject: [Python-checkins] r69619 - python/trunk/Lib/test/test_pep263.py Message-ID: <20090214170051.A747E1E4048@bag.python.org> Author: benjamin.peterson Date: Sat Feb 14 18:00:51 2009 New Revision: 69619 Log: this needn't be a shebang line Modified: python/trunk/Lib/test/test_pep263.py Modified: python/trunk/Lib/test/test_pep263.py ============================================================================== --- python/trunk/Lib/test/test_pep263.py (original) +++ python/trunk/Lib/test/test_pep263.py Sat Feb 14 18:00:51 2009 @@ -1,4 +1,4 @@ -#! -*- coding: koi8-r -*- +# -*- coding: koi8-r -*- import unittest from test import test_support From python-checkins at python.org Sat Feb 14 18:01:37 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 14 Feb 2009 18:01:37 +0100 (CET) Subject: [Python-checkins] r69620 - in python/trunk/Lib: subprocess.py test/test_subprocess.py Message-ID: <20090214170137.DC9711E404E@bag.python.org> Author: georg.brandl Date: Sat Feb 14 18:01:36 2009 New Revision: 69620 Log: #5179: don't leak PIPE fds when child execution fails. Modified: python/trunk/Lib/subprocess.py python/trunk/Lib/test/test_subprocess.py Modified: python/trunk/Lib/subprocess.py ============================================================================== --- python/trunk/Lib/subprocess.py (original) +++ python/trunk/Lib/subprocess.py Sat Feb 14 18:01:36 2009 @@ -1151,6 +1151,9 @@ if data != "": os.waitpid(self.pid, 0) child_exception = pickle.loads(data) + for fd in (p2cwrite, c2pread, errread): + if fd is not None: + os.close(fd) raise child_exception Modified: python/trunk/Lib/test/test_subprocess.py ============================================================================== --- python/trunk/Lib/test/test_subprocess.py (original) +++ python/trunk/Lib/test/test_subprocess.py Sat Feb 14 18:01:36 2009 @@ -520,6 +520,22 @@ else: self.fail("Expected TypeError") + def test_leaking_fds_on_error(self): + # see bug #5179: Popen leaks file descriptors to PIPEs if + # the child fails to execute; this will eventually exhaust + # the maximum number of open fds. 1024 seems a very common + # value for that limit, but Windows has 2048, so we loop + # 1024 times (each call leaked two fds). + for i in range(1024): + try: + subprocess.Popen(['nonexisting_i_hope'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + # Windows raises IOError + except (IOError, OSError), err: + if err.errno != 2: # ignore "no such file" + raise + # # POSIX tests # From python-checkins at python.org Sat Feb 14 18:04:26 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 14 Feb 2009 18:04:26 +0100 (CET) Subject: [Python-checkins] r69621 - in python/branches/release26-maint: Lib/subprocess.py Lib/test/test_subprocess.py Message-ID: <20090214170426.BDB701E4002@bag.python.org> Author: georg.brandl Date: Sat Feb 14 18:04:26 2009 New Revision: 69621 Log: Merged revisions 69620 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69620 | georg.brandl | 2009-02-14 18:01:36 +0100 (Sa, 14 Feb 2009) | 1 line #5179: don't leak PIPE fds when child execution fails. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/subprocess.py python/branches/release26-maint/Lib/test/test_subprocess.py Modified: python/branches/release26-maint/Lib/subprocess.py ============================================================================== --- python/branches/release26-maint/Lib/subprocess.py (original) +++ python/branches/release26-maint/Lib/subprocess.py Sat Feb 14 18:04:26 2009 @@ -1103,6 +1103,9 @@ if data != "": os.waitpid(self.pid, 0) child_exception = pickle.loads(data) + for fd in (p2cwrite, c2pread, errread): + if fd is not None: + os.close(fd) raise child_exception Modified: python/branches/release26-maint/Lib/test/test_subprocess.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_subprocess.py (original) +++ python/branches/release26-maint/Lib/test/test_subprocess.py Sat Feb 14 18:04:26 2009 @@ -486,6 +486,22 @@ else: self.fail("Expected TypeError") + def test_leaking_fds_on_error(self): + # see bug #5179: Popen leaks file descriptors to PIPEs if + # the child fails to execute; this will eventually exhaust + # the maximum number of open fds. 1024 seems a very common + # value for that limit, but Windows has 2048, so we loop + # 1024 times (each call leaked two fds). + for i in range(1024): + try: + subprocess.Popen(['nonexisting_i_hope'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + # Windows raises IOError + except (IOError, OSError), err: + if err.errno != 2: # ignore "no such file" + raise + # # POSIX tests # From buildbot at python.org Sat Feb 14 19:29:08 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 14 Feb 2009 18:29:08 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090214182908.6BD181E4002@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/4644 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,georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sat Feb 14 20:09:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 14 Feb 2009 19:09:41 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090214190941.6A7601E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/647 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson,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 Sat Feb 14 21:33:48 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 14 Feb 2009 21:33:48 +0100 (CET) Subject: [Python-checkins] r69622 - peps/trunk/pep-0375.txt Message-ID: <20090214203348.7715A1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 14 21:33:48 2009 New Revision: 69622 Log: add draft schedule Modified: peps/trunk/pep-0375.txt Modified: peps/trunk/pep-0375.txt ============================================================================== --- peps/trunk/pep-0375.txt (original) +++ peps/trunk/pep-0375.txt Sat Feb 14 21:33:48 2009 @@ -34,7 +34,14 @@ Release Schedule ================ -Not yet finalized. +Draft schedule: + +- 3.1a1 March 7 +- 3.1a2 April 11 +- 3.1b1 May 2 +- 3.1b2 May 23 +- 3.1rc1 June 13 +- 3.1rc2 June 27 Features for 3.1 From python-checkins at python.org Sat Feb 14 21:34:47 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 14 Feb 2009 21:34:47 +0100 (CET) Subject: [Python-checkins] r69623 - peps/trunk/pep-0375.txt Message-ID: <20090214203447.12F941E4026@bag.python.org> Author: benjamin.peterson Date: Sat Feb 14 21:34:46 2009 New Revision: 69623 Log: more features Modified: peps/trunk/pep-0375.txt Modified: peps/trunk/pep-0375.txt ============================================================================== --- peps/trunk/pep-0375.txt (original) +++ peps/trunk/pep-0375.txt Sat Feb 14 21:34:46 2009 @@ -48,6 +48,8 @@ ================ - importlib +- io in C +- A reworked email package References From buildbot at python.org Sat Feb 14 21:35:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 14 Feb 2009 20:35:00 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.6 Message-ID: <20090214203500.A5B801E4042@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/88 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 test Excerpt from the test logfile: 2 tests failed: test_bsddb3 test_subprocess sincerely, -The Buildbot From python-checkins at python.org Sat Feb 14 21:39:54 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 14 Feb 2009 21:39:54 +0100 (CET) Subject: [Python-checkins] r69624 - peps/trunk/pep-0375.txt Message-ID: <20090214203954.3268C1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 14 21:39:53 2009 New Revision: 69624 Log: give the year Modified: peps/trunk/pep-0375.txt Modified: peps/trunk/pep-0375.txt ============================================================================== --- peps/trunk/pep-0375.txt (original) +++ peps/trunk/pep-0375.txt Sat Feb 14 21:39:53 2009 @@ -36,12 +36,12 @@ Draft schedule: -- 3.1a1 March 7 -- 3.1a2 April 11 -- 3.1b1 May 2 -- 3.1b2 May 23 -- 3.1rc1 June 13 -- 3.1rc2 June 27 +- 3.1a1 March 7, 2009 +- 3.1a2 April 11, 2009 +- 3.1b1 May 2, 2009 +- 3.1b2 May 23, 2009 +- 3.1rc1 June 13, 2009 +- 3.1rc2 June 27, 2009 Features for 3.1 From python-checkins at python.org Sat Feb 14 21:58:33 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 14 Feb 2009 21:58:33 +0100 (CET) Subject: [Python-checkins] r69625 - in python/branches/io-c: Doc/ACKS.txt Doc/c-api/long.rst Doc/c-api/number.rst Doc/distutils/setupscript.rst Doc/library/2to3.rst Doc/library/collections.rst Doc/library/itertools.rst Doc/library/stdtypes.rst Doc/library/urllib.request.rst Doc/tools/sphinxext/indexsidebar.html Doc/tools/sphinxext/pyspecific.py Include/abstract.h Include/fileobject.h Include/intobject.h Include/pymath.h Lib/collections.py Lib/compileall.py Lib/distutils/command/build_scripts.py Lib/distutils/sysconfig.py Lib/distutils/tests/support.py Lib/distutils/tests/test_build_ext.py Lib/distutils/tests/test_build_scripts.py Lib/distutils/tests/test_config.py Lib/distutils/tests/test_dir_util.py Lib/distutils/tests/test_dist.py Lib/distutils/tests/test_file_util.py Lib/distutils/tests/test_sdist.py Lib/distutils/tests/test_sysconfig.py Lib/distutils/tests/test_util.py Lib/http/client.py Lib/idlelib/Bindings.py Lib/idlelib/EditorWindow.py Lib/idlelib/MultiCall.py Lib/idlelib/configDialog.py Lib/idlelib/keybindingDialog.py Lib/idlelib/macosxSupport.py Lib/importlib/NOTES Lib/io.py Lib/logging/__init__.py Lib/numbers.py Lib/test/crashers/compiler_recursion.py Lib/test/regrtest.py Lib/test/test_builtin.py Lib/test/test_collections.py Lib/test/test_compileall.py Lib/test/test_fractions.py Lib/test/test_hashlib.py Lib/test/test_httplib.py Lib/test/test_io.py Lib/test/test_itertools.py Lib/test/test_logging.py Lib/test/test_os.py Lib/test/test_osx_env.py Lib/test/test_pep263.py Lib/test/test_socket.py Lib/test/test_struct.py Lib/test/test_tk.py Lib/test/test_urllib2_localnet.py Lib/test/test_urllib2net.py Lib/test/test_xmlrpc.py Lib/tkinter/__init__.py Lib/tkinter/test/test_tkinter Lib/tkinter/ttk.py Lib/urllib/request.py Lib/urllib/response.py Lib/xmlrpc/client.py Mac/BuildScript/build-installer.py Mac/BuildScript/resources/ReadMe.txt Mac/BuildScript/resources/Welcome.rtf Mac/BuildScript/scripts/postflight.patch-profile Mac/IDLE/IDLE.app/Contents/MacOS/IDLE Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py Mac/Makefile.in Misc/ACKS Misc/NEWS Modules/_ctypes/callproc.c Modules/_fileio.c Modules/_hashopenssl.c Modules/_iobase.c Modules/_struct.c Modules/_tkinter.c Modules/getpath.c Modules/hashlib.h Modules/itertoolsmodule.c Modules/main.c Modules/md5module.c Modules/sha1module.c Modules/sha256module.c Modules/sha512module.c Modules/socketmodule.c Modules/testcapi_long.h Modules/tkappinit.c Modules/tkinter.h Objects/exceptions.c Objects/longobject.c Objects/object.c Objects/typeobject.c PC/VC6/_multiprocessing.dsp PC/VC6/build_tkinter.py PC/VC6/tcl852.patch PCbuild/sqlite3.vcproj PCbuild/sqlite3.vsprops Python/pymath.c Tools/msi/uuids.py setup.py Message-ID: <20090214205833.BA9E01E4002@bag.python.org> Author: antoine.pitrou Date: Sat Feb 14 21:58:31 2009 New Revision: 69625 Log: Merged revisions 69451,69463,69465,69471,69475-69477,69482-69484,69487,69491,69497,69499,69501,69507,69512-69513,69515,69517,69523-69524,69526,69529,69531-69532,69534,69536,69538,69540,69542,69544,69547,69553,69559-69560,69565,69568,69571-69572,69574-69575,69577,69581,69584,69587,69592,69596,69600,69603,69607,69613-69614,69618 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69451 | benjamin.peterson | 2009-02-08 22:07:20 +0100 (dim., 08 f??vr. 2009) | 1 line fix len() when __len__() returns a non number type #5137 ................ r69463 | guilherme.polo | 2009-02-09 17:44:24 +0100 (lun., 09 f??vr. 2009) | 10 lines Merged revisions 69461 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69461 | guilherme.polo | 2009-02-09 14:41:09 -0200 (Mon, 09 Feb 2009) | 3 lines Fixed issue #4890: Handle empty text search pattern in Tkinter.Text.search ........ ................ r69465 | mark.dickinson | 2009-02-09 18:15:59 +0100 (lun., 09 f??vr. 2009) | 10 lines Merged revisions 69459 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69459 | mark.dickinson | 2009-02-09 14:18:43 +0000 (Mon, 09 Feb 2009) | 3 lines Issue #4575: fix Py_IS_INFINITY macro to work correctly on x87 FPUs. It now forces its argument to double before testing for infinity. ........ ................ r69471 | guilherme.polo | 2009-02-09 21:40:42 +0100 (lun., 09 f??vr. 2009) | 17 lines Merged revisions 69460,69467,69470 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69460 | guilherme.polo | 2009-02-09 14:09:17 -0200 (Mon, 09 Feb 2009) | 1 line Turned setup_master public ........ r69467 | guilherme.polo | 2009-02-09 17:21:21 -0200 (Mon, 09 Feb 2009) | 2 lines Some tests for Tkinter.Text.search ........ r69470 | guilherme.polo | 2009-02-09 17:57:04 -0200 (Mon, 09 Feb 2009) | 1 line Checking for tk availability before continuing (basically the same that is done in test_ttk_guionly) ........ ................ r69475 | brett.cannon | 2009-02-09 22:51:29 +0100 (lun., 09 f??vr. 2009) | 3 lines Add a NOTE that alternative VMs should be supported by importlib in a nicer fashion by factoring out bytecode support. ................ r69476 | guilherme.polo | 2009-02-09 23:33:59 +0100 (lun., 09 f??vr. 2009) | 10 lines Merged revisions 69473 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69473 | guilherme.polo | 2009-02-09 18:50:27 -0200 (Mon, 09 Feb 2009) | 3 lines Fixed issue #5122: Synchronize tk load failure check to prevent a potential deadlock. ........ ................ r69477 | guilherme.polo | 2009-02-09 23:35:27 +0100 (lun., 09 f??vr. 2009) | 9 lines Merged revisions 69474 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69474 | guilherme.polo | 2009-02-09 18:57:45 -0200 (Mon, 09 Feb 2009) | 1 line Enforcing Tk 8.3.1 requirement. ........ ................ r69482 | brett.cannon | 2009-02-10 03:10:16 +0100 (mar., 10 f??vr. 2009) | 11 lines Merged revisions 69481 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69481 | brett.cannon | 2009-02-09 18:07:38 -0800 (Mon, 09 Feb 2009) | 4 lines compileall used the ctime of bytecode and source to determine if the bytecode should be recreated. This created a timing hole. Fixed by just doing what import does; check the mtime and magic number. ........ ................ r69483 | guilherme.polo | 2009-02-10 03:20:49 +0100 (mar., 10 f??vr. 2009) | 1 line This header was supposed to be committed in r69476 ................ r69484 | benjamin.peterson | 2009-02-10 03:41:10 +0100 (mar., 10 f??vr. 2009) | 13 lines Merged revisions 69466,69480 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69466 | raymond.hettinger | 2009-02-09 12:39:41 -0600 (Mon, 09 Feb 2009) | 3 lines Issue 5171: itertools.product docstring missing 'repeat' argument ........ r69480 | raymond.hettinger | 2009-02-09 19:24:05 -0600 (Mon, 09 Feb 2009) | 1 line Issue 1818: collections.namedtuple() to support automatic renaming of invalid fieldnames. ........ ................ r69487 | tarek.ziade | 2009-02-10 13:36:33 +0100 (mar., 10 f??vr. 2009) | 9 lines Merged revisions 69485 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69485 | tarek.ziade | 2009-02-10 13:31:09 +0100 (Tue, 10 Feb 2009) | 1 line Fixed #3386: the optional prefix argument was ignored under OS2 and NT in distutils.sysconfig.get_python_lib ........ ................ r69491 | martin.v.loewis | 2009-02-10 14:13:30 +0100 (mar., 10 f??vr. 2009) | 13 lines Merged revisions 69489-69490 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69489 | martin.v.loewis | 2009-02-10 14:09:19 +0100 (Di, 10 Feb 2009) | 1 line Issue #5134: Silence compiler warnings when compiling sqlite with VC++. ........ r69490 | martin.v.loewis | 2009-02-10 14:12:12 +0100 (Di, 10 Feb 2009) | 1 line Set eol-style to native ........ ................ r69497 | hirokazu.yamamoto | 2009-02-10 15:27:19 +0100 (mar., 10 f??vr. 2009) | 9 lines Merged revisions 69494 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69494 | hirokazu.yamamoto | 2009-02-10 22:31:28 +0900 | 1 line Fixed svn:eol-style. ........ ................ r69499 | mark.dickinson | 2009-02-10 17:13:25 +0100 (mar., 10 f??vr. 2009) | 12 lines Merged revisions 69498 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69498 | mark.dickinson | 2009-02-10 15:46:50 +0000 (Tue, 10 Feb 2009) | 6 lines Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError for negative arguments. Previously, it raised TypeError. Thanks Lisandro Dalcin. ........ ................ r69501 | mark.dickinson | 2009-02-10 17:18:22 +0100 (mar., 10 f??vr. 2009) | 11 lines Merged revisions 69500 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69500 | mark.dickinson | 2009-02-10 16:17:16 +0000 (Tue, 10 Feb 2009) | 4 lines _testcapi depends on testcapi_long.h Thanks Lisandro Dalcin. ........ ................ r69507 | thomas.heller | 2009-02-10 19:59:04 +0100 (mar., 10 f??vr. 2009) | 13 lines (The fix has been slightly adjusted.) Merged revisions 69505 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69505 | thomas.heller | 2009-02-10 19:43:01 +0100 (Di, 10 Feb 2009) | 3 lines Issue#5203: ctypes segfaults when passing a unicode string to a function without argtypes, if HAVE_USABLE_WCHAR_T is false. ........ ................ r69512 | raymond.hettinger | 2009-02-11 01:20:02 +0100 (mer., 11 f??vr. 2009) | 1 line Clean-up named tuple docs. ................ r69513 | antoine.pitrou | 2009-02-11 01:39:14 +0100 (mer., 11 f??vr. 2009) | 3 lines Issue #4631: Fix urlopen() result when an HTTP response uses chunked encoding. ................ r69515 | benjamin.peterson | 2009-02-11 05:10:53 +0100 (mer., 11 f??vr. 2009) | 8 lines Blocked revisions 69509 via svnmerge ........ r69509 | raymond.hettinger | 2009-02-10 18:06:17 -0600 (Tue, 10 Feb 2009) | 1 line Clean-up named tuple docs. ........ ................ r69517 | mark.dickinson | 2009-02-11 18:04:37 +0100 (mer., 11 f??vr. 2009) | 2 lines Issue #4910: PyNumber_Int is deprecated in 3.0.1; will be removed in 3.1. ................ r69523 | raymond.hettinger | 2009-02-12 07:28:27 +0100 (jeu., 12 f??vr. 2009) | 3 lines Issue 5032: added a step argument to itertools.count() and allowed non-integer arguments. ................ r69524 | gregory.p.smith | 2009-02-12 08:35:29 +0100 (jeu., 12 f??vr. 2009) | 4 lines Fixes 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). ................ r69526 | raymond.hettinger | 2009-02-12 11:19:59 +0100 (jeu., 12 f??vr. 2009) | 1 line Fix spaces/tabs in example. ................ r69529 | raymond.hettinger | 2009-02-12 13:08:18 +0100 (jeu., 12 f??vr. 2009) | 1 line Add an extra testcase. ................ r69531 | raymond.hettinger | 2009-02-12 13:53:53 +0100 (jeu., 12 f??vr. 2009) | 1 line One more test. ................ r69532 | ronald.oussoren | 2009-02-12 16:01:44 +0100 (jeu., 12 f??vr. 2009) | 3 lines Fix for issue5194, based on a patch by Ned Deily. ................ r69534 | ronald.oussoren | 2009-02-12 16:12:03 +0100 (jeu., 12 f??vr. 2009) | 2 lines Fix for issue5195, a patch by Ned Deily ................ r69536 | ronald.oussoren | 2009-02-12 16:18:15 +0100 (jeu., 12 f??vr. 2009) | 2 lines Fix for issue5196, patch by Ned Deily. ................ r69538 | ronald.oussoren | 2009-02-12 16:24:51 +0100 (jeu., 12 f??vr. 2009) | 3 lines Update the ReadMe and Welcome files that are used by the OSX binary installer. Fixes issue5226. Patch by Ned Deily. ................ r69540 | ronald.oussoren | 2009-02-12 16:55:38 +0100 (jeu., 12 f??vr. 2009) | 5 lines This fixes issue5143 and includes a test. Issue5143 notes that getpath.c and main.c pass a 'char*' where a 'wchar_t*' is expected on OSX. ................ r69542 | ronald.oussoren | 2009-02-12 17:02:11 +0100 (jeu., 12 f??vr. 2009) | 2 lines This fixes issue3883 (text on the buttons in the preferences panel for IDLE doesn't fit on OSX) ................ r69544 | ronald.oussoren | 2009-02-12 17:08:14 +0100 (jeu., 12 f??vr. 2009) | 2 lines Fix for issue5224 ("Update Shell Profile.command" contains wrong Python version on OSX) ................ r69547 | mark.dickinson | 2009-02-12 18:58:36 +0100 (jeu., 12 f??vr. 2009) | 3 lines Issue 4998: restore utility of __slots__ on Fraction. (forward merge of r68813). ................ r69553 | tarek.ziade | 2009-02-12 22:02:07 +0100 (jeu., 12 f??vr. 2009) | 9 lines Merged revisions 69551 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69551 | tarek.ziade | 2009-02-12 21:56:21 +0100 (Thu, 12 Feb 2009) | 1 line fixing the leak introduced in r69304 ........ ................ r69559 | benjamin.peterson | 2009-02-13 02:35:28 +0100 (ven., 13 f??vr. 2009) | 24 lines Blocked revisions 69522,69525,69528,69530,69546 via svnmerge ........ r69522 | raymond.hettinger | 2009-02-11 23:39:46 -0600 (Wed, 11 Feb 2009) | 3 lines Issue 5032: added a step argument to itertools.count() and allowed non-integer arguments. ........ r69525 | raymond.hettinger | 2009-02-12 04:16:19 -0600 (Thu, 12 Feb 2009) | 1 line Fix spaces/tabs in example. ........ r69528 | raymond.hettinger | 2009-02-12 06:04:26 -0600 (Thu, 12 Feb 2009) | 1 line Add an extra testcase. ........ r69530 | raymond.hettinger | 2009-02-12 06:43:01 -0600 (Thu, 12 Feb 2009) | 1 line One more test. ........ r69546 | mark.dickinson | 2009-02-12 11:55:42 -0600 (Thu, 12 Feb 2009) | 2 lines Typo fix. ........ ................ r69560 | benjamin.peterson | 2009-02-13 03:50:59 +0100 (ven., 13 f??vr. 2009) | 60 lines Merged revisions 69364-69365,69409-69410,69413,69417,69435,69442,69447,69495,69519-69521 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69364 | kristjan.jonsson | 2009-02-06 04:17:34 -0600 (Fri, 06 Feb 2009) | 1 line Fix a number of Win32ErrorTests error cases. chmod wasn't being tested. 'access' never raises an error. ........ r69365 | armin.rigo | 2009-02-06 05:46:26 -0600 (Fri, 06 Feb 2009) | 2 lines Ivan on IRC in #twisted reported this crasher. ........ r69409 | georg.brandl | 2009-02-07 06:21:17 -0600 (Sat, 07 Feb 2009) | 1 line #5174: fix wrong file closing in example. ........ r69410 | neil.schemenauer | 2009-02-07 08:53:31 -0600 (Sat, 07 Feb 2009) | 4 lines Fix broken test in test_hotshot. Treating the current directory as an empty file is sloppy and non-portable. Use NamedTemporaryFile to make an empty file. ........ r69413 | neil.schemenauer | 2009-02-07 12:35:16 -0600 (Sat, 07 Feb 2009) | 2 lines Add test for issue #999042, explict global statement works. ........ r69417 | benjamin.peterson | 2009-02-07 17:01:19 -0600 (Sat, 07 Feb 2009) | 1 line document individual 2to3 fixers ........ r69435 | benjamin.peterson | 2009-02-08 08:38:13 -0600 (Sun, 08 Feb 2009) | 1 line document numliterals fixer ........ r69442 | benjamin.peterson | 2009-02-08 09:14:57 -0600 (Sun, 08 Feb 2009) | 1 line a few edits and typos ........ r69447 | vinay.sajip | 2009-02-08 13:06:08 -0600 (Sun, 08 Feb 2009) | 2 lines Issue #5170: Fixed Unicode output bug in logging and added test case. This is a regression which did not occur in 2.5. ........ r69495 | kristjan.jonsson | 2009-02-10 07:32:24 -0600 (Tue, 10 Feb 2009) | 1 line Issue 4804. Add a function to test the validity of file descriptors on Windows, and stop using global runtime settings to silence the warnings / assertions. ........ r69519 | gregory.p.smith | 2009-02-11 17:45:25 -0600 (Wed, 11 Feb 2009) | 3 lines Issue #1008086: Fixes socket.inet_aton() to always return 4 bytes even on LP64 platforms (most 64-bit Linux, bsd, unix systems). ........ r69520 | benjamin.peterson | 2009-02-11 21:50:00 -0600 (Wed, 11 Feb 2009) | 1 line os.fsync() should be used to ensure that data is written to disk ........ r69521 | benjamin.peterson | 2009-02-11 22:17:04 -0600 (Wed, 11 Feb 2009) | 1 line no need for this __bases__ trick anymore ........ ................ r69565 | georg.brandl | 2009-02-13 10:11:32 +0100 (ven., 13 f??vr. 2009) | 9 lines Merged revisions 69562 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69562 | georg.brandl | 2009-02-13 10:08:34 +0100 (Fr, 13 Feb 2009) | 2 lines Add links to the other versions we have in stock. ........ ................ r69568 | tarek.ziade | 2009-02-13 10:15:20 +0100 (ven., 13 f??vr. 2009) | 9 lines Merged revisions 69566 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69566 | tarek.ziade | 2009-02-13 10:12:33 +0100 (Fri, 13 Feb 2009) | 1 line #5158: added documentation on the depends option in distutils extensions ........ ................ r69571 | georg.brandl | 2009-02-13 11:40:43 +0100 (ven., 13 f??vr. 2009) | 1 line #4894: document "newurl" parameter to redirect_request(). ................ r69572 | georg.brandl | 2009-02-13 11:42:52 +0100 (ven., 13 f??vr. 2009) | 8 lines Blocked revisions 69570 via svnmerge ........ r69570 | georg.brandl | 2009-02-13 11:40:14 +0100 (Fr, 13 Feb 2009) | 1 line #4894: document "newurl" parameter to redirect_request(). ........ ................ r69574 | georg.brandl | 2009-02-13 11:44:28 +0100 (ven., 13 f??vr. 2009) | 8 lines Blocked revisions 69573 via svnmerge ........ r69573 | georg.brandl | 2009-02-13 11:44:17 +0100 (Fr, 13 Feb 2009) | 1 line #3734: document complex coercing behavior better. ........ ................ r69575 | georg.brandl | 2009-02-13 11:50:01 +0100 (ven., 13 f??vr. 2009) | 1 line part of #3613: fix get_host_info() usage of base64.encodestring(). ................ r69577 | georg.brandl | 2009-02-13 12:01:07 +0100 (ven., 13 f??vr. 2009) | 1 line #3694: fix an "XXX undetected error" leak in struct. ................ r69581 | georg.brandl | 2009-02-13 12:10:15 +0100 (ven., 13 f??vr. 2009) | 8 lines Blocked revisions 69578 via svnmerge ........ r69578 | georg.brandl | 2009-02-13 12:03:59 +0100 (Fr, 13 Feb 2009) | 1 line #3694: add test for fix committed in r66693. ........ ................ r69584 | antoine.pitrou | 2009-02-13 15:01:05 +0100 (ven., 13 f??vr. 2009) | 14 lines Merged revisions 69582-69583 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69582 | antoine.pitrou | 2009-02-13 14:52:33 +0100 (ven., 13 f??vr. 2009) | 4 lines Issue #5186: Reduce hash collisions for objects with no __hash__ method by rotating the object pointer by 4 bits to the right. ........ r69583 | antoine.pitrou | 2009-02-13 14:57:40 +0100 (ven., 13 f??vr. 2009) | 3 lines Fix compiler warning (gcc) ........ ................ r69587 | tarek.ziade | 2009-02-13 17:23:57 +0100 (ven., 13 f??vr. 2009) | 9 lines Merged revisions 69585 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69585 | tarek.ziade | 2009-02-13 17:13:16 +0100 (Fri, 13 Feb 2009) | 1 line reverted leak fix, to use the one done in py3k branch (r67382) ........ ................ r69592 | martin.v.loewis | 2009-02-13 21:27:39 +0100 (ven., 13 f??vr. 2009) | 1 line Fix typos in version numbers. ................ r69596 | tarek.ziade | 2009-02-13 23:26:15 +0100 (ven., 13 f??vr. 2009) | 9 lines Merged revisions 69594 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69594 | tarek.ziade | 2009-02-13 23:22:03 +0100 (Fri, 13 Feb 2009) | 1 line Issue #2461: added tests for distutils.util ........ ................ r69600 | tarek.ziade | 2009-02-14 00:04:17 +0100 (sam., 14 f??vr. 2009) | 9 lines Merged revisions 69598 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69598 | tarek.ziade | 2009-02-14 00:00:43 +0100 (Sat, 14 Feb 2009) | 1 line Fixed #4524: distutils build_script command failed with --with-suffix=3 ........ ................ r69603 | tarek.ziade | 2009-02-14 00:48:11 +0100 (sam., 14 f??vr. 2009) | 9 lines Merged revisions 69602 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69602 | tarek.ziade | 2009-02-14 00:41:57 +0100 (Sat, 14 Feb 2009) | 1 line fix the environ for distutils test_util ........ ................ r69607 | raymond.hettinger | 2009-02-14 05:21:49 +0100 (sam., 14 f??vr. 2009) | 1 line Add keyword argument support to itertools.count(). ................ r69613 | tarek.ziade | 2009-02-14 15:35:51 +0100 (sam., 14 f??vr. 2009) | 9 lines Merged revisions 69609 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69609 | tarek.ziade | 2009-02-14 15:10:23 +0100 (Sat, 14 Feb 2009) | 1 line Fix for #5257: refactored all tests in distutils, so they use a temporary directory. ........ ................ r69614 | tarek.ziade | 2009-02-14 15:36:38 +0100 (sam., 14 f??vr. 2009) | 8 lines Blocked revisions 69610 via svnmerge ........ r69610 | tarek.ziade | 2009-02-14 15:12:30 +0100 (Sat, 14 Feb 2009) | 1 line Replace variable ........ ................ r69618 | benjamin.peterson | 2009-02-14 18:00:16 +0100 (sam., 14 f??vr. 2009) | 9 lines Merged revisions 69617 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69617 | benjamin.peterson | 2009-02-14 10:51:03 -0600 (Sat, 14 Feb 2009) | 1 line we're no longer using CVS, so this doesn't have to be binary ........ ................ Added: python/branches/io-c/Lib/distutils/tests/test_util.py - copied unchanged from r69618, /python/branches/py3k/Lib/distutils/tests/test_util.py python/branches/io-c/Lib/test/crashers/compiler_recursion.py - copied unchanged from r69618, /python/branches/py3k/Lib/test/crashers/compiler_recursion.py python/branches/io-c/Lib/test/test_compileall.py - copied unchanged from r69618, /python/branches/py3k/Lib/test/test_compileall.py python/branches/io-c/Lib/test/test_osx_env.py - copied unchanged from r69618, /python/branches/py3k/Lib/test/test_osx_env.py python/branches/io-c/Lib/test/test_tk.py - copied unchanged from r69618, /python/branches/py3k/Lib/test/test_tk.py python/branches/io-c/Lib/tkinter/test/test_tkinter/ (props changed) - copied from r69618, /python/branches/py3k/Lib/tkinter/test/test_tkinter/ python/branches/io-c/Modules/hashlib.h - copied unchanged from r69618, /python/branches/py3k/Modules/hashlib.h python/branches/io-c/Modules/tkinter.h - copied unchanged from r69618, /python/branches/py3k/Modules/tkinter.h python/branches/io-c/PCbuild/sqlite3.vsprops - copied unchanged from r69618, /python/branches/py3k/PCbuild/sqlite3.vsprops Modified: python/branches/io-c/ (props changed) python/branches/io-c/Doc/ACKS.txt python/branches/io-c/Doc/c-api/long.rst python/branches/io-c/Doc/c-api/number.rst python/branches/io-c/Doc/distutils/setupscript.rst python/branches/io-c/Doc/library/2to3.rst python/branches/io-c/Doc/library/collections.rst python/branches/io-c/Doc/library/itertools.rst python/branches/io-c/Doc/library/stdtypes.rst python/branches/io-c/Doc/library/urllib.request.rst python/branches/io-c/Doc/tools/sphinxext/indexsidebar.html python/branches/io-c/Doc/tools/sphinxext/pyspecific.py python/branches/io-c/Include/abstract.h python/branches/io-c/Include/fileobject.h python/branches/io-c/Include/intobject.h python/branches/io-c/Include/pymath.h python/branches/io-c/Lib/collections.py python/branches/io-c/Lib/compileall.py python/branches/io-c/Lib/distutils/command/build_scripts.py python/branches/io-c/Lib/distutils/sysconfig.py python/branches/io-c/Lib/distutils/tests/support.py python/branches/io-c/Lib/distutils/tests/test_build_ext.py python/branches/io-c/Lib/distutils/tests/test_build_scripts.py python/branches/io-c/Lib/distutils/tests/test_config.py python/branches/io-c/Lib/distutils/tests/test_dir_util.py python/branches/io-c/Lib/distutils/tests/test_dist.py python/branches/io-c/Lib/distutils/tests/test_file_util.py python/branches/io-c/Lib/distutils/tests/test_sdist.py python/branches/io-c/Lib/distutils/tests/test_sysconfig.py python/branches/io-c/Lib/http/client.py python/branches/io-c/Lib/idlelib/Bindings.py python/branches/io-c/Lib/idlelib/EditorWindow.py python/branches/io-c/Lib/idlelib/MultiCall.py python/branches/io-c/Lib/idlelib/configDialog.py python/branches/io-c/Lib/idlelib/keybindingDialog.py python/branches/io-c/Lib/idlelib/macosxSupport.py python/branches/io-c/Lib/importlib/NOTES python/branches/io-c/Lib/io.py python/branches/io-c/Lib/logging/__init__.py python/branches/io-c/Lib/numbers.py python/branches/io-c/Lib/test/regrtest.py python/branches/io-c/Lib/test/test_builtin.py python/branches/io-c/Lib/test/test_collections.py python/branches/io-c/Lib/test/test_fractions.py python/branches/io-c/Lib/test/test_hashlib.py python/branches/io-c/Lib/test/test_httplib.py python/branches/io-c/Lib/test/test_io.py python/branches/io-c/Lib/test/test_itertools.py python/branches/io-c/Lib/test/test_logging.py python/branches/io-c/Lib/test/test_os.py python/branches/io-c/Lib/test/test_pep263.py (contents, props changed) python/branches/io-c/Lib/test/test_socket.py python/branches/io-c/Lib/test/test_struct.py python/branches/io-c/Lib/test/test_urllib2_localnet.py python/branches/io-c/Lib/test/test_urllib2net.py python/branches/io-c/Lib/test/test_xmlrpc.py python/branches/io-c/Lib/tkinter/__init__.py python/branches/io-c/Lib/tkinter/ttk.py python/branches/io-c/Lib/urllib/request.py python/branches/io-c/Lib/urllib/response.py python/branches/io-c/Lib/xmlrpc/client.py python/branches/io-c/Mac/BuildScript/build-installer.py python/branches/io-c/Mac/BuildScript/resources/ReadMe.txt python/branches/io-c/Mac/BuildScript/resources/Welcome.rtf python/branches/io-c/Mac/BuildScript/scripts/postflight.patch-profile python/branches/io-c/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE python/branches/io-c/Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py python/branches/io-c/Mac/Makefile.in python/branches/io-c/Misc/ACKS python/branches/io-c/Misc/NEWS python/branches/io-c/Modules/_ctypes/callproc.c python/branches/io-c/Modules/_fileio.c python/branches/io-c/Modules/_hashopenssl.c python/branches/io-c/Modules/_iobase.c python/branches/io-c/Modules/_struct.c python/branches/io-c/Modules/_tkinter.c python/branches/io-c/Modules/getpath.c python/branches/io-c/Modules/itertoolsmodule.c python/branches/io-c/Modules/main.c python/branches/io-c/Modules/md5module.c python/branches/io-c/Modules/sha1module.c python/branches/io-c/Modules/sha256module.c python/branches/io-c/Modules/sha512module.c python/branches/io-c/Modules/socketmodule.c python/branches/io-c/Modules/testcapi_long.h python/branches/io-c/Modules/tkappinit.c python/branches/io-c/Objects/exceptions.c python/branches/io-c/Objects/longobject.c python/branches/io-c/Objects/object.c python/branches/io-c/Objects/typeobject.c python/branches/io-c/PC/VC6/_multiprocessing.dsp (contents, props changed) python/branches/io-c/PC/VC6/build_tkinter.py (contents, props changed) python/branches/io-c/PC/VC6/tcl852.patch (contents, props changed) python/branches/io-c/PCbuild/sqlite3.vcproj python/branches/io-c/Python/pymath.c python/branches/io-c/Tools/msi/uuids.py python/branches/io-c/setup.py Modified: python/branches/io-c/Doc/ACKS.txt ============================================================================== --- python/branches/io-c/Doc/ACKS.txt (original) +++ python/branches/io-c/Doc/ACKS.txt Sat Feb 14 21:58:31 2009 @@ -18,6 +18,7 @@ * Oliver Andrich * Heidi Annexstad * Jes??s Cea Avi??n + * Manuel Balsera * Daniel Barclay * Chris Barker * Don Bashford Modified: python/branches/io-c/Doc/c-api/long.rst ============================================================================== --- python/branches/io-c/Doc/c-api/long.rst (original) +++ python/branches/io-c/Doc/c-api/long.rst Sat Feb 14 21:58:31 2009 @@ -168,17 +168,26 @@ .. cfunction:: PY_LONG_LONG PyLong_AsLongLong(PyObject *pylong) - Return a C :ctype:`long long` from a Python integer. If *pylong* cannot be - represented as a :ctype:`long long`, an :exc:`OverflowError` will be raised. + .. index:: + single: OverflowError (built-in exception) + Return a C :ctype:`long long` from a Python integer. If *pylong* + cannot be represented as a :ctype:`long long`, an + :exc:`OverflowError` is raised and ``-1`` is returned. .. cfunction:: unsigned PY_LONG_LONG PyLong_AsUnsignedLongLong(PyObject *pylong) - Return a C :ctype:`unsigned long long` from a Python integer. If *pylong* - cannot be represented as an :ctype:`unsigned long long`, an :exc:`OverflowError` - will be raised if the value is positive, or a :exc:`TypeError` will be raised if - the value is negative. + .. index:: + single: OverflowError (built-in exception) + Return a C :ctype:`unsigned long long` from a Python integer. If + *pylong* cannot be represented as an :ctype:`unsigned long long`, + an :exc:`OverflowError` is raised and ``(unsigned long long)-1`` is + returned. + + .. versionchanged:: 3.1 + A negative *pylong* now raises :exc:`OverflowError`, not + :exc:`TypeError`. .. cfunction:: unsigned long PyLong_AsUnsignedLongMask(PyObject *io) Modified: python/branches/io-c/Doc/c-api/number.rst ============================================================================== --- python/branches/io-c/Doc/c-api/number.rst (original) +++ python/branches/io-c/Doc/c-api/number.rst Sat Feb 14 21:58:31 2009 @@ -233,6 +233,12 @@ Returns the *o* converted to an integer object on success, or *NULL* on failure. This is the equivalent of the Python expression ``int(o)``. + .. note:: + + This function is defined in the transitional :file:`intobject.h` + header file. It will be removed completely in Python 3.1. Use + the :cfunc:`PyNumber_Long` function instead. + .. cfunction:: PyObject* PyNumber_Long(PyObject *o) Modified: python/branches/io-c/Doc/distutils/setupscript.rst ============================================================================== --- python/branches/io-c/Doc/distutils/setupscript.rst (original) +++ python/branches/io-c/Doc/distutils/setupscript.rst Sat Feb 14 21:58:31 2009 @@ -347,6 +347,10 @@ building compiled extensions: Distutils will automatically add ``initmodule`` to the list of exported symbols. +The :option:`depends` option is a list of files that the extension depends on +(for example header files). The build command will call the compiler on the +sources to rebuild extension if any on this files has been modified since the +previous build. Relationships between Distributions and Packages ================================================ Modified: python/branches/io-c/Doc/library/2to3.rst ============================================================================== --- python/branches/io-c/Doc/library/2to3.rst (original) +++ python/branches/io-c/Doc/library/2to3.rst Sat Feb 14 21:58:31 2009 @@ -14,6 +14,8 @@ automatically. +.. _2to3-using: + Using 2to3 ---------- @@ -52,10 +54,10 @@ Comments and exact indentation are preserved throughout the translation process. -By default, 2to3 runs a set of predefined fixers. The :option:`-l` flag lists -all available fixers. An explicit set of fixers to run can be given with -:option:`-f`. Likewise the :option:`-x` explicitly disables a fixer. The -following example runs only the ``imports`` and ``has_key`` fixers:: +By default, 2to3 runs a set of :ref:`predefined fixers <2to3-fixers>`. The +:option:`-l` flag lists all available fixers. An explicit set of fixers to run +can be given with :option:`-f`. Likewise the :option:`-x` explicitly disables a +fixer. The following example runs only the ``imports`` and ``has_key`` fixers:: $ 2to3 -f imports -f has_key example.py @@ -84,12 +86,263 @@ The :option:`-v` option enables output of more information on the translation process. -When the :option:`-p` is passed, 2to3 treats ``print`` as a function instead of -a statement. This is useful when ``from __future__ import print_function`` is -being used. If this option is not given, the print fixer will surround print -calls in an extra set of parentheses because it cannot differentiate between the -print statement with parentheses (such as ``print ("a" + "b" + "c")``) and a -true function call. +When the :option:`-p` is passed, the :2to3fixer:`print` fixer ``print`` as a +function instead of a statement. This is useful when ``from __future__ import +print_function`` is being used. If this option is not given, the print fixer +will surround print calls in an extra set of parentheses because it cannot +differentiate between the print statement with parentheses (such as ``print +("a" + "b" + "c")``) and a true function call. + + +.. _2to3-fixers: + +Fixers +------ + +Each step of tranforming code is encapsulated in a fixer. The command ``2to3 +-l`` lists them. As :ref:`documented above <2to3-using>`, each can be turned on +and off individually. They are described here in more detail. + + +.. 2to3fixer:: apply + + Removes usage of :func:`apply`. For example ``apply(function, *args, + **kwargs)`` is converted to ``function(*args, **kwargs)``. + +.. 2to3fixer:: basestring + + Converts :class:`basestring` to :class:`str`. + +.. 2to3fixer:: buffer + + Converts :class:`buffer` to :class:`memoryview`. This fixer is optional + because the :class:`memoryview` API is similar but not exactly the same as + that of :class:`buffer`. + +.. 2to3fixer:: callable + + Converts ``callable(x)`` to ``hasattr(x, "__call_")``. + +.. 2to3fixer:: dict + + Fixes dictionary iteration methods. :meth:`dict.iteritems` is converted to + :meth:`dict.items`, :meth:`dict.iterkeys` to :meth:`dict.keys`, and + :meth:`dict.itervalues` to :meth:`dict.values`. It also wraps existing + usages of :meth:`dict.items`, :meth:`dict.keys`, and :meth:`dict.values` in a + call to :class:`list`. + +.. 2to3fixer:: except + + Converts ``except X, T`` to ``except X as T``. + +.. 2to3fixer:: exec + + Converts the :keyword:`exec` statement to the :func:`exec` function. + +.. 2to3fixer:: execfile + + Removes usage of :func:`execfile`. The argument to :func:`execfile` is + wrapped in calls to :func:`open`, :func:`compile`, and :func:`exec`. + +.. 2to3fixer:: filter + + Wraps :func:`filter` usage in a :class:`list` call. + +.. 2to3fixer:: funcattrs + + Fixes function attributes that have been renamed. For example, + ``my_function.func_closure`` is converted to ``my_function.__closure__``. + +.. 2to3fixer:: future + + Removes ``from __future__ import new_feature`` statements. + +.. 2to3fixer:: getcwdu + + Renames :func:`os.getcwdu` to :func:`os.getcwd`. + +.. 2to3fixer:: has_key + + Changes ``dict.has_key(key)`` to ``key in dict``. + +.. 2to3fixer:: idioms + + This optional fixer preforms several transformations that make Python code + more idiomatic. Type comparisions like ``type(x) is SomeClass`` and + ``type(x) == SomeClass`` are converted to ``isinstance(x, SomeClass)``. + ``while 1`` becomes ``while True``. This fixer also tries to make use of + :func:`sorted` in appropiate places. For example, this block :: + + L = list(some_iterable) + L.sort() + + is changed to :: + + L = sorted(some_iterable) + +.. 2to3fixer:: import + + Detects sibling imports and converts them to relative imports. + +.. 2to3fixer:: imports + + Handles module renames in the standard library. + +.. 2to3fixer:: imports2 + + Handles other modules renames in the standard library. It is separate from + the :2to3fixer:`imports` fixer only because of technical limitations. + +.. 2to3fixer:: input + + Converts ``input(prompt)`` to ``eval(input(prompt))`` + +.. 2to3fixer:: intern + + Converts :func:`intern` to :func:`sys.intern`. + +.. 2to3fixer:: isinstance + + Fixes duplicate types in the second argument of :func:`isinstance`. For + example, ``isinstance(x, (int, int))`` is converted to ``isinstance(x, + (int))``. + +.. 2to3fixer:: itertools_imports + + Removes imports of :func:`itertools.ifilter`, :func:`itertools.izip`, and + :func:`itertools.imap`. Imports of :func:`itertools.ifilterfalse` are also + changed to :func:`itertools.filterfalse`. + +.. 2to3fixer:: itertools + + Changes usage of :func:`itertools.ifilter`, :func:`itertools.izip`, and + :func:`itertools.imap` to their builtin equivalents. + :func:`itertools.ifilterfalse` is changed to :func:`itertools.filterfalse`. + +.. 2to3fixer:: long + + Strips the ``L`` prefix on long literals and renames :class:`long` to + :class:`int`. + +.. 2to3fixer:: map + + Wraps :func:`map` in a :class:`list` call. It also changes ``map(None, x)`` + to ``list(x)``. Using ``from future_builtins import map`` disables this + fixer. + +.. 2to3fixer:: metaclass + + Converts the old metaclass syntax (``__metaclass__ = Meta`` in the class + body) to the new (``class X(metaclass=Meta)``). + +.. 2to3fixer:: methodattrs + + Fixes old method attribute names. For example, ``meth.im_func`` is converted + to ``meth.__func__``. + +.. 2to3fixer:: ne + + Converts the old not-equal syntax, ``<>``, to ``!=``. + +.. 2to3fixer:: next + + Converts the use of iterator's :meth:`next` methods to the :func:`next` + function. It also renames :meth:`next` methods to :meth:`~object.__next__`. + +.. 2to3fixer:: nonzero + + Renames :meth:`~object.__nonzero__` to :meth:`~object.__bool__`. + +.. 2to3fixer:: numliterals + + Converts octal literals into the new syntax. + +.. 2to3fixer:: paren + + Add extra parenthesis where they are required in list comprehensions. For + example, ``[x for x in 1, 2]`` becomes ``[x for x in (1, 2)]``. + +.. 2to3fixer:: print + + Converts the :keyword:`print` statement to the :func:`print` function. + +.. 2to3fixer:: raises + + Converts ``raise E, V`` to ``raise E(V)``, and ``raise E, V, T`` to ``raise + E(V).with_traceback(T)``. If ``E`` is a tuple, the translation will be + incorrect because substituting tuples for exceptions has been removed in 3.0. + +.. 2to3fixer:: raw_input + + Converts :func:`raw_input` to :func:`input`. + +.. 2to3fixer:: reduce + + Handles the move of :func:`reduce` to :func:`functools.reduce`. + +.. 2to3fixer:: renames + + Changes :data:`sys.maxint` to :data:`sys.maxsize`. + +.. 2to3fixer:: repr + + Replaces backtick repr with the :func:`repr` function. + +.. 2to3fixer:: set_literal + + Replaces use of the :class:`set` constructor with set literals. This fixer + is optional. + +.. 2to3fixer:: standard_error + + Renames :exc:`StandardError` to :exc:`Exception`. + +.. 2to3fixer:: sys_exc + + Changes the deprecated :data:`sys.exc_value`, :data:`sys.exc_type`, + :data:`sys.exc_traceback` to use :func:`sys.exc_info`. + +.. 2to3fixer:: throw + + Fixes the API change in generator's :meth:`throw` method. + +.. 2to3fixer:: tuple_params + + Removes implicit tuple parameter unpacking. This fixer inserts temporary + variables. + +.. 2to3fixer:: types + + Fixes code broken from the removal of some members in the :mod:`types` + module. + +.. 2to3fixer:: unicode + + Renames :class:`unicode` to :class:`str`. + +.. 2to3fixer:: urllib + + Handles the rename of :mod:`urllib` and :mod:`urllib2` to the :mod:`urllib` + package. + +.. 2to3fixer:: ws_comma + + Removes excess whitespace from comma separated items. This fixer is + optional. + +.. 2to3fixer:: xrange + + Renames :func:`xrange` to :func:`range` and wraps existing :func:`range` + calls with :class:`list`. + +.. 2to3fixer:: xreadlines + + Changes ``for x in file.xreadlines()`` to ``for x in file``. + +.. 2to3fixer:: zip + + Wraps :func:`zip` usage in a :class:`list` call. This is disabled when + ``from future_builtins import zip`` appears. :mod:`lib2to3` - 2to3's library Modified: python/branches/io-c/Doc/library/collections.rst ============================================================================== --- python/branches/io-c/Doc/library/collections.rst (original) +++ python/branches/io-c/Doc/library/collections.rst Sat Feb 14 21:58:31 2009 @@ -597,7 +597,7 @@ self-documenting code. They can be used wherever regular tuples are used, and they add the ability to access fields by name instead of position index. -.. function:: namedtuple(typename, field_names, [verbose]) +.. function:: namedtuple(typename, field_names, [verbose], [rename]) Returns a new tuple subclass named *typename*. The new subclass is used to create tuple-like objects that have fields accessible by attribute lookup as @@ -615,11 +615,19 @@ a :mod:`keyword` such as *class*, *for*, *return*, *global*, *pass*, or *raise*. + If *rename* is true, invalid fieldnames are automatically replaced + with positional names. For example, ``['abc', 'def', 'ghi', 'abc']`` is + converted to ``['abc', '_2', 'ghi', '_4']``, eliminating the keyword + ``def`` and the duplicate fieldname ``abc``. + If *verbose* is true, the class definition is printed just before being built. Named tuple instances do not have per-instance dictionaries, so they are lightweight and require no more memory than regular tuples. + .. versionchanged:: 2.7 + added support for *rename*. + Example: .. doctest:: @@ -747,7 +755,8 @@ >>> getattr(p, 'x') 11 -To convert a dictionary to a named tuple, use the double-star-operator [#]_: +To convert a dictionary to a named tuple, use the double-star-operator +(as described in :ref:`tut-unpacking-arguments`): >>> d = {'x': 11, 'y': 22} >>> Point(**d) @@ -795,10 +804,10 @@ >>> class Status: ... open, pending, closed = range(3) -.. rubric:: Footnotes +.. seealso:: -.. [#] For information on the double-star-operator see - :ref:`tut-unpacking-arguments` and :ref:`calls`. + `Named tuple recipe `_ + adapted for Python 2.4. Modified: python/branches/io-c/Doc/library/itertools.rst ============================================================================== --- python/branches/io-c/Doc/library/itertools.rst (original) +++ python/branches/io-c/Doc/library/itertools.rst Sat Feb 14 21:58:31 2009 @@ -178,7 +178,7 @@ The number of items returned is ``(n+r-1)! / r! / (n-1)!`` when ``n > 0``. - .. versionadded:: 2.7 + .. versionadded:: 3.1 .. function:: compress(data, selectors) @@ -191,22 +191,25 @@ # compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F return (d for d, s in zip(data, selectors) if s) - .. versionadded:: 2.7 + .. versionadded:: 3.1 -.. function:: count([n]) +.. function:: count(start=0, step=1) - Make an iterator that returns consecutive integers starting with *n*. If not - specified *n* defaults to zero. Often used as an argument to :func:`map` to - generate consecutive data points. Also, used with :func:`zip` to add sequence - numbers. Equivalent to:: + Make an iterator that returns evenly spaced values starting with *n*. Often + used as an argument to :func:`map` to generate consecutive data points. + Also, used with :func:`zip` to add sequence numbers. Equivalent to:: - def count(n=0): + def count(start=0, step=1): # count(10) --> 10 11 12 13 14 ... + # count(2.5, 0.5) -> 3.5 3.0 4.5 ... + n = start while True: yield n - n += 1 + n += step + .. versionchanged:: 3.1 + added *step* argument and allowed non-integer arguments. .. function:: cycle(iterable) Modified: python/branches/io-c/Doc/library/stdtypes.rst ============================================================================== --- python/branches/io-c/Doc/library/stdtypes.rst (original) +++ python/branches/io-c/Doc/library/stdtypes.rst Sat Feb 14 21:58:31 2009 @@ -2061,6 +2061,11 @@ Flush the internal buffer, like ``stdio``'s :cfunc:`fflush`. This may be a no-op on some file-like objects. + .. note:: + + :meth:`flush` does not necessarily write the file's data to disk. Use + :meth:`flush` followed by :func:`os.fsync` to ensure this behavior. + .. method:: file.fileno() Modified: python/branches/io-c/Doc/library/urllib.request.rst ============================================================================== --- python/branches/io-c/Doc/library/urllib.request.rst (original) +++ python/branches/io-c/Doc/library/urllib.request.rst Sat Feb 14 21:58:31 2009 @@ -741,14 +741,15 @@ precise meanings of the various redirection codes. -.. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs) +.. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs, newurl) Return a :class:`Request` or ``None`` in response to a redirect. This is called by the default implementations of the :meth:`http_error_30\*` methods when a redirection is received from the server. If a redirection should take place, return a new :class:`Request` to allow :meth:`http_error_30\*` to perform the - redirect. Otherwise, raise :exc:`HTTPError` if no other handler should try to - handle this URL, or return ``None`` if you can't but another handler might. + redirect to *newurl*. Otherwise, raise :exc:`HTTPError` if no other handler + should try to handle this URL, or return ``None`` if you can't but another + handler might. .. note:: @@ -761,8 +762,8 @@ .. method:: HTTPRedirectHandler.http_error_301(req, fp, code, msg, hdrs) - Redirect to the ``Location:`` URL. This method is called by the parent - :class:`OpenerDirector` when getting an HTTP 'moved permanently' response. + Redirect to the ``Location:`` or ``URI:`` URL. This method is called by the + parent :class:`OpenerDirector` when getting an HTTP 'moved permanently' response. .. method:: HTTPRedirectHandler.http_error_302(req, fp, code, msg, hdrs) Modified: python/branches/io-c/Doc/tools/sphinxext/indexsidebar.html ============================================================================== --- python/branches/io-c/Doc/tools/sphinxext/indexsidebar.html (original) +++ python/branches/io-c/Doc/tools/sphinxext/indexsidebar.html Sat Feb 14 21:58:31 2009 @@ -1,5 +1,13 @@

Download

Download these documents

+

Docs for other versions

+ +

Other resources

Modified: python/branches/io-c/Doc/tools/sphinxext/pyspecific.py ============================================================================== --- python/branches/io-c/Doc/tools/sphinxext/pyspecific.py (original) +++ python/branches/io-c/Doc/tools/sphinxext/pyspecific.py Sat Feb 14 21:58:31 2009 @@ -122,3 +122,4 @@ app.add_builder(suspicious.CheckSuspiciousMarkupBuilder) app.add_description_unit('opcode', 'opcode', '%s (opcode)', parse_opcode_signature) + app.add_description_unit('2to3fixer', '2to3fixer', '%s (2to3 fixer)') Modified: python/branches/io-c/Include/abstract.h ============================================================================== --- python/branches/io-c/Include/abstract.h (original) +++ python/branches/io-c/Include/abstract.h Sat Feb 14 21:58:31 2009 @@ -784,7 +784,11 @@ is cleared and the value is clipped. */ - #define PyNumber_Int PyNumber_Long + /* + PyNumber_Int used to be found here. It's now in Include/intobject.h, + where it is defined to be an alias for PyNumber_Long. New code + should use PyNumber_Long instead. + */ PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o); Modified: python/branches/io-c/Include/fileobject.h ============================================================================== --- python/branches/io-c/Include/fileobject.h (original) +++ python/branches/io-c/Include/fileobject.h Sat Feb 14 21:58:31 2009 @@ -30,6 +30,17 @@ PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int); PyAPI_DATA(PyTypeObject) PyStdPrinter_Type; +#if defined _MSC_VER && _MSC_VER >= 1400 +/* A routine to check if a file descriptor is valid on Windows. Returns 0 + * and sets errno to EBADF if it isn't. This is to avoid Assertions + * from various functions in the Windows CRT beginning with + * Visual Studio 2005 + */ +int _PyVerify_fd(int fd); +#else +#define _PyVerify_fd(A) (1) /* dummy */ +#endif + #ifdef __cplusplus } #endif Modified: python/branches/io-c/Include/intobject.h ============================================================================== --- python/branches/io-c/Include/intobject.h (original) +++ python/branches/io-c/Include/intobject.h Sat Feb 14 21:58:31 2009 @@ -1,8 +1,8 @@ /* Integer object interface - This header files exists to make porting code to Python 3.0 easier. It - defines aliases from PyInt_* to PyLong_*. Only PyInt_GetMax() and - PyInt_CheckExact() remain in longobject.h. + This header file exists to make porting code to Python 3.0 easier. It + defines aliases from PyInt_* to PyLong_* and an alias from + PyNumber_Int to PyNumber_Long. */ #ifndef Py_INTOBJECT_H @@ -28,6 +28,7 @@ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyInt_AS_LONG PyLong_AS_LONG +#define PyNumber_Int PyNumber_Long #ifdef __cplusplus } Modified: python/branches/io-c/Include/pymath.h ============================================================================== --- python/branches/io-c/Include/pymath.h (original) +++ python/branches/io-c/Include/pymath.h Sat Feb 14 21:58:31 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: @@ -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 -#if defined HAVE_DECL_ISINF && HAVE_DECL_ISINF == 1 -#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) Modified: python/branches/io-c/Lib/collections.py ============================================================================== --- python/branches/io-c/Lib/collections.py (original) +++ python/branches/io-c/Lib/collections.py Sat Feb 14 21:58:31 2009 @@ -18,7 +18,7 @@ ### namedtuple ################################################################################ -def namedtuple(typename, field_names, verbose=False): +def namedtuple(typename, field_names, verbose=False, rename=False): """Returns a new subclass of tuple with named fields. >>> Point = namedtuple('Point', 'x y') @@ -47,6 +47,16 @@ if isinstance(field_names, str): field_names = field_names.replace(',', ' ').split() # names separated by whitespace and/or commas field_names = tuple(map(str, field_names)) + if rename: + names = list(field_names) + seen = set() + for i, name in enumerate(names): + if (not all(c.isalnum() or c=='_' for c in name) or _iskeyword(name) + or not name or name[0].isdigit() or name.startswith('_') + or name in seen): + names[i] = '_%d' % (i+1) + seen.add(name) + field_names = tuple(names) for name in (typename,) + field_names: if not all(c.isalnum() or c=='_' for c in name): raise ValueError('Type names and field names can only contain alphanumeric characters and underscores: %r' % name) @@ -56,7 +66,7 @@ raise ValueError('Type names and field names cannot start with a number: %r' % name) seen_names = set() for name in field_names: - if name.startswith('_'): + if name.startswith('_') and not rename: raise ValueError('Field names cannot start with an underscore: %r' % name) if name in seen_names: raise ValueError('Encountered duplicate field name: %r' % name) Modified: python/branches/io-c/Lib/compileall.py ============================================================================== --- python/branches/io-c/Lib/compileall.py (original) +++ python/branches/io-c/Lib/compileall.py Sat Feb 14 21:58:31 2009 @@ -11,10 +11,11 @@ See module py_compile for details of the actual byte-compilation. """ - import os import sys import py_compile +import struct +import imp __all__ = ["compile_dir","compile_path"] @@ -54,11 +55,17 @@ if os.path.isfile(fullname): head, tail = name[:-3], name[-3:] if tail == '.py': - cfile = fullname + (__debug__ and 'c' or 'o') - ftime = os.stat(fullname).st_mtime - try: ctime = os.stat(cfile).st_mtime - except os.error: ctime = 0 - if (ctime > ftime) and not force: continue + if not force: + try: + mtime = os.stat(fullname).st_mtime + expect = struct.pack('<4sl', imp.get_magic(), mtime) + cfile = fullname + (__debug__ and 'c' or 'o') + with open(cfile, 'rb') as chandle: + actual = chandle.read(8) + if expect == actual: + continue + except IOError: + pass if not quiet: print('Compiling', fullname, '...') try: @@ -86,7 +93,8 @@ name != os.curdir and name != os.pardir and \ os.path.isdir(fullname) and \ not os.path.islink(fullname): - if not compile_dir(fullname, maxlevels - 1, dfile, force, rx, quiet): + if not compile_dir(fullname, maxlevels - 1, dfile, force, rx, + quiet): success = 0 return success Modified: python/branches/io-c/Lib/distutils/command/build_scripts.py ============================================================================== --- python/branches/io-c/Lib/distutils/command/build_scripts.py (original) +++ python/branches/io-c/Lib/distutils/command/build_scripts.py Sat Feb 14 21:58:31 2009 @@ -104,8 +104,8 @@ outf.write("#!%s%s\n" % (os.path.join( sysconfig.get_config_var("BINDIR"), - "python" + sysconfig.get_config_var("VERSION") - + sysconfig.get_config_var("EXE")), + "python%s%s" % (sysconfig.get_config_var("VERSION"), + sysconfig.get_config_var("EXE"))), post_interp)) outf.writelines(f.readlines()) outf.close() Modified: python/branches/io-c/Lib/distutils/sysconfig.py ============================================================================== --- python/branches/io-c/Lib/distutils/sysconfig.py (original) +++ python/branches/io-c/Lib/distutils/sysconfig.py Sat Feb 14 21:58:31 2009 @@ -130,7 +130,7 @@ if get_python_version() < "2.2": return prefix else: - return os.path.join(PREFIX, "Lib", "site-packages") + return os.path.join(prefix, "Lib", "site-packages") elif os.name == "mac": if plat_specific: if standard_lib: @@ -144,9 +144,9 @@ return os.path.join(prefix, "Lib", "site-packages") elif os.name == "os2": if standard_lib: - return os.path.join(PREFIX, "Lib") + return os.path.join(prefix, "Lib") else: - return os.path.join(PREFIX, "Lib", "site-packages") + return os.path.join(prefix, "Lib", "site-packages") else: raise DistutilsPlatformError( "I don't know where Python installs its library " Modified: python/branches/io-c/Lib/distutils/tests/support.py ============================================================================== --- python/branches/io-c/Lib/distutils/tests/support.py (original) +++ python/branches/io-c/Lib/distutils/tests/support.py Sat Feb 14 21:58:31 2009 @@ -1,5 +1,5 @@ """Support code for distutils test cases.""" - +import os import shutil import tempfile @@ -31,7 +31,7 @@ super().tearDown() while self.tempdirs: d = self.tempdirs.pop() - shutil.rmtree(d) + shutil.rmtree(d, os.name in ('nt', 'cygwin')) def mkdtemp(self): """Create a temporary directory that will be cleaned up. Modified: python/branches/io-c/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/io-c/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/io-c/Lib/distutils/tests/test_build_ext.py Sat Feb 14 21:58:31 2009 @@ -7,6 +7,7 @@ from distutils.core import Extension, Distribution from distutils.command.build_ext import build_ext from distutils import sysconfig +from distutils.tests.support import TempdirManager import unittest from test import support @@ -19,11 +20,12 @@ srcdir = sysconfig.get_config_var('srcdir') return os.path.join(srcdir, 'Modules', 'xxmodule.c') -class BuildExtTestCase(unittest.TestCase): +class BuildExtTestCase(TempdirManager, unittest.TestCase): def setUp(self): # Create a simple test environment # Note that we're making changes to sys.path - self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_") + TempdirManager.setUp(self) + self.tmp_dir = self.mkdtemp() self.sys_path = sys.path[:] sys.path.append(self.tmp_dir) shutil.copy(_get_source_filename(), self.tmp_dir) @@ -74,8 +76,7 @@ # Get everything back to normal support.unload('xx') 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') + TempdirManager.tearDown(self) def test_solaris_enable_shared(self): dist = Distribution({'name': 'xx'}) Modified: python/branches/io-c/Lib/distutils/tests/test_build_scripts.py ============================================================================== --- python/branches/io-c/Lib/distutils/tests/test_build_scripts.py (original) +++ python/branches/io-c/Lib/distutils/tests/test_build_scripts.py Sat Feb 14 21:58:31 2009 @@ -5,6 +5,7 @@ from distutils.command.build_scripts import build_scripts from distutils.core import Distribution +from distutils import sysconfig from distutils.tests import support @@ -73,6 +74,33 @@ f.write(text) f.close() + def test_version_int(self): + source = self.mkdtemp() + target = self.mkdtemp() + expected = self.write_sample_scripts(source) + + + cmd = self.get_build_scripts_cmd(target, + [os.path.join(source, fn) + for fn in expected]) + cmd.finalize_options() + + # http://bugs.python.org/issue4524 + # + # On linux-g++-32 with command line `./configure --enable-ipv6 + # --with-suffix=3`, python is compiled okay but the build scripts + # failed when writing the name of the executable + old = sysconfig._config_vars.get('VERSION') + sysconfig._config_vars['VERSION'] = 4 + try: + cmd.run() + finally: + if old is not None: + sysconfig._config_vars['VERSION'] = old + + built = os.listdir(target) + for name in expected: + self.assert_(name in built) def test_suite(): return unittest.makeSuite(BuildScriptsTestCase) Modified: python/branches/io-c/Lib/distutils/tests/test_config.py ============================================================================== --- python/branches/io-c/Lib/distutils/tests/test_config.py (original) +++ python/branches/io-c/Lib/distutils/tests/test_config.py Sat Feb 14 21:58:31 2009 @@ -2,6 +2,7 @@ import sys import os import unittest +import tempfile from distutils.core import PyPIRCCommand from distutils.core import Distribution @@ -49,13 +50,15 @@ def setUp(self): """Patches the environment.""" + support.TempdirManager.setUp(self) + if 'HOME' in os.environ: self._old_home = os.environ['HOME'] else: self._old_home = None - curdir = os.path.dirname(__file__) - os.environ['HOME'] = curdir - self.rc = os.path.join(curdir, '.pypirc') + self.tmp_dir = self.mkdtemp() + os.environ['HOME'] = self.tmp_dir + self.rc = os.path.join(self.tmp_dir, '.pypirc') self.dist = Distribution() class command(PyPIRCCommand): @@ -74,9 +77,8 @@ del os.environ['HOME'] else: os.environ['HOME'] = self._old_home - if os.path.exists(self.rc): - os.remove(self.rc) set_threshold(self.old_threshold) + support.TempdirManager.tearDown(self) def test_server_registration(self): # This test makes sure PyPIRCCommand knows how to: Modified: python/branches/io-c/Lib/distutils/tests/test_dir_util.py ============================================================================== --- python/branches/io-c/Lib/distutils/tests/test_dir_util.py (original) +++ python/branches/io-c/Lib/distutils/tests/test_dir_util.py Sat Feb 14 21:58:31 2009 @@ -9,8 +9,9 @@ from distutils.dir_util import copy_tree from distutils import log +from distutils.tests import support -class DirUtilTestCase(unittest.TestCase): +class DirUtilTestCase(support.TempdirManager, unittest.TestCase): def _log(self, msg, *args): if len(args) > 0: @@ -19,18 +20,18 @@ self._logs.append(msg) def setUp(self): + support.TempdirManager.setUp(self) self._logs = [] - self.root_target = os.path.join(os.path.dirname(__file__), 'deep') + tmp_dir = self.mkdtemp() + self.root_target = os.path.join(tmp_dir, 'deep') self.target = os.path.join(self.root_target, 'here') - self.target2 = os.path.join(os.path.dirname(__file__), 'deep2') + self.target2 = os.path.join(tmp_dir, 'deep2') self.old_log = log.info log.info = self._log def tearDown(self): - for target in (self.target, self.target2): - if os.path.exists(target): - shutil.rmtree(target) log.info = self.old_log + support.TempdirManager.tearDown(self) def test_mkpath_remove_tree_verbosity(self): Modified: python/branches/io-c/Lib/distutils/tests/test_dist.py ============================================================================== --- python/branches/io-c/Lib/distutils/tests/test_dist.py (original) +++ python/branches/io-c/Lib/distutils/tests/test_dist.py Sat Feb 14 21:58:31 2009 @@ -9,6 +9,7 @@ import warnings from test.support import TESTFN +from distutils.tests import support class test_dist(distutils.cmd.Command): @@ -120,7 +121,7 @@ self.assertEquals(len(warns), 0) -class MetadataTestCase(unittest.TestCase): +class MetadataTestCase(support.TempdirManager, unittest.TestCase): def test_simple_metadata(self): attrs = {"name": "package", @@ -219,8 +220,8 @@ else: user_filename = "pydistutils.cfg" - curdir = os.path.dirname(__file__) - user_filename = os.path.join(curdir, user_filename) + temp_dir = self.mkdtemp() + user_filename = os.path.join(temp_dir, user_filename) f = open(user_filename, 'w') f.write('.') f.close() @@ -230,14 +231,14 @@ # linux-style if sys.platform in ('linux', 'darwin'): - os.environ['HOME'] = curdir + os.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'] = curdir + os.environ['HOME'] = temp_dir files = dist.find_config_files() self.assert_(user_filename in files, '%r not found in %r' % (user_filename, files)) Modified: python/branches/io-c/Lib/distutils/tests/test_file_util.py ============================================================================== --- python/branches/io-c/Lib/distutils/tests/test_file_util.py (original) +++ python/branches/io-c/Lib/distutils/tests/test_file_util.py Sat Feb 14 21:58:31 2009 @@ -5,8 +5,9 @@ from distutils.file_util import move_file from distutils import log +from distutils.tests import support -class FileUtilTestCase(unittest.TestCase): +class FileUtilTestCase(support.TempdirManager, unittest.TestCase): def _log(self, msg, *args): if len(args) > 0: @@ -15,24 +16,20 @@ self._logs.append(msg) def setUp(self): + support.TempdirManager.setUp(self) self._logs = [] self.old_log = log.info log.info = self._log - self.source = os.path.join(os.path.dirname(__file__), 'f1') - self.target = os.path.join(os.path.dirname(__file__), 'f2') - self.target_dir = os.path.join(os.path.dirname(__file__), 'd1') + tmp_dir = self.mkdtemp() + self.source = os.path.join(tmp_dir, 'f1') + self.target = os.path.join(tmp_dir, 'f2') + self.target_dir = os.path.join(tmp_dir, 'd1') def tearDown(self): log.info = self.old_log - for f in (self.source, self.target, self.target_dir): - if os.path.exists(f): - if os.path.isfile(f): - os.remove(f) - else: - shutil.rmtree(f) + support.TempdirManager.tearDown(self) def test_move_file_verbosity(self): - f = open(self.source, 'w') f.write('some content') f.close() Modified: python/branches/io-c/Lib/distutils/tests/test_sdist.py ============================================================================== --- python/branches/io-c/Lib/distutils/tests/test_sdist.py (original) +++ python/branches/io-c/Lib/distutils/tests/test_sdist.py Sat Feb 14 21:58:31 2009 @@ -5,6 +5,7 @@ import zipfile from os.path import join import sys +import tempfile from distutils.command.sdist import sdist from distutils.core import Distribution @@ -12,9 +13,6 @@ from distutils.errors import DistutilsExecError from distutils.spawn import find_executable -CURDIR = os.path.dirname(__file__) -TEMP_PKG = join(CURDIR, 'temppkg') - SETUP_PY = """ from distutils.core import setup import somecode @@ -29,28 +27,25 @@ class sdistTestCase(PyPIRCCommandTestCase): def setUp(self): + # PyPIRCCommandTestCase creates a temp dir already + # and put it in self.tmp_dir PyPIRCCommandTestCase.setUp(self) + # setting up an environment self.old_path = os.getcwd() + os.mkdir(join(self.tmp_dir, 'somecode')) + os.mkdir(join(self.tmp_dir, 'dist')) + # creating a MANIFEST, a package, and a README + self._write(join(self.tmp_dir, 'MANIFEST.in'), MANIFEST_IN) + self._write(join(self.tmp_dir, 'README'), 'xxx') + self._write(join(self.tmp_dir, 'somecode', '__init__.py'), '#') + self._write(join(self.tmp_dir, 'setup.py'), SETUP_PY) + os.chdir(self.tmp_dir) def tearDown(self): + # back to normal os.chdir(self.old_path) - if os.path.exists(TEMP_PKG): - shutil.rmtree(TEMP_PKG) PyPIRCCommandTestCase.tearDown(self) - def _init_tmp_pkg(self): - if os.path.exists(TEMP_PKG): - shutil.rmtree(TEMP_PKG) - os.mkdir(TEMP_PKG) - os.mkdir(join(TEMP_PKG, 'somecode')) - os.mkdir(join(TEMP_PKG, 'dist')) - # creating a MANIFEST, a package, and a README - self._write(join(TEMP_PKG, 'MANIFEST.in'), MANIFEST_IN) - self._write(join(TEMP_PKG, 'README'), 'xxx') - self._write(join(TEMP_PKG, 'somecode', '__init__.py'), '#') - self._write(join(TEMP_PKG, 'setup.py'), SETUP_PY) - os.chdir(TEMP_PKG) - def _write(self, path, content): f = open(path, 'w') try: @@ -62,18 +57,17 @@ # this test creates a package with some vcs dirs in it # and launch sdist to make sure they get pruned # on all systems - self._init_tmp_pkg() # creating VCS directories with some files in them - os.mkdir(join(TEMP_PKG, 'somecode', '.svn')) - self._write(join(TEMP_PKG, 'somecode', '.svn', 'ok.py'), 'xxx') + os.mkdir(join(self.tmp_dir, 'somecode', '.svn')) + self._write(join(self.tmp_dir, 'somecode', '.svn', 'ok.py'), 'xxx') - os.mkdir(join(TEMP_PKG, 'somecode', '.hg')) - self._write(join(TEMP_PKG, 'somecode', '.hg', + os.mkdir(join(self.tmp_dir, 'somecode', '.hg')) + self._write(join(self.tmp_dir, 'somecode', '.hg', 'ok'), 'xxx') - os.mkdir(join(TEMP_PKG, 'somecode', '.git')) - self._write(join(TEMP_PKG, 'somecode', '.git', + os.mkdir(join(self.tmp_dir, 'somecode', '.git')) + self._write(join(self.tmp_dir, 'somecode', '.git', 'ok'), 'xxx') # now building a sdist @@ -96,7 +90,7 @@ cmd.run() # now let's check what we have - dist_folder = join(TEMP_PKG, 'dist') + dist_folder = join(self.tmp_dir, 'dist') files = os.listdir(dist_folder) self.assertEquals(files, ['fake-1.0.zip']) @@ -116,8 +110,6 @@ find_executable('gzip') is None): return - self._init_tmp_pkg() - # now building a sdist dist = Distribution() dist.script_name = 'setup.py' @@ -137,7 +129,7 @@ cmd.run() # making sure we have two files - dist_folder = join(TEMP_PKG, 'dist') + dist_folder = join(self.tmp_dir, 'dist') result = os.listdir(dist_folder) result.sort() self.assertEquals(result, Modified: python/branches/io-c/Lib/distutils/tests/test_sysconfig.py ============================================================================== --- python/branches/io-c/Lib/distutils/tests/test_sysconfig.py (original) +++ python/branches/io-c/Lib/distutils/tests/test_sysconfig.py Sat Feb 14 21:58:31 2009 @@ -26,6 +26,8 @@ # XXX doesn't work on Linux when Python was never installed before #self.assert_(os.path.isdir(lib_dir), lib_dir) # test for pythonxx.lib? + self.assertNotEqual(sysconfig.get_python_lib(), + sysconfig.get_python_lib(prefix=TESTFN)) def test_get_python_inc(self): inc_dir = sysconfig.get_python_inc() Modified: python/branches/io-c/Lib/http/client.py ============================================================================== --- python/branches/io-c/Lib/http/client.py (original) +++ python/branches/io-c/Lib/http/client.py Sat Feb 14 21:58:31 2009 @@ -249,7 +249,7 @@ return email.parser.Parser(_class=HTTPMessage).parsestr(hstring) -class HTTPResponse: +class HTTPResponse(io.RawIOBase): # strict: If true, raise BadStatusLine if the status line can't be # parsed as a valid HTTP/1.0 or 1.1 status line. By default it is @@ -471,8 +471,6 @@ # called, meaning self.isclosed() is meaningful. return self.fp is None - # XXX It would be nice to have readline and __iter__ for this, too. - def read(self, amt=None): if self.fp is None: return b"" @@ -585,6 +583,9 @@ amt -= len(chunk) return b"".join(s) + def fileno(self): + return self.fp.fileno() + def getheader(self, name, default=None): if self.msg is None: raise ResponseNotReady() @@ -596,6 +597,11 @@ raise ResponseNotReady() return list(self.msg.items()) + # We override IOBase.__iter__ so that it doesn't check for closed-ness + + def __iter__(self): + return self + class HTTPConnection: Modified: python/branches/io-c/Lib/idlelib/Bindings.py ============================================================================== --- python/branches/io-c/Lib/idlelib/Bindings.py (original) +++ python/branches/io-c/Lib/idlelib/Bindings.py Sat Feb 14 21:58:31 2009 @@ -10,6 +10,7 @@ """ import sys from idlelib.configHandler import idleConf +from idlelib import macosxSupport menudefs = [ # underscore prefixes character to underscore @@ -80,7 +81,7 @@ ]), ] -if sys.platform == 'darwin' and '.app' in sys.executable: +if macosxSupport.runningAsOSXApp(): # Running as a proper MacOS application bundle. This block restructures # the menus a little to make them conform better to the HIG. Modified: python/branches/io-c/Lib/idlelib/EditorWindow.py ============================================================================== --- python/branches/io-c/Lib/idlelib/EditorWindow.py (original) +++ python/branches/io-c/Lib/idlelib/EditorWindow.py Sat Feb 14 21:58:31 2009 @@ -363,7 +363,7 @@ underline, label = prepstr(label) menudict[name] = menu = Menu(mbar, name=name) mbar.add_cascade(label=label, menu=menu, underline=underline) - if sys.platform == 'darwin' and '.framework' in sys.executable: + if macosxSupport.runningAsOSXApp(): # Insert the application menu menudict['application'] = menu = Menu(mbar, name='apple') mbar.add_cascade(label='IDLE', menu=menu) Modified: python/branches/io-c/Lib/idlelib/MultiCall.py ============================================================================== --- python/branches/io-c/Lib/idlelib/MultiCall.py (original) +++ python/branches/io-c/Lib/idlelib/MultiCall.py Sat Feb 14 21:58:31 2009 @@ -32,6 +32,7 @@ import sys import re import tkinter +from idlelib import macosxSupport # the event type constants, which define the meaning of mc_type MC_KEYPRESS=0; MC_KEYRELEASE=1; MC_BUTTONPRESS=2; MC_BUTTONRELEASE=3; @@ -44,7 +45,7 @@ MC_OPTION = 1<<6; MC_COMMAND = 1<<7 # define the list of modifiers, to be used in complex event types. -if sys.platform == "darwin" and sys.executable.count(".app"): +if macosxSupport.runningAsOSXApp(): _modifiers = (("Shift",), ("Control",), ("Option",), ("Command",)) _modifier_masks = (MC_SHIFT, MC_CONTROL, MC_OPTION, MC_COMMAND) else: Modified: python/branches/io-c/Lib/idlelib/configDialog.py ============================================================================== --- python/branches/io-c/Lib/idlelib/configDialog.py (original) +++ python/branches/io-c/Lib/idlelib/configDialog.py Sat Feb 14 21:58:31 2009 @@ -21,6 +21,7 @@ from idlelib.keybindingDialog import GetKeysDialog from idlelib.configSectionNameDialog import GetCfgSectionNameDialog from idlelib.configHelpSourceEdit import GetHelpSourceDialog +from idlelib import macosxSupport class ConfigDialog(Toplevel): @@ -71,18 +72,27 @@ page_names=['Fonts/Tabs','Highlighting','Keys','General']) frameActionButtons = Frame(self,pady=2) #action buttons + + if macosxSupport.runningAsOSXApp(): + # Surpress the padx and pady arguments when + # running as IDLE.app, otherwise the text + # on these buttons will not be readable. + extraKwds={} + else: + extraKwds=dict(padx=6, pady=3) + self.buttonHelp = Button(frameActionButtons,text='Help', command=self.Help,takefocus=FALSE, - padx=6,pady=3) + **extraKwds) self.buttonOk = Button(frameActionButtons,text='Ok', command=self.Ok,takefocus=FALSE, - padx=6,pady=3) + **extraKwds) self.buttonApply = Button(frameActionButtons,text='Apply', command=self.Apply,takefocus=FALSE, - padx=6,pady=3) + **extraKwds) self.buttonCancel = Button(frameActionButtons,text='Cancel', command=self.Cancel,takefocus=FALSE, - padx=6,pady=3) + **extraKwds) self.CreatePageFontTab() self.CreatePageHighlight() self.CreatePageKeys() Modified: python/branches/io-c/Lib/idlelib/keybindingDialog.py ============================================================================== --- python/branches/io-c/Lib/idlelib/keybindingDialog.py (original) +++ python/branches/io-c/Lib/idlelib/keybindingDialog.py Sat Feb 14 21:58:31 2009 @@ -4,6 +4,7 @@ from tkinter import * import tkinter.messagebox as tkMessageBox import string +from idlelib import macosxSupport class GetKeysDialog(Toplevel): def __init__(self,parent,title,action,currentKeySequences): @@ -133,7 +134,7 @@ config-keys.def must use the same ordering. """ import sys - if sys.platform == 'darwin' and sys.argv[0].count('.app'): + if macosxSupport.runningAsOSXApp(): self.modifiers = ['Shift', 'Control', 'Option', 'Command'] else: self.modifiers = ['Control', 'Alt', 'Shift'] Modified: python/branches/io-c/Lib/idlelib/macosxSupport.py ============================================================================== --- python/branches/io-c/Lib/idlelib/macosxSupport.py (original) +++ python/branches/io-c/Lib/idlelib/macosxSupport.py Sat Feb 14 21:58:31 2009 @@ -6,8 +6,12 @@ import tkinter def runningAsOSXApp(): - """ Returns True iff running from the IDLE.app bundle on OSX """ - return (sys.platform == 'darwin' and 'IDLE.app' in sys.argv[0]) + """ + Returns True if Python is running from within an app on OSX. + If so, assume that Python was built with Aqua Tcl/Tk rather than + X11 Tck/Tk. + """ + return (sys.platform == 'darwin' and '.app' in sys.executable) def addOpenEventSupport(root, flist): """ Modified: python/branches/io-c/Lib/importlib/NOTES ============================================================================== --- python/branches/io-c/Lib/importlib/NOTES (original) +++ python/branches/io-c/Lib/importlib/NOTES Sat Feb 14 21:58:31 2009 @@ -1,6 +1,10 @@ to do ///// +* Refactor source/bytecode finder/loader code such that bytecode support is a + subclass of source support (makes it nicer for VMs that don't use CPython + bytecode). + * Implement PEP 302 protocol for loaders (should just be a matter of testing). + Built-in. Modified: python/branches/io-c/Lib/io.py ============================================================================== --- python/branches/io-c/Lib/io.py (original) +++ python/branches/io-c/Lib/io.py Sat Feb 14 21:58:31 2009 @@ -493,7 +493,6 @@ terminator(s) recognized. """ # For backwards compatibility, a (slowish) readline(). - self._checkClosed() if hasattr(self, "peek"): def nreadahead(): readahead = self.peek(1) Modified: python/branches/io-c/Lib/logging/__init__.py ============================================================================== --- python/branches/io-c/Lib/logging/__init__.py (original) +++ python/branches/io-c/Lib/logging/__init__.py Sat Feb 14 21:58:31 2009 @@ -758,17 +758,19 @@ """ try: msg = self.format(record) + stream = self.stream fs = "%s\n" if not _unicode: #if no unicode support... - self.stream.write(fs % msg) + stream.write(fs % msg) else: try: - if getattr(self.stream, 'encoding', None) is not None: - self.stream.write(fs % msg.encode(self.stream.encoding)) + if (isinstance(msg, unicode) or + getattr(stream, 'encoding', None) is None): + stream.write(fs % msg) else: - self.stream.write(fs % msg) + stream.write(fs % msg.encode(stream.encoding)) except UnicodeError: - self.stream.write(fs % msg.encode("UTF-8")) + stream.write(fs % msg.encode("UTF-8")) self.flush() except (KeyboardInterrupt, SystemExit): raise Modified: python/branches/io-c/Lib/numbers.py ============================================================================== --- python/branches/io-c/Lib/numbers.py (original) +++ python/branches/io-c/Lib/numbers.py Sat Feb 14 21:58:31 2009 @@ -15,6 +15,8 @@ If you just want to check if an argument x is a number, without caring what kind, use isinstance(x, Number). """ + __slots__ = () + # Concrete numeric types must provide their own hash implementation __hash__ = None @@ -38,6 +40,8 @@ type as described below. """ + __slots__ = () + @abstractmethod def __complex__(self): """Return a builtin complex instance. Called for complex(self).""" @@ -152,6 +156,8 @@ Real also provides defaults for the derived operations. """ + __slots__ = () + @abstractmethod def __float__(self): """Any Real can be converted to a native float object. @@ -264,6 +270,8 @@ class Rational(Real): """.numerator and .denominator should be in lowest terms.""" + __slots__ = () + @abstractproperty def numerator(self): raise NotImplementedError @@ -287,6 +295,8 @@ class Integral(Rational): """Integral adds a conversion to int and the bit-string operations.""" + __slots__ = () + @abstractmethod def __int__(self): """int(self)""" Modified: python/branches/io-c/Lib/test/regrtest.py ============================================================================== --- python/branches/io-c/Lib/test/regrtest.py (original) +++ python/branches/io-c/Lib/test/regrtest.py Sat Feb 14 21:58:31 2009 @@ -1075,6 +1075,7 @@ test_pty test_socketserver test_tcl + test_tk test_ttk_guionly test_ttk_textonly test_timeout @@ -1092,6 +1093,7 @@ test_kqueue test_ossaudiodev test_tcl + test_tk test_ttk_guionly test_ttk_textonly test_zipimport @@ -1109,6 +1111,7 @@ test_ossaudiodev test_pep277 test_tcl + test_tk test_ttk_guionly test_ttk_textonly test_multiprocessing @@ -1125,6 +1128,7 @@ test_ossaudiodev test_pep277 test_tcl + test_tk test_ttk_guionly test_ttk_textonly test_multiprocessing Modified: python/branches/io-c/Lib/test/test_builtin.py ============================================================================== --- python/branches/io-c/Lib/test/test_builtin.py (original) +++ python/branches/io-c/Lib/test/test_builtin.py Sat Feb 14 21:58:31 2009 @@ -611,6 +611,18 @@ def __len__(self): raise ValueError self.assertRaises(ValueError, len, BadSeq()) + class InvalidLen: + def __len__(self): + return None + self.assertRaises(TypeError, len, InvalidLen()) + class FloatLen: + def __len__(self): + return 4.5 + self.assertRaises(TypeError, len, FloatLen()) + class HugeLen: + def __len__(self): + return sys.maxsize + 1 + self.assertRaises(OverflowError, len, HugeLen()) def test_map(self): self.assertEqual( Modified: python/branches/io-c/Lib/test/test_collections.py ============================================================================== --- python/branches/io-c/Lib/test/test_collections.py (original) +++ python/branches/io-c/Lib/test/test_collections.py Sat Feb 14 21:58:31 2009 @@ -47,6 +47,17 @@ self.assertRaises(TypeError, Point._make, [11]) # catch too few args self.assertRaises(TypeError, Point._make, [11, 22, 33]) # catch too many args + def test_name_fixer(self): + for spec, renamed in [ + [('efg', 'g%hi'), ('efg', '_2')], # field with non-alpha char + [('abc', 'class'), ('abc', '_2')], # field has keyword + [('8efg', '9ghi'), ('_1', '_2')], # field starts with digit + [('abc', '_efg'), ('abc', '_2')], # field with leading underscore + [('abc', 'efg', 'efg', 'ghi'), ('abc', 'efg', '_3', 'ghi')], # duplicate field + [('abc', '', 'x'), ('abc', '_2', 'x')], # fieldname is a space + ]: + self.assertEqual(namedtuple('NT', spec, rename=True)._fields, renamed) + def test_instance(self): Point = namedtuple('Point', 'x y') p = Point(11, 22) Modified: python/branches/io-c/Lib/test/test_fractions.py ============================================================================== --- python/branches/io-c/Lib/test/test_fractions.py (original) +++ python/branches/io-c/Lib/test/test_fractions.py Sat Feb 14 21:58:31 2009 @@ -407,6 +407,11 @@ self.assertEqual(id(r), id(copy(r))) self.assertEqual(id(r), id(deepcopy(r))) + def test_slots(self): + # Issue 4998 + r = F(13, 7) + self.assertRaises(AttributeError, setattr, r, 'a', 10) + def test_main(): run_unittest(FractionTest, GcdTest) Modified: python/branches/io-c/Lib/test/test_hashlib.py ============================================================================== --- python/branches/io-c/Lib/test/test_hashlib.py (original) +++ python/branches/io-c/Lib/test/test_hashlib.py Sat Feb 14 21:58:31 2009 @@ -63,6 +63,18 @@ computed = hashlib.new(name, data).hexdigest() self.assertEqual(computed, digest) + def check_no_unicode(self, algorithm_name): + # Unicode objects are not allowed as input. + self.assertRaises(TypeError, getattr(hashlib, algorithm_name), 'spam') + self.assertRaises(TypeError, hashlib.new, algorithm_name, 'spam') + + def test_no_unicode(self): + self.check_no_unicode('md5') + self.check_no_unicode('sha1') + self.check_no_unicode('sha224') + self.check_no_unicode('sha256') + self.check_no_unicode('sha384') + self.check_no_unicode('sha512') def test_case_md5_0(self): self.check('md5', b'', 'd41d8cd98f00b204e9800998ecf8427e') Modified: python/branches/io-c/Lib/test/test_httplib.py ============================================================================== --- python/branches/io-c/Lib/test/test_httplib.py (original) +++ python/branches/io-c/Lib/test/test_httplib.py Sat Feb 14 21:58:31 2009 @@ -42,7 +42,6 @@ raise AssertionError('caller tried to read past EOF') return data - class HeaderTests(TestCase): def test_auto_headers(self): # Some headers are added automatically, but should not be added by @@ -245,7 +244,6 @@ self.assertEqual(httpConn.sock.gettimeout(), 30) httpConn.close() - class HTTPSTimeoutTest(TestCase): # XXX Here should be tests for HTTPS, there isn't any right now! @@ -257,7 +255,7 @@ def test_main(verbose=None): support.run_unittest(HeaderTests, OfflineTest, BasicTest, TimeoutTest, - HTTPSTimeoutTest) + HTTPSTimeoutTest) if __name__ == '__main__': test_main() Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Sat Feb 14 21:58:31 2009 @@ -1889,6 +1889,7 @@ self.assertRaises(ValueError, f.fileno) self.assertRaises(ValueError, f.isatty) self.assertRaises(ValueError, f.__iter__) + self.assertRaises(ValueError, next, f) if hasattr(f, "peek"): self.assertRaises(ValueError, f.peek, 1) self.assertRaises(ValueError, f.read) Modified: python/branches/io-c/Lib/test/test_itertools.py ============================================================================== --- python/branches/io-c/Lib/test/test_itertools.py (original) +++ python/branches/io-c/Lib/test/test_itertools.py Sat Feb 14 21:58:31 2009 @@ -2,6 +2,8 @@ from test import support from itertools import * from weakref import proxy +from decimal import Decimal +from fractions import Fraction import sys import operator import random @@ -328,7 +330,7 @@ self.assertEqual(take(2, lzip('abc',count(3))), [('a', 3), ('b', 4)]) self.assertEqual(take(2, zip('abc',count(-1))), [('a', -1), ('b', 0)]) self.assertEqual(take(2, zip('abc',count(-3))), [('a', -3), ('b', -2)]) - self.assertRaises(TypeError, count, 2, 3) + self.assertRaises(TypeError, count, 2, 3, 4) self.assertRaises(TypeError, count, 'a') self.assertEqual(list(islice(count(maxsize-5), 10)), list(range(maxsize-5, maxsize+5))) @@ -341,6 +343,7 @@ c = count(-9) self.assertEqual(repr(c), 'count(-9)') next(c) + self.assertEqual(repr(count(10.25)), 'count(10.25)') self.assertEqual(next(c), -8) for i in (-sys.maxsize-5, -sys.maxsize+5 ,-10, -1, 0, 10, sys.maxsize-5, sys.maxsize+5): # Test repr (ignoring the L in longs) @@ -348,6 +351,45 @@ r2 = 'count(%r)'.__mod__(i).replace('L', '') self.assertEqual(r1, r2) + def test_count_with_stride(self): + self.assertEqual(lzip('abc',count(2,3)), [('a', 2), ('b', 5), ('c', 8)]) + self.assertEqual(lzip('abc',count(2,0)), [('a', 2), ('b', 2), ('c', 2)]) + self.assertEqual(lzip('abc',count(2,1)), [('a', 2), ('b', 3), ('c', 4)]) + self.assertEqual(lzip('abc',count(2,3)), [('a', 2), ('b', 5), ('c', 8)]) + self.assertEqual(take(20, count(maxsize-15, 3)), take(20, range(maxsize-15, maxsize+100, 3))) + self.assertEqual(take(20, count(-maxsize-15, 3)), take(20, range(-maxsize-15,-maxsize+100, 3))) + self.assertEqual(take(3, count(2, 3.25-4j)), [2, 5.25-4j, 8.5-8j]) + self.assertEqual(take(3, count(Decimal('1.1'), Decimal('.1'))), + [Decimal('1.1'), Decimal('1.2'), Decimal('1.3')]) + self.assertEqual(take(3, count(Fraction(2,3), Fraction(1,7))), + [Fraction(2,3), Fraction(17,21), Fraction(20,21)]) + self.assertEqual(repr(take(3, count(10, 2.5))), repr([10, 12.5, 15.0])) + c = count(3, 5) + self.assertEqual(repr(c), 'count(3, 5)') + next(c) + self.assertEqual(repr(c), 'count(8, 5)') + c = count(-9, 0) + self.assertEqual(repr(c), 'count(-9, 0)') + next(c) + self.assertEqual(repr(c), 'count(-9, 0)') + c = count(-9, -3) + self.assertEqual(repr(c), 'count(-9, -3)') + next(c) + self.assertEqual(repr(c), 'count(-12, -3)') + self.assertEqual(repr(c), 'count(-12, -3)') + self.assertEqual(repr(count(10.5, 1.25)), 'count(10.5, 1.25)') + self.assertEqual(repr(count(10.5, 1)), 'count(10.5)') # suppress step=1 when it's an int + self.assertEqual(repr(count(10.5, 1.00)), 'count(10.5, 1.0)') # do show float values lilke 1.0 + for i in (-sys.maxsize-5, -sys.maxsize+5 ,-10, -1, 0, 10, sys.maxsize-5, sys.maxsize+5): + for j in (-sys.maxsize-5, -sys.maxsize+5 ,-10, -1, 0, 1, 10, sys.maxsize-5, sys.maxsize+5): + # Test repr (ignoring the L in longs) + r1 = repr(count(i, j)).replace('L', '') + if j == 1: + r2 = ('count(%r)' % i).replace('L', '') + else: + r2 = ('count(%r, %r)' % (i, j)).replace('L', '') + self.assertEqual(r1, r2) + def test_cycle(self): self.assertEqual(take(10, cycle('abc')), list('abcabcabca')) self.assertEqual(list(cycle('')), []) Modified: python/branches/io-c/Lib/test/test_logging.py ============================================================================== --- python/branches/io-c/Lib/test/test_logging.py (original) +++ python/branches/io-c/Lib/test/test_logging.py Sat Feb 14 21:58:31 2009 @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2001-2004 by Vinay Sajip. All Rights Reserved. +# Copyright 2001-2009 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, @@ -18,13 +18,14 @@ """Test harness for the logging module. Run all tests. -Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved. +Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved. """ import logging import logging.handlers import logging.config +import codecs import copy import pickle import io @@ -860,6 +861,7 @@ ('foo', 'DEBUG', '3'), ]) + class EncodingTest(BaseTest): def test_encoding_plain_file(self): # In Python 2.x, a plain file object is treated as having no encoding. @@ -886,6 +888,27 @@ if os.path.isfile(fn): os.remove(fn) + def test_encoding_cyrillic_unicode(self): + log = logging.getLogger("test") + #Get a message in Unicode: Do svidanya in Cyrillic (meaning goodbye) + message = '\u0434\u043e \u0441\u0432\u0438\u0434\u0430\u043d\u0438\u044f' + #Ensure it's written in a Cyrillic encoding + writer_class = codecs.getwriter('cp1251') + stream = io.BytesIO() + writer = writer_class(stream, 'strict') + handler = logging.StreamHandler(writer) + log.addHandler(handler) + try: + log.warning(message) + finally: + log.removeHandler(handler) + handler.close() + # check we wrote exactly those bytes, ignoring trailing \n etc + s = stream.getvalue() + #Compare against what the data should be when encoded in CP-1251 + self.assertEqual(s, b'\xe4\xee \xf1\xe2\xe8\xe4\xe0\xed\xe8\xff\n') + + class WarningsTest(BaseTest): def test_warnings(self): logging.captureWarnings(True) Modified: python/branches/io-c/Lib/test/test_os.py ============================================================================== --- python/branches/io-c/Lib/test/test_os.py (original) +++ python/branches/io-c/Lib/test/test_os.py Sat Feb 14 21:58:31 2009 @@ -576,16 +576,18 @@ self.assertRaises(WindowsError, os.chdir, support.TESTFN) def test_mkdir(self): - self.assertRaises(WindowsError, os.chdir, support.TESTFN) + f = open(test_support.TESTFN, "w") + try: + self.assertRaises(WindowsError, os.mkdir, support.TESTFN) + finally: + f.close() + os.unlink(test_support.TESTFN) def test_utime(self): self.assertRaises(WindowsError, os.utime, support.TESTFN, None) - def test_access(self): - self.assertRaises(WindowsError, os.utime, support.TESTFN, 0) - def test_chmod(self): - self.assertRaises(WindowsError, os.utime, support.TESTFN, 0) + self.assertRaises(WindowsError, os.chmod, support.TESTFN, 0) class TestInvalidFD(unittest.TestCase): singles = ["fchdir", "dup", "fdopen", "fdatasync", "fstat", Modified: python/branches/io-c/Lib/test/test_pep263.py ============================================================================== Binary files. No diff available. Modified: python/branches/io-c/Lib/test/test_socket.py ============================================================================== --- python/branches/io-c/Lib/test/test_socket.py (original) +++ python/branches/io-c/Lib/test/test_socket.py Sat Feb 14 21:58:31 2009 @@ -398,6 +398,14 @@ # Check that setting it to an invalid type raises TypeError self.assertRaises(TypeError, socket.setdefaulttimeout, "spam") + def testIPv4_inet_aton_fourbytes(self): + if not hasattr(socket, 'inet_aton'): + return # No inet_aton, nothing to check + # Test that issue1008086 and issue767150 are fixed. + # It must return 4 bytes. + self.assertEquals(b'\x00'*4, socket.inet_aton('0.0.0.0')) + self.assertEquals(b'\xff'*4, socket.inet_aton('255.255.255.255')) + def testIPv4toString(self): if not hasattr(socket, 'inet_pton'): return # No inet_pton() on this platform Modified: python/branches/io-c/Lib/test/test_struct.py ============================================================================== --- python/branches/io-c/Lib/test/test_struct.py (original) +++ python/branches/io-c/Lib/test/test_struct.py Sat Feb 14 21:58:31 2009 @@ -48,7 +48,7 @@ def deprecated_err(func, *args): try: func(*args) - except (struct.error, TypeError): + except (struct.error, OverflowError): pass except DeprecationWarning: if not PY_STRUCT_OVERFLOW_MASKING: @@ -191,7 +191,7 @@ def test_native_qQ(self): # can't pack -1 as unsigned regardless - self.assertRaises((struct.error, TypeError), struct.pack, "Q", -1) + self.assertRaises((struct.error, OverflowError), struct.pack, "Q", -1) # can't pack string as 'q' regardless self.assertRaises(struct.error, struct.pack, "q", "a") # ditto, but 'Q' @@ -524,6 +524,10 @@ self.assertRaises(struct.error, s.pack_into, small_buf, 0, test_string) self.assertRaises(struct.error, s.pack_into, small_buf, 2, test_string) + # Test bogus offset (issue 3694) + sb = small_buf + self.assertRaises(TypeError, struct.pack_into, b'1', sb, None) + def test_pack_into_fn(self): test_string = b'Reykjavik rocks, eow!' writable_buf = array.array('b', b' '*100) Modified: python/branches/io-c/Lib/test/test_urllib2_localnet.py ============================================================================== --- python/branches/io-c/Lib/test/test_urllib2_localnet.py (original) +++ python/branches/io-c/Lib/test/test_urllib2_localnet.py Sat Feb 14 21:58:31 2009 @@ -310,7 +310,7 @@ self.send_response(response_code) for (header, value) in headers: - self.send_header(header, value % self.port) + self.send_header(header, value % {'port':self.port}) if body: self.send_header("Content-type", "text/plain") self.end_headers() @@ -341,10 +341,17 @@ self.server.stop() def urlopen(self, url, data=None): + l = [] f = urllib.request.urlopen(url, data) - result = f.read() - f.close() - return result + try: + # Exercise various methods + l.extend(f.readlines(200)) + l.append(f.readline()) + l.append(f.read(1024)) + l.append(f.read()) + finally: + f.close() + return b"".join(l) def start_server(self, responses=None): if responses is None: @@ -361,7 +368,8 @@ def test_redirection(self): expected_response = b"We got here..." responses = [ - (302, [("Location", "http://localhost:%s/somewhere_else")], ""), + (302, [("Location", "http://localhost:%(port)s/somewhere_else")], + ""), (200, [], expected_response) ] @@ -370,6 +378,20 @@ self.assertEquals(data, expected_response) self.assertEquals(handler.requests, ["/", "/somewhere_else"]) + def test_chunked(self): + expected_response = b"hello world" + chunked_start = ( + b'a\r\n' + b'hello worl\r\n' + b'1\r\n' + b'd\r\n' + b'0\r\n' + ) + response = [(200, [("Transfer-Encoding", "chunked")], chunked_start)] + handler = self.start_server(response) + data = self.urlopen("http://localhost:%s/" % handler.port) + self.assertEquals(data, expected_response) + def test_404(self): expected_response = b"Bad bad bad..." handler = self.start_server([(404, [], expected_response)]) Modified: python/branches/io-c/Lib/test/test_urllib2net.py ============================================================================== --- python/branches/io-c/Lib/test/test_urllib2net.py (original) +++ python/branches/io-c/Lib/test/test_urllib2net.py Sat Feb 14 21:58:31 2009 @@ -195,7 +195,7 @@ def test_http_basic(self): self.assertTrue(socket.getdefaulttimeout() is None) u = _urlopen_with_retry("http://www.python.org") - self.assertTrue(u.fp.raw._sock.gettimeout() is None) + self.assertTrue(u.fp.fp.raw._sock.gettimeout() is None) def test_http_default_timeout(self): self.assertTrue(socket.getdefaulttimeout() is None) @@ -204,7 +204,7 @@ u = _urlopen_with_retry("http://www.python.org") finally: socket.setdefaulttimeout(None) - self.assertEqual(u.fp.raw._sock.gettimeout(), 60) + self.assertEqual(u.fp.fp.raw._sock.gettimeout(), 60) def test_http_no_timeout(self): self.assertTrue(socket.getdefaulttimeout() is None) @@ -213,11 +213,11 @@ u = _urlopen_with_retry("http://www.python.org", timeout=None) finally: socket.setdefaulttimeout(None) - self.assertTrue(u.fp.raw._sock.gettimeout() is None) + self.assertTrue(u.fp.fp.raw._sock.gettimeout() is None) def test_http_timeout(self): u = _urlopen_with_retry("http://www.python.org", timeout=120) - self.assertEqual(u.fp.raw._sock.gettimeout(), 120) + self.assertEqual(u.fp.fp.raw._sock.gettimeout(), 120) FTP_HOST = "ftp://ftp.mirror.nl/pub/mirror/gnu/" Modified: python/branches/io-c/Lib/test/test_xmlrpc.py ============================================================================== --- python/branches/io-c/Lib/test/test_xmlrpc.py (original) +++ python/branches/io-c/Lib/test/test_xmlrpc.py Sat Feb 14 21:58:31 2009 @@ -135,6 +135,14 @@ xmlrpclib.loads(strg)[0][0]) self.assertRaises(TypeError, xmlrpclib.dumps, (arg1,)) + def test_get_host_info(self): + # see bug #3613, this raised a TypeError + transp = xmlrpc.client.Transport() + self.assertEquals(transp.get_host_info("user at host.tld"), + ('host.tld', + [('Authorization', 'Basic dXNlcg==')], {})) + + class HelperTestCase(unittest.TestCase): def test_escape(self): self.assertEqual(xmlrpclib.escape("a&b"), "a&b") Modified: python/branches/io-c/Lib/tkinter/__init__.py ============================================================================== --- python/branches/io-c/Lib/tkinter/__init__.py (original) +++ python/branches/io-c/Lib/tkinter/__init__.py Sat Feb 14 21:58:31 2009 @@ -3016,7 +3016,8 @@ forwards=None, backwards=None, exact=None, regexp=None, nocase=None, count=None, elide=None): """Search PATTERN beginning from INDEX until STOPINDEX. - Return the index of the first character of a match or an empty string.""" + Return the index of the first character of a match or an + empty string.""" args = [self._w, 'search'] if forwards: args.append('-forwards') if backwards: args.append('-backwards') @@ -3025,7 +3026,7 @@ if nocase: args.append('-nocase') if elide: args.append('-elide') if count: args.append('-count'); args.append(count) - if pattern[0] == '-': args.append('--') + if pattern and pattern[0] == '-': args.append('--') args.append(pattern) args.append(index) if stopindex: args.append(stopindex) Modified: python/branches/io-c/Lib/tkinter/ttk.py ============================================================================== --- python/branches/io-c/Lib/tkinter/ttk.py (original) +++ python/branches/io-c/Lib/tkinter/ttk.py Sat Feb 14 21:58:31 2009 @@ -23,7 +23,7 @@ # Extensions "LabeledScale", "OptionMenu", # functions - "tclobjs_to_py"] + "tclobjs_to_py", "setup_master"] import tkinter @@ -47,24 +47,6 @@ master.tk.eval('package require tile') # TclError may be raised here master._tile_loaded = True - -def _setup_master(master=None): - """If master is not None, itself is returned. If master is None, - the default master is returned if there is one, otherwise a new - master is created and returned. - - If it is not allowed to use the default root and master is None, - RuntimeError is raised.""" - if master is None: - if tkinter._support_default_root: - master = tkinter._default_root or tkinter.Tk() - else: - raise RuntimeError( - "No master specified and tkinter is " - "configured to not support default root") - return master - - def _format_optdict(optdict, script=False, ignore=None): """Formats optdict to a tuple to pass it to tk.call. @@ -367,6 +349,22 @@ return adict +def setup_master(master=None): + """If master is not None, itself is returned. If master is None, + the default master is returned if there is one, otherwise a new + master is created and returned. + + If it is not allowed to use the default root and master is None, + RuntimeError is raised.""" + if master is None: + if tkinter._support_default_root: + master = tkinter._default_root or tkinter.Tk() + else: + raise RuntimeError( + "No master specified and tkinter is " + "configured to not support default root") + return master + class Style(object): """Manipulate style database.""" @@ -374,7 +372,7 @@ _name = "ttk::style" def __init__(self, master=None): - master = _setup_master(master) + master = setup_master(master) if not getattr(master, '_tile_loaded', False): # Load tile now, if needed @@ -555,7 +553,7 @@ active, disabled, focus, pressed, selected, background, readonly, alternate, invalid """ - master = _setup_master(master) + master = setup_master(master) if not getattr(master, '_tile_loaded', False): # Load tile now, if needed _load_tile(master) Modified: python/branches/io-c/Lib/urllib/request.py ============================================================================== --- python/branches/io-c/Lib/urllib/request.py (original) +++ python/branches/io-c/Lib/urllib/request.py Sat Feb 14 21:58:31 2009 @@ -333,7 +333,6 @@ handlers = chain.get(kind, ()) for handler in handlers: func = getattr(handler, meth_name) - result = func(*args) if result is not None: return result @@ -1070,7 +1069,8 @@ except socket.error as err: # XXX what error? raise URLError(err) - resp = addinfourl(r.fp, r.msg, req.get_full_url()) +## resp = addinfourl(r.fp, r.msg, req.get_full_url()) + resp = addinfourl(r, r.msg, req.get_full_url()) resp.code = r.status resp.msg = r.reason return resp @@ -1606,7 +1606,7 @@ # According to RFC 2616, "2xx" code indicates that the client's # request was successfully received, understood, and accepted. if 200 <= response.status < 300: - return addinfourl(response.fp, response.msg, "http:" + url, + return addinfourl(response, response.msg, "http:" + url, response.status) else: return self.http_error( Modified: python/branches/io-c/Lib/urllib/response.py ============================================================================== --- python/branches/io-c/Lib/urllib/response.py (original) +++ python/branches/io-c/Lib/urllib/response.py Sat Feb 14 21:58:31 2009 @@ -17,7 +17,8 @@ self.read = self.fp.read self.readline = self.fp.readline # TODO(jhylton): Make sure an object with readlines() is also iterable - if hasattr(self.fp, "readlines"): self.readlines = self.fp.readlines + if hasattr(self.fp, "readlines"): + self.readlines = self.fp.readlines if hasattr(self.fp, "fileno"): self.fileno = self.fp.fileno else: Modified: python/branches/io-c/Lib/xmlrpc/client.py ============================================================================== --- python/branches/io-c/Lib/xmlrpc/client.py (original) +++ python/branches/io-c/Lib/xmlrpc/client.py Sat Feb 14 21:58:31 2009 @@ -1161,7 +1161,8 @@ if auth: import base64 - auth = base64.encodestring(urllib.parse.unquote(auth)) + auth = urllib.parse.unquote_to_bytes(auth) + auth = base64.encodestring(auth).decode("utf-8") auth = "".join(auth.split()) # get rid of whitespace extra_headers = [ ("Authorization", "Basic " + auth) Modified: python/branches/io-c/Mac/BuildScript/build-installer.py ============================================================================== --- python/branches/io-c/Mac/BuildScript/build-installer.py (original) +++ python/branches/io-c/Mac/BuildScript/build-installer.py Sat Feb 14 21:58:31 2009 @@ -1033,8 +1033,7 @@ buildPythonDocs() fn = os.path.join(WORKDIR, "_root", "Applications", "Python %s"%(getVersion(),), "Update Shell Profile.command") - patchFile("scripts/postflight.patch-profile", fn) - os.chmod(fn, 0755) + patchScript("scripts/postflight.patch-profile", fn) folder = os.path.join(WORKDIR, "_root", "Applications", "Python %s"%( getVersion(),)) Modified: python/branches/io-c/Mac/BuildScript/resources/ReadMe.txt ============================================================================== --- python/branches/io-c/Mac/BuildScript/resources/ReadMe.txt (original) +++ python/branches/io-c/Mac/BuildScript/resources/ReadMe.txt Sat Feb 14 21:58:31 2009 @@ -14,10 +14,9 @@ MacPython consists of the Python programming language interpreter, plus a set of programs to allow easy -access to it for Mac users (an integrated development -environment, an applet builder), plus a set of pre-built -extension modules that open up specific Macintosh technologies -to Python programs (Carbon, AppleScript, Quicktime, more). +access to it for Mac users including an integrated development +environment, IDLE, plus a set of pre-built extension modules +that open up specific Macintosh technologies to Python programs. The installer puts the applications in "Python $VERSION" in your Applications folder, command-line tools in @@ -25,7 +24,7 @@ $PYTHONFRAMEWORKINSTALLDIR. More information on MacPython can be found at -http://www.cwi.nl/~jack/macpython and -http://pythonmac.org/. More information on -Python in general 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/io-c/Mac/BuildScript/resources/Welcome.rtf ============================================================================== --- python/branches/io-c/Mac/BuildScript/resources/Welcome.rtf (original) +++ python/branches/io-c/Mac/BuildScript/resources/Welcome.rtf Sat Feb 14 21:58:31 2009 @@ -10,11 +10,10 @@ \b Mac OS X $MACOSX_DEPLOYMENT_TARGET \b0 .\ \ -MacPython consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for Mac users (an integrated development environment, an applet builder), plus a set of pre-built extension modules that open up specific Macintosh technologies to Python programs (Carbon, AppleScript, Quicktime, more).\ +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.\ \ See the ReadMe file for more information.\ \ \b NOTE: -\b0 This package will by default update not your shell profile, and will also not install\ -files in /usr/local. } \ No newline at end of file +\b0 This package will by default not update your shell profile and will also not install files in /usr/local. Double-click \b Update Shell Profile\b0 at any time to make $FULL_VERSION the default Python.} Modified: python/branches/io-c/Mac/BuildScript/scripts/postflight.patch-profile ============================================================================== --- python/branches/io-c/Mac/BuildScript/scripts/postflight.patch-profile (original) +++ python/branches/io-c/Mac/BuildScript/scripts/postflight.patch-profile Sat Feb 14 21:58:31 2009 @@ -5,8 +5,8 @@ echo "These changes will be effective only in shell windows that you open" echo "after running this script." -PYVER=2.5 -PYTHON_ROOT="/Library/Frameworks/Python.framework/Versions/Current" +PYVER=@PYVER@ +PYTHON_ROOT="/Library/Frameworks/Python.framework/Versions/@PYVER@" if [ `id -ur` = 0 ]; then # Run from the installer, do some trickery to fetch the information Modified: python/branches/io-c/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE ============================================================================== --- python/branches/io-c/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE (original) +++ python/branches/io-c/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE Sat Feb 14 21:58:31 2009 @@ -1,4 +1,4 @@ -#!%prefix%/Resources/Python.app/Contents/MacOS/Python3 +#!%prefix%/Resources/Python.app/Contents/MacOS/%exe% import sys, os execdir = os.path.dirname(sys.argv[0]) Modified: python/branches/io-c/Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py ============================================================================== --- python/branches/io-c/Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py (original) +++ python/branches/io-c/Mac/IDLE/IDLE.app/Contents/Resources/idlemain.py Sat Feb 14 21:58:31 2009 @@ -3,8 +3,6 @@ """ import sys, os -from idlelib.PyShell import main - # Change the current directory the user's home directory, that way we'll get # a more useful default location in the open/save dialogs. os.chdir(os.path.expanduser('~/Documents')) @@ -13,10 +11,54 @@ # Make sure sys.executable points to the python interpreter inside the # framework, instead of at the helper executable inside the application # bundle (the latter works, but doesn't allow access to the window server) -if sys.executable.endswith('-32'): - sys.executable = os.path.join(sys.prefix, 'bin', 'python-32') -else: - sys.executable = os.path.join(sys.prefix, 'bin', 'python') +# +# .../IDLE.app/ +# Contents/ +# MacOS/ +# IDLE (a python script) +# Python{-32} (symlink) +# Resources/ +# idlemain.py (this module) +# ... +# +# ../IDLE.app/Contents/MacOS/Python{-32} is symlinked to +# ..Library/Frameworks/Python.framework/Versions/m.n +# /Resources/Python.app/Contents/MacOS/Python{-32} +# which is the Python interpreter executable +# +# The flow of control is as follows: +# 1. IDLE.app is launched which starts python running the IDLE script +# 2. IDLE script exports +# PYTHONEXECUTABLE = .../IDLE.app/Contents/MacOS/Python{-32} +# (the symlink to the framework python) +# 3. IDLE script alters sys.argv and uses os.execve to replace itself with +# idlemain.py running under the symlinked python. +# This is the magic step. +# 4. During interpreter initialization, because PYTHONEXECUTABLE is defined, +# sys.executable may get set to an unuseful value. +# +# (Note that the IDLE script and the setting of PYTHONEXECUTABLE is +# generated automatically by bundlebuilder in the Python 2.x build. +# Also, IDLE invoked via command line, i.e. bin/idle, bypasses all of +# this.) +# +# Now fix up the execution environment before importing idlelib. + +# Reset sys.executable to its normal value, the actual path of +# the interpreter in the framework, by following the symlink +# exported in PYTHONEXECUTABLE. +pyex = os.environ['PYTHONEXECUTABLE'] +sys.executable = os.path.join(os.path.dirname(pyex), os.readlink(pyex)) + +# Remove any sys.path entries for the Resources dir in the IDLE.app bundle. +p = pyex.partition('.app') +if p[2].startswith('/Contents/MacOS/Python'): + sys.path = [value for value in sys.path if + value.partition('.app') != (p[0], p[1], '/Contents/Resources')] + +# Unexport PYTHONEXECUTABLE so that the other Python processes started +# by IDLE have a normal sys.executable. +del os.environ['PYTHONEXECUTABLE'] # Look for the -psn argument that the launcher adds and remove it, it will # only confuse the IDLE startup code. @@ -25,6 +67,7 @@ del sys.argv[idx] break -#argvemulator.ArgvCollector().mainloop() +# Now it is safe to import idlelib. +from idlelib.PyShell import main if __name__ == '__main__': main() Modified: python/branches/io-c/Mac/Makefile.in ============================================================================== --- python/branches/io-c/Mac/Makefile.in (original) +++ python/branches/io-c/Mac/Makefile.in Sat Feb 14 21:58:31 2009 @@ -49,7 +49,7 @@ checkapplepython install_pythonw install_versionedtools installapps4way: install_Python4way install_PythonLauncher \ - install_IDLE install_pythonw4way install_versionedtools + install_IDLE4way install_pythonw4way install_versionedtools install_pythonw: pythonw @@ -215,11 +215,33 @@ install_IDLE: test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" - -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" + -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -rf "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" /bin/cp -PR "$(srcdir)/IDLE/IDLE.app" "$(DESTDIR)$(PYTHONAPPSDIR)" - ln -sf $(INSTALLED_PYTHONAPP) "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/Python" + ln -sf "$(INSTALLED_PYTHONAPP)" "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/Python" sed -e "s!%prefix%!$(prefix)!g" -e 's!%exe%!$(PYTHONFRAMEWORK)!g' < "$(srcdir)/IDLE/IDLE.app/Contents/MacOS/IDLE" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/IDLE" sed "s!%version%!`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`!g" < "$(srcdir)/IDLE/IDLE.app/Contents/Info.plist" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/Info.plist" + if [ -f "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def" ]; then \ + /bin/cp -p "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def" \ + "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def~" ; \ + sed -e 's!name= IDLE Classic Windows!name= IDLE Classic OSX!g' \ + < "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def~" \ + > "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def" ; \ + rm "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def~" ; \ + fi + if [ -f "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def" ]; then \ + /bin/cp -p "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def" \ + "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def~" ; \ + sed -e 's!zoom-height=!zoom-height=!g' \ + -e 's! "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def" ; \ + rm "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def~" ; \ + fi + touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" + +install_IDLE4way: install_IDLE + ln -sf "$(INSTALLED_PYTHONAPP)-32" "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/Python" + sed -e "s!%prefix%!$(prefix)!g" -e 's!%exe%!$(PYTHONFRAMEWORK)-32!g' < "$(srcdir)/IDLE/IDLE.app/Contents/MacOS/IDLE" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/IDLE" touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" $(INSTALLED_PYTHONAPP): install_Python Modified: python/branches/io-c/Misc/ACKS ============================================================================== --- python/branches/io-c/Misc/ACKS (original) +++ python/branches/io-c/Misc/ACKS Sat Feb 14 21:58:31 2009 @@ -152,6 +152,7 @@ Drew Csillag John Cugini Tom Culliton +Lisandro Dalcin Andrew Dalke Lars Damerow Eric Daniel @@ -183,7 +184,7 @@ Andy Dustman Gary Duzan Eugene Dvurechenski -Josip Dzolonga +Josip Dzolonga Maxim Dzumanenko Walter D?rwald Hans Eckardt @@ -234,6 +235,7 @@ Ulisses Furquim Hagen F?rstenau Achim Gaedke +Martin von Gagern Lele Gaifax Santiago Gala Yitzchak Gale Modified: python/branches/io-c/Misc/NEWS ============================================================================== --- python/branches/io-c/Misc/NEWS (original) +++ python/branches/io-c/Misc/NEWS Sat Feb 14 21:58:31 2009 @@ -12,6 +12,15 @@ Core and Builtins ----------------- +- Issue #5186: Reduce hash collisions for objects with no __hash__ method by + rotating the object pointer by 4 bits to the right. + +- 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 #5137: Make len() correctly raise a TypeError when a __len__ method + returns a non-number type. + - Issue #5182: Removed memoryview.__str__. - Issue #1717: Removed builtin cmp() function, dropped tp_compare @@ -157,6 +166,40 @@ Library ------- +- Issue #5257: refactored all tests in distutils, so they use + support.TempdirManager, to avoid writing in the tests directory. + +- Issue #4524: distutils build_script command failed with --with-suffix=3. + Initial patch by Amaury Forgeot d'Arc. + +- Issue #2461: added tests for distutils.util + +- Issue #4998: The memory saving effect of __slots__ had been lost on Fractions + which inherited from numbers.py which did not have __slots__ defined. The + numbers hierarchy now has its own __slots__ declarations. + +- Issue #4631: Fix urlopen() result when an HTTP response uses chunked + encoding. + +- Issue #5203: Fixed ctypes segfaults when passing a unicode string to a + function without argtypes (only occurs if HAVE_USABLE_WCHAR_T is false). + +- Issue #3386: distutils.sysconfig.get_python_lib prefix argument was ignored + under NT and OS2. Patch by Philip Jenvey. + +- Issue #5128: Make compileall properly inspect bytecode to determine if needs + to be recreated. This avoids a timing hole thanks to the old reliance on the + ctime of the files involved. + +- Issue #5122: Synchronize tk load failure check to prevent a potential + deadlock. + +- Issue #1818: collections.namedtuple() now supports a keyword argument + 'rename' which lets invalid fieldnames be automatically converted to + positional names in the form, _1, _2, ... + +- Issue #4890: Handle empty text search pattern in Tkinter.Text.search. + - Issue #4512 (part 2): Promote ``ZipImporter._get_filename()`` to be a public documented method ``ZipImporter.get_filename()``. @@ -213,6 +256,9 @@ - Added a new itertools functions: combinations_with_replacement() and compress(). +- Issue 5032: added a step argument to itertools.count() and + allowed non-integer arguments. + - Fix and properly document the multiprocessing module's logging support, expose the internal levels and provide proper usage examples. @@ -415,6 +461,8 @@ Build ----- +- Issue #5134: Silence compiler warnings when compiling sqlite with VC++. + - Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. - Issue #4895: Use _strdup on Windows CE. @@ -443,6 +491,9 @@ C-API ----- +- Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError + for negative arguments. Previously, it raised TypeError. + - Issue #4720: The format for PyArg_ParseTupleAndKeywords can begin with '|'. - Issue #3632: from the gdb debugger, the 'pyo' macro can now be called when @@ -455,6 +506,10 @@ Extension Modules ----------------- +- 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). + - Issue #4397: Fix occasional test_socket failure on OS X. - Issue #4279: Fix build of parsermodule under Cygwin. Modified: python/branches/io-c/Modules/_ctypes/callproc.c ============================================================================== --- python/branches/io-c/Modules/_ctypes/callproc.c (original) +++ python/branches/io-c/Modules/_ctypes/callproc.c Sat Feb 14 21:58:31 2009 @@ -645,14 +645,15 @@ #ifdef CTYPES_UNICODE if (PyUnicode_Check(obj)) { - pa->ffi_type = &ffi_type_pointer; #ifdef HAVE_USABLE_WCHAR_T + pa->ffi_type = &ffi_type_pointer; pa->value.p = PyUnicode_AS_UNICODE(obj); Py_INCREF(obj); pa->keep = obj; return 0; #else int size = PyUnicode_GET_SIZE(obj); + pa->ffi_type = &ffi_type_pointer; size += 1; /* terminating NUL */ size *= sizeof(wchar_t); pa->value.p = PyMem_Malloc(size); Modified: python/branches/io-c/Modules/_fileio.c ============================================================================== --- python/branches/io-c/Modules/_fileio.c (original) +++ python/branches/io-c/Modules/_fileio.c Sat Feb 14 21:58:31 2009 @@ -158,7 +158,7 @@ { #if defined(HAVE_FSTAT) struct stat buf; - if (fstat(fd, &buf) < 0 && errno == EBADF) { + if (!_PyVerify_fd(fd) || (fstat(fd, &buf) < 0 && errno == EBADF)) { PyObject *exc; char *msg = strerror(EBADF); exc = PyObject_CallFunction(PyExc_OSError, "(is)", Modified: python/branches/io-c/Modules/_hashopenssl.c ============================================================================== --- python/branches/io-c/Modules/_hashopenssl.c (original) +++ python/branches/io-c/Modules/_hashopenssl.c Sat Feb 14 21:58:31 2009 @@ -15,6 +15,7 @@ #include "Python.h" #include "structmember.h" +#include "hashlib.h" /* EVP is the preferred interface to hashing in OpenSSL */ #include @@ -203,28 +204,6 @@ return retval; } -#define MY_GET_BUFFER_VIEW_OR_ERROUT(obj, viewp) do { \ - if (PyUnicode_Check((obj))) { \ - PyErr_SetString(PyExc_TypeError, \ - "Unicode-objects must be encoded before hashing");\ - return NULL; \ - } \ - if (!PyObject_CheckBuffer((obj))) { \ - PyErr_SetString(PyExc_TypeError, \ - "object supporting the buffer API required"); \ - return NULL; \ - } \ - if (PyObject_GetBuffer((obj), (viewp), PyBUF_SIMPLE) == -1) { \ - return NULL; \ - } \ - if ((viewp)->ndim > 1) { \ - PyErr_SetString(PyExc_BufferError, \ - "Buffer must be single dimension"); \ - PyBuffer_Release((viewp)); \ - return NULL; \ - } \ - } while(0); - PyDoc_STRVAR(EVP_update__doc__, "Update this hash object's state with the provided string."); @@ -237,7 +216,7 @@ if (!PyArg_ParseTuple(args, "O:update", &obj)) return NULL; - MY_GET_BUFFER_VIEW_OR_ERROUT(obj, &view); + GET_BUFFER_VIEW_OR_ERROUT(obj, &view); #ifdef WITH_THREAD if (self->lock == NULL && view.len >= HASHLIB_GIL_MINSIZE) { @@ -344,7 +323,7 @@ } if (data_obj) - MY_GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); if (!PyArg_Parse(name_obj, "s", &nameStr)) { PyErr_SetString(PyExc_TypeError, "name must be a string"); @@ -507,7 +486,7 @@ } if (data_obj) - MY_GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); digest = EVP_get_digestbyname(name); @@ -538,7 +517,7 @@ } \ \ if (data_obj) \ - MY_GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); \ + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); \ \ ret_obj = EVPnew( \ CONST_ ## NAME ## _name_obj, \ Modified: python/branches/io-c/Modules/_iobase.c ============================================================================== --- python/branches/io-c/Modules/_iobase.c (original) +++ python/branches/io-c/Modules/_iobase.c Sat Feb 14 21:58:31 2009 @@ -390,9 +390,6 @@ return NULL; } - if (_PyIOBase_checkClosed(self, Py_True) == NULL) - return NULL; - if (PyObject_HasAttrString(self, "peek")) has_peek = 1; Modified: python/branches/io-c/Modules/_struct.c ============================================================================== --- python/branches/io-c/Modules/_struct.c (original) +++ python/branches/io-c/Modules/_struct.c Sat Feb 14 21:58:31 2009 @@ -1785,7 +1785,7 @@ assert( buffer_len >= 0 ); /* Extract the offset from the first argument */ - offset = PyLong_AsSsize_t(PyTuple_GET_ITEM(args, 1)); + offset = PyNumber_AsSsize_t(PyTuple_GET_ITEM(args, 1), PyExc_IndexError); if (offset == -1 && PyErr_Occurred()) return NULL; Modified: python/branches/io-c/Modules/_tkinter.c ============================================================================== --- python/branches/io-c/Modules/_tkinter.c (original) +++ python/branches/io-c/Modules/_tkinter.c Sat Feb 14 21:58:31 2009 @@ -33,6 +33,8 @@ #include #endif +#include "tkinter.h" + /* Allow using this code in Python 2.[12] */ #ifndef PyDoc_STRVAR #define PyDoc_STRVAR(name,str) static char name[] = str @@ -74,10 +76,8 @@ #define CONST #endif -#define TKMAJORMINOR (TK_MAJOR_VERSION*1000 + TK_MINOR_VERSION) - -#if TKMAJORMINOR < 8002 -#error "Tk older than 8.2 not supported" +#if TK_VERSION_HEX < 0x08030102 +#error "Tk older than 8.3.1 not supported" #endif /* Unicode conversion assumes that Tcl_UniChar is two bytes. @@ -280,6 +280,9 @@ static PyObject *valInCmd; static PyObject *trbInCmd; +#ifdef TKINTER_PROTECT_LOADTK +static int tk_load_failed; +#endif static PyObject * @@ -553,21 +556,35 @@ int Tcl_AppInit(Tcl_Interp *interp) { - Tk_Window main; const char * _tkinter_skip_tk_init; if (Tcl_Init(interp) == TCL_ERROR) { PySys_WriteStderr("Tcl_Init error: %s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } - _tkinter_skip_tk_init = Tcl_GetVar(interp, "_tkinter_skip_tk_init", TCL_GLOBAL_ONLY); - if (_tkinter_skip_tk_init == NULL || strcmp(_tkinter_skip_tk_init, "1") != 0) { - main = Tk_MainWindow(interp); - if (Tk_Init(interp) == TCL_ERROR) { - PySys_WriteStderr("Tk_Init error: %s\n", Tcl_GetStringResult(interp)); - return TCL_ERROR; - } + + _tkinter_skip_tk_init = Tcl_GetVar(interp, + "_tkinter_skip_tk_init", TCL_GLOBAL_ONLY); + if (_tkinter_skip_tk_init != NULL && + strcmp(_tkinter_skip_tk_init, "1") == 0) { + return TCL_OK; + } + +#ifdef TKINTER_PROTECT_LOADTK + if (tk_load_failed) { + PySys_WriteStderr("Tk_Init error: %s\n", TKINTER_LOADTK_ERRMSG); + return TCL_ERROR; + } +#endif + + if (Tk_Init(interp) == TCL_ERROR) { +#ifdef TKINTER_PROTECT_LOADTK + tk_load_failed = 1; +#endif + PySys_WriteStderr("Tk_Init error: %s\n", Tcl_GetStringResult(interp)); + return TCL_ERROR; } + return TCL_OK; } #endif /* !WITH_APPINIT */ @@ -650,8 +667,15 @@ ckfree(argv0); if (! wantTk) { - Tcl_SetVar(v->interp, "_tkinter_skip_tk_init", "1", TCL_GLOBAL_ONLY); + Tcl_SetVar(v->interp, + "_tkinter_skip_tk_init", "1", TCL_GLOBAL_ONLY); } +#ifdef TKINTER_PROTECT_LOADTK + else if (tk_load_failed) { + Tcl_SetVar(v->interp, + "_tkinter_tk_failed", "1", TCL_GLOBAL_ONLY); + } +#endif /* some initial arguments need to be in argv */ if (sync || use) { @@ -686,6 +710,18 @@ if (Tcl_AppInit(v->interp) != TCL_OK) { PyObject *result = Tkinter_Error((PyObject *)v); +#ifdef TKINTER_PROTECT_LOADTK + if (wantTk) { + const char *_tkinter_tk_failed; + _tkinter_tk_failed = Tcl_GetVar(v->interp, + "_tkinter_tk_failed", TCL_GLOBAL_ONLY); + + if ( _tkinter_tk_failed != NULL && + strcmp(_tkinter_tk_failed, "1") == 0) { + tk_load_failed = 1; + } + } +#endif Py_DECREF((PyObject *)v); return (TkappObject *)result; } @@ -2547,22 +2583,21 @@ static PyObject * Tkapp_TkInit(PyObject *self, PyObject *args) { - static int has_failed; Tcl_Interp *interp = Tkapp_Interp(self); - Tk_Window main_window; const char * _tk_exists = NULL; int err; - main_window = Tk_MainWindow(interp); - /* In all current versions of Tk (including 8.4.13), Tk_Init - deadlocks on the second call when the first call failed. - To avoid the deadlock, we just refuse the second call through - a static variable. */ - if (has_failed) { - PyErr_SetString(Tkinter_TclError, - "Calling Tk_Init again after a previous call failed might deadlock"); +#ifdef TKINTER_PROTECT_LOADTK + /* Up to Tk 8.4.13, Tk_Init deadlocks on the second call when the + * first call failed. + * To avoid the deadlock, we just refuse the second call through + * a static variable. + */ + if (tk_load_failed) { + PyErr_SetString(Tkinter_TclError, TKINTER_LOADTK_ERRMSG); return NULL; } +#endif /* We want to guard against calling Tk_Init() multiple times */ CHECK_TCL_APPARTMENT; @@ -2582,8 +2617,10 @@ } if (_tk_exists == NULL || strcmp(_tk_exists, "1") != 0) { if (Tk_Init(interp) == TCL_ERROR) { - PyErr_SetString(Tkinter_TclError, Tcl_GetStringResult(Tkapp_Interp(self))); - has_failed = 1; + PyErr_SetString(Tkinter_TclError, Tcl_GetStringResult(Tkapp_Interp(self))); +#ifdef TKINTER_PROTECT_LOADTK + tk_load_failed = 1; +#endif return NULL; } } Modified: python/branches/io-c/Modules/getpath.c ============================================================================== --- python/branches/io-c/Modules/getpath.c (original) +++ python/branches/io-c/Modules/getpath.c Sat Feb 14 21:58:31 2009 @@ -457,6 +457,7 @@ #else unsigned long nsexeclength = MAXPATHLEN; #endif + char execpath[MAXPATHLEN+1]; #endif if (_path) { @@ -486,8 +487,13 @@ * will fail if a relative path was used. but in that case, * absolutize() should help us out below */ - else if(0 == _NSGetExecutablePath(progpath, &nsexeclength) && progpath[0] == SEP) - ; + else if(0 == _NSGetExecutablePath(execpath, &nsexeclength) && execpath[0] == SEP) { + size_t r = mbstowcs(progpath, execpath, MAXPATHLEN+1); + if (r == (size_t)-1 || r > MAXPATHLEN) { + /* Could not convert execpath, or it's too long. */ + progpath[0] = '\0'; + } + } #endif /* __APPLE__ */ else if (path) { while (1) { Modified: python/branches/io-c/Modules/itertoolsmodule.c ============================================================================== --- python/branches/io-c/Modules/itertoolsmodule.c (original) +++ python/branches/io-c/Modules/itertoolsmodule.c Sat Feb 14 21:58:31 2009 @@ -1791,6 +1791,9 @@ The leftmost iterators are in the outermost for-loop, so the output tuples\n\ cycle in a manner similar to an odometer (with the rightmost element changing\n\ on every iteration).\n\n\ +To compute the product of an iterable with itself, specify the number\n\ +of repetitions with the optional repeat keyword argument. For example,\n\ +product(A, repeat=4) means the same as product(A, A, A, A).\n\n\ product('ab', range(3)) --> ('a',0) ('a',1) ('a',2) ('b',0) ('b',1) ('b',2)\n\ product((0,1), (0,1), (0,1)) --> (0,0,0) (0,0,1) (0,1,0) (0,1,1) (1,0,0) ..."); @@ -2883,9 +2886,27 @@ typedef struct { PyObject_HEAD Py_ssize_t cnt; - PyObject *long_cnt; /* Arbitrarily large count when cnt >= PY_SSIZE_T_MAX */ + PyObject *long_cnt; + PyObject *long_step; } countobject; +/* Counting logic and invariants: + +C_add_mode: when cnt an integer < PY_SSIZE_T_MAX and no step is specified. + + assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL && long_step==PyInt(1)); + Advances with: cnt += 1 + When count hits Y_SSIZE_T_MAX, switch to Py_add_mode. + +Py_add_mode: when cnt == PY_SSIZE_T_MAX, step is not int(1), or cnt is a float. + + assert(cnt == PY_SSIZE_T_MAX && long_cnt != NULL && long_step != NULL); + All counting is done with python objects (no overflows or underflows). + Advances with: long_cnt += long_step + Step may be zero -- effectively a slow version of repeat(cnt). + Either long_cnt or long_step may be a float. +*/ + static PyTypeObject count_type; static PyObject * @@ -2893,28 +2914,44 @@ { countobject *lz; Py_ssize_t cnt = 0; - PyObject *cnt_arg = NULL; PyObject *long_cnt = NULL; + PyObject *long_step = NULL; + static char *kwlist[] = {"start", "step", 0}; - if (type == &count_type && !_PyArg_NoKeywords("count()", kwds)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OO:count", + kwlist, &long_cnt, &long_step)) return NULL; - if (!PyArg_UnpackTuple(args, "count", 0, 1, &cnt_arg)) - return NULL; + if (long_cnt != NULL && !PyNumber_Check(long_cnt) || + long_step != NULL && !PyNumber_Check(long_step)) { + PyErr_SetString(PyExc_TypeError, "a number is required"); + return NULL; + } - if (cnt_arg != NULL) { - cnt = PyLong_AsSsize_t(cnt_arg); - if (cnt == -1 && PyErr_Occurred()) { + if (long_step == NULL) { + /* If not specified, step defaults to 1 */ + long_step = PyLong_FromLong(1); + if (long_step == NULL) + return NULL; + } else + Py_INCREF(long_step); + assert(long_step != NULL); + + if (long_cnt != NULL) { + cnt = PyLong_AsSsize_t(long_cnt); + if ((cnt == -1 && PyErr_Occurred()) || + !PyIndex_Check(long_cnt) || + !PyLong_Check(long_step) || + PyLong_AS_LONG(long_step) != 1) { + /* Switch to Py_add_mode */ PyErr_Clear(); - if (!PyLong_Check(cnt_arg)) { - PyErr_SetString(PyExc_TypeError, "an integer is required"); - return NULL; - } - long_cnt = cnt_arg; Py_INCREF(long_cnt); cnt = PY_SSIZE_T_MAX; - } + } else + long_cnt = NULL; } + assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL || + cnt == PY_SSIZE_T_MAX && long_cnt != NULL); /* create countobject structure */ lz = (countobject *)PyObject_New(countobject, &count_type); @@ -2924,6 +2961,7 @@ } lz->cnt = cnt; lz->long_cnt = long_cnt; + lz->long_step = long_step; return (PyObject *)lz; } @@ -2931,7 +2969,8 @@ static void count_dealloc(countobject *lz) { - Py_XDECREF(lz->long_cnt); + Py_XDECREF(lz->long_cnt); + Py_XDECREF(lz->long_step); PyObject_Del(lz); } @@ -2939,32 +2978,29 @@ count_nextlong(countobject *lz) { static PyObject *one = NULL; - PyObject *cnt; + PyObject *long_cnt; PyObject *stepped_up; - if (lz->long_cnt == NULL) { - lz->long_cnt = PyLong_FromSsize_t(PY_SSIZE_T_MAX); - if (lz->long_cnt == NULL) - return NULL; - } - if (one == NULL) { - one = PyLong_FromLong(1); - if (one == NULL) + long_cnt = lz->long_cnt; + if (long_cnt == NULL) { + /* Switch to Py_add_mode */ + long_cnt = PyLong_FromSsize_t(PY_SSIZE_T_MAX); + if (long_cnt == NULL) return NULL; } - cnt = lz->long_cnt; - assert(cnt != NULL); - stepped_up = PyNumber_Add(cnt, one); + assert(lz->cnt == PY_SSIZE_T_MAX && long_cnt != NULL); + + stepped_up = PyNumber_Add(long_cnt, lz->long_step); if (stepped_up == NULL) return NULL; lz->long_cnt = stepped_up; - return cnt; + return long_cnt; } static PyObject * count_next(countobject *lz) { - if (lz->cnt == PY_SSIZE_T_MAX) + if (lz->cnt == PY_SSIZE_T_MAX) return count_nextlong(lz); return PyLong_FromSsize_t(lz->cnt++); } @@ -2972,17 +3008,34 @@ static PyObject * count_repr(countobject *lz) { - if (lz->cnt != PY_SSIZE_T_MAX) + if (lz->cnt != PY_SSIZE_T_MAX) return PyUnicode_FromFormat("count(%zd)", lz->cnt); - return PyUnicode_FromFormat("count(%R)", lz->long_cnt); + if (PyLong_Check(lz->long_step)) { + long step = PyLong_AsLong(lz->long_step); + if (step == -1 && PyErr_Occurred()) { + PyErr_Clear(); + } + if (step == 1) { + /* Don't display step when it is an integer equal to 1 */ + return PyUnicode_FromFormat("count(%R)", lz->long_cnt); + } + } + return PyUnicode_FromFormat("count(%R, %R)", + lz->long_cnt, lz->long_step); } PyDoc_STRVAR(count_doc, -"count([firstval]) --> count object\n\ + "count([start[, step]]) --> count object\n\ \n\ Return a count object whose .__next__() method returns consecutive\n\ -integers starting from zero or, if specified, from firstval."); +integers starting from zero or, if specified, from start.\n\ +If step is specified, counts by that interval. Equivalent to:\n\n\ + def count(firstval=0, step=1):\n\ + x = firstval\n\ + while 1:\n\ + yield x\n\ + x += step\n"); static PyTypeObject count_type = { PyVarObject_HEAD_INIT(NULL, 0) Modified: python/branches/io-c/Modules/main.c ============================================================================== --- python/branches/io-c/Modules/main.c (original) +++ python/branches/io-c/Modules/main.c Sat Feb 14 21:58:31 2009 @@ -487,10 +487,23 @@ so the actual executable path is passed in an environment variable. See Lib/plat-mac/bundlebuiler.py for details about the bootstrap script. */ - if ((p = Py_GETENV("PYTHONEXECUTABLE")) && *p != '\0') - Py_SetProgramName(p); - else + if ((p = Py_GETENV("PYTHONEXECUTABLE")) && *p != '\0') { + wchar_t* buffer; + size_t len = strlen(p); + size_t r; + + buffer = malloc(len * sizeof(wchar_t)); + if (buffer == NULL) { + Py_FatalError( + "not enough memory to copy PYTHONEXECUTABLE"); + } + + r = mbstowcs(buffer, p, len); + Py_SetProgramName(buffer); + /* buffer is now handed off - do not free */ + } else { Py_SetProgramName(argv[0]); + } #else Py_SetProgramName(argv[0]); #endif Modified: python/branches/io-c/Modules/md5module.c ============================================================================== --- python/branches/io-c/Modules/md5module.c (original) +++ python/branches/io-c/Modules/md5module.c Sat Feb 14 21:58:31 2009 @@ -17,6 +17,7 @@ /* MD5 objects */ #include "Python.h" +#include "hashlib.h" /* Some useful types */ @@ -411,11 +412,14 @@ static PyObject * MD5_update(MD5object *self, PyObject *args) { + PyObject *obj; Py_buffer buf; - if (!PyArg_ParseTuple(args, "s*:update", &buf)) + if (!PyArg_ParseTuple(args, "O:update", &obj)) return NULL; + GET_BUFFER_VIEW_OR_ERROUT(obj, &buf); + md5_process(&self->hash_state, buf.buf, buf.len); PyBuffer_Release(&buf); @@ -511,14 +515,17 @@ { static char *kwlist[] = {"string", NULL}; MD5object *new; + PyObject *data_obj = NULL; Py_buffer buf; - buf.buf = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s*:new", kwlist, - &buf)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf); + if ((new = newMD5object()) == NULL) return NULL; @@ -528,7 +535,7 @@ Py_DECREF(new); return NULL; } - if (buf.buf) { + if (data_obj) { md5_process(&new->hash_state, buf.buf, buf.len); PyBuffer_Release(&buf); } Modified: python/branches/io-c/Modules/sha1module.c ============================================================================== --- python/branches/io-c/Modules/sha1module.c (original) +++ python/branches/io-c/Modules/sha1module.c Sat Feb 14 21:58:31 2009 @@ -17,6 +17,7 @@ /* SHA1 objects */ #include "Python.h" +#include "hashlib.h" /* Some useful types */ @@ -387,11 +388,14 @@ static PyObject * SHA1_update(SHA1object *self, PyObject *args) { + PyObject *obj; Py_buffer buf; - if (!PyArg_ParseTuple(args, "s*:update", &buf)) + if (!PyArg_ParseTuple(args, "O:update", &obj)) return NULL; + GET_BUFFER_VIEW_OR_ERROUT(obj, &buf); + sha1_process(&self->hash_state, buf.buf, buf.len); PyBuffer_Release(&buf); @@ -487,14 +491,17 @@ { static char *kwlist[] = {"string", NULL}; SHA1object *new; + PyObject *data_obj = NULL; Py_buffer buf; - buf.buf = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s*:new", kwlist, - &buf)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf); + if ((new = newSHA1object()) == NULL) return NULL; @@ -504,7 +511,7 @@ Py_DECREF(new); return NULL; } - if (buf.buf) { + if (data_obj) { sha1_process(&new->hash_state, buf.buf, buf.len); PyBuffer_Release(&buf); } Modified: python/branches/io-c/Modules/sha256module.c ============================================================================== --- python/branches/io-c/Modules/sha256module.c (original) +++ python/branches/io-c/Modules/sha256module.c Sat Feb 14 21:58:31 2009 @@ -18,6 +18,7 @@ #include "Python.h" #include "structmember.h" +#include "hashlib.h" /* Endianness testing and definitions */ @@ -480,14 +481,17 @@ static PyObject * SHA256_update(SHAobject *self, PyObject *args) { - unsigned char *cp; - int len; + PyObject *obj; + Py_buffer buf; - if (!PyArg_ParseTuple(args, "s#:update", &cp, &len)) + if (!PyArg_ParseTuple(args, "O:update", &obj)) return NULL; - sha_update(self, cp, len); + GET_BUFFER_VIEW_OR_ERROUT(obj, &buf); + sha_update(self, buf.buf, buf.len); + + PyBuffer_Release(&buf); Py_INCREF(Py_None); return Py_None; } @@ -614,14 +618,17 @@ { static char *kwlist[] = {"string", NULL}; SHAobject *new; - unsigned char *cp = NULL; - int len; + PyObject *data_obj = NULL; + Py_buffer buf; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s#:new", kwlist, - &cp, &len)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf); + if ((new = newSHA256object()) == NULL) return NULL; @@ -631,8 +638,10 @@ Py_DECREF(new); return NULL; } - if (cp) - sha_update(new, cp, len); + if (data_obj) { + sha_update(new, buf.buf, buf.len); + PyBuffer_Release(&buf); + } return (PyObject *)new; } @@ -645,14 +654,17 @@ { static char *kwlist[] = {"string", NULL}; SHAobject *new; - unsigned char *cp = NULL; - int len; + PyObject *data_obj = NULL; + Py_buffer buf; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s#:new", kwlist, - &cp, &len)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf); + if ((new = newSHA224object()) == NULL) return NULL; @@ -662,8 +674,10 @@ Py_DECREF(new); return NULL; } - if (cp) - sha_update(new, cp, len); + if (data_obj) { + sha_update(new, buf.buf, buf.len); + PyBuffer_Release(&buf); + } return (PyObject *)new; } Modified: python/branches/io-c/Modules/sha512module.c ============================================================================== --- python/branches/io-c/Modules/sha512module.c (original) +++ python/branches/io-c/Modules/sha512module.c Sat Feb 14 21:58:31 2009 @@ -18,6 +18,7 @@ #include "Python.h" #include "structmember.h" +#include "hashlib.h" #ifdef PY_LONG_LONG /* If no PY_LONG_LONG, don't compile anything! */ @@ -546,14 +547,17 @@ static PyObject * SHA512_update(SHAobject *self, PyObject *args) { - unsigned char *cp; - int len; + PyObject *obj; + Py_buffer buf; - if (!PyArg_ParseTuple(args, "s#:update", &cp, &len)) + if (!PyArg_ParseTuple(args, "O:update", &obj)) return NULL; - sha512_update(self, cp, len); + GET_BUFFER_VIEW_OR_ERROUT(obj, &buf); + sha512_update(self, buf.buf, buf.len); + + PyBuffer_Release(&buf); Py_INCREF(Py_None); return Py_None; } @@ -680,14 +684,17 @@ { static char *kwlist[] = {"string", NULL}; SHAobject *new; - unsigned char *cp = NULL; - int len; + PyObject *data_obj = NULL; + Py_buffer buf; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s#:new", kwlist, - &cp, &len)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf); + if ((new = newSHA512object()) == NULL) return NULL; @@ -697,8 +704,10 @@ Py_DECREF(new); return NULL; } - if (cp) - sha512_update(new, cp, len); + if (data_obj) { + sha512_update(new, buf.buf, buf.len); + PyBuffer_Release(&buf); + } return (PyObject *)new; } @@ -711,14 +720,17 @@ { static char *kwlist[] = {"string", NULL}; SHAobject *new; - unsigned char *cp = NULL; - int len; + PyObject *data_obj = NULL; + Py_buffer buf; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|s#:new", kwlist, - &cp, &len)) { + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|O:new", kwlist, + &data_obj)) { return NULL; } + if (data_obj) + GET_BUFFER_VIEW_OR_ERROUT(data_obj, &buf); + if ((new = newSHA384object()) == NULL) return NULL; @@ -728,8 +740,10 @@ Py_DECREF(new); return NULL; } - if (cp) - sha512_update(new, cp, len); + if (data_obj) { + sha512_update(new, buf.buf, buf.len); + PyBuffer_Release(&buf); + } return (PyObject *)new; } Modified: python/branches/io-c/Modules/socketmodule.c ============================================================================== --- python/branches/io-c/Modules/socketmodule.c (original) +++ python/branches/io-c/Modules/socketmodule.c Sat Feb 14 21:58:31 2009 @@ -3567,8 +3567,11 @@ #endif #if !defined(HAVE_INET_ATON) || defined(USE_INET_ATON_WEAKLINK) +#if (SIZEOF_INT != 4) +#error "Not sure if in_addr_t exists and int is not 32-bits." +#endif /* Have to use inet_addr() instead */ - unsigned long packed_addr; + unsigned int packed_addr; #endif char *ip_addr; @@ -5090,7 +5093,10 @@ inet_pton(int af, const char *src, void *dst) { if (af == AF_INET) { - long packed_addr; +#if (SIZEOF_INT != 4) +#error "Not sure if in_addr_t exists and int is not 32-bits." +#endif + unsigned int packed_addr; packed_addr = inet_addr(src); if (packed_addr == INADDR_NONE) return 0; Modified: python/branches/io-c/Modules/testcapi_long.h ============================================================================== --- python/branches/io-c/Modules/testcapi_long.h (original) +++ python/branches/io-c/Modules/testcapi_long.h Sat Feb 14 21:58:31 2009 @@ -97,6 +97,10 @@ if (uout != (unsigned TYPENAME)-1 || !PyErr_Occurred()) return error( "PyLong_AsUnsignedXXX(-1) didn't complain"); + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return error( + "PyLong_AsUnsignedXXX(-1) raised " + "something other than OverflowError"); PyErr_Clear(); UNBIND(x); @@ -112,11 +116,15 @@ return error( "unexpected NULL from PyNumber_Lshift"); - uout = F_PY_TO_U(x); + uout = F_PY_TO_U(x); if (uout != (unsigned TYPENAME)-1 || !PyErr_Occurred()) return error( "PyLong_AsUnsignedXXX(2**NBITS) didn't " "complain"); + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return error( + "PyLong_AsUnsignedXXX(2**NBITS) raised " + "something other than OverflowError"); PyErr_Clear(); /* Signed complains about 2**(NBITS-1)? @@ -132,6 +140,10 @@ return error( "PyLong_AsXXX(2**(NBITS-1)) didn't " "complain"); + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return error( + "PyLong_AsXXX(2**(NBITS-1)) raised " + "something other than OverflowError"); PyErr_Clear(); /* Signed complains about -2**(NBITS-1)-1?; @@ -153,6 +165,10 @@ return error( "PyLong_AsXXX(-2**(NBITS-1)-1) didn't " "complain"); + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return error( + "PyLong_AsXXX(-2**(NBITS-1)-1) raised " + "something other than OverflowError"); PyErr_Clear(); UNBIND(y); Modified: python/branches/io-c/Modules/tkappinit.c ============================================================================== --- python/branches/io-c/Modules/tkappinit.c (original) +++ python/branches/io-c/Modules/tkappinit.c Sat Feb 14 21:58:31 2009 @@ -16,11 +16,21 @@ #include #include +#include "tkinter.h" + +#ifdef TKINTER_PROTECT_LOADTK +/* See Tkapp_TkInit in _tkinter.c for the usage of tk_load_faile */ +static int tk_load_failed; +#endif + int Tcl_AppInit(Tcl_Interp *interp) { Tk_Window main_window; - const char * _tkinter_skip_tk_init; + const char *_tkinter_skip_tk_init; +#ifdef TKINTER_PROTECT_LOADTK + const char *_tkinter_tk_failed; +#endif #ifdef TK_AQUA #ifndef MAX_PATH_LEN @@ -74,12 +84,32 @@ /* Initialize modules that don't require Tk */ #endif - _tkinter_skip_tk_init = Tcl_GetVar(interp, "_tkinter_skip_tk_init", TCL_GLOBAL_ONLY); - if (_tkinter_skip_tk_init != NULL && strcmp(_tkinter_skip_tk_init, "1") == 0) { + _tkinter_skip_tk_init = Tcl_GetVar(interp, + "_tkinter_skip_tk_init", TCL_GLOBAL_ONLY); + if (_tkinter_skip_tk_init != NULL && + strcmp(_tkinter_skip_tk_init, "1") == 0) { return TCL_OK; } - if (Tk_Init(interp) == TCL_ERROR) + +#ifdef TKINTER_PROTECT_LOADTK + _tkinter_tk_failed = Tcl_GetVar(interp, + "_tkinter_tk_failed", TCL_GLOBAL_ONLY); + + if (tk_load_failed || ( + _tkinter_tk_failed != NULL && + strcmp(_tkinter_tk_failed, "1") == 0)) { + Tcl_SetResult(interp, TKINTER_LOADTK_ERRMSG, TCL_STATIC); return TCL_ERROR; + } +#endif + + if (Tk_Init(interp) == TCL_ERROR) { +#ifdef TKINTER_PROTECT_LOADTK + tk_load_failed = 1; + Tcl_SetVar(interp, "_tkinter_tk_failed", "1", TCL_GLOBAL_ONLY); +#endif + return TCL_ERROR; + } main_window = Tk_MainWindow(interp); Modified: python/branches/io-c/Objects/exceptions.c ============================================================================== --- python/branches/io-c/Objects/exceptions.c (original) +++ python/branches/io-c/Objects/exceptions.c Sat Feb 14 21:58:31 2009 @@ -1776,28 +1776,6 @@ if (PyDict_SetItemString(bdict, # TYPE, PyExc_ ## TYPE)) \ Py_FatalError("Module dictionary insertion problem."); -#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__) -/* crt variable checking in VisualStudio .NET 2005 */ -#include - -static int prevCrtReportMode; -static _invalid_parameter_handler prevCrtHandler; - -/* Invalid parameter handler. Sets a ValueError exception */ -static void -InvalidParameterHandler( - const wchar_t * expression, - const wchar_t * function, - const wchar_t * file, - unsigned int line, - uintptr_t pReserved) -{ - /* Do nothing, allow execution to continue. Usually this - * means that the CRT will set errno to EINVAL - */ -} -#endif - void _PyExc_Init(void) @@ -1949,13 +1927,6 @@ } Py_DECREF(bltinmod); - -#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__) - /* Set CRT argument error handler */ - prevCrtHandler = _set_invalid_parameter_handler(InvalidParameterHandler); - /* turn off assertions in debug mode */ - prevCrtReportMode = _CrtSetReportMode(_CRT_ASSERT, 0); -#endif } void @@ -1963,9 +1934,4 @@ { Py_XDECREF(PyExc_MemoryErrorInst); PyExc_MemoryErrorInst = NULL; -#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__) - /* reset CRT error handling */ - _set_invalid_parameter_handler(prevCrtHandler); - _CrtSetReportMode(_CRT_ASSERT, prevCrtReportMode); -#endif } Modified: python/branches/io-c/Objects/longobject.c ============================================================================== --- python/branches/io-c/Objects/longobject.c (original) +++ python/branches/io-c/Objects/longobject.c Sat Feb 14 21:58:31 2009 @@ -786,7 +786,7 @@ if (Py_SIZE(v) < 0) { ndigits = -(Py_SIZE(v)); if (!is_signed) { - PyErr_SetString(PyExc_TypeError, + PyErr_SetString(PyExc_OverflowError, "can't convert negative int to unsigned"); return -1; } Modified: python/branches/io-c/Objects/object.c ============================================================================== --- python/branches/io-c/Objects/object.c (original) +++ python/branches/io-c/Objects/object.c Sat Feb 14 21:58:31 2009 @@ -699,23 +699,15 @@ long _Py_HashPointer(void *p) { -#if SIZEOF_LONG >= SIZEOF_VOID_P - return (long)p; -#else - /* convert to a Python long and hash that */ - PyObject* longobj; long x; - - if ((longobj = PyLong_FromVoidPtr(p)) == NULL) { - x = -1; - goto finally; - } - x = PyObject_Hash(longobj); - -finally: - Py_XDECREF(longobj); + size_t y = (size_t)p; + /* bottom 3 or 4 bits are likely to be 0; rotate y by 4 to avoid + excessive hash collisions for dicts and sets */ + y = (y >> 4) | (y << (8 * SIZEOF_VOID_P - 4)); + x = (long)y; + if (x == -1) + x = -2; return x; -#endif } long Modified: python/branches/io-c/Objects/typeobject.c ============================================================================== --- python/branches/io-c/Objects/typeobject.c (original) +++ python/branches/io-c/Objects/typeobject.c Sat Feb 14 21:58:31 2009 @@ -4618,7 +4618,7 @@ if (res == NULL) return -1; - len = PyLong_AsSsize_t(res); + len = PyNumber_AsSsize_t(res, PyExc_OverflowError); Py_DECREF(res); if (len < 0) { if (!PyErr_Occurred()) Modified: python/branches/io-c/PC/VC6/_multiprocessing.dsp ============================================================================== --- python/branches/io-c/PC/VC6/_multiprocessing.dsp (original) +++ python/branches/io-c/PC/VC6/_multiprocessing.dsp Sat Feb 14 21:58:31 2009 @@ -1,115 +1,115 @@ -# Microsoft Developer Studio Project File - Name="_multiprocessing" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=_multiprocessing - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "_multiprocessing.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "_multiprocessing.mak" CFG="_multiprocessing - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "_multiprocessing - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "_multiprocessing - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "_multiprocessing" -# PROP Scc_LocalPath ".." -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "_multiprocessing - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "." -# PROP Intermediate_Dir "x86-temp-release\_multiprocessing" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1D0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing.pyd" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "_multiprocessing - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "." -# PROP Intermediate_Dir "x86-temp-debug\_multiprocessing" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1d0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing_d.pyd" /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "_multiprocessing - Win32 Release" -# Name "_multiprocessing - Win32 Debug" -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\multiprocessing.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\pipe_connection.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\semaphore.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\socket_connection.c -# End Source File -# Begin Source File - -SOURCE=..\..\Modules\_multiprocessing\win32_functions.c -# End Source File -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="_multiprocessing" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=_multiprocessing - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "_multiprocessing.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "_multiprocessing.mak" CFG="_multiprocessing - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "_multiprocessing - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "_multiprocessing - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "_multiprocessing" +# PROP Scc_LocalPath ".." +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "_multiprocessing - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "." +# PROP Intermediate_Dir "x86-temp-release\_multiprocessing" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +F90=df.exe +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1D0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing.pyd" +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "_multiprocessing - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "." +# PROP Intermediate_Dir "x86-temp-debug\_multiprocessing" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +F90=df.exe +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /base:"0x1e1d0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_multiprocessing_d.pyd" /pdbtype:sept +# SUBTRACT LINK32 /pdb:none + +!ENDIF + +# Begin Target + +# Name "_multiprocessing - Win32 Release" +# Name "_multiprocessing - Win32 Debug" +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\multiprocessing.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\pipe_connection.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\semaphore.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\socket_connection.c +# End Source File +# Begin Source File + +SOURCE=..\..\Modules\_multiprocessing\win32_functions.c +# End Source File +# End Target +# End Project Modified: python/branches/io-c/PC/VC6/build_tkinter.py ============================================================================== --- python/branches/io-c/PC/VC6/build_tkinter.py (original) +++ python/branches/io-c/PC/VC6/build_tkinter.py Sat Feb 14 21:58:31 2009 @@ -1,81 +1,81 @@ -import os -import sys -import subprocess - -TCL_MAJOR = 8 -TCL_MINOR = 5 -TCL_PATCH = 2 - -TIX_MAJOR = 8 -TIX_MINOR = 4 -TIX_PATCH = 3 - -def abspath(name): - par = os.path.pardir - return os.path.abspath(os.path.join(__file__, par, par, par, par, name)) - -TCL_DIR = abspath("tcl%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) -TK_DIR = abspath("tk%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) -TIX_DIR = abspath("tix%d.%d.%d" % (TIX_MAJOR, TIX_MINOR, TIX_PATCH)) -OUT_DIR = abspath("tcltk") - -def have_args(*a): - return any(s in sys.argv[1:] for s in a) - -def enter(dir): - os.chdir(os.path.join(dir, "win")) - -def main(): - debug = have_args("-d", "--debug") - clean = have_args("clean") - install = have_args("install") - tcl = have_args("tcl") - tk = have_args("tk") - tix = have_args("tix") - if not(tcl) and not(tk) and not(tix): - tcl = tk = tix = True - - def nmake(makefile, *a): - args = ["nmake", "/nologo", "/f", makefile, "DEBUG=%d" % debug] - args.extend(a) - subprocess.check_call(args) - - if tcl: - enter(TCL_DIR) - def nmake_tcl(*a): - nmake("makefile.vc", *a) - if clean: - nmake_tcl("clean") - elif install: - nmake_tcl("install", "INSTALLDIR=" + OUT_DIR) - else: - nmake_tcl() - - if tk: - enter(TK_DIR) - def nmake_tk(*a): - nmake("makefile.vc", "TCLDIR=" + TCL_DIR, *a) - if clean: - nmake_tk("clean") - elif install: - nmake_tk("install", "INSTALLDIR=" + OUT_DIR) - else: - nmake_tk() - - if tix: - enter(TIX_DIR) - def nmake_tix(*a): - nmake("python.mak", - "TCL_MAJOR=%d" % TCL_MAJOR, - "TCL_MINOR=%d" % TCL_MINOR, - "TCL_PATCH=%d" % TCL_PATCH, - "MACHINE=IX86", *a) - if clean: - nmake_tix("clean") - elif install: - nmake_tix("install", "INSTALL_DIR=" + OUT_DIR) - else: - nmake_tix() - -if __name__ == '__main__': - main() +import os +import sys +import subprocess + +TCL_MAJOR = 8 +TCL_MINOR = 5 +TCL_PATCH = 2 + +TIX_MAJOR = 8 +TIX_MINOR = 4 +TIX_PATCH = 3 + +def abspath(name): + par = os.path.pardir + return os.path.abspath(os.path.join(__file__, par, par, par, par, name)) + +TCL_DIR = abspath("tcl%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) +TK_DIR = abspath("tk%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH)) +TIX_DIR = abspath("tix%d.%d.%d" % (TIX_MAJOR, TIX_MINOR, TIX_PATCH)) +OUT_DIR = abspath("tcltk") + +def have_args(*a): + return any(s in sys.argv[1:] for s in a) + +def enter(dir): + os.chdir(os.path.join(dir, "win")) + +def main(): + debug = have_args("-d", "--debug") + clean = have_args("clean") + install = have_args("install") + tcl = have_args("tcl") + tk = have_args("tk") + tix = have_args("tix") + if not(tcl) and not(tk) and not(tix): + tcl = tk = tix = True + + def nmake(makefile, *a): + args = ["nmake", "/nologo", "/f", makefile, "DEBUG=%d" % debug] + args.extend(a) + subprocess.check_call(args) + + if tcl: + enter(TCL_DIR) + def nmake_tcl(*a): + nmake("makefile.vc", *a) + if clean: + nmake_tcl("clean") + elif install: + nmake_tcl("install", "INSTALLDIR=" + OUT_DIR) + else: + nmake_tcl() + + if tk: + enter(TK_DIR) + def nmake_tk(*a): + nmake("makefile.vc", "TCLDIR=" + TCL_DIR, *a) + if clean: + nmake_tk("clean") + elif install: + nmake_tk("install", "INSTALLDIR=" + OUT_DIR) + else: + nmake_tk() + + if tix: + enter(TIX_DIR) + def nmake_tix(*a): + nmake("python.mak", + "TCL_MAJOR=%d" % TCL_MAJOR, + "TCL_MINOR=%d" % TCL_MINOR, + "TCL_PATCH=%d" % TCL_PATCH, + "MACHINE=IX86", *a) + if clean: + nmake_tix("clean") + elif install: + nmake_tix("install", "INSTALL_DIR=" + OUT_DIR) + else: + nmake_tix() + +if __name__ == '__main__': + main() Modified: python/branches/io-c/PC/VC6/tcl852.patch ============================================================================== --- python/branches/io-c/PC/VC6/tcl852.patch (original) +++ python/branches/io-c/PC/VC6/tcl852.patch Sat Feb 14 21:58:31 2009 @@ -1,22 +1,22 @@ ---- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 -+++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 -@@ -367,7 +367,7 @@ - typedef struct stati64 Tcl_StatBuf; - # define TCL_LL_MODIFIER "L" - # else /* __BORLANDC__ */ --# if _MSC_VER < 1400 && !defined(_M_IX86) -+# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ - typedef struct _stati64 Tcl_StatBuf; - # else - typedef struct _stat64 Tcl_StatBuf; ---- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 -+++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 -@@ -367,7 +367,7 @@ - typedef struct stati64 Tcl_StatBuf; - # define TCL_LL_MODIFIER "L" - # else /* __BORLANDC__ */ --# if _MSC_VER < 1400 && !defined(_M_IX86) -+# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ - typedef struct _stati64 Tcl_StatBuf; - # else - typedef struct _stat64 Tcl_StatBuf; +--- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 ++++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 +@@ -367,7 +367,7 @@ + typedef struct stati64 Tcl_StatBuf; + # define TCL_LL_MODIFIER "L" + # else /* __BORLANDC__ */ +-# if _MSC_VER < 1400 && !defined(_M_IX86) ++# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ + typedef struct _stati64 Tcl_StatBuf; + # else + typedef struct _stat64 Tcl_StatBuf; +--- tcl8.5.2\generic\tcl.h Fri Jun 13 03:35:39 2008 ++++ tcl8.5.2\generic\tcl.h Sun Jan 4 16:52:30 2009 +@@ -367,7 +367,7 @@ + typedef struct stati64 Tcl_StatBuf; + # define TCL_LL_MODIFIER "L" + # else /* __BORLANDC__ */ +-# if _MSC_VER < 1400 && !defined(_M_IX86) ++# if _MSC_VER < 1400 /*&& !defined(_M_IX86)*/ + typedef struct _stati64 Tcl_StatBuf; + # else + typedef struct _stat64 Tcl_StatBuf; Modified: python/branches/io-c/PCbuild/sqlite3.vcproj ============================================================================== --- python/branches/io-c/PCbuild/sqlite3.vcproj (original) +++ python/branches/io-c/PCbuild/sqlite3.vcproj Sat Feb 14 21:58:31 2009 @@ -22,7 +22,7 @@ @@ -166,8 +164,7 @@ /> @@ -229,8 +226,7 @@ /> @@ -291,8 +287,7 @@ /> @@ -354,8 +349,7 @@ /> @@ -415,8 +409,7 @@ /> @@ -478,8 +471,7 @@ /> Dear Web Designer, Apologies for this (one-time-only) intrusion but I have found your info on the web and thought this might be of interest to you: It is important in these difficult economic times to offer the BEST web site design services and to have the BEST professional web site at very AFFORDABLE prices. Flashing Webs is a premium source for high quality website, flash, flash intros, logo, corporate identities, and php-nuke themes. Web templates can be used to build your personal webpage or huge corporate site, online shop or offline presentation or even as a design for the software you develop! And everything you create is going to be easy, fast and professional. www.flashingwebs.com Nearly 6000 templates - Flash, Drupal, Dynamic flash photo galleries, Joomla, Magento, Mambo, Online store/shop, PHP-Nuke Themes, WordPress Themes, Zen cart and many more..... No technical skills needed!? Simply select your template and request a free customization quote with your own logo, text etc.? We also offer you the opportunity to become a reseller and earn 20%! Please visit www.flashingwebs.com for more info. Kind regards, Carlo From nnorwitz at gmail.com Sat Feb 14 23:38:15 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 14 Feb 2009 17:38:15 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090214223815.GA27437@python.psfb.org> 335 tests OK. 1 test failed: test_smtplib 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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-23823 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] [12983 refs] [12986 refs] [12983 refs] test_slice test_smtplib test test_smtplib produced unexpected output: ********************************************************************** error: uncaptured python exception, closing channel (:[Errno 9] Bad file descriptor [/tmp/python-test/local/lib/python2.7/asyncore.py|readwrite|101] [/tmp/python-test/local/lib/python2.7/asyncore.py|handle_write_event|427] [|getsockopt|1] [/tmp/python-test/local/lib/python2.7/socket.py|_dummy|165]) ********************************************************************** test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 335 tests OK. 1 test failed: test_smtplib 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [677362 refs] From python-checkins at python.org Sun Feb 15 00:33:34 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 15 Feb 2009 00:33:34 +0100 (CET) Subject: [Python-checkins] r69626 - python/branches/io-c/Modules/_textio.c Message-ID: <20090214233334.C2CC31E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 15 00:33:34 2009 New Revision: 69626 Log: only catch AttributeError and UnsupportedOperation Modified: python/branches/io-c/Modules/_textio.c Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Sun Feb 15 00:33:34 2009 @@ -750,10 +750,16 @@ /* Try os.device_encoding(fileno) */ PyObject *fileno, *os;; fileno = PyObject_CallMethod(buffer, "fileno", NULL); - /* Ignore any error */ - /* XXX only AttributeError and UnsupportedOperation */ - if (fileno == NULL) - PyErr_Clear(); + /* Ignore only AttributeError and UnsupportedOperation */ + if (fileno == NULL) { + if (PyErr_ExceptionMatches(PyExc_AttributeError) || + PyErr_ExceptionMatches(PyIOExc_UnsupportedOperation)) { + PyErr_Clear(); + } + else { + goto error; + } + } else { os = PyImport_ImportModule("os"); if (os == NULL) { From python-checkins at python.org Sun Feb 15 04:35:28 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 15 Feb 2009 04:35:28 +0100 (CET) Subject: [Python-checkins] r69627 - in python/branches/io-c/Modules: _iomodule.h _textio.c io.c Message-ID: <20090215033528.5E33F1E401C@bag.python.org> Author: benjamin.peterson Date: Sun Feb 15 04:35:28 2009 New Revision: 69627 Log: give the IO module its own state and store the os and locale modules in it Modified: python/branches/io-c/Modules/_iomodule.h python/branches/io-c/Modules/_textio.c python/branches/io-c/Modules/io.c Modified: python/branches/io-c/Modules/_iomodule.h ============================================================================== --- python/branches/io-c/Modules/_iomodule.h (original) +++ python/branches/io-c/Modules/_iomodule.h Sun Feb 15 04:35:28 2009 @@ -93,6 +93,19 @@ /* Implementation details */ +/* IO module structure */ + +extern PyModuleDef _PyIO_Module; + +typedef struct { + PyObject *os_module; + PyObject *locale_module; +} _PyIO_State; + + +#define IO_MOD_STATE(mod) ((_PyIO_State *)PyModule_GetState(mod)) +#define IO_STATE IO_MOD_STATE(PyState_FindModule(&_PyIO_Module)) + extern PyObject *_PyIO_str_close; extern PyObject *_PyIO_str_closed; extern PyObject *_PyIO_str_decode; Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Sun Feb 15 04:35:28 2009 @@ -713,6 +713,7 @@ char *errors = NULL; char *newline = NULL; int line_buffering = 0; + _PyIO_State *state = IO_STATE; PyObject *res; int r; @@ -748,7 +749,7 @@ if (encoding == NULL) { /* Try os.device_encoding(fileno) */ - PyObject *fileno, *os;; + PyObject *fileno; fileno = PyObject_CallMethod(buffer, "fileno", NULL); /* Ignore only AttributeError and UnsupportedOperation */ if (fileno == NULL) { @@ -761,14 +762,9 @@ } } else { - os = PyImport_ImportModule("os"); - if (os == NULL) { - Py_DECREF(fileno); - goto error; - } - self->encoding = PyObject_CallMethod(os, "device_encoding", + self->encoding = PyObject_CallMethod(state->os_module, + "device_encoding", "N", fileno); - Py_DECREF(os); if (self->encoding == NULL) goto error; else if (!PyUnicode_Check(self->encoding)) @@ -776,16 +772,23 @@ } } if (encoding == NULL && self->encoding == NULL) { - /* try locale.getpreferredencoding() */ - PyObject *locale = PyImport_ImportModule("locale"); - if (locale == NULL) { - PyErr_Clear(); - self->encoding = PyUnicode_FromString("ascii"); + if (state->locale_module == NULL) { + state->locale_module = PyImport_ImportModule("locale"); + if (state->locale_module == NULL) { + if (PyErr_ExceptionMatches(PyExc_ImportError)) { + PyErr_Clear(); + self->encoding = PyUnicode_FromString("ascii"); + } + else + goto error; + } + else + goto use_locale; } else { + use_locale: self->encoding = PyObject_CallMethod( - locale, "getpreferredencoding", NULL); - Py_DECREF(locale); + state->locale_module, "getpreferredencoding", NULL); if (self->encoding == NULL) goto error; if (!PyUnicode_Check(self->encoding)) Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Sun Feb 15 04:35:28 2009 @@ -556,6 +556,27 @@ return result; } +static int +iomodule_traverse(_PyIO_State *mod, visitproc visit, void *arg) { + Py_VISIT(mod->os_module); + if (mod->locale_module != NULL) + Py_VISIT(mod->locale_module); + return 0; +} + +static int +iomodule_clear(_PyIO_State *mod) { + Py_CLEAR(mod->os_module); + if (mod->locale_module != NULL) + Py_CLEAR(mod->locale_module); + return 0; +} + +static int +iomodule_free(_PyIO_State *mod) { + iomodule_clear(mod); +} + /* * Module definition */ @@ -565,25 +586,32 @@ {NULL, NULL} }; -static struct PyModuleDef iomodule = { +struct PyModuleDef _PyIO_Module = { PyModuleDef_HEAD_INIT, "io", module_doc, - -1, + sizeof(_PyIO_State), module_methods, NULL, - NULL, - NULL, - NULL + (traverseproc)iomodule_traverse, + (inquiry)iomodule_clear, + (freefunc)iomodule_free }; PyMODINIT_FUNC PyInit__io(void) { - PyObject *m = PyModule_Create(&iomodule); + PyObject *m = PyModule_Create(&_PyIO_Module); + _PyIO_State *state; PyTypeObject *base; if (m == NULL) goto fail; + state = IO_MOD_STATE(m); + + /* put os in the module state */ + state->os_module = PyImport_ImportModule("os"); + if (state->os_module == NULL) + goto fail; /* UnsupportedOperation inherits from ValueError and IOError */ PyIOExc_UnsupportedOperation = PyObject_CallFunction( From python-checkins at python.org Sun Feb 15 05:08:32 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 15 Feb 2009 05:08:32 +0100 (CET) Subject: [Python-checkins] r69628 - in python/branches/io-c/Modules: _bufferedio.c _iobase.c _iomodule.h _textio.c io.c Message-ID: <20090215040832.E0C551E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 15 05:08:32 2009 New Revision: 69628 Log: put interned strings in the module state structure Modified: python/branches/io-c/Modules/_bufferedio.c python/branches/io-c/Modules/_iobase.c python/branches/io-c/Modules/_iomodule.h python/branches/io-c/Modules/_textio.c python/branches/io-c/Modules/io.c Modified: python/branches/io-c/Modules/_bufferedio.c ============================================================================== --- python/branches/io-c/Modules/_bufferedio.c (original) +++ python/branches/io-c/Modules/_bufferedio.c Sun Feb 15 05:08:32 2009 @@ -344,6 +344,7 @@ { PyObject *pos = Py_None; PyObject *res; + _PyIO_State *state = IO_STATE; CHECK_INITIALIZED(self) if (!PyArg_ParseTuple(args, "|O:truncate", &pos)) { @@ -354,7 +355,7 @@ * and a flush may be necessary to synch both views of the current * file state. */ - res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_flush, NULL); + res = PyObject_CallMethodObjArgs(self->raw, state->str_flush, NULL); if (res == NULL) return NULL; Py_DECREF(res); @@ -370,7 +371,7 @@ /* XXX: Should seek() be used, instead of passing the position * XXX directly to truncate? */ - res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_truncate, pos, NULL); + res = PyObject_CallMethodObjArgs(self->raw, state->str_truncate, pos, NULL); Py_DECREF(pos); return res; @@ -382,7 +383,7 @@ BufferedIOMixin_flush(BufferedObject *self, PyObject *args) { CHECK_INITIALIZED(self) - return PyObject_CallMethodObjArgs(self->raw, _PyIO_str_flush, NULL); + return PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_flush, NULL); } static int @@ -391,7 +392,7 @@ int closed; PyObject *res; CHECK_INITIALIZED_INT(self) - res = PyObject_GetAttr(self->raw, _PyIO_str_closed); + res = PyObject_GetAttr(self->raw, IO_STATE->str_closed); if (res == NULL) return -1; closed = PyObject_IsTrue(res); @@ -403,7 +404,7 @@ BufferedIOMixin_closed_get(BufferedObject *self, void *context) { CHECK_INITIALIZED(self) - return PyObject_GetAttr(self->raw, _PyIO_str_closed); + return PyObject_GetAttr(self->raw, IO_STATE->str_closed); } static PyObject * @@ -411,6 +412,7 @@ { PyObject *res = NULL; int r; + _PyIO_State *state = IO_STATE; CHECK_INITIALIZED(self) ENTER_BUFFERED(self) @@ -425,7 +427,7 @@ } /* flush() will most probably re-take the lock, so drop it first */ LEAVE_BUFFERED(self) - res = PyObject_CallMethodObjArgs((PyObject *)self, _PyIO_str_flush, NULL); + res = PyObject_CallMethodObjArgs((PyObject *)self, state->str_flush, NULL); ENTER_BUFFERED(self) if (res == NULL) { /* If flush() fails, just give up */ @@ -436,7 +438,7 @@ } Py_XDECREF(res); - res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_close, NULL); + res = PyObject_CallMethodObjArgs(self->raw, state->str_close, NULL); end: LEAVE_BUFFERED(self) @@ -449,21 +451,21 @@ BufferedIOMixin_seekable(BufferedObject *self, PyObject *args) { CHECK_INITIALIZED(self) - return PyObject_CallMethodObjArgs(self->raw, _PyIO_str_seekable, NULL); + return PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_seekable, NULL); } static PyObject * BufferedIOMixin_readable(BufferedObject *self, PyObject *args) { CHECK_INITIALIZED(self) - return PyObject_CallMethodObjArgs(self->raw, _PyIO_str_readable, NULL); + return PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_readable, NULL); } static PyObject * BufferedIOMixin_writable(BufferedObject *self, PyObject *args) { CHECK_INITIALIZED(self) - return PyObject_CallMethodObjArgs(self->raw, _PyIO_str_writable, NULL); + return PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_writable, NULL); } static PyObject * @@ -486,14 +488,14 @@ BufferedIOMixin_fileno(BufferedObject *self, PyObject *args) { CHECK_INITIALIZED(self) - return PyObject_CallMethodObjArgs(self->raw, _PyIO_str_fileno, NULL); + return PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_fileno, NULL); } static PyObject * BufferedIOMixin_isatty(BufferedObject *self, PyObject *args) { CHECK_INITIALIZED(self) - return PyObject_CallMethodObjArgs(self->raw, _PyIO_str_isatty, NULL); + return PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_isatty, NULL); } @@ -540,7 +542,7 @@ { PyObject *res; Py_off_t n; - res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_tell, NULL); + res = PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_tell, NULL); if (res == NULL) return -1; n = PyNumber_AsOff_t(res, PyExc_ValueError); @@ -569,7 +571,7 @@ Py_DECREF(posobj); return -1; } - res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_seek, + res = PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_seek, posobj, whenceobj, NULL); Py_DECREF(posobj); Py_DECREF(whenceobj); @@ -1034,7 +1036,7 @@ } _BufferedReader_reset_buf(self); } - res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_truncate, pos, NULL); + res = PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_truncate, pos, NULL); if (res == NULL) goto end; /* Reset cached position */ @@ -1062,7 +1064,7 @@ } else { line = PyObject_CallMethodObjArgs((PyObject *)self, - _PyIO_str_readline, NULL); + IO_STATE->str_readline, NULL); if (line && !PyBytes_Check(line)) { PyErr_Format(PyExc_IOError, "readline() should have returned a bytes object, " @@ -1140,7 +1142,7 @@ memobj = PyMemoryView_FromBuffer(&buf); if (memobj == NULL) return -1; - res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_readinto, memobj, NULL); + res = PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_readinto, memobj, NULL); Py_DECREF(memobj); if (res == NULL) return -1; @@ -1185,6 +1187,7 @@ PyObject *data, *res = NULL; Py_ssize_t current_size, remaining, written; char *out; + _PyIO_State *state = IO_STATE; static PyObject *sep = NULL; /* Special case for when the number of bytes to read is unspecified. */ @@ -1225,7 +1228,7 @@ } /* Read until EOF or until read() would block. */ - data = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_read, NULL); + data = PyObject_CallMethodObjArgs(self->raw, state->str_read, NULL); if (data == NULL) { Py_DECREF(chunks); return NULL; @@ -1521,7 +1524,7 @@ memobj = PyMemoryView_FromBuffer(&buf); if (memobj == NULL) return -1; - res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_write, memobj, NULL); + res = PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_write, memobj, NULL); Py_DECREF(memobj); if (res == NULL) return -1; Modified: python/branches/io-c/Modules/_iobase.c ============================================================================== --- python/branches/io-c/Modules/_iobase.c (original) +++ python/branches/io-c/Modules/_iobase.c Sun Feb 15 05:08:32 2009 @@ -134,7 +134,7 @@ int closed; /* This gets the derived attribute, which is *not* __IOBase_closed in most cases! */ - res = PyObject_GetAttr(self, _PyIO_str_closed); + res = PyObject_GetAttr(self, IO_STATE->str_closed); if (res == NULL) return 0; closed = PyObject_IsTrue(res); @@ -173,7 +173,7 @@ if (IS_CLOSED(self)) Py_RETURN_NONE; - res = PyObject_CallMethodObjArgs(self, _PyIO_str_flush, NULL); + res = PyObject_CallMethodObjArgs(self, IO_STATE->str_flush, NULL); PyObject_SetAttrString(self, "__IOBase_closed", Py_True); if (res == NULL) { /* If flush() fails, just give up */ @@ -194,13 +194,14 @@ PyObject *res; PyObject *tp, *v, *tb; int closed = 1; + _PyIO_State *state = IO_STATE; PyErr_Fetch(&tp, &v, &tb); /* We need to resurrect the object as calling close() can invoke arbitrary code. */ ((PyObject *) self)->ob_refcnt++; /* The object could already be in an usable state, so we'll take any error as meaning "stop, nothing to see here". */ - res = PyObject_GetAttr(self, _PyIO_str_closed); + res = PyObject_GetAttr(self, state->str_closed); if (res == NULL) PyErr_Clear(); else { @@ -210,7 +211,7 @@ PyErr_Clear(); } if (closed == 0) { - res = PyObject_CallMethodObjArgs((PyObject *) self, _PyIO_str_close, + res = PyObject_CallMethodObjArgs((PyObject *) self, state->str_close, NULL); if (res == NULL) PyErr_Clear(); @@ -247,7 +248,7 @@ PyObject * _PyIOBase_checkSeekable(PyObject *self, PyObject *args) { - PyObject *res = PyObject_CallMethodObjArgs(self, _PyIO_str_seekable, NULL); + PyObject *res = PyObject_CallMethodObjArgs(self, IO_STATE->str_seekable, NULL); if (res == NULL) return NULL; if (res != Py_True) { @@ -276,7 +277,7 @@ PyObject * _PyIOBase_checkReadable(PyObject *self, PyObject *args) { - PyObject *res = PyObject_CallMethodObjArgs(self, _PyIO_str_readable, NULL); + PyObject *res = PyObject_CallMethodObjArgs(self, IO_STATE->str_readable, NULL); if (res == NULL) return NULL; if (res != Py_True) { @@ -305,7 +306,7 @@ PyObject * _PyIOBase_checkWritable(PyObject *self, PyObject *args) { - PyObject *res = PyObject_CallMethodObjArgs(self, _PyIO_str_writable, NULL); + PyObject *res = PyObject_CallMethodObjArgs(self, IO_STATE->str_writable, NULL); if (res == NULL) return NULL; if (res != Py_True) { @@ -334,7 +335,7 @@ static PyObject * IOBase_exit(PyObject *self, PyObject *args) { - return PyObject_CallMethodObjArgs(self, _PyIO_str_close, NULL); + return PyObject_CallMethodObjArgs(self, IO_STATE->str_close, NULL); } /* Lower-level APIs */ @@ -484,7 +485,7 @@ static PyObject * IOBase_iternext(PyObject *self) { - PyObject *line = PyObject_CallMethodObjArgs(self, _PyIO_str_readline, NULL); + PyObject *line = PyObject_CallMethodObjArgs(self, IO_STATE->str_readline, NULL); if (line == NULL) return NULL; @@ -561,6 +562,7 @@ static PyObject * IOBase_writelines(PyObject *self, PyObject *args) { + _PyIO_State *state = IO_STATE; PyObject *lines, *iter, *res; if (!PyArg_ParseTuple(args, "O:writelines", &lines)) { @@ -585,7 +587,7 @@ break; /* Stop Iteration */ } - res = PyObject_CallMethodObjArgs(self, _PyIO_str_write, line, NULL); + res = PyObject_CallMethodObjArgs(self, state->str_write, line, NULL); Py_DECREF(line); if (res == NULL) { Py_DECREF(iter); @@ -719,7 +721,7 @@ if (b == NULL) return NULL; - res = PyObject_CallMethodObjArgs(self, _PyIO_str_readinto, b, NULL); + res = PyObject_CallMethodObjArgs(self, IO_STATE->str_readinto, b, NULL); if (res == NULL) { Py_DECREF(b); return NULL; Modified: python/branches/io-c/Modules/_iomodule.h ============================================================================== --- python/branches/io-c/Modules/_iomodule.h (original) +++ python/branches/io-c/Modules/_iomodule.h Sun Feb 15 05:08:32 2009 @@ -100,30 +100,31 @@ typedef struct { PyObject *os_module; PyObject *locale_module; + + /* various interned strings */ + PyObject *str_close; + PyObject *str_closed; + PyObject *str_decode; + PyObject *str_encode; + PyObject *str_fileno; + PyObject *str_flush; + PyObject *str_getstate; + PyObject *str_isatty; + PyObject *str_newlines; + PyObject *str_read; + PyObject *str_read1; + PyObject *str_readable; + PyObject *str_readinto; + PyObject *str_readline; + PyObject *str_reset; + PyObject *str_seek; + PyObject *str_seekable; + PyObject *str_tell; + PyObject *str_truncate; + PyObject *str_writable; + PyObject *str_write; } _PyIO_State; #define IO_MOD_STATE(mod) ((_PyIO_State *)PyModule_GetState(mod)) #define IO_STATE IO_MOD_STATE(PyState_FindModule(&_PyIO_Module)) - -extern PyObject *_PyIO_str_close; -extern PyObject *_PyIO_str_closed; -extern PyObject *_PyIO_str_decode; -extern PyObject *_PyIO_str_encode; -extern PyObject *_PyIO_str_fileno; -extern PyObject *_PyIO_str_flush; -extern PyObject *_PyIO_str_getstate; -extern PyObject *_PyIO_str_isatty; -extern PyObject *_PyIO_str_newlines; -extern PyObject *_PyIO_str_read; -extern PyObject *_PyIO_str_read1; -extern PyObject *_PyIO_str_readable; -extern PyObject *_PyIO_str_readinto; -extern PyObject *_PyIO_str_readline; -extern PyObject *_PyIO_str_reset; -extern PyObject *_PyIO_str_seek; -extern PyObject *_PyIO_str_seekable; -extern PyObject *_PyIO_str_tell; -extern PyObject *_PyIO_str_truncate; -extern PyObject *_PyIO_str_writable; -extern PyObject *_PyIO_str_write; Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Sun Feb 15 05:08:32 2009 @@ -226,7 +226,7 @@ } /* decode input (with the eventual \r from a previous pass) */ - output = PyObject_CallMethodObjArgs(self->decoder, _PyIO_str_decode, + output = PyObject_CallMethodObjArgs(self->decoder, IO_STATE->str_decode, input, final ? Py_True : Py_False, NULL); if (output == NULL) return NULL; @@ -422,7 +422,7 @@ IncrementalNewlineDecoder_getstate(PyNewLineDecoderObject *self, PyObject *args) { PyObject *state = PyObject_CallMethodObjArgs(self->decoder, - _PyIO_str_getstate, NULL); + IO_STATE->str_getstate, NULL); PyObject *buffer; unsigned PY_LONG_LONG flag; @@ -461,7 +461,7 @@ { self->seennl = 0; self->pendingcr = 0; - return PyObject_CallMethodObjArgs(self->decoder, _PyIO_str_reset, NULL); + return PyObject_CallMethodObjArgs(self->decoder, IO_STATE->str_reset, NULL); } static PyObject * @@ -1046,7 +1046,7 @@ if (b == NULL) return -1; ret = PyObject_CallMethodObjArgs(self->buffer, - _PyIO_str_write, b, NULL); + IO_STATE->str_write, b, NULL); Py_DECREF(b); if (ret == NULL) return -1; @@ -1062,6 +1062,7 @@ PyObject *ret; PyObject *text; /* owned reference */ PyObject *b; + _PyIO_State *state = IO_STATE; Py_ssize_t textlen; int haslf = 0; int needflush = 0; @@ -1103,7 +1104,7 @@ b = (*self->encodefunc)((PyObject *) self, text); else b = PyObject_CallMethodObjArgs(self->encoder, - _PyIO_str_encode, text, NULL); + state->str_encode, text, NULL); Py_DECREF(text); if (b == NULL) return NULL; @@ -1128,7 +1129,7 @@ } if (needflush) { - ret = PyObject_CallMethodObjArgs(self->buffer, _PyIO_str_flush, NULL); + ret = PyObject_CallMethodObjArgs(self->buffer, state->str_flush, NULL); if (ret == NULL) return NULL; Py_DECREF(ret); @@ -1198,6 +1199,7 @@ PyObject *dec_flags = NULL; PyObject *input_chunk = NULL; PyObject *decoded_chars, *chunk_size; + _PyIO_State *iostate = IO_STATE; int eof; /* The return value is True unless EOF was reached. The decoded string is @@ -1217,7 +1219,7 @@ */ PyObject *state = PyObject_CallMethodObjArgs(self->decoder, - _PyIO_str_getstate, NULL); + iostate->str_getstate, NULL); if (state == NULL) return -1; /* Given this, we know there was a valid snapshot point @@ -1237,7 +1239,7 @@ if (chunk_size == NULL) goto fail; input_chunk = PyObject_CallMethodObjArgs(self->buffer, - _PyIO_str_read1, chunk_size, NULL); + iostate->str_read1, chunk_size, NULL); Py_DECREF(chunk_size); if (input_chunk == NULL) goto fail; @@ -1251,7 +1253,7 @@ } else { decoded_chars = PyObject_CallMethodObjArgs(self->decoder, - _PyIO_str_decode, input_chunk, eof ? Py_True : Py_False, NULL); + iostate->str_decode, input_chunk, eof ? Py_True : Py_False, NULL); } /* TODO sanity check: isinstance(decoded_chars, unicode) */ @@ -1306,7 +1308,7 @@ PyObject *decoded; if (bytes == NULL) goto fail; - decoded = PyObject_CallMethodObjArgs(self->decoder, _PyIO_str_decode, + decoded = PyObject_CallMethodObjArgs(self->decoder, IO_STATE->str_decode, bytes, Py_True, NULL); Py_DECREF(bytes); if (decoded == NULL) @@ -1746,7 +1748,7 @@ utf-16, that we are expecting a BOM). */ if (cookie->start_pos == 0 && cookie->dec_flags == 0) - res = PyObject_CallMethodObjArgs(self->decoder, _PyIO_str_reset, NULL); + res = PyObject_CallMethodObjArgs(self->decoder, IO_STATE->str_reset, NULL); else res = PyObject_CallMethod(self->decoder, "setstate", "((yi))", "", cookie->dec_flags); @@ -1764,6 +1766,7 @@ int whence = 0; static PyObject *zero = NULL; PyObject *res; + _PyIO_State *state = IO_STATE; int cmp; CHECK_INITIALIZED(self); @@ -1852,7 +1855,7 @@ goto fail; } - res = PyObject_CallMethodObjArgs((PyObject *)self, _PyIO_str_flush, NULL); + res = PyObject_CallMethodObjArgs((PyObject *)self, state->str_flush, NULL); if (res == NULL) goto fail; Py_DECREF(res); @@ -1868,7 +1871,7 @@ if (posobj == NULL) goto fail; res = PyObject_CallMethodObjArgs(self->buffer, - _PyIO_str_seek, posobj, NULL); + state->str_seek, posobj, NULL); Py_DECREF(posobj); if (res == NULL) goto fail; @@ -1936,6 +1939,7 @@ Py_ssize_t chars_to_skip, chars_decoded; PyObject *saved_state = NULL; char *input, *input_end; + _PyIO_State *iostate = IO_STATE; CHECK_INITIALIZED(self); CHECK_CLOSED(self); @@ -1996,7 +2000,7 @@ * forward until it gives us enough decoded characters. */ saved_state = PyObject_CallMethodObjArgs(self->decoder, - _PyIO_str_getstate, NULL); + iostate->str_getstate, NULL); if (saved_state == NULL) goto fail; @@ -2029,7 +2033,7 @@ cookie.bytes_to_feed += 1; state = PyObject_CallMethodObjArgs(self->decoder, - _PyIO_str_getstate, NULL); + iostate->str_getstate, NULL); if (state == NULL) goto fail; if (!PyArg_Parse(state, "(y#i)", &dec_buffer, &dec_buffer_len, &dec_flags)) { @@ -2101,26 +2105,27 @@ { PyObject *pos = Py_None; PyObject *res; + _PyIO_State *state = IO_STATE; CHECK_INITIALIZED(self) if (!PyArg_ParseTuple(args, "|O:truncate", &pos)) { return NULL; } - res = PyObject_CallMethodObjArgs((PyObject *) self, _PyIO_str_flush, NULL); + res = PyObject_CallMethodObjArgs((PyObject *) self, state->str_flush, NULL); if (res == NULL) return NULL; Py_DECREF(res); if (pos != Py_None) { res = PyObject_CallMethodObjArgs((PyObject *) self, - _PyIO_str_seek, pos, NULL); + state->str_seek, pos, NULL); if (res == NULL) return NULL; Py_DECREF(res); } - return PyObject_CallMethodObjArgs(self->buffer, _PyIO_str_truncate, NULL); + return PyObject_CallMethodObjArgs(self->buffer, state->str_truncate, NULL); } /* Inquiries */ @@ -2201,7 +2206,7 @@ } else { line = PyObject_CallMethodObjArgs((PyObject *)self, - _PyIO_str_readline, NULL); + IO_STATE->str_readline, NULL); if (line && !PyUnicode_Check(line)) { PyErr_Format(PyExc_IOError, "readline() should have returned an str object, " @@ -2236,7 +2241,7 @@ TextIOWrapper_closed_get(PyTextIOWrapperObject *self, void *context) { CHECK_INITIALIZED(self); - return PyObject_GetAttr(self->buffer, _PyIO_str_closed); + return PyObject_GetAttr(self->buffer, IO_STATE->str_closed); } static PyObject * @@ -2246,7 +2251,7 @@ CHECK_INITIALIZED(self); if (self->decoder == NULL) Py_RETURN_NONE; - res = PyObject_GetAttr(self->decoder, _PyIO_str_newlines); + res = PyObject_GetAttr(self->decoder, IO_STATE->str_newlines); if (res == NULL) { PyErr_Clear(); Py_RETURN_NONE; Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Sun Feb 15 05:08:32 2009 @@ -22,30 +22,6 @@ PyObject *PyIOExc_UnsupportedOperation; -/* Various interned strings */ - -PyObject *_PyIO_str_close; -PyObject *_PyIO_str_closed; -PyObject *_PyIO_str_decode; -PyObject *_PyIO_str_encode; -PyObject *_PyIO_str_fileno; -PyObject *_PyIO_str_flush; -PyObject *_PyIO_str_getstate; -PyObject *_PyIO_str_isatty; -PyObject *_PyIO_str_newlines; -PyObject *_PyIO_str_read; -PyObject *_PyIO_str_read1; -PyObject *_PyIO_str_readable; -PyObject *_PyIO_str_readinto; -PyObject *_PyIO_str_readline; -PyObject *_PyIO_str_reset; -PyObject *_PyIO_str_seek; -PyObject *_PyIO_str_seekable; -PyObject *_PyIO_str_tell; -PyObject *_PyIO_str_truncate; -PyObject *_PyIO_str_writable; -PyObject *_PyIO_str_write; - PyDoc_STRVAR(module_doc, "The io module provides the Python interfaces to stream handling. The\n" @@ -572,9 +548,31 @@ return 0; } -static int -iomodule_free(_PyIO_State *mod) { - iomodule_clear(mod); +static void +iomodule_free(_PyIO_State *state) { + iomodule_clear(state); + + Py_DECREF(state->str_close); + Py_DECREF(state->str_closed); + Py_DECREF(state->str_decode); + Py_DECREF(state->str_encode); + Py_DECREF(state->str_fileno); + Py_DECREF(state->str_flush); + Py_DECREF(state->str_getstate); + Py_DECREF(state->str_isatty); + Py_DECREF(state->str_newlines); + Py_DECREF(state->str_read); + Py_DECREF(state->str_read1); + Py_DECREF(state->str_readable); + Py_DECREF(state->str_readinto); + Py_DECREF(state->str_readline); + Py_DECREF(state->str_reset); + Py_DECREF(state->str_seek); + Py_DECREF(state->str_seekable); + Py_DECREF(state->str_tell); + Py_DECREF(state->str_truncate); + Py_DECREF(state->str_writable); + Py_DECREF(state->str_write); } /* @@ -711,47 +709,47 @@ PyModule_AddObject(m, "IncrementalNewlineDecoder", (PyObject *) &PyIncrementalNewlineDecoder_Type); /* Interned strings */ - if (!(_PyIO_str_close = PyUnicode_InternFromString("close"))) + if (!(state->str_close = PyUnicode_InternFromString("close"))) goto fail; - if (!(_PyIO_str_closed = PyUnicode_InternFromString("closed"))) + if (!(state->str_closed = PyUnicode_InternFromString("closed"))) goto fail; - if (!(_PyIO_str_decode = PyUnicode_InternFromString("decode"))) + if (!(state->str_decode = PyUnicode_InternFromString("decode"))) goto fail; - if (!(_PyIO_str_encode = PyUnicode_InternFromString("encode"))) + if (!(state->str_encode = PyUnicode_InternFromString("encode"))) goto fail; - if (!(_PyIO_str_fileno = PyUnicode_InternFromString("fileno"))) + if (!(state->str_fileno = PyUnicode_InternFromString("fileno"))) goto fail; - if (!(_PyIO_str_flush = PyUnicode_InternFromString("flush"))) + if (!(state->str_flush = PyUnicode_InternFromString("flush"))) goto fail; - if (!(_PyIO_str_getstate = PyUnicode_InternFromString("getstate"))) + if (!(state->str_getstate = PyUnicode_InternFromString("getstate"))) goto fail; - if (!(_PyIO_str_isatty = PyUnicode_InternFromString("isatty"))) + if (!(state->str_isatty = PyUnicode_InternFromString("isatty"))) goto fail; - if (!(_PyIO_str_newlines = PyUnicode_InternFromString("newlines"))) + if (!(state->str_newlines = PyUnicode_InternFromString("newlines"))) goto fail; - if (!(_PyIO_str_read = PyUnicode_InternFromString("read"))) + if (!(state->str_read = PyUnicode_InternFromString("read"))) goto fail; - if (!(_PyIO_str_read1 = PyUnicode_InternFromString("read1"))) + if (!(state->str_read1 = PyUnicode_InternFromString("read1"))) goto fail; - if (!(_PyIO_str_readable = PyUnicode_InternFromString("readable"))) + if (!(state->str_readable = PyUnicode_InternFromString("readable"))) goto fail; - if (!(_PyIO_str_readinto = PyUnicode_InternFromString("readinto"))) + if (!(state->str_readinto = PyUnicode_InternFromString("readinto"))) goto fail; - if (!(_PyIO_str_readline = PyUnicode_InternFromString("readline"))) + if (!(state->str_readline = PyUnicode_InternFromString("readline"))) goto fail; - if (!(_PyIO_str_reset = PyUnicode_InternFromString("reset"))) + if (!(state->str_reset = PyUnicode_InternFromString("reset"))) goto fail; - if (!(_PyIO_str_seek = PyUnicode_InternFromString("seek"))) + if (!(state->str_seek = PyUnicode_InternFromString("seek"))) goto fail; - if (!(_PyIO_str_seekable = PyUnicode_InternFromString("seekable"))) + if (!(state->str_seekable = PyUnicode_InternFromString("seekable"))) goto fail; - if (!(_PyIO_str_tell = PyUnicode_InternFromString("tell"))) + if (!(state->str_tell = PyUnicode_InternFromString("tell"))) goto fail; - if (!(_PyIO_str_truncate = PyUnicode_InternFromString("truncate"))) + if (!(state->str_truncate = PyUnicode_InternFromString("truncate"))) goto fail; - if (!(_PyIO_str_write = PyUnicode_InternFromString("write"))) + if (!(state->str_write = PyUnicode_InternFromString("write"))) goto fail; - if (!(_PyIO_str_writable = PyUnicode_InternFromString("writable"))) + if (!(state->str_writable = PyUnicode_InternFromString("writable"))) goto fail; return m; From python-checkins at python.org Sun Feb 15 05:15:29 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 15 Feb 2009 05:15:29 +0100 (CET) Subject: [Python-checkins] r69629 - in python/branches/io-c/Modules: _bufferedio.c _iobase.c _iomodule.h _textio.c io.c Message-ID: <20090215041529.CFD9A1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 15 05:15:29 2009 New Revision: 69629 Log: put UnsupportedOperation in the module state Modified: python/branches/io-c/Modules/_bufferedio.c python/branches/io-c/Modules/_iobase.c python/branches/io-c/Modules/_iomodule.h python/branches/io-c/Modules/_textio.c python/branches/io-c/Modules/io.c Modified: python/branches/io-c/Modules/_bufferedio.c ============================================================================== --- python/branches/io-c/Modules/_bufferedio.c (original) +++ python/branches/io-c/Modules/_bufferedio.c Sun Feb 15 05:15:29 2009 @@ -69,7 +69,7 @@ static PyObject * BufferedIOBase_unsupported(const char *message) { - PyErr_SetString(PyIOExc_UnsupportedOperation, message); + PyErr_SetString(IO_STATE->unsupported_operation, message); return NULL; } Modified: python/branches/io-c/Modules/_iobase.c ============================================================================== --- python/branches/io-c/Modules/_iobase.c (original) +++ python/branches/io-c/Modules/_iobase.c Sun Feb 15 05:15:29 2009 @@ -58,7 +58,7 @@ static PyObject * IOBase_unsupported(const char *message) { - PyErr_SetString(PyIOExc_UnsupportedOperation, message); + PyErr_SetString(IO_STATE->unsupported_operation, message); return NULL; } Modified: python/branches/io-c/Modules/_iomodule.h ============================================================================== --- python/branches/io-c/Modules/_iomodule.h (original) +++ python/branches/io-c/Modules/_iomodule.h Sun Feb 15 05:15:29 2009 @@ -27,8 +27,6 @@ extern PyObject* _PyIOBase_checkSeekable(PyObject *self, PyObject *args); extern PyObject* _PyIOBase_checkClosed(PyObject *self, PyObject *args); -extern PyObject* PyIOExc_UnsupportedOperation; - /* Helper for finalization. This function will revive an object ready to be deallocated and try to close() it. It returns 0 if the object can be destroyed, or -1 if it @@ -101,6 +99,8 @@ PyObject *os_module; PyObject *locale_module; + PyObject *unsupported_operation; + /* various interned strings */ PyObject *str_close; PyObject *str_closed; Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Sun Feb 15 05:15:29 2009 @@ -24,7 +24,7 @@ static PyObject * _unsupported(const char *message) { - PyErr_SetString(PyIOExc_UnsupportedOperation, message); + PyErr_SetString(IO_STATE->unsupported_operation, message); return NULL; } @@ -754,7 +754,7 @@ /* Ignore only AttributeError and UnsupportedOperation */ if (fileno == NULL) { if (PyErr_ExceptionMatches(PyExc_AttributeError) || - PyErr_ExceptionMatches(PyIOExc_UnsupportedOperation)) { + PyErr_ExceptionMatches(state->unsupported_operation)) { PyErr_Clear(); } else { Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Sun Feb 15 05:15:29 2009 @@ -20,7 +20,6 @@ #include #endif /* HAVE_SYS_STAT_H */ -PyObject *PyIOExc_UnsupportedOperation; PyDoc_STRVAR(module_doc, @@ -612,13 +611,13 @@ goto fail; /* UnsupportedOperation inherits from ValueError and IOError */ - PyIOExc_UnsupportedOperation = PyObject_CallFunction( + state->unsupported_operation = PyObject_CallFunction( (PyObject *)&PyType_Type, "s(OO){}", "UnsupportedOperation", PyExc_ValueError, PyExc_IOError); - if (PyIOExc_UnsupportedOperation == NULL) + if (state->unsupported_operation == NULL) goto fail; PyModule_AddObject(m, "UnsupportedOperation", - PyIOExc_UnsupportedOperation); + state->unsupported_operation); /* BlockingIOError */ base = (PyTypeObject *)PyExc_IOError; From python-checkins at python.org Sun Feb 15 06:46:50 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 15 Feb 2009 06:46:50 +0100 (CET) Subject: [Python-checkins] r69630 - python/branches/py3k/Lib/importlib/NOTES Message-ID: <20090215054650.D181B1E4002@bag.python.org> Author: brett.cannon Date: Sun Feb 15 06:46:50 2009 New Revision: 69630 Log: Add a NOTE about the new specific semantics for failed loads. Modified: python/branches/py3k/Lib/importlib/NOTES Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sun Feb 15 06:46:50 2009 @@ -1,6 +1,8 @@ to do ///// +* Change failed loading based on PEP 302 changes. + * Refactor source/bytecode finder/loader code such that bytecode support is a subclass of source support (makes it nicer for VMs that don't use CPython bytecode). From python-checkins at python.org Sun Feb 15 06:48:14 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 15 Feb 2009 06:48:14 +0100 (CET) Subject: [Python-checkins] r69631 - in python/branches/py3k/Lib/importlib: _bootstrap.py test/import_/test_path.py test/import_/util.py Message-ID: <20090215054814.2D61F1E4002@bag.python.org> Author: brett.cannon Date: Sun Feb 15 06:48:13 2009 New Revision: 69631 Log: Change importlib.machinery.PathFinder to not have implicit semantics (that's not handled by importlib._bootstrap._DefaultPathFinder). Modified: python/branches/py3k/Lib/importlib/_bootstrap.py python/branches/py3k/Lib/importlib/test/import_/test_path.py python/branches/py3k/Lib/importlib/test/import_/util.py Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Sun Feb 15 06:48:13 2009 @@ -610,36 +610,25 @@ """Meta path finder for sys.(path|path_hooks|path_importer_cache).""" - _default_hook = staticmethod(chaining_fs_path_hook(ExtensionFileImporter, - PyFileImporter)) - - # The list of implicit hooks cannot be a class attribute because of - # bootstrapping issues for accessing imp. @classmethod - def _implicit_hooks(cls): - """Return a list of the implicit path hooks.""" - return [cls._default_hook, imp.NullImporter] - - @classmethod - def _path_hooks(cls, path): - """Search sys.path_hooks for a finder for 'path'. + def _path_hooks(cls, path, hooks=None): + """Search sequence of hooks for a finder for 'path'. - Guaranteed to return a finder for the path as NullImporter is the - default importer for any path that does not have an explicit finder. + If 'hooks' is false then use sys.path_hooks. """ - for hook in sys.path_hooks + cls._implicit_hooks(): + if not hooks: + hooks = sys.path_hooks + for hook in hooks: try: return hook(path) except ImportError: continue else: - # This point should never be reached thanks to NullImporter. - raise SystemError("no hook could find an importer for " - "{0}".format(path)) + raise ImportError("no path hook found for {0}".format(path)) @classmethod - def _path_importer_cache(cls, path): + def _path_importer_cache(cls, path, default=None): """Get the finder for the path from sys.path_importer_cache. If the path is not in the cache, find the appropriate finder and cache @@ -657,9 +646,9 @@ finder = cls._path_hooks(path) sys.path_importer_cache[path] = finder else: - if finder is None: + if finder is None and default: # Raises ImportError on failure. - finder = cls._default_hook(path) + finder = default(path) sys.path_importer_cache[path] = finder return finder @@ -680,6 +669,30 @@ return None +class _DefaultPathFinder(PathFinder): + + """Subclass of PathFinder that implements implicit semantics for + __import__.""" + + _default_hook = staticmethod(chaining_fs_path_hook(ExtensionFileImporter, + PyFileImporter)) + + @classmethod + def _path_hooks(cls, path): + """Search sys.path_hooks as well as implicit path hooks.""" + try: + return super()._path_hooks(path) + except ImportError: + implicit_hooks = [cls._default_hook, imp.NullImporter] + return super()._path_hooks(path, implicit_hooks) + + @classmethod + def _path_importer_cache(cls, path): + """Use the default path hook when None is stored in + sys.path_importer_cache.""" + return super()._path_importer_cache(path, cls._default_hook) + + class ImportLockContext(object): """Context manager for the import lock.""" @@ -693,6 +706,8 @@ imp.release_lock() +_IMPLICIT_META_PATH = [BuiltinImporter, FrozenImporter, _DefaultPathFinder] + def _gcd_import(name, package=None, level=0): """Import and return the module based on its name, the package the call is being made from, and the level adjustment. @@ -736,8 +751,7 @@ # Backwards-compatibility; be nicer to skip the dict lookup. parent_module = sys.modules[parent] path = parent_module.__path__ - meta_path = (sys.meta_path + - [BuiltinImporter, FrozenImporter, PathFinder]) + meta_path = sys.meta_path + _IMPLICIT_META_PATH for finder in meta_path: loader = finder.find_module(name, path) if loader is not None: Modified: python/branches/py3k/Lib/importlib/test/import_/test_path.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_path.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_path.py Sun Feb 15 06:48:13 2009 @@ -1,3 +1,4 @@ +from importlib import _bootstrap from importlib import machinery from .. import util from . import util as import_util @@ -12,20 +13,13 @@ class FinderTests(unittest.TestCase): - """Tests for SysPathImporter.""" + """Tests for PathFinder.""" def test_failure(self): # Test None returned upon not finding a suitable finder. - def mock_implicit_hooks(): - return [] - # XXX Not blackbox. - original_hooks = machinery.PathFinder._implicit_hooks - machinery.PathFinder._implicit_hooks = staticmethod(mock_implicit_hooks) - try: - with util.import_state(): - self.assert_(machinery.PathFinder.find_module('XXX') is None) - finally: - machinery.PathFinder._implicit_hooks = original_hooks + module = '' + with util.import_state(): + self.assert_(machinery.PathFinder.find_module(module) is None) def test_sys_path(self): # Test that sys.path is used when 'path' is None. @@ -48,23 +42,6 @@ loader = machinery.PathFinder.find_module(module, [path]) self.assert_(loader is importer) - def test_path_importer_cache_has_None(self): - # Test that the default hook is used when sys.path_importer_cache - # contains None for a path. - module = '' - importer = util.mock_modules(module) - path = '' - # XXX Not blackbox. - original_hook = machinery.PathFinder._default_hook - mock_hook = import_util.mock_path_hook(path, importer=importer) - machinery.PathFinder._default_hook = staticmethod(mock_hook) - try: - with util.import_state(path_importer_cache={path: None}): - loader = machinery.PathFinder.find_module(module, path=[path]) - self.assert_(loader is importer) - finally: - machinery.PathFinder._default_hook = original_hook - def test_path_hooks(self): # Test that sys.path_hooks is used. # Test that sys.path_importer_cache is set. @@ -78,6 +55,11 @@ self.assert_(path in sys.path_importer_cache) self.assert_(sys.path_importer_cache[path] is importer) + +class DefaultPathFinderTests(unittest.TestCase): + + """Test importlib._bootstrap._DefaultPathFinder.""" + def test_implicit_hooks(self): # Test that the implicit path hooks are used. existing_path = os.path.dirname(support.TESTFN) @@ -85,22 +67,41 @@ module = '' assert not os.path.exists(bad_path) with util.import_state(): - nothing = machinery.PathFinder.find_module(module, - path=[existing_path]) + nothing = _bootstrap._DefaultPathFinder.find_module(module, + path=[existing_path]) self.assert_(nothing is None) self.assert_(existing_path in sys.path_importer_cache) self.assert_(not isinstance(sys.path_importer_cache[existing_path], imp.NullImporter)) - nothing = machinery.PathFinder.find_module(module, path=[bad_path]) + nothing = _bootstrap._DefaultPathFinder.find_module(module, + path=[bad_path]) self.assert_(nothing is None) self.assert_(bad_path in sys.path_importer_cache) self.assert_(isinstance(sys.path_importer_cache[bad_path], imp.NullImporter)) + def test_path_importer_cache_has_None(self): + # Test that the default hook is used when sys.path_importer_cache + # contains None for a path. + module = '' + importer = util.mock_modules(module) + path = '' + # XXX Not blackbox. + original_hook = _bootstrap._DefaultPathFinder._default_hook + mock_hook = import_util.mock_path_hook(path, importer=importer) + _bootstrap._DefaultPathFinder._default_hook = staticmethod(mock_hook) + try: + with util.import_state(path_importer_cache={path: None}): + loader = _bootstrap._DefaultPathFinder.find_module(module, + path=[path]) + self.assert_(loader is importer) + finally: + _bootstrap._DefaultPathFinder._default_hook = original_hook + def test_main(): from test.support import run_unittest - run_unittest(PathTests, __path__Tests, FinderTests) + run_unittest(FinderTests, DefaultPathFinderTests) if __name__ == '__main__': test_main() Modified: python/branches/py3k/Lib/importlib/test/import_/util.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/util.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/util.py Sun Feb 15 06:48:13 2009 @@ -9,8 +9,8 @@ """Delegate to allow for injecting different implementations of import.""" if using___import__: return __import__(*args, **kwargs) - #return importlib.Import()(*args, **kwargs) - return importlib._bootstrap._import(*args, **kwargs) + else: + return importlib._bootstrap._import(*args, **kwargs) def importlib_only(fxn): From python-checkins at python.org Sun Feb 15 07:06:09 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 15 Feb 2009 07:06:09 +0100 (CET) Subject: [Python-checkins] r69632 - peps/trunk/pep-0302.txt Message-ID: <20090215060609.A96461E4002@bag.python.org> Author: brett.cannon Date: Sun Feb 15 07:06:09 2009 New Revision: 69632 Log: Specify what a loader must do if a load fails. Modified: peps/trunk/pep-0302.txt Modified: peps/trunk/pep-0302.txt ============================================================================== --- peps/trunk/pep-0302.txt (original) +++ peps/trunk/pep-0302.txt Sun Feb 15 07:06:09 2009 @@ -251,21 +251,16 @@ the loader must create a new module object and add it to sys.modules. - In C code, all of these requirements can be met simply by using - the PyImport_AddModule() function, which returns the existing - module or creates a new one and adds it to sys.modules for you. - In Python code, you can use something like: - - module = sys.modules.setdefault(fullname, new.module(fullname)) - - to accomplish the same results. - Note that the module object *must* be in sys.modules before the loader executes the module code. This is crucial because the module code may (directly or indirectly) import itself; adding it to sys.modules beforehand prevents unbounded recursion in the worst case and multiple loading in the best. + If the load fails, the loader needs to remove any module it may have + inserted into sys.modules. If the module was already in + sys.modules then the loader should leave it alone. + - The __file__ attribute must be set. This must be a string, but it may be a dummy value, for example "". The privilege of not having a __file__ attribute at all is reserved for built-in From buildbot at python.org Sun Feb 15 07:40:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 15 Feb 2009 06:40:39 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090215064039.520121E4002@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/291 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: 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.x.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Sun Feb 15 10:19:48 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sun, 15 Feb 2009 10:19:48 +0100 (CET) Subject: [Python-checkins] r69633 - python/trunk/Doc/library/io.rst Message-ID: <20090215091948.E58D11E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sun Feb 15 10:19:48 2009 New Revision: 69633 Log: Fixed typo. Modified: python/trunk/Doc/library/io.rst Modified: python/trunk/Doc/library/io.rst ============================================================================== --- python/trunk/Doc/library/io.rst (original) +++ python/trunk/Doc/library/io.rst Sun Feb 15 10:19:48 2009 @@ -633,7 +633,7 @@ .. class:: StringIO([initial_value[, encoding[, errors[, newline]]]]) - An in-memory stream for text. It in inherits :class:`TextIOWrapper`. + An in-memory stream for text. It inherits :class:`TextIOWrapper`. Create a new StringIO stream with an inital value, encoding, error handling, and newline setting. See :class:`TextIOWrapper`\'s constructor for more From python-checkins at python.org Sun Feb 15 11:13:42 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 15 Feb 2009 11:13:42 +0100 (CET) Subject: [Python-checkins] r69634 - in python/trunk: Include/longintrepr.h Lib/test/test_sys.py Misc/NEWS Objects/longobject.c Message-ID: <20090215101342.0B1021E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 15 11:13:41 2009 New Revision: 69634 Log: Issue #5260: Various portability and standards compliance fixes, optimizations and cleanups in Objects/longobject.c. The most significant change is that longs now use less memory: average savings are 2 bytes per long on 32-bit systems and 6 bytes per long on 64-bit systems. (This memory saving already exists in py3k.) Modified: python/trunk/Include/longintrepr.h python/trunk/Lib/test/test_sys.py python/trunk/Misc/NEWS python/trunk/Objects/longobject.c Modified: python/trunk/Include/longintrepr.h ============================================================================== --- python/trunk/Include/longintrepr.h (original) +++ python/trunk/Include/longintrepr.h Sun Feb 15 11:13:41 2009 @@ -19,14 +19,13 @@ long_pow() requires that SHIFT be divisible by 5. */ typedef unsigned short digit; -typedef unsigned int wdigit; /* digit widened to parameter size */ #define BASE_TWODIGITS_TYPE long typedef unsigned BASE_TWODIGITS_TYPE twodigits; typedef BASE_TWODIGITS_TYPE stwodigits; /* signed variant of twodigits */ #define PyLong_SHIFT 15 #define PyLong_BASE ((digit)1 << PyLong_SHIFT) -#define PyLong_MASK ((int)(PyLong_BASE - 1)) +#define PyLong_MASK ((digit)(PyLong_BASE - 1)) /* b/w compatibility with Python 2.5 */ #define SHIFT PyLong_SHIFT Modified: python/trunk/Lib/test/test_sys.py ============================================================================== --- python/trunk/Lib/test/test_sys.py (original) +++ python/trunk/Lib/test/test_sys.py Sun Feb 15 11:13:41 2009 @@ -593,12 +593,12 @@ # listreverseiterator (list) check(reversed([]), size(h + 'lP')) # long - check(0L, size(vh + 'H') - self.H) - check(1L, size(vh + 'H')) - check(-1L, size(vh + 'H')) - check(32768L, size(vh + 'H') + self.H) - check(32768L*32768L-1, size(vh + 'H') + self.H) - check(32768L*32768L, size(vh + 'H') + 2*self.H) + check(0L, size(vh)) + check(1L, size(vh) + self.H) + check(-1L, size(vh) + self.H) + check(32768L, size(vh) + 2*self.H) + check(32768L*32768L-1, size(vh) + 2*self.H) + check(32768L*32768L, size(vh) + 3*self.H) # module check(unittest, size(h + 'P')) # None Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Feb 15 11:13:41 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #5260: Long integers now consume less memory: average + saving is 2 bytes per long on a 32-bit system and 6 bytes per long + on a 64-bit system. + - Issue #5186: Reduce hash collisions for objects with no __hash__ method by rotating the object pointer by 4 bits to the right. Modified: python/trunk/Objects/longobject.c ============================================================================== --- python/trunk/Objects/longobject.c (original) +++ python/trunk/Objects/longobject.c Sun Feb 15 11:13:41 2009 @@ -8,6 +8,7 @@ #include "longintrepr.h" #include +#include /* For long multiplication, use the O(N**2) school algorithm unless * both operands contain more than KARATSUBA_CUTOFF digits (this @@ -30,12 +31,6 @@ #define MAX(x, y) ((x) < (y) ? (y) : (x)) #define MIN(x, y) ((x) > (y) ? (y) : (x)) -/* Forward */ -static PyLongObject *long_normalize(PyLongObject *); -static PyLongObject *mul1(PyLongObject *, wdigit); -static PyLongObject *muladd1(PyLongObject *, wdigit, wdigit); -static PyLongObject *divrem1(PyLongObject *, digit, digit *); - #define SIGCHECK(PyTryBlock) \ if (--_Py_Ticker < 0) { \ _Py_Ticker = _Py_CheckInterval; \ @@ -62,16 +57,20 @@ /* Allocate a new long int object with size digits. Return NULL and set exception if we run out of memory. */ +#define MAX_LONG_DIGITS \ + ((PY_SSIZE_T_MAX - offsetof(PyLongObject, ob_digit))/sizeof(digit)) + PyLongObject * _PyLong_New(Py_ssize_t size) { - if (size > PY_SSIZE_T_MAX) { - PyErr_NoMemory(); + if (size > MAX_LONG_DIGITS) { + PyErr_SetString(PyExc_OverflowError, + "too many digits in integer"); return NULL; } /* coverity[ampersand_in_size] */ - /* XXX(nnorwitz): This can overflow -- - PyObject_NEW_VAR / _PyObject_VAR_SIZE need to detect overflow */ + /* XXX(nnorwitz): PyObject_NEW_VAR / _PyObject_VAR_SIZE need to detect + overflow */ return PyObject_NEW_VAR(PyLongObject, &PyLong_Type, size); } @@ -197,8 +196,8 @@ return NULL; frac = ldexp(frac, (expo-1) % PyLong_SHIFT + 1); for (i = ndig; --i >= 0; ) { - long bits = (long)frac; - v->ob_digit[i] = (digit) bits; + digit bits = (digit)frac; + v->ob_digit[i] = bits; frac = frac - (double)bits; frac = ldexp(frac, PyLong_SHIFT); } @@ -438,9 +437,9 @@ int incr; /* direction to move pstartbyte */ const unsigned char* pendbyte; /* MSB of bytes */ size_t numsignificantbytes; /* number of bytes that matter */ - size_t ndigits; /* number of Python long digits */ + Py_ssize_t ndigits; /* number of Python long digits */ PyLongObject* v; /* result */ - int idigit = 0; /* next free index in v->ob_digit */ + Py_ssize_t idigit = 0; /* next free index in v->ob_digit */ if (n == 0) return PyLong_FromLong(0L); @@ -483,12 +482,16 @@ } /* How many Python long digits do we need? We have - 8*numsignificantbytes bits, and each Python long digit has PyLong_SHIFT - bits, so it's the ceiling of the quotient. */ + 8*numsignificantbytes bits, and each Python long digit has + PyLong_SHIFT bits, so it's the ceiling of the quotient. */ + /* catch overflow before it happens */ + if (numsignificantbytes > (PY_SSIZE_T_MAX - PyLong_SHIFT) / 8) { + PyErr_SetString(PyExc_OverflowError, + "byte array too long to convert to int"); + return NULL; + } ndigits = (numsignificantbytes * 8 + PyLong_SHIFT - 1) / PyLong_SHIFT; - if (ndigits > (size_t)INT_MAX) - return PyErr_NoMemory(); - v = _PyLong_New((int)ndigits); + v = _PyLong_New(ndigits); if (v == NULL) return NULL; @@ -517,8 +520,9 @@ accumbits += 8; if (accumbits >= PyLong_SHIFT) { /* There's enough to fill a Python digit. */ - assert(idigit < (int)ndigits); - v->ob_digit[idigit] = (digit)(accum & PyLong_MASK); + assert(idigit < ndigits); + v->ob_digit[idigit] = (digit)(accum & + PyLong_MASK); ++idigit; accum >>= PyLong_SHIFT; accumbits -= PyLong_SHIFT; @@ -527,7 +531,7 @@ } assert(accumbits < PyLong_SHIFT); if (accumbits) { - assert(idigit < (int)ndigits); + assert(idigit < ndigits); v->ob_digit[idigit] = (digit)accum; ++idigit; } @@ -1124,19 +1128,11 @@ /* Multiply by a single digit, ignoring the sign. */ static PyLongObject * -mul1(PyLongObject *a, wdigit n) -{ - return muladd1(a, n, (digit)0); -} - -/* Multiply by a single digit and add a single digit, ignoring the sign. */ - -static PyLongObject * -muladd1(PyLongObject *a, wdigit n, wdigit extra) +mul1(PyLongObject *a, digit n) { Py_ssize_t size_a = ABS(Py_SIZE(a)); PyLongObject *z = _PyLong_New(size_a+1); - twodigits carry = extra; + twodigits carry = 0; Py_ssize_t i; if (z == NULL) @@ -1757,8 +1753,6 @@ static PyLongObject *x_divrem (PyLongObject *, PyLongObject *, PyLongObject **); static PyObject *long_long(PyObject *v); -static int long_divrem(PyLongObject *, PyLongObject *, - PyLongObject **, PyLongObject **); /* Long division with remainder, top-level routine */ @@ -1976,14 +1970,12 @@ sign = -1; i = -(i); } -#define LONG_BIT_PyLong_SHIFT (8*sizeof(long) - PyLong_SHIFT) /* The following loop produces a C unsigned long x such that x is congruent to the absolute value of v modulo ULONG_MAX. The resulting x is nonzero if and only if v is. */ while (--i >= 0) { /* Force a native long #-bits (32 or 64) circular shift */ - x = ((x << PyLong_SHIFT) & ~PyLong_MASK) | - ((x >> LONG_BIT_PyLong_SHIFT) & PyLong_MASK); + x = (x >> (8*SIZEOF_LONG-PyLong_SHIFT)) | (x << PyLong_SHIFT); x += v->ob_digit[i]; /* If the addition above overflowed we compensate by incrementing. This preserves the value modulo @@ -1991,11 +1983,10 @@ if (x < v->ob_digit[i]) x++; } -#undef LONG_BIT_PyLong_SHIFT x = x * sign; - if (x == -1) - x = -2; - return x; + if (x == (unsigned long)-1) + x = (unsigned long)-2; + return (long)x; } @@ -3337,7 +3328,7 @@ /* Since PyLong_FromString doesn't have a length parameter, * check here for possible NULs in the string. */ char *string = PyString_AS_STRING(x); - if (strlen(string) != PyString_Size(x)) { + if (strlen(string) != (size_t)PyString_Size(x)) { /* create a repr() of the input string, * just like PyLong_FromString does. */ PyObject *srepr; @@ -3443,9 +3434,7 @@ { Py_ssize_t res; - res = v->ob_type->tp_basicsize; - if (v->ob_size != 0) - res += abs(v->ob_size) * sizeof(digit); + res = v->ob_type->tp_basicsize + ABS(Py_SIZE(v))*sizeof(digit); return PyInt_FromSsize_t(res); } @@ -3619,7 +3608,7 @@ PyObject_HEAD_INIT(&PyType_Type) 0, /* ob_size */ "long", /* tp_name */ - sizeof(PyLongObject) - sizeof(digit), /* tp_basicsize */ + offsetof(PyLongObject, ob_digit), /* tp_basicsize */ sizeof(digit), /* tp_itemsize */ long_dealloc, /* tp_dealloc */ 0, /* tp_print */ From buildbot at python.org Sun Feb 15 11:43:01 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 15 Feb 2009 10:43:01 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090215104301.E63421E4002@bag.python.org> The Buildbot has detected a new failure of OS X x86 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/150 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: hirokazu.yamamoto,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_email_renamed make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Feb 15 12:04:39 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 15 Feb 2009 12:04:39 +0100 (CET) Subject: [Python-checkins] r69635 - in python/branches/py3k: Include/longintrepr.h Objects/longobject.c Message-ID: <20090215110439.4C12D1E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 15 12:04:38 2009 New Revision: 69635 Log: Merged revisions 69634 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69634 | mark.dickinson | 2009-02-15 10:13:41 +0000 (Sun, 15 Feb 2009) | 6 lines Issue #5260: Various portability and standards compliance fixes, optimizations and cleanups in Objects/longobject.c. The most significant change is that longs now use less memory: average savings are 2 bytes per long on 32-bit systems and 6 bytes per long on 64-bit systems. (This memory saving already exists in py3k.) ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Include/longintrepr.h python/branches/py3k/Objects/longobject.c Modified: python/branches/py3k/Include/longintrepr.h ============================================================================== --- python/branches/py3k/Include/longintrepr.h (original) +++ python/branches/py3k/Include/longintrepr.h Sun Feb 15 12:04:38 2009 @@ -19,14 +19,13 @@ long_pow() requires that SHIFT be divisible by 5. */ typedef unsigned short digit; -typedef unsigned int wdigit; /* digit widened to parameter size */ #define BASE_TWODIGITS_TYPE long typedef unsigned BASE_TWODIGITS_TYPE twodigits; typedef BASE_TWODIGITS_TYPE stwodigits; /* signed variant of twodigits */ #define PyLong_SHIFT 15 #define PyLong_BASE ((digit)1 << PyLong_SHIFT) -#define PyLong_MASK ((int)(PyLong_BASE - 1)) +#define PyLong_MASK ((digit)(PyLong_BASE - 1)) #if PyLong_SHIFT % 5 != 0 #error "longobject.c requires that SHIFT be divisible by 5" Modified: python/branches/py3k/Objects/longobject.c ============================================================================== --- python/branches/py3k/Objects/longobject.c (original) +++ python/branches/py3k/Objects/longobject.c Sun Feb 15 12:04:38 2009 @@ -6,6 +6,7 @@ #include "longintrepr.h" #include +#include #ifndef NSMALLPOSINTS #define NSMALLPOSINTS 257 @@ -90,12 +91,6 @@ #define MAX(x, y) ((x) < (y) ? (y) : (x)) #define MIN(x, y) ((x) > (y) ? (y) : (x)) -/* Forward */ -static PyLongObject *long_normalize(PyLongObject *); -static PyLongObject *mul1(PyLongObject *, wdigit); -static PyLongObject *muladd1(PyLongObject *, wdigit, wdigit); -static PyLongObject *divrem1(PyLongObject *, digit, digit *); - #define SIGCHECK(PyTryBlock) \ if (--_Py_Ticker < 0) { \ _Py_Ticker = _Py_CheckInterval; \ @@ -122,25 +117,29 @@ /* Allocate a new long int object with size digits. Return NULL and set exception if we run out of memory. */ +#define MAX_LONG_DIGITS \ + ((PY_SSIZE_T_MAX - offsetof(PyLongObject, ob_digit))/sizeof(digit)) + PyLongObject * _PyLong_New(Py_ssize_t size) { PyLongObject *result; - /* Can't use sizeof(PyLongObject) here, since the - compiler takes padding at the end into account. - As the consequence, this would waste 2 bytes on - a 32-bit system, and 6 bytes on a 64-bit system. - This computation would be incorrect on systems - which have padding before the digits; with 16-bit - digits this should not happen. */ - result = PyObject_MALLOC(sizeof(PyVarObject) + + /* Number of bytes needed is: offsetof(PyLongObject, ob_digit) + + sizeof(digit)*size. Previous incarnations of this code used + sizeof(PyVarObject) instead of the offsetof, but this risks being + incorrect in the presence of padding between the PyVarObject header + and the digits. */ + if (size > MAX_LONG_DIGITS) { + PyErr_SetString(PyExc_OverflowError, + "too many digits in integer"); + return NULL; + } + result = PyObject_MALLOC(offsetof(PyLongObject, ob_digit) + size*sizeof(digit)); if (!result) { PyErr_NoMemory(); return NULL; } - /* XXX(nnorwitz): This can overflow -- - PyObject_NEW_VAR / _PyObject_VAR_SIZE need to detect overflow */ return (PyLongObject*)PyObject_INIT_VAR(result, &PyLong_Type, size); } @@ -297,8 +296,8 @@ return NULL; frac = ldexp(frac, (expo-1) % PyLong_SHIFT + 1); for (i = ndig; --i >= 0; ) { - long bits = (long)frac; - v->ob_digit[i] = (digit) bits; + digit bits = (digit)frac; + v->ob_digit[i] = bits; frac = frac - (double)bits; frac = ldexp(frac, PyLong_SHIFT); } @@ -667,9 +666,9 @@ int incr; /* direction to move pstartbyte */ const unsigned char* pendbyte; /* MSB of bytes */ size_t numsignificantbytes; /* number of bytes that matter */ - size_t ndigits; /* number of Python long digits */ + Py_ssize_t ndigits; /* number of Python long digits */ PyLongObject* v; /* result */ - int idigit = 0; /* next free index in v->ob_digit */ + Py_ssize_t idigit = 0; /* next free index in v->ob_digit */ if (n == 0) return PyLong_FromLong(0L); @@ -712,12 +711,16 @@ } /* How many Python long digits do we need? We have - 8*numsignificantbytes bits, and each Python long digit has PyLong_SHIFT - bits, so it's the ceiling of the quotient. */ + 8*numsignificantbytes bits, and each Python long digit has + PyLong_SHIFT bits, so it's the ceiling of the quotient. */ + /* catch overflow before it happens */ + if (numsignificantbytes > (PY_SSIZE_T_MAX - PyLong_SHIFT) / 8) { + PyErr_SetString(PyExc_OverflowError, + "byte array too long to convert to int"); + return NULL; + } ndigits = (numsignificantbytes * 8 + PyLong_SHIFT - 1) / PyLong_SHIFT; - if (ndigits > (size_t)INT_MAX) - return PyErr_NoMemory(); - v = _PyLong_New((int)ndigits); + v = _PyLong_New(ndigits); if (v == NULL) return NULL; @@ -746,8 +749,9 @@ accumbits += 8; if (accumbits >= PyLong_SHIFT) { /* There's enough to fill a Python digit. */ - assert(idigit < (int)ndigits); - v->ob_digit[idigit] = (digit)(accum & PyLong_MASK); + assert(idigit < ndigits); + v->ob_digit[idigit] = (digit)(accum & + PyLong_MASK); ++idigit; accum >>= PyLong_SHIFT; accumbits -= PyLong_SHIFT; @@ -756,7 +760,7 @@ } assert(accumbits < PyLong_SHIFT); if (accumbits) { - assert(idigit < (int)ndigits); + assert(idigit < ndigits); v->ob_digit[idigit] = (digit)accum; ++idigit; } @@ -1409,19 +1413,11 @@ /* Multiply by a single digit, ignoring the sign. */ static PyLongObject * -mul1(PyLongObject *a, wdigit n) -{ - return muladd1(a, n, (digit)0); -} - -/* Multiply by a single digit and add a single digit, ignoring the sign. */ - -static PyLongObject * -muladd1(PyLongObject *a, wdigit n, wdigit extra) +mul1(PyLongObject *a, digit n) { Py_ssize_t size_a = ABS(Py_SIZE(a)); PyLongObject *z = _PyLong_New(size_a+1); - twodigits carry = extra; + twodigits carry = 0; Py_ssize_t i; if (z == NULL) @@ -2034,8 +2030,6 @@ static PyLongObject *x_divrem (PyLongObject *, PyLongObject *, PyLongObject **); static PyObject *long_long(PyObject *v); -static int long_divrem(PyLongObject *, PyLongObject *, - PyLongObject **, PyLongObject **); /* Long division with remainder, top-level routine */ @@ -2293,14 +2287,12 @@ sign = -1; i = -(i); } -#define LONG_BIT_PyLong_SHIFT (8*sizeof(long) - PyLong_SHIFT) /* The following loop produces a C unsigned long x such that x is congruent to the absolute value of v modulo ULONG_MAX. The resulting x is nonzero if and only if v is. */ while (--i >= 0) { /* Force a native long #-bits (32 or 64) circular shift */ - x = ((x << PyLong_SHIFT) & ~PyLong_MASK) | - ((x >> LONG_BIT_PyLong_SHIFT) & PyLong_MASK); + x = (x >> (8*SIZEOF_LONG-PyLong_SHIFT)) | (x << PyLong_SHIFT); x += v->ob_digit[i]; /* If the addition above overflowed we compensate by incrementing. This preserves the value modulo @@ -2308,11 +2300,10 @@ if (x < v->ob_digit[i]) x++; } -#undef LONG_BIT_PyLong_SHIFT x = x * sign; - if (x == -1) - x = -2; - return x; + if (x == (unsigned long)-1) + x = (unsigned long)-2; + return (long)x; } @@ -3566,12 +3557,12 @@ /* Since PyLong_FromString doesn't have a length parameter, * check here for possible NULs in the string. */ char *string; - int size = Py_SIZE(x); + Py_ssize_t size = Py_SIZE(x); if (PyByteArray_Check(x)) string = PyByteArray_AS_STRING(x); else string = PyBytes_AS_STRING(x); - if (strlen(string) != size) { + if (strlen(string) != (size_t)size) { /* We only see this if there's a null byte in x, x is a bytes or buffer, *and* a base is given. */ PyErr_Format(PyExc_ValueError, @@ -3784,7 +3775,7 @@ { Py_ssize_t res; - res = sizeof(PyVarObject) + abs(Py_SIZE(v))*sizeof(digit); + res = offsetof(PyLongObject, ob_digit) + ABS(Py_SIZE(v))*sizeof(digit); return PyLong_FromSsize_t(res); } @@ -3959,9 +3950,7 @@ PyTypeObject PyLong_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "int", /* tp_name */ - /* See _PyLong_New for why this isn't - sizeof(PyLongObject) - sizeof(digit) */ - sizeof(PyVarObject), /* tp_basicsize */ + offsetof(PyLongObject, ob_digit), /* tp_basicsize */ sizeof(digit), /* tp_itemsize */ long_dealloc, /* tp_dealloc */ 0, /* tp_print */ @@ -3973,8 +3962,8 @@ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ (hashfunc)long_hash, /* tp_hash */ - 0, /* tp_call */ - long_repr, /* tp_str */ + 0, /* tp_call */ + long_repr, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -3998,7 +3987,7 @@ 0, /* tp_init */ 0, /* tp_alloc */ long_new, /* tp_new */ - PyObject_Del, /* tp_free */ + PyObject_Del, /* tp_free */ }; int From buildbot at python.org Sun Feb 15 12:12:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 15 Feb 2009 11:12:52 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090215111253.16A291E4002@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/157 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: hirokazu.yamamoto,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sun Feb 15 15:31:44 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 15 Feb 2009 15:31:44 +0100 (CET) Subject: [Python-checkins] r69636 - python/branches/io-c/Modules/io.c Message-ID: <20090215143144.0A4291E400C@bag.python.org> Author: benjamin.peterson Date: Sun Feb 15 15:31:42 2009 New Revision: 69636 Log: dealloc unsupported_operation Modified: python/branches/io-c/Modules/io.c Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Sun Feb 15 15:31:42 2009 @@ -544,6 +544,7 @@ Py_CLEAR(mod->os_module); if (mod->locale_module != NULL) Py_CLEAR(mod->locale_module); + Py_CLEAR(mod->unsupported_operation); return 0; } @@ -616,6 +617,7 @@ "UnsupportedOperation", PyExc_ValueError, PyExc_IOError); if (state->unsupported_operation == NULL) goto fail; + Py_INCREF(state->unsupported_operation); PyModule_AddObject(m, "UnsupportedOperation", state->unsupported_operation); From python-checkins at python.org Sun Feb 15 16:14:57 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 15 Feb 2009 16:14:57 +0100 (CET) Subject: [Python-checkins] r69637 - in python/branches/py3k: Include/longintrepr.h Objects/longobject.c Message-ID: <20090215151457.BABD51E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 15 16:14:57 2009 New Revision: 69637 Log: A few more type fixes for py3k that were missed in r69635 Modified: python/branches/py3k/Include/longintrepr.h python/branches/py3k/Objects/longobject.c Modified: python/branches/py3k/Include/longintrepr.h ============================================================================== --- python/branches/py3k/Include/longintrepr.h (original) +++ python/branches/py3k/Include/longintrepr.h Sun Feb 15 16:14:57 2009 @@ -19,6 +19,7 @@ long_pow() requires that SHIFT be divisible by 5. */ typedef unsigned short digit; +typedef short sdigit; /* signed variant of digit */ #define BASE_TWODIGITS_TYPE long typedef unsigned BASE_TWODIGITS_TYPE twodigits; typedef BASE_TWODIGITS_TYPE stwodigits; /* signed variant of twodigits */ Modified: python/branches/py3k/Objects/longobject.c ============================================================================== --- python/branches/py3k/Objects/longobject.c (original) +++ python/branches/py3k/Objects/longobject.c Sun Feb 15 16:14:57 2009 @@ -15,8 +15,10 @@ #define NSMALLNEGINTS 5 #endif -#define MEDIUM_VALUE(x) (Py_SIZE(x) < 0 ? -(x)->ob_digit[0] : \ - (Py_SIZE(x) == 0 ? 0 : (x)->ob_digit[0])) +/* convert a PyLong of size 1, 0 or -1 to an sdigit */ +#define MEDIUM_VALUE(x) (Py_SIZE(x) < 0 ? -(sdigit)(x)->ob_digit[0] : \ + (Py_SIZE(x) == 0 ? (sdigit)0 : \ + (sdigit)(x)->ob_digit[0])) #define ABS(x) ((x) < 0 ? -(x) : (x)) #if NSMALLNEGINTS + NSMALLPOSINTS > 0 @@ -31,7 +33,7 @@ #endif static PyObject * -get_small_int(int ival) +get_small_int(sdigit ival) { PyObject *v = (PyObject*)(small_ints + ival + NSMALLNEGINTS); Py_INCREF(v); @@ -52,7 +54,7 @@ maybe_small_long(PyLongObject *v) { if (v && ABS(Py_SIZE(v)) <= 1) { - int ival = MEDIUM_VALUE(v); + sdigit ival = MEDIUM_VALUE(v); if (-NSMALLNEGINTS <= ival && ival < NSMALLPOSINTS) { Py_DECREF(v); return (PyLongObject *)get_small_int(ival); @@ -129,7 +131,7 @@ sizeof(PyVarObject) instead of the offsetof, but this risks being incorrect in the presence of padding between the PyVarObject header and the digits. */ - if (size > MAX_LONG_DIGITS) { + if (size > (Py_ssize_t)MAX_LONG_DIGITS) { PyErr_SetString(PyExc_OverflowError, "too many digits in integer"); return NULL; @@ -154,7 +156,7 @@ if (i < 0) i = -(i); if (i < 2) { - int ival = src->ob_digit[0]; + sdigit ival = src->ob_digit[0]; if (Py_SIZE(src) < 0) ival = -ival; CHECK_SMALL_INT(ival); @@ -2142,7 +2144,7 @@ carry += v->ob_digit[i+k] - z + ((twodigits)zz << PyLong_SHIFT); v->ob_digit[i+k] = (digit)(carry & PyLong_MASK); - carry = Py_ARITHMETIC_RIGHT_SHIFT(BASE_TWODIGITS_TYPE, + carry = Py_ARITHMETIC_RIGHT_SHIFT(stwodigits, carry, PyLong_SHIFT); carry -= zz; } @@ -2162,7 +2164,7 @@ carry += v->ob_digit[i+k] + w->ob_digit[i]; v->ob_digit[i+k] = (digit)(carry & PyLong_MASK); carry = Py_ARITHMETIC_RIGHT_SHIFT( - BASE_TWODIGITS_TYPE, + stwodigits, carry, PyLong_SHIFT); } } @@ -2216,7 +2218,7 @@ if (i < 0) sign = 0; else { - sign = (int)a->ob_digit[i] - (int)b->ob_digit[i]; + sign = (sdigit)a->ob_digit[i] - (sdigit)b->ob_digit[i]; if (Py_SIZE(a) < 0) sign = -sign; } @@ -3159,7 +3161,7 @@ for (i = Py_SIZE(b) - 1; i >= 0; --i) { digit bi = b->ob_digit[i]; - for (j = 1 << (PyLong_SHIFT-1); j != 0; j >>= 1) { + for (j = (digit)1 << (PyLong_SHIFT-1); j != 0; j >>= 1) { MULT(z, z, z) if (bi & j) MULT(z, a, z) @@ -3384,9 +3386,8 @@ { digit maska, maskb; /* 0 or PyLong_MASK */ int negz; - Py_ssize_t size_a, size_b, size_z; + Py_ssize_t size_a, size_b, size_z, i; PyLongObject *z; - int i; digit diga, digb; PyObject *v; From python-checkins at python.org Sun Feb 15 16:24:45 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 15 Feb 2009 16:24:45 +0100 (CET) Subject: [Python-checkins] r69638 - python/branches/io-c/Lib/test/test_memoryio.py Message-ID: <20090215152445.800E71E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 15 16:24:45 2009 New Revision: 69638 Log: actually test the C implementation Modified: python/branches/io-c/Lib/test/test_memoryio.py Modified: python/branches/io-c/Lib/test/test_memoryio.py ============================================================================== --- python/branches/io-c/Lib/test/test_memoryio.py (original) +++ python/branches/io-c/Lib/test/test_memoryio.py Sun Feb 15 16:24:45 2009 @@ -9,12 +9,6 @@ import io import sys -try: - import _bytesio, _stringio - has_c_implementation = True -except ImportError: - has_c_implementation = False - class MemoryTestMixin: @@ -400,18 +394,15 @@ # self.assertEqual(memio.tell(), len(buf) * 2) # self.assertEqual(memio.getvalue(), buf + buf) -if has_c_implementation: - class CBytesIOTest(PyBytesIOTest): - ioclass = io.BytesIO +class CBytesIOTest(PyBytesIOTest): + ioclass = io.BytesIO - class CStringIOTest(PyStringIOTest): - ioclass = io.StringIO +class CStringIOTest(PyStringIOTest): + ioclass = io.StringIO def test_main(): - tests = [PyBytesIOTest, PyStringIOTest] - if has_c_implementation: - tests.extend([CBytesIOTest, CStringIOTest]) + tests = [PyBytesIOTest, PyStringIOTest, CBytesIOTest, CStringIOTest] support.run_unittest(*tests) if __name__ == '__main__': From python-checkins at python.org Sun Feb 15 16:48:39 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 15 Feb 2009 16:48:39 +0100 (CET) Subject: [Python-checkins] r69639 - in python/trunk: Include/longintrepr.h Objects/longobject.c Message-ID: <20090215154839.8DB851E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 15 16:48:39 2009 New Revision: 69639 Log: A few more minor fixed in longobject.c Modified: python/trunk/Include/longintrepr.h python/trunk/Objects/longobject.c Modified: python/trunk/Include/longintrepr.h ============================================================================== --- python/trunk/Include/longintrepr.h (original) +++ python/trunk/Include/longintrepr.h Sun Feb 15 16:48:39 2009 @@ -19,6 +19,7 @@ long_pow() requires that SHIFT be divisible by 5. */ typedef unsigned short digit; +typedef short sdigit; /* signed variant of digit */ #define BASE_TWODIGITS_TYPE long typedef unsigned BASE_TWODIGITS_TYPE twodigits; typedef BASE_TWODIGITS_TYPE stwodigits; /* signed variant of twodigits */ Modified: python/trunk/Objects/longobject.c ============================================================================== --- python/trunk/Objects/longobject.c (original) +++ python/trunk/Objects/longobject.c Sun Feb 15 16:48:39 2009 @@ -63,7 +63,7 @@ PyLongObject * _PyLong_New(Py_ssize_t size) { - if (size > MAX_LONG_DIGITS) { + if (size > (Py_ssize_t)MAX_LONG_DIGITS) { PyErr_SetString(PyExc_OverflowError, "too many digits in integer"); return NULL; @@ -1945,7 +1945,7 @@ if (i < 0) sign = 0; else { - sign = (int)a->ob_digit[i] - (int)b->ob_digit[i]; + sign = (sdigit)a->ob_digit[i] - (sdigit)b->ob_digit[i]; if (Py_SIZE(a) < 0) sign = -sign; } @@ -2865,7 +2865,7 @@ for (i = Py_SIZE(b) - 1; i >= 0; --i) { digit bi = b->ob_digit[i]; - for (j = 1 << (PyLong_SHIFT-1); j != 0; j >>= 1) { + for (j = (digit)1 << (PyLong_SHIFT-1); j != 0; j >>= 1) { MULT(z, z, z) if (bi & j) MULT(z, a, z) @@ -3099,9 +3099,8 @@ { digit maska, maskb; /* 0 or PyLong_MASK */ int negz; - Py_ssize_t size_a, size_b, size_z; + Py_ssize_t size_a, size_b, size_z, i; PyLongObject *z; - int i; digit diga, digb; PyObject *v; From python-checkins at python.org Sun Feb 15 16:49:17 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 15 Feb 2009 16:49:17 +0100 (CET) Subject: [Python-checkins] r69640 - python/branches/py3k Message-ID: <20090215154917.2121F1E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 15 16:49:16 2009 New Revision: 69640 Log: Blocked revisions 69639 via svnmerge ........ r69639 | mark.dickinson | 2009-02-15 15:48:39 +0000 (Sun, 15 Feb 2009) | 2 lines A few more minor fixed in longobject.c ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sun Feb 15 16:52:00 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 15 Feb 2009 16:52:00 +0100 (CET) Subject: [Python-checkins] r69639 - svn:log Message-ID: <20090215155200.A794F1E4002@bag.python.org> Author: mark.dickinson Revision: 69639 Property Name: svn:log Action: modified Property diff: --- old property value +++ new property value @@ -1 +1 @@ -A few more minor fixed in longobject.c +A few more minor fixes in longobject.c From python-checkins at python.org Sun Feb 15 17:12:37 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 15 Feb 2009 17:12:37 +0100 (CET) Subject: [Python-checkins] r69641 - in python/branches/io-c/Modules: _bufferedio.c _iobase.c _iomodule.h _textio.c io.c Message-ID: <20090215161237.954901E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 15 17:12:37 2009 New Revision: 69641 Log: make interned strings globals again ;( putting them in the module state was asking for trouble when the module was dealloced before the classes in it were Modified: python/branches/io-c/Modules/_bufferedio.c python/branches/io-c/Modules/_iobase.c python/branches/io-c/Modules/_iomodule.h python/branches/io-c/Modules/_textio.c python/branches/io-c/Modules/io.c Modified: python/branches/io-c/Modules/_bufferedio.c ============================================================================== --- python/branches/io-c/Modules/_bufferedio.c (original) +++ python/branches/io-c/Modules/_bufferedio.c Sun Feb 15 17:12:37 2009 @@ -344,7 +344,6 @@ { PyObject *pos = Py_None; PyObject *res; - _PyIO_State *state = IO_STATE; CHECK_INITIALIZED(self) if (!PyArg_ParseTuple(args, "|O:truncate", &pos)) { @@ -355,7 +354,7 @@ * and a flush may be necessary to synch both views of the current * file state. */ - res = PyObject_CallMethodObjArgs(self->raw, state->str_flush, NULL); + res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_flush, NULL); if (res == NULL) return NULL; Py_DECREF(res); @@ -371,7 +370,7 @@ /* XXX: Should seek() be used, instead of passing the position * XXX directly to truncate? */ - res = PyObject_CallMethodObjArgs(self->raw, state->str_truncate, pos, NULL); + res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_truncate, pos, NULL); Py_DECREF(pos); return res; @@ -383,7 +382,7 @@ BufferedIOMixin_flush(BufferedObject *self, PyObject *args) { CHECK_INITIALIZED(self) - return PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_flush, NULL); + return PyObject_CallMethodObjArgs(self->raw, _PyIO_str_flush, NULL); } static int @@ -392,7 +391,7 @@ int closed; PyObject *res; CHECK_INITIALIZED_INT(self) - res = PyObject_GetAttr(self->raw, IO_STATE->str_closed); + res = PyObject_GetAttr(self->raw, _PyIO_str_closed); if (res == NULL) return -1; closed = PyObject_IsTrue(res); @@ -404,7 +403,7 @@ BufferedIOMixin_closed_get(BufferedObject *self, void *context) { CHECK_INITIALIZED(self) - return PyObject_GetAttr(self->raw, IO_STATE->str_closed); + return PyObject_GetAttr(self->raw, _PyIO_str_closed); } static PyObject * @@ -412,7 +411,6 @@ { PyObject *res = NULL; int r; - _PyIO_State *state = IO_STATE; CHECK_INITIALIZED(self) ENTER_BUFFERED(self) @@ -427,7 +425,7 @@ } /* flush() will most probably re-take the lock, so drop it first */ LEAVE_BUFFERED(self) - res = PyObject_CallMethodObjArgs((PyObject *)self, state->str_flush, NULL); + res = PyObject_CallMethodObjArgs((PyObject *)self, _PyIO_str_flush, NULL); ENTER_BUFFERED(self) if (res == NULL) { /* If flush() fails, just give up */ @@ -438,7 +436,7 @@ } Py_XDECREF(res); - res = PyObject_CallMethodObjArgs(self->raw, state->str_close, NULL); + res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_close, NULL); end: LEAVE_BUFFERED(self) @@ -451,21 +449,21 @@ BufferedIOMixin_seekable(BufferedObject *self, PyObject *args) { CHECK_INITIALIZED(self) - return PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_seekable, NULL); + return PyObject_CallMethodObjArgs(self->raw, _PyIO_str_seekable, NULL); } static PyObject * BufferedIOMixin_readable(BufferedObject *self, PyObject *args) { CHECK_INITIALIZED(self) - return PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_readable, NULL); + return PyObject_CallMethodObjArgs(self->raw, _PyIO_str_readable, NULL); } static PyObject * BufferedIOMixin_writable(BufferedObject *self, PyObject *args) { CHECK_INITIALIZED(self) - return PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_writable, NULL); + return PyObject_CallMethodObjArgs(self->raw, _PyIO_str_writable, NULL); } static PyObject * @@ -488,14 +486,14 @@ BufferedIOMixin_fileno(BufferedObject *self, PyObject *args) { CHECK_INITIALIZED(self) - return PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_fileno, NULL); + return PyObject_CallMethodObjArgs(self->raw, _PyIO_str_fileno, NULL); } static PyObject * BufferedIOMixin_isatty(BufferedObject *self, PyObject *args) { CHECK_INITIALIZED(self) - return PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_isatty, NULL); + return PyObject_CallMethodObjArgs(self->raw, _PyIO_str_isatty, NULL); } @@ -542,7 +540,7 @@ { PyObject *res; Py_off_t n; - res = PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_tell, NULL); + res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_tell, NULL); if (res == NULL) return -1; n = PyNumber_AsOff_t(res, PyExc_ValueError); @@ -571,7 +569,7 @@ Py_DECREF(posobj); return -1; } - res = PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_seek, + res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_seek, posobj, whenceobj, NULL); Py_DECREF(posobj); Py_DECREF(whenceobj); @@ -1036,7 +1034,7 @@ } _BufferedReader_reset_buf(self); } - res = PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_truncate, pos, NULL); + res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_truncate, pos, NULL); if (res == NULL) goto end; /* Reset cached position */ @@ -1064,7 +1062,7 @@ } else { line = PyObject_CallMethodObjArgs((PyObject *)self, - IO_STATE->str_readline, NULL); + _PyIO_str_readline, NULL); if (line && !PyBytes_Check(line)) { PyErr_Format(PyExc_IOError, "readline() should have returned a bytes object, " @@ -1142,7 +1140,7 @@ memobj = PyMemoryView_FromBuffer(&buf); if (memobj == NULL) return -1; - res = PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_readinto, memobj, NULL); + res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_readinto, memobj, NULL); Py_DECREF(memobj); if (res == NULL) return -1; @@ -1187,7 +1185,6 @@ PyObject *data, *res = NULL; Py_ssize_t current_size, remaining, written; char *out; - _PyIO_State *state = IO_STATE; static PyObject *sep = NULL; /* Special case for when the number of bytes to read is unspecified. */ @@ -1228,7 +1225,7 @@ } /* Read until EOF or until read() would block. */ - data = PyObject_CallMethodObjArgs(self->raw, state->str_read, NULL); + data = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_read, NULL); if (data == NULL) { Py_DECREF(chunks); return NULL; @@ -1524,7 +1521,7 @@ memobj = PyMemoryView_FromBuffer(&buf); if (memobj == NULL) return -1; - res = PyObject_CallMethodObjArgs(self->raw, IO_STATE->str_write, memobj, NULL); + res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_write, memobj, NULL); Py_DECREF(memobj); if (res == NULL) return -1; Modified: python/branches/io-c/Modules/_iobase.c ============================================================================== --- python/branches/io-c/Modules/_iobase.c (original) +++ python/branches/io-c/Modules/_iobase.c Sun Feb 15 17:12:37 2009 @@ -134,7 +134,7 @@ int closed; /* This gets the derived attribute, which is *not* __IOBase_closed in most cases! */ - res = PyObject_GetAttr(self, IO_STATE->str_closed); + res = PyObject_GetAttr(self, _PyIO_str_closed); if (res == NULL) return 0; closed = PyObject_IsTrue(res); @@ -173,7 +173,7 @@ if (IS_CLOSED(self)) Py_RETURN_NONE; - res = PyObject_CallMethodObjArgs(self, IO_STATE->str_flush, NULL); + res = PyObject_CallMethodObjArgs(self, _PyIO_str_flush, NULL); PyObject_SetAttrString(self, "__IOBase_closed", Py_True); if (res == NULL) { /* If flush() fails, just give up */ @@ -194,14 +194,13 @@ PyObject *res; PyObject *tp, *v, *tb; int closed = 1; - _PyIO_State *state = IO_STATE; PyErr_Fetch(&tp, &v, &tb); /* We need to resurrect the object as calling close() can invoke arbitrary code. */ ((PyObject *) self)->ob_refcnt++; /* The object could already be in an usable state, so we'll take any error as meaning "stop, nothing to see here". */ - res = PyObject_GetAttr(self, state->str_closed); + res = PyObject_GetAttr(self, _PyIO_str_closed); if (res == NULL) PyErr_Clear(); else { @@ -211,7 +210,7 @@ PyErr_Clear(); } if (closed == 0) { - res = PyObject_CallMethodObjArgs((PyObject *) self, state->str_close, + res = PyObject_CallMethodObjArgs((PyObject *) self, _PyIO_str_close, NULL); if (res == NULL) PyErr_Clear(); @@ -248,7 +247,7 @@ PyObject * _PyIOBase_checkSeekable(PyObject *self, PyObject *args) { - PyObject *res = PyObject_CallMethodObjArgs(self, IO_STATE->str_seekable, NULL); + PyObject *res = PyObject_CallMethodObjArgs(self, _PyIO_str_seekable, NULL); if (res == NULL) return NULL; if (res != Py_True) { @@ -277,7 +276,7 @@ PyObject * _PyIOBase_checkReadable(PyObject *self, PyObject *args) { - PyObject *res = PyObject_CallMethodObjArgs(self, IO_STATE->str_readable, NULL); + PyObject *res = PyObject_CallMethodObjArgs(self, _PyIO_str_readable, NULL); if (res == NULL) return NULL; if (res != Py_True) { @@ -306,7 +305,7 @@ PyObject * _PyIOBase_checkWritable(PyObject *self, PyObject *args) { - PyObject *res = PyObject_CallMethodObjArgs(self, IO_STATE->str_writable, NULL); + PyObject *res = PyObject_CallMethodObjArgs(self, _PyIO_str_writable, NULL); if (res == NULL) return NULL; if (res != Py_True) { @@ -335,7 +334,7 @@ static PyObject * IOBase_exit(PyObject *self, PyObject *args) { - return PyObject_CallMethodObjArgs(self, IO_STATE->str_close, NULL); + return PyObject_CallMethodObjArgs(self, _PyIO_str_close, NULL); } /* Lower-level APIs */ @@ -485,7 +484,7 @@ static PyObject * IOBase_iternext(PyObject *self) { - PyObject *line = PyObject_CallMethodObjArgs(self, IO_STATE->str_readline, NULL); + PyObject *line = PyObject_CallMethodObjArgs(self, _PyIO_str_readline, NULL); if (line == NULL) return NULL; @@ -562,7 +561,6 @@ static PyObject * IOBase_writelines(PyObject *self, PyObject *args) { - _PyIO_State *state = IO_STATE; PyObject *lines, *iter, *res; if (!PyArg_ParseTuple(args, "O:writelines", &lines)) { @@ -587,7 +585,7 @@ break; /* Stop Iteration */ } - res = PyObject_CallMethodObjArgs(self, state->str_write, line, NULL); + res = PyObject_CallMethodObjArgs(self, _PyIO_str_write, line, NULL); Py_DECREF(line); if (res == NULL) { Py_DECREF(iter); @@ -721,7 +719,7 @@ if (b == NULL) return NULL; - res = PyObject_CallMethodObjArgs(self, IO_STATE->str_readinto, b, NULL); + res = PyObject_CallMethodObjArgs(self, _PyIO_str_readinto, b, NULL); if (res == NULL) { Py_DECREF(b); return NULL; Modified: python/branches/io-c/Modules/_iomodule.h ============================================================================== --- python/branches/io-c/Modules/_iomodule.h (original) +++ python/branches/io-c/Modules/_iomodule.h Sun Feb 15 17:12:37 2009 @@ -100,31 +100,30 @@ PyObject *locale_module; PyObject *unsupported_operation; - - /* various interned strings */ - PyObject *str_close; - PyObject *str_closed; - PyObject *str_decode; - PyObject *str_encode; - PyObject *str_fileno; - PyObject *str_flush; - PyObject *str_getstate; - PyObject *str_isatty; - PyObject *str_newlines; - PyObject *str_read; - PyObject *str_read1; - PyObject *str_readable; - PyObject *str_readinto; - PyObject *str_readline; - PyObject *str_reset; - PyObject *str_seek; - PyObject *str_seekable; - PyObject *str_tell; - PyObject *str_truncate; - PyObject *str_writable; - PyObject *str_write; } _PyIO_State; #define IO_MOD_STATE(mod) ((_PyIO_State *)PyModule_GetState(mod)) #define IO_STATE IO_MOD_STATE(PyState_FindModule(&_PyIO_Module)) + +extern PyObject *_PyIO_str_close; +extern PyObject *_PyIO_str_closed; +extern PyObject *_PyIO_str_decode; +extern PyObject *_PyIO_str_encode; +extern PyObject *_PyIO_str_fileno; +extern PyObject *_PyIO_str_flush; +extern PyObject *_PyIO_str_getstate; +extern PyObject *_PyIO_str_isatty; +extern PyObject *_PyIO_str_newlines; +extern PyObject *_PyIO_str_read; +extern PyObject *_PyIO_str_read1; +extern PyObject *_PyIO_str_readable; +extern PyObject *_PyIO_str_readinto; +extern PyObject *_PyIO_str_readline; +extern PyObject *_PyIO_str_reset; +extern PyObject *_PyIO_str_seek; +extern PyObject *_PyIO_str_seekable; +extern PyObject *_PyIO_str_tell; +extern PyObject *_PyIO_str_truncate; +extern PyObject *_PyIO_str_writable; +extern PyObject *_PyIO_str_write; Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Sun Feb 15 17:12:37 2009 @@ -226,7 +226,7 @@ } /* decode input (with the eventual \r from a previous pass) */ - output = PyObject_CallMethodObjArgs(self->decoder, IO_STATE->str_decode, + output = PyObject_CallMethodObjArgs(self->decoder, _PyIO_str_decode, input, final ? Py_True : Py_False, NULL); if (output == NULL) return NULL; @@ -422,7 +422,7 @@ IncrementalNewlineDecoder_getstate(PyNewLineDecoderObject *self, PyObject *args) { PyObject *state = PyObject_CallMethodObjArgs(self->decoder, - IO_STATE->str_getstate, NULL); + _PyIO_str_getstate, NULL); PyObject *buffer; unsigned PY_LONG_LONG flag; @@ -461,7 +461,7 @@ { self->seennl = 0; self->pendingcr = 0; - return PyObject_CallMethodObjArgs(self->decoder, IO_STATE->str_reset, NULL); + return PyObject_CallMethodObjArgs(self->decoder, _PyIO_str_reset, NULL); } static PyObject * @@ -1046,7 +1046,7 @@ if (b == NULL) return -1; ret = PyObject_CallMethodObjArgs(self->buffer, - IO_STATE->str_write, b, NULL); + _PyIO_str_write, b, NULL); Py_DECREF(b); if (ret == NULL) return -1; @@ -1062,7 +1062,6 @@ PyObject *ret; PyObject *text; /* owned reference */ PyObject *b; - _PyIO_State *state = IO_STATE; Py_ssize_t textlen; int haslf = 0; int needflush = 0; @@ -1104,7 +1103,7 @@ b = (*self->encodefunc)((PyObject *) self, text); else b = PyObject_CallMethodObjArgs(self->encoder, - state->str_encode, text, NULL); + _PyIO_str_encode, text, NULL); Py_DECREF(text); if (b == NULL) return NULL; @@ -1129,7 +1128,7 @@ } if (needflush) { - ret = PyObject_CallMethodObjArgs(self->buffer, state->str_flush, NULL); + ret = PyObject_CallMethodObjArgs(self->buffer, _PyIO_str_flush, NULL); if (ret == NULL) return NULL; Py_DECREF(ret); @@ -1199,7 +1198,6 @@ PyObject *dec_flags = NULL; PyObject *input_chunk = NULL; PyObject *decoded_chars, *chunk_size; - _PyIO_State *iostate = IO_STATE; int eof; /* The return value is True unless EOF was reached. The decoded string is @@ -1219,7 +1217,7 @@ */ PyObject *state = PyObject_CallMethodObjArgs(self->decoder, - iostate->str_getstate, NULL); + _PyIO_str_getstate, NULL); if (state == NULL) return -1; /* Given this, we know there was a valid snapshot point @@ -1239,7 +1237,7 @@ if (chunk_size == NULL) goto fail; input_chunk = PyObject_CallMethodObjArgs(self->buffer, - iostate->str_read1, chunk_size, NULL); + _PyIO_str_read1, chunk_size, NULL); Py_DECREF(chunk_size); if (input_chunk == NULL) goto fail; @@ -1253,7 +1251,7 @@ } else { decoded_chars = PyObject_CallMethodObjArgs(self->decoder, - iostate->str_decode, input_chunk, eof ? Py_True : Py_False, NULL); + _PyIO_str_decode, input_chunk, eof ? Py_True : Py_False, NULL); } /* TODO sanity check: isinstance(decoded_chars, unicode) */ @@ -1308,7 +1306,7 @@ PyObject *decoded; if (bytes == NULL) goto fail; - decoded = PyObject_CallMethodObjArgs(self->decoder, IO_STATE->str_decode, + decoded = PyObject_CallMethodObjArgs(self->decoder, _PyIO_str_decode, bytes, Py_True, NULL); Py_DECREF(bytes); if (decoded == NULL) @@ -1748,7 +1746,7 @@ utf-16, that we are expecting a BOM). */ if (cookie->start_pos == 0 && cookie->dec_flags == 0) - res = PyObject_CallMethodObjArgs(self->decoder, IO_STATE->str_reset, NULL); + res = PyObject_CallMethodObjArgs(self->decoder, _PyIO_str_reset, NULL); else res = PyObject_CallMethod(self->decoder, "setstate", "((yi))", "", cookie->dec_flags); @@ -1766,7 +1764,6 @@ int whence = 0; static PyObject *zero = NULL; PyObject *res; - _PyIO_State *state = IO_STATE; int cmp; CHECK_INITIALIZED(self); @@ -1855,7 +1852,7 @@ goto fail; } - res = PyObject_CallMethodObjArgs((PyObject *)self, state->str_flush, NULL); + res = PyObject_CallMethodObjArgs((PyObject *)self, _PyIO_str_flush, NULL); if (res == NULL) goto fail; Py_DECREF(res); @@ -1871,7 +1868,7 @@ if (posobj == NULL) goto fail; res = PyObject_CallMethodObjArgs(self->buffer, - state->str_seek, posobj, NULL); + _PyIO_str_seek, posobj, NULL); Py_DECREF(posobj); if (res == NULL) goto fail; @@ -1939,7 +1936,6 @@ Py_ssize_t chars_to_skip, chars_decoded; PyObject *saved_state = NULL; char *input, *input_end; - _PyIO_State *iostate = IO_STATE; CHECK_INITIALIZED(self); CHECK_CLOSED(self); @@ -2000,7 +1996,7 @@ * forward until it gives us enough decoded characters. */ saved_state = PyObject_CallMethodObjArgs(self->decoder, - iostate->str_getstate, NULL); + _PyIO_str_getstate, NULL); if (saved_state == NULL) goto fail; @@ -2033,7 +2029,7 @@ cookie.bytes_to_feed += 1; state = PyObject_CallMethodObjArgs(self->decoder, - iostate->str_getstate, NULL); + _PyIO_str_getstate, NULL); if (state == NULL) goto fail; if (!PyArg_Parse(state, "(y#i)", &dec_buffer, &dec_buffer_len, &dec_flags)) { @@ -2105,27 +2101,26 @@ { PyObject *pos = Py_None; PyObject *res; - _PyIO_State *state = IO_STATE; CHECK_INITIALIZED(self) if (!PyArg_ParseTuple(args, "|O:truncate", &pos)) { return NULL; } - res = PyObject_CallMethodObjArgs((PyObject *) self, state->str_flush, NULL); + res = PyObject_CallMethodObjArgs((PyObject *) self, _PyIO_str_flush, NULL); if (res == NULL) return NULL; Py_DECREF(res); if (pos != Py_None) { res = PyObject_CallMethodObjArgs((PyObject *) self, - state->str_seek, pos, NULL); + _PyIO_str_seek, pos, NULL); if (res == NULL) return NULL; Py_DECREF(res); } - return PyObject_CallMethodObjArgs(self->buffer, state->str_truncate, NULL); + return PyObject_CallMethodObjArgs(self->buffer, _PyIO_str_truncate, NULL); } /* Inquiries */ @@ -2206,7 +2201,7 @@ } else { line = PyObject_CallMethodObjArgs((PyObject *)self, - IO_STATE->str_readline, NULL); + _PyIO_str_readline, NULL); if (line && !PyUnicode_Check(line)) { PyErr_Format(PyExc_IOError, "readline() should have returned an str object, " @@ -2241,7 +2236,7 @@ TextIOWrapper_closed_get(PyTextIOWrapperObject *self, void *context) { CHECK_INITIALIZED(self); - return PyObject_GetAttr(self->buffer, IO_STATE->str_closed); + return PyObject_GetAttr(self->buffer, _PyIO_str_closed); } static PyObject * @@ -2251,7 +2246,7 @@ CHECK_INITIALIZED(self); if (self->decoder == NULL) Py_RETURN_NONE; - res = PyObject_GetAttr(self->decoder, IO_STATE->str_newlines); + res = PyObject_GetAttr(self->decoder, _PyIO_str_newlines); if (res == NULL) { PyErr_Clear(); Py_RETURN_NONE; Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Sun Feb 15 17:12:37 2009 @@ -21,6 +21,30 @@ #endif /* HAVE_SYS_STAT_H */ +/* Various interned strings */ + +PyObject *_PyIO_str_close; +PyObject *_PyIO_str_closed; +PyObject *_PyIO_str_decode; +PyObject *_PyIO_str_encode; +PyObject *_PyIO_str_fileno; +PyObject *_PyIO_str_flush; +PyObject *_PyIO_str_getstate; +PyObject *_PyIO_str_isatty; +PyObject *_PyIO_str_newlines; +PyObject *_PyIO_str_read; +PyObject *_PyIO_str_read1; +PyObject *_PyIO_str_readable; +PyObject *_PyIO_str_readinto; +PyObject *_PyIO_str_readline; +PyObject *_PyIO_str_reset; +PyObject *_PyIO_str_seek; +PyObject *_PyIO_str_seekable; +PyObject *_PyIO_str_tell; +PyObject *_PyIO_str_truncate; +PyObject *_PyIO_str_writable; +PyObject *_PyIO_str_write; + PyDoc_STRVAR(module_doc, "The io module provides the Python interfaces to stream handling. The\n" @@ -549,30 +573,8 @@ } static void -iomodule_free(_PyIO_State *state) { - iomodule_clear(state); - - Py_DECREF(state->str_close); - Py_DECREF(state->str_closed); - Py_DECREF(state->str_decode); - Py_DECREF(state->str_encode); - Py_DECREF(state->str_fileno); - Py_DECREF(state->str_flush); - Py_DECREF(state->str_getstate); - Py_DECREF(state->str_isatty); - Py_DECREF(state->str_newlines); - Py_DECREF(state->str_read); - Py_DECREF(state->str_read1); - Py_DECREF(state->str_readable); - Py_DECREF(state->str_readinto); - Py_DECREF(state->str_readline); - Py_DECREF(state->str_reset); - Py_DECREF(state->str_seek); - Py_DECREF(state->str_seekable); - Py_DECREF(state->str_tell); - Py_DECREF(state->str_truncate); - Py_DECREF(state->str_writable); - Py_DECREF(state->str_write); +iomodule_free(_PyIO_State *mod) { + iomodule_clear(mod); } /* @@ -710,47 +712,47 @@ PyModule_AddObject(m, "IncrementalNewlineDecoder", (PyObject *) &PyIncrementalNewlineDecoder_Type); /* Interned strings */ - if (!(state->str_close = PyUnicode_InternFromString("close"))) + if (!(_PyIO_str_close = PyUnicode_InternFromString("close"))) goto fail; - if (!(state->str_closed = PyUnicode_InternFromString("closed"))) + if (!(_PyIO_str_closed = PyUnicode_InternFromString("closed"))) goto fail; - if (!(state->str_decode = PyUnicode_InternFromString("decode"))) + if (!(_PyIO_str_decode = PyUnicode_InternFromString("decode"))) goto fail; - if (!(state->str_encode = PyUnicode_InternFromString("encode"))) + if (!(_PyIO_str_encode = PyUnicode_InternFromString("encode"))) goto fail; - if (!(state->str_fileno = PyUnicode_InternFromString("fileno"))) + if (!(_PyIO_str_fileno = PyUnicode_InternFromString("fileno"))) goto fail; - if (!(state->str_flush = PyUnicode_InternFromString("flush"))) + if (!(_PyIO_str_flush = PyUnicode_InternFromString("flush"))) goto fail; - if (!(state->str_getstate = PyUnicode_InternFromString("getstate"))) + if (!(_PyIO_str_getstate = PyUnicode_InternFromString("getstate"))) goto fail; - if (!(state->str_isatty = PyUnicode_InternFromString("isatty"))) + if (!(_PyIO_str_isatty = PyUnicode_InternFromString("isatty"))) goto fail; - if (!(state->str_newlines = PyUnicode_InternFromString("newlines"))) + if (!(_PyIO_str_newlines = PyUnicode_InternFromString("newlines"))) goto fail; - if (!(state->str_read = PyUnicode_InternFromString("read"))) + if (!(_PyIO_str_read = PyUnicode_InternFromString("read"))) goto fail; - if (!(state->str_read1 = PyUnicode_InternFromString("read1"))) + if (!(_PyIO_str_read1 = PyUnicode_InternFromString("read1"))) goto fail; - if (!(state->str_readable = PyUnicode_InternFromString("readable"))) + if (!(_PyIO_str_readable = PyUnicode_InternFromString("readable"))) goto fail; - if (!(state->str_readinto = PyUnicode_InternFromString("readinto"))) + if (!(_PyIO_str_readinto = PyUnicode_InternFromString("readinto"))) goto fail; - if (!(state->str_readline = PyUnicode_InternFromString("readline"))) + if (!(_PyIO_str_readline = PyUnicode_InternFromString("readline"))) goto fail; - if (!(state->str_reset = PyUnicode_InternFromString("reset"))) + if (!(_PyIO_str_reset = PyUnicode_InternFromString("reset"))) goto fail; - if (!(state->str_seek = PyUnicode_InternFromString("seek"))) + if (!(_PyIO_str_seek = PyUnicode_InternFromString("seek"))) goto fail; - if (!(state->str_seekable = PyUnicode_InternFromString("seekable"))) + if (!(_PyIO_str_seekable = PyUnicode_InternFromString("seekable"))) goto fail; - if (!(state->str_tell = PyUnicode_InternFromString("tell"))) + if (!(_PyIO_str_tell = PyUnicode_InternFromString("tell"))) goto fail; - if (!(state->str_truncate = PyUnicode_InternFromString("truncate"))) + if (!(_PyIO_str_truncate = PyUnicode_InternFromString("truncate"))) goto fail; - if (!(state->str_write = PyUnicode_InternFromString("write"))) + if (!(_PyIO_str_write = PyUnicode_InternFromString("write"))) goto fail; - if (!(state->str_writable = PyUnicode_InternFromString("writable"))) + if (!(_PyIO_str_writable = PyUnicode_InternFromString("writable"))) goto fail; return m; From python-checkins at python.org Sun Feb 15 17:19:46 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 15 Feb 2009 17:19:46 +0100 (CET) Subject: [Python-checkins] r69642 - in python/branches/io-c/Lib: io.py test/test_memoryio.py Message-ID: <20090215161946.854891E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 15 17:19:45 2009 New Revision: 69642 Log: actually test the python implementations Modified: python/branches/io-c/Lib/io.py python/branches/io-c/Lib/test/test_memoryio.py Modified: python/branches/io-c/Lib/io.py ============================================================================== --- python/branches/io-c/Lib/io.py (original) +++ python/branches/io-c/Lib/io.py Sun Feb 15 17:19:45 2009 @@ -1367,7 +1367,7 @@ TextIOWrapper = _io.TextIOWrapper -class unusedTextIOWrapper(TextIOBase): +class unused_TextIOWrapper(TextIOBase): r"""Character and line based layer over a BufferedIOBase object, buffer. @@ -1847,7 +1847,7 @@ def newlines(self): return self._decoder.newlines if self._decoder else None -class unused_StringIO(TextIOWrapper): +class unused_StringIO(unused_TextIOWrapper): """Text I/O implementation using an in-memory buffer. The initial_value argument sets the value of object. The newline @@ -1857,10 +1857,10 @@ # XXX This is really slow, but fully functional def __init__(self, initial_value="", newline="\n"): - super(_StringIO, self).__init__(BytesIO(), - encoding="utf-8", - errors="strict", - newline=newline) + super(unused_StringIO, self).__init__(BytesIO(), + encoding="utf-8", + errors="strict", + newline=newline) if initial_value: if not isinstance(initial_value, str): initial_value = str(initial_value) Modified: python/branches/io-c/Lib/test/test_memoryio.py ============================================================================== --- python/branches/io-c/Lib/test/test_memoryio.py (original) +++ python/branches/io-c/Lib/test/test_memoryio.py Sun Feb 15 17:19:45 2009 @@ -142,7 +142,7 @@ self.assertEqual(memio.readline(), self.EOF) memio.seek(0) self.assertEqual(type(memio.readline()), type(buf)) - self.assertEqual(memio.readline(None), buf) + self.assertEqual(memio.readline(), buf) self.assertRaises(TypeError, memio.readline, '') memio.close() self.assertRaises(ValueError, memio.readline) @@ -294,7 +294,7 @@ @staticmethod def buftype(s): return s.encode("ascii") - ioclass = io._BytesIO + ioclass = io.unused_BytesIO EOF = b"" def test_read1(self): @@ -367,7 +367,7 @@ class PyStringIOTest(MemoryTestMixin, unittest.TestCase): buftype = str - ioclass = io._StringIO + ioclass = io.unused_StringIO EOF = "" def test_relative_seek(self): From buildbot at python.org Sun Feb 15 17:33:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 15 Feb 2009 16:33:17 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090215163317.B45C11E4002@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/4646 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 Sun Feb 15 17:52:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 15 Feb 2009 16:52:57 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090215165258.0456B1E4010@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/295 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_posix test_subprocess ====================================================================== 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Sun Feb 15 18:27:41 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 15 Feb 2009 18:27:41 +0100 (CET) Subject: [Python-checkins] r69643 - python/branches/py3k/Objects/longobject.c Message-ID: <20090215172741.939081E4002@bag.python.org> Author: mark.dickinson Date: Sun Feb 15 18:27:41 2009 New Revision: 69643 Log: Fix more places in Objects/longobject.c where it's silently assumed that sizeof(digit) < sizeof(int). Modified: 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 Sun Feb 15 18:27:41 2009 @@ -47,7 +47,7 @@ } #define CHECK_SMALL_INT(ival) \ do if (-NSMALLNEGINTS <= ival && ival < NSMALLPOSINTS) { \ - return get_small_int((int)ival); \ + return get_small_int((sdigit)ival); \ } while(0) static PyLongObject * @@ -365,7 +365,7 @@ switch (i) { case -1: - res = -v->ob_digit[0]; + res = -(sdigit)v->ob_digit[0]; break; case 0: res = 0; @@ -440,7 +440,7 @@ v = (PyLongObject *)vv; i = Py_SIZE(v); switch (i) { - case -1: return -v->ob_digit[0]; + case -1: return -(sdigit)v->ob_digit[0]; case 0: return 0; case 1: return v->ob_digit[0]; } @@ -1235,7 +1235,7 @@ v = (PyLongObject*)vv; switch(Py_SIZE(v)) { - case -1: return -v->ob_digit[0]; + case -1: return -(sdigit)v->ob_digit[0]; case 0: return 0; case 1: return v->ob_digit[0]; } @@ -2279,7 +2279,7 @@ of mapping keys will turn out weird */ i = Py_SIZE(v); switch(i) { - case -1: return v->ob_digit[0]==1 ? -2 : -v->ob_digit[0]; + case -1: return v->ob_digit[0]==1 ? -2 : -(sdigit)v->ob_digit[0]; case 0: return 0; case 1: return v->ob_digit[0]; } From python-checkins at python.org Sun Feb 15 18:59:30 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 15 Feb 2009 18:59:30 +0100 (CET) Subject: [Python-checkins] r69644 - in python/branches/io-c/Modules: _bytesio.c _iobase.c Message-ID: <20090215175930.754EC1E4002@bag.python.org> Author: antoine.pitrou Date: Sun Feb 15 18:59:30 2009 New Revision: 69644 Log: Fix memory leak in destructor when a Python class inherits from IOBase (or an IOBase-derived type) Modified: python/branches/io-c/Modules/_bytesio.c python/branches/io-c/Modules/_iobase.c Modified: python/branches/io-c/Modules/_bytesio.c ============================================================================== --- python/branches/io-c/Modules/_bytesio.c (original) +++ python/branches/io-c/Modules/_bytesio.c Sun Feb 15 18:59:30 2009 @@ -536,22 +536,22 @@ static PyObject * bytesio_write(BytesIOObject *self, PyObject *obj) { - const char *bytes; - Py_ssize_t size; Py_ssize_t n = 0; + Py_buffer buf; + PyObject *result = NULL; CHECK_CLOSED(self); - if (PyObject_AsReadBuffer(obj, (void *)&bytes, &size) < 0) + if (PyObject_GetBuffer(obj, &buf, PyBUF_CONTIG_RO) < 0) return NULL; - if (size != 0) { - n = write_bytes(self, bytes, size); - if (n < 0) - return NULL; - } + if (buf.len != 0) + n = write_bytes(self, buf.buf, buf.len); + if (n >= 0) + result = PyLong_FromSsize_t(n); - return PyLong_FromSsize_t(n); + PyBuffer_Release(&buf); + return result; } PyDoc_STRVAR(writelines_doc, @@ -611,6 +611,9 @@ PyMem_Free(self->buf); self->buf = NULL; } + Py_CLEAR(self->dict); + if (self->weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *)self); Py_TYPE(self)->tp_free(self); } Modified: python/branches/io-c/Modules/_iobase.c ============================================================================== --- python/branches/io-c/Modules/_iobase.c (original) +++ python/branches/io-c/Modules/_iobase.c Sun Feb 15 18:59:30 2009 @@ -193,6 +193,7 @@ { PyObject *res; PyObject *tp, *v, *tb; + PyObject **dictptr; int closed = 1; PyErr_Fetch(&tp, &v, &tb); /* We need to resurrect the object as calling close() can invoke @@ -217,9 +218,14 @@ else Py_DECREF(res); } + /* The code above might have re-added a dict, DECREF it */ + dictptr = _PyObject_GetDictPtr(self); + if (dictptr != NULL) + Py_CLEAR(*dictptr); PyErr_Restore(tp, v, tb); - if (--((PyObject *) self)->ob_refcnt != 0) + if (--((PyObject *) self)->ob_refcnt != 0) { return -1; + } return 0; } @@ -670,14 +676,6 @@ 0, /* tp_init */ 0, /* tp_alloc */ PyType_GenericNew, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ - 0, /* tp_del */ }; From python-checkins at python.org Sun Feb 15 19:23:26 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 15 Feb 2009 19:23:26 +0100 (CET) Subject: [Python-checkins] r69645 - python/branches/io-c/Modules/_iobase.c Message-ID: <20090215182326.A83121E4002@bag.python.org> Author: antoine.pitrou Date: Sun Feb 15 19:23:26 2009 New Revision: 69645 Log: Add a warning about the embarassing state of IOBase finalization Modified: python/branches/io-c/Modules/_iobase.c Modified: python/branches/io-c/Modules/_iobase.c ============================================================================== --- python/branches/io-c/Modules/_iobase.c (original) +++ python/branches/io-c/Modules/_iobase.c Sun Feb 15 19:23:26 2009 @@ -201,6 +201,10 @@ ((PyObject *) self)->ob_refcnt++; /* The object could already be in an usable state, so we'll take any error as meaning "stop, nothing to see here". */ + /* XXX any Python method or property called from here may rely on + attributes being set in the instance __dict__, but the __dict__ has + already been cleared by subtype_dealloc(). + Worse, since exceptions are silenced, the user will be unaware of it. */ res = PyObject_GetAttr(self, _PyIO_str_closed); if (res == NULL) PyErr_Clear(); From python-checkins at python.org Sun Feb 15 20:14:42 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 15 Feb 2009 20:14:42 +0100 (CET) Subject: [Python-checkins] r69646 - in python/branches/io-c: Lib/test/test_fileio.py Modules/_fileio.c Message-ID: <20090215191442.BDB6A1E4002@bag.python.org> Author: antoine.pitrou Date: Sun Feb 15 20:14:42 2009 New Revision: 69646 Log: Fix opening of 8-bit filenames with FileIO Modified: python/branches/io-c/Lib/test/test_fileio.py python/branches/io-c/Modules/_fileio.c Modified: python/branches/io-c/Lib/test/test_fileio.py ============================================================================== --- python/branches/io-c/Lib/test/test_fileio.py (original) +++ python/branches/io-c/Lib/test/test_fileio.py Sun Feb 15 20:14:42 2009 @@ -176,6 +176,22 @@ f.close() os.unlink(TESTFN) + def testBytesOpen(self): + # Opening a bytes filename + try: + fn = TESTFN.encode("ascii") + except UnicodeEncodeError: + # Skip test + return + f = _FileIO(fn, "w") + try: + f.write(b"abc") + f.close() + with open(TESTFN, "rb") as f: + self.assertEquals(f.read(), b"abc") + finally: + os.unlink(TESTFN) + def testInvalidFd(self): self.assertRaises(ValueError, _FileIO, -10) self.assertRaises(OSError, _FileIO, make_bad_fd()) Modified: python/branches/io-c/Modules/_fileio.c ============================================================================== --- python/branches/io-c/Modules/_fileio.c (original) +++ python/branches/io-c/Modules/_fileio.c Sun Feb 15 20:14:42 2009 @@ -228,7 +228,8 @@ if (fd < 0) { if (PyBytes_Check(nameobj) || PyByteArray_Check(nameobj)) { - if (PyObject_AsCharBuffer(nameobj, &name, NULL) < 0) + Py_ssize_t namelen; + if (PyObject_AsCharBuffer(nameobj, &name, &namelen) < 0) return -1; } else { From python-checkins at python.org Sun Feb 15 20:20:23 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 15 Feb 2009 20:20:23 +0100 (CET) Subject: [Python-checkins] r69647 - python/branches/io-c/Modules/_fileio.c Message-ID: <20090215192023.0C7D61E4002@bag.python.org> Author: antoine.pitrou Date: Sun Feb 15 20:20:22 2009 New Revision: 69647 Log: Fix leak in FileIO constructor Modified: python/branches/io-c/Modules/_fileio.c Modified: python/branches/io-c/Modules/_fileio.c ============================================================================== --- python/branches/io-c/Modules/_fileio.c (original) +++ python/branches/io-c/Modules/_fileio.c Sun Feb 15 20:20:22 2009 @@ -178,7 +178,7 @@ PyFileIOObject *self = (PyFileIOObject *) oself; static char *kwlist[] = {"file", "mode", "closefd", NULL}; const char *name = NULL; - PyObject *nameobj; + PyObject *nameobj, *stringobj = NULL; char *mode = "r"; char *s; #ifdef MS_WINDOWS @@ -233,22 +233,22 @@ return -1; } else { - PyObject *s; PyObject *u = PyUnicode_FromObject(nameobj); if (u == NULL) return -1; - s = PyUnicode_AsEncodedString( + stringobj = PyUnicode_AsEncodedString( u, Py_FileSystemDefaultEncoding, NULL); Py_DECREF(u); - if (s == NULL) + if (stringobj == NULL) return -1; - if (!PyBytes_Check(s)) { + if (!PyBytes_Check(stringobj)) { PyErr_SetString(PyExc_TypeError, "encoder failed to return bytes"); + goto error; } - name = PyBytes_AS_STRING(s); + name = PyBytes_AS_STRING(stringobj); } } @@ -369,6 +369,7 @@ ret = -1; done: + Py_CLEAR(stringobj); return ret; } From python-checkins at python.org Sun Feb 15 20:58:17 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 15 Feb 2009 20:58:17 +0100 (CET) Subject: [Python-checkins] r69648 - in python/branches/io-c/Modules: _bufferedio.c _iomodule.h _textio.c io.c Message-ID: <20090215195817.0D8061E4002@bag.python.org> Author: antoine.pitrou Date: Sun Feb 15 20:58:16 2009 New Revision: 69648 Log: Fix some refleaks Modified: python/branches/io-c/Modules/_bufferedio.c python/branches/io-c/Modules/_iomodule.h python/branches/io-c/Modules/_textio.c python/branches/io-c/Modules/io.c Modified: python/branches/io-c/Modules/_bufferedio.c ============================================================================== --- python/branches/io-c/Modules/_bufferedio.c (original) +++ python/branches/io-c/Modules/_bufferedio.c Sun Feb 15 20:58:16 2009 @@ -898,7 +898,7 @@ goto end; } Py_CLEAR(res); - res = _PyBytes_Join(PyBytes_FromStringAndSize(NULL, 0), chunks); + res = _PyBytes_Join(_PyIO_empty_bytes, chunks); end: LEAVE_BUFFERED(self) Modified: python/branches/io-c/Modules/_iomodule.h ============================================================================== --- python/branches/io-c/Modules/_iomodule.h (original) +++ python/branches/io-c/Modules/_iomodule.h Sun Feb 15 20:58:16 2009 @@ -127,3 +127,6 @@ extern PyObject *_PyIO_str_truncate; extern PyObject *_PyIO_str_writable; extern PyObject *_PyIO_str_write; + +extern PyObject *_PyIO_empty_str; +extern PyObject *_PyIO_empty_bytes; Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Sun Feb 15 20:58:16 2009 @@ -1042,7 +1042,7 @@ if (self->pending_bytes == NULL) return 0; - b = _PyBytes_Join(PyBytes_FromStringAndSize(NULL, 0), self->pending_bytes); + b = _PyBytes_Join(_PyIO_empty_bytes, self->pending_bytes); if (b == NULL) return -1; ret = PyObject_CallMethodObjArgs(self->buffer, @@ -1359,8 +1359,7 @@ if (result != NULL && PyList_Append(chunks, result) < 0) goto fail; Py_CLEAR(result); - result = PyUnicode_Join(PyUnicode_FromStringAndSize(NULL, 0), - chunks); + result = PyUnicode_Join(_PyIO_empty_str, chunks); if (result == NULL) goto fail; Py_CLEAR(chunks); @@ -1618,7 +1617,7 @@ if (line != NULL && PyList_Append(chunks, line) < 0) goto error; Py_CLEAR(line); - line = PyUnicode_Join(PyUnicode_FromStringAndSize(NULL, 0), chunks); + line = PyUnicode_Join(_PyIO_empty_str, chunks); if (line == NULL) goto error; Py_DECREF(chunks); Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Sun Feb 15 20:58:16 2009 @@ -45,6 +45,9 @@ PyObject *_PyIO_str_writable; PyObject *_PyIO_str_write; +PyObject *_PyIO_empty_str; +PyObject *_PyIO_empty_bytes; + PyDoc_STRVAR(module_doc, "The io module provides the Python interfaces to stream handling. The\n" @@ -754,6 +757,11 @@ goto fail; if (!(_PyIO_str_writable = PyUnicode_InternFromString("writable"))) goto fail; + + if (!(_PyIO_empty_str = PyUnicode_FromStringAndSize(NULL, 0))) + goto fail; + if (!(_PyIO_empty_bytes = PyBytes_FromStringAndSize(NULL, 0))) + goto fail; return m; From python-checkins at python.org Sun Feb 15 21:05:14 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 15 Feb 2009 21:05:14 +0100 (CET) Subject: [Python-checkins] r69649 - python/branches/io-c/Modules/_iobase.c Message-ID: <20090215200514.C569E1E4023@bag.python.org> Author: antoine.pitrou Date: Sun Feb 15 21:05:13 2009 New Revision: 69649 Log: Fix a leak in IOBase.writelines Modified: python/branches/io-c/Modules/_iobase.c Modified: python/branches/io-c/Modules/_iobase.c ============================================================================== --- python/branches/io-c/Modules/_iobase.c (original) +++ python/branches/io-c/Modules/_iobase.c Sun Feb 15 21:05:13 2009 @@ -586,7 +586,7 @@ while (1) { PyObject *line = PyIter_Next(iter); - if(line == NULL) { + if (line == NULL) { if (PyErr_Occurred()) { Py_DECREF(iter); return NULL; @@ -603,6 +603,7 @@ } Py_DECREF(res); } + Py_DECREF(iter); Py_RETURN_NONE; } From python-checkins at python.org Sun Feb 15 21:11:57 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 15 Feb 2009 21:11:57 +0100 (CET) Subject: [Python-checkins] r69650 - in python/branches/io-c/Modules: _bufferedio.c _iobase.c Message-ID: <20090215201157.0B6421E4002@bag.python.org> Author: antoine.pitrou Date: Sun Feb 15 21:11:56 2009 New Revision: 69650 Log: Fix memory leak in BufferedWriter.truncate Modified: python/branches/io-c/Modules/_bufferedio.c python/branches/io-c/Modules/_iobase.c Modified: python/branches/io-c/Modules/_bufferedio.c ============================================================================== --- python/branches/io-c/Modules/_bufferedio.c (original) +++ python/branches/io-c/Modules/_bufferedio.c Sun Feb 15 21:11:56 2009 @@ -1014,9 +1014,6 @@ return NULL; } - if (pos != Py_None) - Py_INCREF(pos); - ENTER_BUFFERED(self) if (self->writable) { Modified: python/branches/io-c/Modules/_iobase.c ============================================================================== --- python/branches/io-c/Modules/_iobase.c (original) +++ python/branches/io-c/Modules/_iobase.c Sun Feb 15 21:11:56 2009 @@ -101,7 +101,7 @@ static PyObject * IOBase_truncate(PyObject *self, PyObject *args) { - return IOBase_unsupported("seek"); + return IOBase_unsupported("truncate"); } /* Flush and close methods */ From python-checkins at python.org Sun Feb 15 21:25:35 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 15 Feb 2009 21:25:35 +0100 (CET) Subject: [Python-checkins] r69651 - python/branches/io-c/Modules/_textio.c Message-ID: <20090215202535.02B321E4002@bag.python.org> Author: antoine.pitrou Date: Sun Feb 15 21:25:34 2009 New Revision: 69651 Log: Fix a leak in TextIOWrapper.seek Modified: python/branches/io-c/Modules/_textio.c Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Sun Feb 15 21:25:34 2009 @@ -1833,6 +1833,7 @@ } res = PyObject_CallMethod(self->buffer, "seek", "ii", 0, 2); + Py_XDECREF(cookieObj); return res; } else if (whence != 0) { From python-checkins at python.org Sun Feb 15 21:26:29 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 15 Feb 2009 21:26:29 +0100 (CET) Subject: [Python-checkins] r69652 - python/branches/io-c/Modules/_bufferedio.c Message-ID: <20090215202629.459521E4002@bag.python.org> Author: antoine.pitrou Date: Sun Feb 15 21:26:28 2009 New Revision: 69652 Log: Unify implementations of truncate for buffered objects Modified: python/branches/io-c/Modules/_bufferedio.c Modified: python/branches/io-c/Modules/_bufferedio.c ============================================================================== --- python/branches/io-c/Modules/_bufferedio.c (original) +++ python/branches/io-c/Modules/_bufferedio.c Sun Feb 15 21:26:28 2009 @@ -337,45 +337,6 @@ * by BufferedReader and BufferedWriter */ -/* Positioning */ - -static PyObject * -BufferedIOMixin_truncate(BufferedObject *self, PyObject *args) -{ - PyObject *pos = Py_None; - PyObject *res; - - CHECK_INITIALIZED(self) - if (!PyArg_ParseTuple(args, "|O:truncate", &pos)) { - return NULL; - } - - /* Flush the stream. We're mixing buffered I/O with lower-level I/O, - * and a flush may be necessary to synch both views of the current - * file state. - */ - res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_flush, NULL); - if (res == NULL) - return NULL; - Py_DECREF(res); - - if (pos == Py_None) { - pos = PyObject_CallMethod(self->raw, "tell", NULL); - if (pos == NULL) - return NULL; - } - else - Py_INCREF(pos); - - /* XXX: Should seek() be used, instead of passing the position - * XXX directly to truncate? - */ - res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_truncate, pos, NULL); - Py_DECREF(pos); - - return res; -} - /* Flush and close */ static PyObject * @@ -1379,7 +1340,6 @@ static PyMethodDef BufferedReader_methods[] = { /* BufferedIOMixin methods */ - {"truncate", (PyCFunction)BufferedIOMixin_truncate, METH_VARARGS}, {"flush", (PyCFunction)BufferedIOMixin_flush, METH_NOARGS}, {"close", (PyCFunction)BufferedIOMixin_close, METH_NOARGS}, {"seekable", (PyCFunction)BufferedIOMixin_seekable, METH_NOARGS}, @@ -1394,6 +1354,7 @@ {"readline", (PyCFunction)Buffered_readline, METH_VARARGS}, {"seek", (PyCFunction)Buffered_seek, METH_VARARGS}, {"tell", (PyCFunction)Buffered_tell, METH_NOARGS}, + {"truncate", (PyCFunction)Buffered_truncate, METH_VARARGS}, {NULL, NULL} }; From python-checkins at python.org Mon Feb 16 00:30:22 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 00:30:22 +0100 (CET) Subject: [Python-checkins] r69656 - python/branches/io-c/Modules/_bytesio.c Message-ID: <20090215233022.A5A901E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 00:29:48 2009 New Revision: 69656 Log: braces make this much clearer Modified: python/branches/io-c/Modules/_bytesio.c Modified: python/branches/io-c/Modules/_bytesio.c ============================================================================== --- python/branches/io-c/Modules/_bytesio.c (original) +++ python/branches/io-c/Modules/_bytesio.c Mon Feb 16 00:29:48 2009 @@ -148,10 +148,12 @@ static PyObject * bytesio_get_closed(BytesIOObject *self) { - if (self->buf == NULL) + if (self->buf == NULL) { Py_RETURN_TRUE; - else + } + else { Py_RETURN_FALSE; + } } /* Generic getter for the writable, readable and seekable properties */ From python-checkins at python.org Mon Feb 16 00:46:07 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 00:46:07 +0100 (CET) Subject: [Python-checkins] r69657 - python/branches/io-c/Modules/_iobase.c Message-ID: <20090215234607.71A0E1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 00:46:07 2009 New Revision: 69657 Log: use the correct macro Modified: python/branches/io-c/Modules/_iobase.c Modified: python/branches/io-c/Modules/_iobase.c ============================================================================== --- python/branches/io-c/Modules/_iobase.c (original) +++ python/branches/io-c/Modules/_iobase.c Mon Feb 16 00:46:07 2009 @@ -198,7 +198,7 @@ PyErr_Fetch(&tp, &v, &tb); /* We need to resurrect the object as calling close() can invoke arbitrary code. */ - ((PyObject *) self)->ob_refcnt++; + Py_REFCNT(self)++; /* The object could already be in an usable state, so we'll take any error as meaning "stop, nothing to see here". */ /* XXX any Python method or property called from here may rely on @@ -227,7 +227,7 @@ if (dictptr != NULL) Py_CLEAR(*dictptr); PyErr_Restore(tp, v, tb); - if (--((PyObject *) self)->ob_refcnt != 0) { + if (--Py_REFCNT(self) != 0) { return -1; } return 0; From buildbot at python.org Mon Feb 16 02:26:03 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 16 Feb 2009 01:26:03 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian 3.x Message-ID: <20090216012603.B24D21E4002@bag.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/56 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: brett.cannon,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_zipfile make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Feb 16 02:38:59 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 16 Feb 2009 02:38:59 +0100 (CET) Subject: [Python-checkins] r69658 - in python/branches/io-c/Modules: _bufferedio.c _iobase.c _textio.c Message-ID: <20090216013859.9B8A81E4002@bag.python.org> Author: antoine.pitrou Date: Mon Feb 16 02:38:59 2009 New Revision: 69658 Log: Fix crash in test_urllib2_localnet in debug mode. It was due to an HTTPResponse object being revived when calling its close() method in IOBase's tp_dealloc. _PyIOBase_finalize() starts looking scary... Modified: python/branches/io-c/Modules/_bufferedio.c python/branches/io-c/Modules/_iobase.c python/branches/io-c/Modules/_textio.c Modified: python/branches/io-c/Modules/_bufferedio.c ============================================================================== --- python/branches/io-c/Modules/_bufferedio.c (original) +++ python/branches/io-c/Modules/_bufferedio.c Mon Feb 16 02:38:59 2009 @@ -296,6 +296,7 @@ { if (self->ok && _PyIOBase_finalize((PyObject *) self) < 0) return; + _PyObject_GC_UNTRACK(self); self->ok = 0; if (self->weakreflist != NULL) PyObject_ClearWeakRefs((PyObject *)self); Modified: python/branches/io-c/Modules/_iobase.c ============================================================================== --- python/branches/io-c/Modules/_iobase.c (original) +++ python/branches/io-c/Modules/_iobase.c Mon Feb 16 02:38:59 2009 @@ -186,20 +186,22 @@ Py_RETURN_NONE; } -/* Destructor */ - int _PyIOBase_finalize(PyObject *self) { PyObject *res; PyObject *tp, *v, *tb; - PyObject **dictptr; int closed = 1; + int is_zombie; + PyErr_Fetch(&tp, &v, &tb); - /* We need to resurrect the object as calling close() can invoke - arbitrary code. */ - Py_REFCNT(self)++; - /* The object could already be in an usable state, so we'll take any + /* If _PyIOBase_finalize() is called from a destructor, we need to + resurrect the object as calling close() can invoke arbitrary code. */ + is_zombie = (Py_REFCNT(self) == 0); + if (is_zombie) { + ++Py_REFCNT(self); + } + /* The object could already be in an unusable state, so we'll take any error as meaning "stop, nothing to see here". */ /* XXX any Python method or property called from here may rely on attributes being set in the instance __dict__, but the __dict__ has @@ -222,22 +224,52 @@ else Py_DECREF(res); } - /* The code above might have re-added a dict, DECREF it */ - dictptr = _PyObject_GetDictPtr(self); - if (dictptr != NULL) - Py_CLEAR(*dictptr); PyErr_Restore(tp, v, tb); - if (--Py_REFCNT(self) != 0) { - return -1; + if (is_zombie) { + if (--Py_REFCNT(self) != 0) { + /* The object lives again. The following code is taken from + slot_tp_del in typeobject.c. */ + Py_ssize_t refcnt = Py_REFCNT(self); + _Py_NewReference(self); + Py_REFCNT(self) = refcnt; + /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so + * we need to undo that. */ + _Py_DEC_REFTOTAL; + /* If Py_TRACE_REFS, _Py_NewReference re-added self to the object + * chain, so no more to do there. + * If COUNT_ALLOCS, the original decref bumped tp_frees, and + * _Py_NewReference bumped tp_allocs: both of those need to be + * undone. + */ +#ifdef COUNT_ALLOCS + --Py_TYPE(self)->tp_frees; + --Py_TYPE(self)->tp_allocs; +#endif + return -1; + } + else { + /* The code above might have re-added a dict, DECREF it */ + PyObject **dictptr = _PyObject_GetDictPtr(self); + if (dictptr != NULL) + Py_CLEAR(*dictptr); + } } return 0; } +/* Destructor */ + static void IOBase_dealloc(PyObject *self) { - if (_PyIOBase_finalize(self) == 0) - Py_TYPE(self)->tp_free(self); + if (_PyIOBase_finalize((PyObject *)self) < 0) { + /* When called from a heap type's dealloc, the type will be + decref'ed on return (see e.g. subtype_dealloc in typeobject.c). */ + if (PyType_HasFeature(Py_TYPE(self), Py_TPFLAGS_HEAPTYPE)) + Py_INCREF(Py_TYPE(self)); + return; + } + Py_TYPE(self)->tp_free(self); } /* Inquiry methods */ @@ -683,7 +715,6 @@ PyType_GenericNew, /* tp_new */ }; - /* * RawIOBase class, Inherits from IOBase. Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Mon Feb 16 02:38:59 2009 @@ -943,6 +943,7 @@ { if (_TextIOWrapper_clear(self) < 0) return; + _PyObject_GC_UNTRACK(self); if (self->weakreflist != NULL) PyObject_ClearWeakRefs((PyObject *)self); Py_CLEAR(self->dict); From skip at pobox.com Sat Feb 14 19:17:49 2009 From: skip at pobox.com (skip at pobox.com) Date: Sat, 14 Feb 2009 12:17:49 -0600 Subject: [Python-checkins] r68914 - peps/trunk/pep-0374.txt In-Reply-To: <20090124230633.9B1801E4026@bag.python.org> References: <20090124230633.9B1801E4026@bag.python.org> Message-ID: <18839.2765.477347.933293@montanaro.dyndns.org> Brett, I'm offline, just reading through now stale checkin messages, so this may be more evident when viewed in a larger context, but it's not real clear that there's not a typo in the checkout times: >> ======= ================ ============== >> DVCS Time Space >> ------- ---------------- -------------- >> -svn 1:04 139 M >> -bzr 2:29:24 or 8:46 275 M or 596 M >> -hg 2:30 171 M >> -git 2:54 134 M >> +svn 1:04 139 M >> +bzr 1 2:29:24 275 M >> +bzr 2 8:46 596 M >> +hg 2:30 171 M >> +git 2:54 134 M >> ======= ================ ============== If bzr 1 really takes nearly 2.5 hours to check out the code perhaps it's worth noting that fact either explicitly or by using a time format which includes units, e.g., 2h29m24s vs. 2:29:24. Skip From skip at pobox.com Sat Feb 14 19:24:35 2009 From: skip at pobox.com (skip at pobox.com) Date: Sat, 14 Feb 2009 12:24:35 -0600 Subject: [Python-checkins] PEP 374 addenda In-Reply-To: References: <20090124230633.9B1801E4026@bag.python.org> <8D05F27DD8E640749774E2B6D34F0293@RaymondLaptop1> Message-ID: <18839.3171.613662.154260@montanaro.dyndns.org> [Sorry for the late reply here. I'm offline, on vacation, and not paying a lot of attention to email.] >> Also, how many developers or casual contributors will we lose because >> they simply aren't willing to bear the transition costs? Brett> That's an unmeasurable number short of seeing how large of an Brett> outcry there is against something. And since I have not even made Brett> a case for one DVCS over another it isn't worth worrying about Brett> this number quite yet. Still, it would seem to be a useful factor for you to estimate when considering which, if any, of the candidate DVCSs will provide the smallest barrier to entry. Skip From skip at pobox.com Sat Feb 14 19:40:49 2009 From: skip at pobox.com (skip at pobox.com) Date: Sat, 14 Feb 2009 12:40:49 -0600 Subject: [Python-checkins] r69038 - in python/trunk: PC/dl_nt.c Python/dynload_win.c In-Reply-To: <20090127231223.82B4A1E4015@bag.python.org> References: <20090127231223.82B4A1E4015@bag.python.org> Message-ID: <18839.4145.169835.107382@montanaro.dyndns.org> Mark> +// Windows "Activation Context" work: Mark> +// Our .pyd extension modules are generally built without a manifest (ie, Mark> +// those included with Python and those built with a default distutils. Mark> +// This requires we perform some "activation context" magic when loading our Mark> +// extensions. In summary: Mark> +// * As our DLL loads we save the context being used. Mark> +// * Before loading our extensions we re-activate our saved context. Mark> +// * After extension load is complete we restore the old context. Mark> +// As an added complication, this magic only works on XP or later - we simply Mark> +// use the existence (or not) of the relevant function pointers from kernel32. Mark> +// See bug 4566 (http://python.org/sf/4566) for more details. Shouldn't these be c-style comments? (Again, sorry if I'm way behind...) Skip From python-checkins at python.org Mon Feb 16 03:55:48 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 03:55:48 +0100 (CET) Subject: [Python-checkins] r69659 - in python/branches/io-c/Modules: _iomodule.h io.c Message-ID: <20090216025548.8DFCD1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 03:55:48 2009 New Revision: 69659 Log: fix segfault on initialization failing Modified: python/branches/io-c/Modules/_iomodule.h python/branches/io-c/Modules/io.c Modified: python/branches/io-c/Modules/_iomodule.h ============================================================================== --- python/branches/io-c/Modules/_iomodule.h (original) +++ python/branches/io-c/Modules/_iomodule.h Mon Feb 16 03:55:48 2009 @@ -96,6 +96,7 @@ extern PyModuleDef _PyIO_Module; typedef struct { + int initialized; PyObject *os_module; PyObject *locale_module; Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Mon Feb 16 03:55:48 2009 @@ -560,14 +560,19 @@ static int iomodule_traverse(_PyIO_State *mod, visitproc visit, void *arg) { + if (!mod->initialized) + return 0; Py_VISIT(mod->os_module); if (mod->locale_module != NULL) Py_VISIT(mod->locale_module); + Py_VISIT(mod->unsupported_operation); return 0; } static int iomodule_clear(_PyIO_State *mod) { + if (!mod->initialized) + return 0; Py_CLEAR(mod->os_module); if (mod->locale_module != NULL) Py_CLEAR(mod->locale_module); @@ -605,7 +610,7 @@ PyInit__io(void) { PyObject *m = PyModule_Create(&_PyIO_Module); - _PyIO_State *state; + _PyIO_State *state = NULL; PyTypeObject *base; if (m == NULL) goto fail; @@ -763,9 +768,15 @@ if (!(_PyIO_empty_bytes = PyBytes_FromStringAndSize(NULL, 0))) goto fail; + state->initialized = 1; + return m; fail: + if (state != NULL) { + Py_XDECREF(state->os_module); + Py_XDECREF(state->unsupported_operation); + } Py_XDECREF(m); return NULL; } From brett at python.org Mon Feb 16 04:07:59 2009 From: brett at python.org (Brett Cannon) Date: Sun, 15 Feb 2009 19:07:59 -0800 Subject: [Python-checkins] r68914 - peps/trunk/pep-0374.txt In-Reply-To: <18839.2765.477347.933293@montanaro.dyndns.org> References: <20090124230633.9B1801E4026@bag.python.org> <18839.2765.477347.933293@montanaro.dyndns.org> Message-ID: On Sat, Feb 14, 2009 at 10:17, wrote: > Brett, > > I'm offline, just reading through now stale checkin messages, so this may > be > more evident when viewed in a larger context, but it's not real clear that > there's not a typo in the checkout times: > This is so stale the worry is not longer an issue. =) -Brett -------------- next part -------------- An HTML attachment was scrubbed... URL: From python-checkins at python.org Mon Feb 16 04:09:31 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 04:09:31 +0100 (CET) Subject: [Python-checkins] r69660 - python/branches/io-c/Modules/_textio.c Message-ID: <20090216030931.5BE5E1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 04:09:31 2009 New Revision: 69660 Log: apparently locale.getprefferedencoding() can raise a ImportError, too Modified: python/branches/io-c/Modules/_textio.c Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Mon Feb 16 04:09:31 2009 @@ -789,9 +789,15 @@ use_locale: self->encoding = PyObject_CallMethod( state->locale_module, "getpreferredencoding", NULL); - if (self->encoding == NULL) - goto error; - if (!PyUnicode_Check(self->encoding)) + if (self->encoding == NULL) { + if (PyErr_ExceptionMatches(PyExc_ImportError)) { + PyErr_Clear(); + self->encoding = PyUnicode_FromString("ascii"); + } + else + goto error; + } + else if (!PyUnicode_Check(self->encoding)) Py_CLEAR(self->encoding); } } From python-checkins at python.org Mon Feb 16 04:54:15 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 04:54:15 +0100 (CET) Subject: [Python-checkins] r69661 - python/branches/io-c/Modules/io.c Message-ID: <20090216035415.B55861E400C@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 04:54:15 2009 New Revision: 69661 Log: it's amazing this worked at all; I was using the wrong structs! Modified: python/branches/io-c/Modules/io.c Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Mon Feb 16 04:54:15 2009 @@ -559,29 +559,32 @@ } static int -iomodule_traverse(_PyIO_State *mod, visitproc visit, void *arg) { - if (!mod->initialized) +iomodule_traverse(PyObject *mod, visitproc visit, void *arg) { + _PyIO_State *state = IO_MOD_STATE(mod); + if (!state->initialized) return 0; - Py_VISIT(mod->os_module); - if (mod->locale_module != NULL) - Py_VISIT(mod->locale_module); - Py_VISIT(mod->unsupported_operation); + Py_VISIT(state->os_module); + if (state->locale_module != NULL) { + Py_VISIT(state->locale_module); + } + Py_VISIT(state->unsupported_operation); return 0; } static int -iomodule_clear(_PyIO_State *mod) { - if (!mod->initialized) +iomodule_clear(PyObject *mod) { + _PyIO_State *state = IO_MOD_STATE(mod); + if (!state->initialized) return 0; - Py_CLEAR(mod->os_module); - if (mod->locale_module != NULL) - Py_CLEAR(mod->locale_module); - Py_CLEAR(mod->unsupported_operation); + Py_CLEAR(state->os_module); + if (state->locale_module != NULL) + Py_CLEAR(state->locale_module); + Py_CLEAR(state->unsupported_operation); return 0; } static void -iomodule_free(_PyIO_State *mod) { +iomodule_free(PyObject *mod) { iomodule_clear(mod); } @@ -601,9 +604,9 @@ sizeof(_PyIO_State), module_methods, NULL, - (traverseproc)iomodule_traverse, - (inquiry)iomodule_clear, - (freefunc)iomodule_free + iomodule_traverse, + iomodule_clear, + (freefunc)iomodule_free, }; PyMODINIT_FUNC @@ -613,8 +616,9 @@ _PyIO_State *state = NULL; PyTypeObject *base; if (m == NULL) - goto fail; + return NULL; state = IO_MOD_STATE(m); + state->initialized = 0; /* put os in the module state */ state->os_module = PyImport_ImportModule("os"); @@ -773,10 +777,8 @@ return m; fail: - if (state != NULL) { - Py_XDECREF(state->os_module); - Py_XDECREF(state->unsupported_operation); - } - Py_XDECREF(m); + Py_XDECREF(state->os_module); + Py_XDECREF(state->unsupported_operation); + Py_DECREF(m); return NULL; } From python-checkins at python.org Mon Feb 16 05:18:01 2009 From: python-checkins at python.org (brett.cannon) Date: Mon, 16 Feb 2009 05:18:01 +0100 (CET) Subject: [Python-checkins] r69662 - in python/branches/py3k: Doc/library/importlib.rst Lib/importlib/NOTES Message-ID: <20090216041801.C9EE11E4002@bag.python.org> Author: brett.cannon Date: Mon Feb 16 05:18:01 2009 New Revision: 69662 Log: Document importlib.machinery.PathFinder. Modified: python/branches/py3k/Doc/library/importlib.rst python/branches/py3k/Lib/importlib/NOTES Modified: python/branches/py3k/Doc/library/importlib.rst ============================================================================== --- python/branches/py3k/Doc/library/importlib.rst (original) +++ python/branches/py3k/Doc/library/importlib.rst Mon Feb 16 05:18:01 2009 @@ -18,12 +18,12 @@ :func:`__import__` function) in Python source code. This provides an implementaiton of :keyword:`import` which is portable to any Python interpreter. This also provides a reference implementation which is easier to -read than one in a programming language other than Python. +comprehend than one in a programming language other than Python. Two, the components to implement :keyword:`import` can be exposed in this package, making it easier for users to create their own custom objects (known -generically as importers) to participate in the import process. Details on -providing custom importers can be found in :pep:`302`. +generically as an :term:`importer`) to participate in the import process. +Details on providing custom importers can be found in :pep:`302`. .. seealso:: @@ -126,3 +126,28 @@ Class method that allows this class to be a :term:`loader` for frozen modules. + + +.. class:: PathFinder + + :term:`Finder` for :data:`sys.path`. + + This class does not perfectly mirror the semantics of :keyword:`import` in + terms of :data:`sys.path`. No implicit path hooks are assumed for + simplification of the class and its semantics. + + Only class method are defined by this class to alleviate the need for + instantiation. + + .. classmethod:: find_module(fullname, path=None) + + Class method that attempts to find a :term:`loader` for the module + specified by *fullname* either on :data:`sys.path` or, if defined, on + *path*. For each path entry that is searched, + :data:`sys.path_importer_cache` is checked. If an non-false object is + found then it is used as the :term:`finder` to query for the module + being searched for. For no entry is found in + :data:`sys.path_importer_cache`, then :data:`sys.path_hooks` is + searched for a finder for the path entry and, if found, is stored in + :data:`sys.path_importer_cache` along with being queried about the + module. Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Mon Feb 16 05:18:01 2009 @@ -52,7 +52,6 @@ + machinery - (?) Chained path hook/finder - - (?) FileFinder - Extensions importers * ExtensionFinder @@ -65,6 +64,11 @@ - PathFinder +* Make sure that there is documentation *somewhere* fully explaining the +semantics of import that can be referenced from the package's documentation +(even if it is in the package documentation itself, although it might be best +in the language specification). + * Write benchmark suite. * OPTIMIZE! From buildbot at python.org Mon Feb 16 06:04:21 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 16 Feb 2009 05:04:21 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090216050421.B2D121E4002@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/297 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 Mon Feb 16 06:33:24 2009 From: python-checkins at python.org (alexandre.vassalotti) Date: Mon, 16 Feb 2009 06:33:24 +0100 (CET) Subject: [Python-checkins] r69663 - peps/trunk/pep-0374.txt Message-ID: <20090216053324.EB40F1E4002@bag.python.org> Author: alexandre.vassalotti Date: Mon Feb 16 06:33:23 2009 New Revision: 69663 Log: Update the example for Mercurial in "Separation of Issue Dependencies". Add a note about newline translation on Windows. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Mon Feb 16 06:33:23 2009 @@ -331,8 +331,8 @@ [ui] username = Firstname Lastname -If you are using Windows, enable the win32text extension to use -Unix-style newlines by adding to your configuration:: +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 = @@ -1061,28 +1061,29 @@ 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). - cd .. - hg clone trunk fix-socket-bug - cd fix-socket-bug + hg shelve + # Select changes to put aside # Edit some other code (e.g. socket). hg commit - cd ../issue0000 - hg pull ../fix-socket-bug - hg merge - # Edit some more code. + hg unselve + # Complete initial fix. hg commit - cd ../trunk - hg pull ../issue0000 - hg merge - hg push cd .. - rm -rf issue0000 fix-socket-bug + 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 ''' From python-checkins at python.org Mon Feb 16 10:13:20 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Mon, 16 Feb 2009 10:13:20 +0100 (CET) Subject: [Python-checkins] r69664 - in python/branches/py3k: Misc/NEWS Modules/timemodule.c Message-ID: <20090216091320.BB53C1E400C@bag.python.org> Author: hirokazu.yamamoto Date: Mon Feb 16 10:13:20 2009 New Revision: 69664 Log: Issue #5249: time.strftime returned malformed string when format string contained non ascii character on windows. Modified: python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/timemodule.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon Feb 16 10:13:20 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #5249: time.strftime returned malformed string when format string + contained non ascii character on windows. + - Issue #5186: Reduce hash collisions for objects with no __hash__ method by rotating the object pointer by 4 bits to the right. Modified: python/branches/py3k/Modules/timemodule.c ============================================================================== --- python/branches/py3k/Modules/timemodule.c (original) +++ python/branches/py3k/Modules/timemodule.c Mon Feb 16 10:13:20 2009 @@ -508,9 +508,11 @@ return NULL; } - /* Convert the unicode string to an ascii one */ - fmt = _PyUnicode_AsString(format); - + /* 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); fmtlen = strlen(fmt); /* I hate these functions that presume you know how big the output @@ -519,6 +521,7 @@ for (i = 1024; ; i += i) { outbuf = (char *)PyMem_Malloc(i); if (outbuf == NULL) { + Py_DECREF(format); return PyErr_NoMemory(); } buflen = strftime(outbuf, i, fmt, &buf); @@ -532,6 +535,7 @@ ret = PyUnicode_Decode(outbuf, buflen, TZNAME_ENCODING, NULL); PyMem_Free(outbuf); + Py_DECREF(format); return ret; } PyMem_Free(outbuf); @@ -539,6 +543,7 @@ /* VisualStudio .NET 2005 does this properly */ if (buflen == 0 && errno == EINVAL) { PyErr_SetString(PyExc_ValueError, "Invalid format string"); + Py_DECREF(format); return 0; } #endif From python-checkins at python.org Mon Feb 16 10:29:32 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Mon, 16 Feb 2009 10:29:32 +0100 (CET) Subject: [Python-checkins] r69665 - in python/branches/release30-maint: Misc/NEWS Modules/timemodule.c Message-ID: <20090216092932.146021E4002@bag.python.org> Author: hirokazu.yamamoto Date: Mon Feb 16 10:29:31 2009 New Revision: 69665 Log: Merged revisions 69664 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69664 | hirokazu.yamamoto | 2009-02-16 18:13:20 +0900 | 2 lines Issue #5249: time.strftime returned malformed string when format string contained non ascii character on windows. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/timemodule.c Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Mon Feb 16 10:29:31 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #5249: time.strftime returned malformed string when format string + contained non ascii character on windows. + Library ------- Modified: python/branches/release30-maint/Modules/timemodule.c ============================================================================== --- python/branches/release30-maint/Modules/timemodule.c (original) +++ python/branches/release30-maint/Modules/timemodule.c Mon Feb 16 10:29:31 2009 @@ -508,9 +508,11 @@ return NULL; } - /* Convert the unicode string to an ascii one */ - fmt = _PyUnicode_AsString(format); - + /* 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); fmtlen = strlen(fmt); /* I hate these functions that presume you know how big the output @@ -519,6 +521,7 @@ for (i = 1024; ; i += i) { outbuf = (char *)PyMem_Malloc(i); if (outbuf == NULL) { + Py_DECREF(format); return PyErr_NoMemory(); } buflen = strftime(outbuf, i, fmt, &buf); @@ -532,6 +535,7 @@ ret = PyUnicode_Decode(outbuf, buflen, TZNAME_ENCODING, NULL); PyMem_Free(outbuf); + Py_DECREF(format); return ret; } PyMem_Free(outbuf); @@ -539,6 +543,7 @@ /* VisualStudio .NET 2005 does this properly */ if (buflen == 0 && errno == EINVAL) { PyErr_SetString(PyExc_ValueError, "Invalid format string"); + Py_DECREF(format); return 0; } #endif From buildbot at python.org Mon Feb 16 10:32:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 16 Feb 2009 09:32:09 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090216093209.8DBDD1E4002@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/367 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_pipes make: *** [buildbottest] Error 1 sincerely, -The Buildbot From eric at trueblade.com Mon Feb 16 10:42:04 2009 From: eric at trueblade.com (Eric Smith) Date: Mon, 16 Feb 2009 04:42:04 -0500 Subject: [Python-checkins] r69663 - peps/trunk/pep-0374.txt In-Reply-To: <20090216053324.EB40F1E4002@bag.python.org> References: <20090216053324.EB40F1E4002@bag.python.org> Message-ID: <499934EC.1040807@trueblade.com> alexandre.vassalotti wrote: > Author: alexandre.vassalotti > Date: Mon Feb 16 06:33:23 2009 > New Revision: 69663 ... > + hg unselve ... I assume this is a typo. Eric. From python-checkins at python.org Mon Feb 16 10:56:39 2009 From: python-checkins at python.org (eric.smith) Date: Mon, 16 Feb 2009 10:56:39 +0100 (CET) Subject: [Python-checkins] r69666 - python/trunk/Misc/ACKS Message-ID: <20090216095639.7FCA71E4002@bag.python.org> Author: eric.smith Date: Mon Feb 16 10:56:39 2009 New Revision: 69666 Log: Added Ross Light to ACKS, for bug 4285 (r69331). Modified: python/trunk/Misc/ACKS Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Mon Feb 16 10:56:39 2009 @@ -420,6 +420,7 @@ Mark Levinson William Lewis Robert van Liere +Ross Light Shawn Ligocki Martin Ligr Christopher Lindblad From buildbot at python.org Mon Feb 16 11:17:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 16 Feb 2009 10:17:31 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.0 Message-ID: <20090216101731.EAA171E4046@bag.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/179 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: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Mon Feb 16 13:37:12 2009 From: python-checkins at python.org (eric.smith) Date: Mon, 16 Feb 2009 13:37:12 +0100 (CET) Subject: [Python-checkins] r69667 - in python/branches/py3k: Misc/ACKS Message-ID: <20090216123712.7CAF01E4002@bag.python.org> Author: eric.smith Date: Mon Feb 16 13:37:11 2009 New Revision: 69667 Log: Merged revisions 69666 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69666 | eric.smith | 2009-02-16 04:56:39 -0500 (Mon, 16 Feb 2009) | 1 line Added Ross Light to ACKS, for bug 4285 (r69331). ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/ACKS Modified: python/branches/py3k/Misc/ACKS ============================================================================== --- python/branches/py3k/Misc/ACKS (original) +++ python/branches/py3k/Misc/ACKS Mon Feb 16 13:37:11 2009 @@ -421,6 +421,7 @@ Mark Levinson William Lewis Robert van Liere +Ross Light Shawn Ligocki Martin Ligr Christopher Lindblad From python-checkins at python.org Mon Feb 16 13:39:58 2009 From: python-checkins at python.org (eric.smith) Date: Mon, 16 Feb 2009 13:39:58 +0100 (CET) Subject: [Python-checkins] r69668 - python/branches/release26-maint Message-ID: <20090216123958.1F10B1E4002@bag.python.org> Author: eric.smith Date: Mon Feb 16 13:39:57 2009 New Revision: 69668 Log: Blocked revisions 69666 via svnmerge ........ r69666 | eric.smith | 2009-02-16 04:56:39 -0500 (Mon, 16 Feb 2009) | 1 line Added Ross Light to ACKS, for bug 4285 (r69331). ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Mon Feb 16 13:40:36 2009 From: python-checkins at python.org (eric.smith) Date: Mon, 16 Feb 2009 13:40:36 +0100 (CET) Subject: [Python-checkins] r69669 - python/branches/release30-maint Message-ID: <20090216124036.AEFBA1E4002@bag.python.org> Author: eric.smith Date: Mon Feb 16 13:40:36 2009 New Revision: 69669 Log: Blocked revisions 69667 via svnmerge ................ r69667 | eric.smith | 2009-02-16 07:37:11 -0500 (Mon, 16 Feb 2009) | 9 lines Merged revisions 69666 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69666 | eric.smith | 2009-02-16 04:56:39 -0500 (Mon, 16 Feb 2009) | 1 line Added Ross Light to ACKS, for bug 4285 (r69331). ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Mon Feb 16 14:29:08 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 16 Feb 2009 13:29:08 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090216132908.7562A1E4002@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/299 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: eric.smith 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.x.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Mon Feb 16 14:53:47 2009 From: python-checkins at python.org (alexandre.vassalotti) Date: Mon, 16 Feb 2009 14:53:47 +0100 (CET) Subject: [Python-checkins] r69670 - peps/trunk/pep-0374.txt Message-ID: <20090216135347.683B31E4025@bag.python.org> Author: alexandre.vassalotti Date: Mon Feb 16 14:53:47 2009 New Revision: 69670 Log: Fix typo. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Mon Feb 16 14:53:47 2009 @@ -1074,7 +1074,7 @@ # Select changes to put aside # Edit some other code (e.g. socket). hg commit - hg unselve + hg unshelve # Complete initial fix. hg commit cd .. From python-checkins at python.org Mon Feb 16 15:38:29 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 15:38:29 +0100 (CET) Subject: [Python-checkins] r69671 - python/branches/io-c/Modules/_bytesio.c Message-ID: <20090216143829.99F1D1E4010@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 15:38:27 2009 New Revision: 69671 Log: add garbage collection support to bytesio Modified: python/branches/io-c/Modules/_bytesio.c Modified: python/branches/io-c/Modules/_bytesio.c ============================================================================== --- python/branches/io-c/Modules/_bytesio.c (original) +++ python/branches/io-c/Modules/_bytesio.c Mon Feb 16 15:38:27 2009 @@ -613,9 +613,7 @@ PyMem_Free(self->buf); self->buf = NULL; } - Py_CLEAR(self->dict); - if (self->weakreflist != NULL) - PyObject_ClearWeakRefs((PyObject *)self); + Py_TYPE(self)->tp_clear((PyObject *)self); Py_TYPE(self)->tp_free(self); } @@ -665,6 +663,24 @@ return 0; } +static int +bytesio_traverse(BytesIOObject *self, visitproc visit, void *arg) +{ + Py_VISIT(self->dict); + Py_VISIT(self->weakreflist); + return 0; +} + +static int +bytesio_clear(BytesIOObject *self) +{ + Py_CLEAR(self->dict); + if (self->weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *)self); + return 0; +} + + static PyGetSetDef bytesio_getsetlist[] = { {"closed", (getter)bytesio_get_closed, NULL, "True if the file is closed."}, @@ -718,10 +734,11 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | + Py_TPFLAGS_HAVE_GC, /*tp_flags*/ bytesio_doc, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + (traverseproc)bytesio_traverse, /*tp_traverse*/ + (inquiry)bytesio_clear, /*tp_clear*/ 0, /*tp_richcompare*/ offsetof(BytesIOObject, weakreflist), /*tp_weaklistoffset*/ PyObject_SelfIter, /*tp_iter*/ From python-checkins at python.org Mon Feb 16 15:54:35 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 15:54:35 +0100 (CET) Subject: [Python-checkins] r69672 - python/trunk/Doc/c-api/string.rst Message-ID: <20090216145435.2EA2B1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 15:54:34 2009 New Revision: 69672 Log: note functions that are not aliased to PyBytes_ #5280 Modified: python/trunk/Doc/c-api/string.rst Modified: python/trunk/Doc/c-api/string.rst ============================================================================== --- python/trunk/Doc/c-api/string.rst (original) +++ python/trunk/Doc/c-api/string.rst Mon Feb 16 15:54:34 2009 @@ -9,8 +9,10 @@ called with a non-string parameter. .. note:: - These functions have been renamed to PyBytes_* in Python 3.x. The PyBytes - names are also available in 2.6. + + These functions have been renamed to PyBytes_* in Python 3.x. Unless + otherwise noted, the PyBytes functions available in 3.x are aliased to their + PyString_* equivalents to help porting. .. index:: object: string @@ -219,6 +221,10 @@ reference-count-neutral; you own the object after the call if and only if you owned it before the call.) + .. note:: + + This function is not available in 3.x and does not have a PyBytes alias. + .. cfunction:: PyObject* PyString_InternFromString(const char *v) @@ -227,6 +233,10 @@ been interned, or a new ("owned") reference to an earlier interned string object with the same value. + .. note:: + + This function is not available in 3.x and does not have a PyBytes alias. + .. cfunction:: PyObject* PyString_Decode(const char *s, Py_ssize_t size, const char *encoding, const char *errors) @@ -236,6 +246,10 @@ The codec to be used is looked up using the Python codec registry. Return *NULL* if an exception was raised by the codec. + .. note:: + + This function is not available in 3.x and does not have a PyBytes alias. + .. cfunction:: PyObject* PyString_AsDecodedObject(PyObject *str, const char *encoding, const char *errors) @@ -245,6 +259,10 @@ The codec to be used is looked up using the Python codec registry. Return *NULL* if an exception was raised by the codec. + .. note:: + + This function is not available in 3.x and does not have a PyBytes alias. + .. cfunction:: PyObject* PyString_Encode(const char *s, Py_ssize_t size, const char *encoding, const char *errors) @@ -254,6 +272,10 @@ :meth:`encode` method. The codec to be used is looked up using the Python codec registry. Return *NULL* if an exception was raised by the codec. + .. note:: + + This function is not available in 3.x and does not have a PyBytes alias. + .. cfunction:: PyObject* PyString_AsEncodedObject(PyObject *str, const char *encoding, const char *errors) @@ -262,3 +284,7 @@ parameters of the same name in the string :meth:`encode` method. The codec to be used is looked up using the Python codec registry. Return *NULL* if an exception was raised by the codec. + + .. note:: + + This function is not available in 3.x and does not have a PyBytes alias. From buildbot at python.org Mon Feb 16 16:09:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 16 Feb 2009 15:09:22 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090216150923.297981E4002@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/160 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 Mon Feb 16 16:38:23 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 16:38:23 +0100 (CET) Subject: [Python-checkins] r69673 - in sandbox/trunk/2to3/lib2to3: fixes/fix_itertools_imports.py tests/test_fixers.py Message-ID: <20090216153823.217AB1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 16:38:22 2009 New Revision: 69673 Log: fix handling of as imports #5279 Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_itertools_imports.py sandbox/trunk/2to3/lib2to3/tests/test_fixers.py 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 Mon Feb 16 16:38:22 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: 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 Mon Feb 16 16:38:22 2009 @@ -3402,6 +3402,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) From python-checkins at python.org Mon Feb 16 16:41:37 2009 From: python-checkins at python.org (facundo.batista) Date: Mon, 16 Feb 2009 16:41:37 +0100 (CET) Subject: [Python-checkins] r69674 - python/branches/py3k/Lib/decimal.py Message-ID: <20090216154137.80F571E4002@bag.python.org> Author: facundo.batista Date: Mon Feb 16 16:41:37 2009 New Revision: 69674 Log: Removed message about compatibility with 2.3. Modified: python/branches/py3k/Lib/decimal.py Modified: python/branches/py3k/Lib/decimal.py ============================================================================== --- python/branches/py3k/Lib/decimal.py (original) +++ python/branches/py3k/Lib/decimal.py Mon Feb 16 16:41:37 2009 @@ -7,18 +7,14 @@ # and Aahz # and Tim Peters -# This module is currently Py2.3 compatible and should be kept that way -# unless a major compelling advantage arises. IOW, 2.3 compatibility is -# strongly preferred, but not guaranteed. - -# Also, this module should be kept in sync with the latest updates of -# the IBM specification as it evolves. Those updates will be treated +# This module should be kept in sync with the latest updates of the +# IBM specification as it evolves. Those updates will be treated # as bug fixes (deviation from the spec is a compatibility, usability # bug) and will be backported. At this point the spec is stabilizing # and the updates are becoming fewer, smaller, and less significant. """ -This is a Py2.3 implementation of decimal floating point arithmetic based on +This is an implementation of decimal floating point arithmetic based on the General Decimal Arithmetic Specification: www2.hursley.ibm.com/decimal/decarith.html From python-checkins at python.org Mon Feb 16 17:15:34 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 17:15:34 +0100 (CET) Subject: [Python-checkins] r69675 - python/branches/py3k/Doc/reference/simple_stmts.rst Message-ID: <20090216161534.59A7C1E4034@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 17:15:34 2009 New Revision: 69675 Log: raise more generic Exception() instead of RuntimeError() #5281 Modified: python/branches/py3k/Doc/reference/simple_stmts.rst Modified: python/branches/py3k/Doc/reference/simple_stmts.rst ============================================================================== --- python/branches/py3k/Doc/reference/simple_stmts.rst (original) +++ python/branches/py3k/Doc/reference/simple_stmts.rst Mon Feb 16 17:15:34 2009 @@ -503,7 +503,7 @@ :meth:`with_traceback` exception method (which returns the same exception instance, with its traceback set to its argument), like so:: - raise RuntimeError("foo occurred").with_traceback(tracebackobj) + raise Exception("foo occurred").with_traceback(tracebackobj) .. index:: pair: exception; chaining __cause__ (exception attribute) From python-checkins at python.org Mon Feb 16 17:20:10 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 17:20:10 +0100 (CET) Subject: [Python-checkins] r69676 - in python/branches/py3k/Lib: modulefinder.py pkgutil.py subprocess.py Message-ID: <20090216162010.842A91E4063@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 17:20:10 2009 New Revision: 69676 Log: no 2.3 compat in the py3k lib #3676 Modified: python/branches/py3k/Lib/modulefinder.py python/branches/py3k/Lib/pkgutil.py python/branches/py3k/Lib/subprocess.py Modified: python/branches/py3k/Lib/modulefinder.py ============================================================================== --- python/branches/py3k/Lib/modulefinder.py (original) +++ python/branches/py3k/Lib/modulefinder.py Mon Feb 16 17:20:10 2009 @@ -1,5 +1,4 @@ """Find modules used by a script, using introspection.""" -# This module should be kept compatible with Python 2.2, see PEP 291. from __future__ import generators import dis @@ -10,11 +9,7 @@ import types import struct -if hasattr(sys.__stdout__, "newlines"): - READ_MODE = "U" # universal line endings -else: - # remain compatible with Python < 2.3 - READ_MODE = "r" +READ_MODE = "rU" # XXX Clean up once str8's cstor matches bytes. LOAD_CONST = bytes([dis.opname.index('LOAD_CONST')]) Modified: python/branches/py3k/Lib/pkgutil.py ============================================================================== --- python/branches/py3k/Lib/pkgutil.py (original) +++ python/branches/py3k/Lib/pkgutil.py Mon Feb 16 17:20:10 2009 @@ -1,8 +1,5 @@ """Utilities to support packages.""" -# NOTE: This module must remain compatible with Python 2.3, as it is shared -# by setuptools for distribution with Python 2.3 and up. - import os import sys import imp Modified: python/branches/py3k/Lib/subprocess.py ============================================================================== --- python/branches/py3k/Lib/subprocess.py (original) +++ python/branches/py3k/Lib/subprocess.py Mon Feb 16 17:20:10 2009 @@ -2,8 +2,6 @@ # # For more information about this module, see PEP 324. # -# This module should remain compatible with Python 2.2, see PEP 291. -# # Copyright (c) 2003-2005 by Peter Astrand # # Licensed to PSF under a Contributor Agreement. From python-checkins at python.org Mon Feb 16 17:31:04 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 17:31:04 +0100 (CET) Subject: [Python-checkins] r69677 - python/branches/io-c/Modules/_textio.c Message-ID: <20090216163104.97A501E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 17:31:03 2009 New Revision: 69677 Log: reduce ImportError catching code duplication I'm not sure this makes the code clearer with its new gotos, but at least I added a big fat comment Modified: python/branches/io-c/Modules/_textio.c Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Mon Feb 16 17:31:03 2009 @@ -774,14 +774,8 @@ if (encoding == NULL && self->encoding == NULL) { if (state->locale_module == NULL) { state->locale_module = PyImport_ImportModule("locale"); - if (state->locale_module == NULL) { - if (PyErr_ExceptionMatches(PyExc_ImportError)) { - PyErr_Clear(); - self->encoding = PyUnicode_FromString("ascii"); - } - else - goto error; - } + if (state->locale_module == NULL) + goto catch_ImportError; else goto use_locale; } @@ -790,6 +784,13 @@ self->encoding = PyObject_CallMethod( state->locale_module, "getpreferredencoding", NULL); if (self->encoding == NULL) { + catch_ImportError: + /* + Importing locale can raise a ImportError because of + _functools, and locale.getpreferredencoding can raise a + ImportError if _locale is not available. These will happen + during module building. + */ if (PyErr_ExceptionMatches(PyExc_ImportError)) { PyErr_Clear(); self->encoding = PyUnicode_FromString("ascii"); From python-checkins at python.org Mon Feb 16 17:45:22 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 17:45:22 +0100 (CET) Subject: [Python-checkins] r69678 - peps/trunk/pep-0375.txt Message-ID: <20090216164522.ECF021E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 17:45:21 2009 New Revision: 69678 Log: new schedule; this time with only one beta Modified: peps/trunk/pep-0375.txt Modified: peps/trunk/pep-0375.txt ============================================================================== --- peps/trunk/pep-0375.txt (original) +++ peps/trunk/pep-0375.txt Mon Feb 16 17:45:21 2009 @@ -37,11 +37,11 @@ Draft schedule: - 3.1a1 March 7, 2009 -- 3.1a2 April 11, 2009 +- 3.1a2 April 4, 2009 - 3.1b1 May 2, 2009 -- 3.1b2 May 23, 2009 -- 3.1rc1 June 13, 2009 -- 3.1rc2 June 27, 2009 +- 3.1rc1 May 30, 2009 +- 3.1rc2 June 13, 2009 +- 3.1 final June 27, 2009 Features for 3.1 From buildbot at python.org Mon Feb 16 18:06:03 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 16 Feb 2009 17:06:03 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090216170604.7F1F81E4002@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/301 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 Mon Feb 16 18:36:07 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 18:36:07 +0100 (CET) Subject: [Python-checkins] r69679 - in sandbox/trunk/2to3/lib2to3: fixer_util.py fixes/fix_set_literal.py pytree.py tests/test_pytree.py Message-ID: <20090216173607.1990E1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 18:36:06 2009 New Revision: 69679 Log: make Base.get_next_sibling() and Base.get_prev_sibling() properties Modified: sandbox/trunk/2to3/lib2to3/fixer_util.py sandbox/trunk/2to3/lib2to3/fixes/fix_set_literal.py sandbox/trunk/2to3/lib2to3/pytree.py sandbox/trunk/2to3/lib2to3/tests/test_pytree.py Modified: sandbox/trunk/2to3/lib2to3/fixer_util.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixer_util.py (original) +++ sandbox/trunk/2to3/lib2to3/fixer_util.py Mon Feb 16 18:36:06 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: 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 Mon Feb 16 18:36:06 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: sandbox/trunk/2to3/lib2to3/pytree.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/pytree.py (original) +++ sandbox/trunk/2to3/lib2to3/pytree.py Mon Feb 16 18:36:06 2009 @@ -162,10 +162,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 +179,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 @@ -193,8 +197,8 @@ 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() + 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() Modified: sandbox/trunk/2to3/lib2to3/tests/test_pytree.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/test_pytree.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/test_pytree.py Mon Feb 16 18:36:06 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 Mon Feb 16 18:41:48 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 18:41:48 +0100 (CET) Subject: [Python-checkins] r69680 - sandbox/trunk/2to3/lib2to3/pytree.py Message-ID: <20090216174148.55C581E4036@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 18:41:48 2009 New Revision: 69680 Log: normalize docstrings in pytree according to PEP 11 Modified: sandbox/trunk/2to3/lib2to3/pytree.py Modified: sandbox/trunk/2to3/lib2to3/pytree.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/pytree.py (original) +++ sandbox/trunk/2to3/lib2to3/pytree.py Mon Feb 16 18:41:48 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: @@ -196,8 +207,10 @@ return self.parent.children[i-1] def get_suffix(self): - """Return the string immediately following the invocant node. This - is effectively equivalent to node.next_sibling.get_prefix()""" + """ + 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 "" @@ -209,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. @@ -226,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. """ @@ -269,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. """ @@ -278,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() @@ -310,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: @@ -324,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: @@ -383,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. @@ -413,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. @@ -444,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. """ @@ -453,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. """ @@ -465,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. @@ -490,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. @@ -509,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), @@ -537,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. @@ -565,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: @@ -577,7 +613,8 @@ """ def __init__(self, content=None, min=0, max=HUGE, name=None): - """Initializer. + """ + Initializer. Args: content: optional sequence of subsequences of patterns; @@ -645,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 @@ -748,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 @@ -780,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 From python-checkins at python.org Mon Feb 16 18:43:10 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 18:43:10 +0100 (CET) Subject: [Python-checkins] r69681 - sandbox/trunk/2to3/lib2to3/patcomp.py Message-ID: <20090216174310.0BCB31E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 18:43:09 2009 New Revision: 69681 Log: use a set 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 Mon Feb 16 18:43:09 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 From python-checkins at python.org Mon Feb 16 19:22:15 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 19:22:15 +0100 (CET) Subject: [Python-checkins] r69682 - python/branches/py3k/Lib/distutils/version.py Message-ID: <20090216182215.F3F3F1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 19:22:15 2009 New Revision: 69682 Log: remove another use of cmp() Modified: python/branches/py3k/Lib/distutils/version.py Modified: python/branches/py3k/Lib/distutils/version.py ============================================================================== --- python/branches/py3k/Lib/distutils/version.py (original) +++ python/branches/py3k/Lib/distutils/version.py Mon Feb 16 19:22:15 2009 @@ -338,7 +338,12 @@ if isinstance(other, str): other = LooseVersion(other) - return cmp(self.version, other.version) + if self.version == other.version: + return 0 + if self.version < other.version: + return -1 + if self.version > other.version: + return 1 # end class LooseVersion From mal at egenix.com Mon Feb 16 19:23:50 2009 From: mal at egenix.com (M.-A. Lemburg) Date: Mon, 16 Feb 2009 19:23:50 +0100 Subject: [Python-checkins] r69682 - python/branches/py3k/Lib/distutils/version.py In-Reply-To: <20090216182215.F3F3F1E4002@bag.python.org> References: <20090216182215.F3F3F1E4002@bag.python.org> Message-ID: <4999AF36.8030707@egenix.com> On 2009-02-16 19:22, benjamin.peterson wrote: > Author: benjamin.peterson > Date: Mon Feb 16 19:22:15 2009 > New Revision: 69682 > > Log: > remove another use of cmp() Sigh. It would be so much easier to just put this implementation somewhere in the stdlib and reference it whenever necessary, instead of cluttering up the whole stdlib with different versions of the same piece of code. > Modified: > python/branches/py3k/Lib/distutils/version.py > > Modified: python/branches/py3k/Lib/distutils/version.py > ============================================================================== > --- python/branches/py3k/Lib/distutils/version.py (original) > +++ python/branches/py3k/Lib/distutils/version.py Mon Feb 16 19:22:15 2009 > @@ -338,7 +338,12 @@ > if isinstance(other, str): > other = LooseVersion(other) > > - return cmp(self.version, other.version) > + if self.version == other.version: > + return 0 > + if self.version < other.version: > + return -1 > + if self.version > other.version: > + return 1 > > > # end class LooseVersion > _______________________________________________ > Python-checkins mailing list > Python-checkins at python.org > http://mail.python.org/mailman/listinfo/python-checkins -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 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/ ________________________________________________________________________ ::: 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 Mon Feb 16 19:25:19 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 19:25:19 +0100 (CET) Subject: [Python-checkins] r69683 - in python/branches/release30-maint: Lib/distutils/version.py Message-ID: <20090216182519.E922E1E4066@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 19:25:19 2009 New Revision: 69683 Log: Merged revisions 69682 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69682 | benjamin.peterson | 2009-02-16 12:22:15 -0600 (Mon, 16 Feb 2009) | 1 line remove another use of cmp() ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/distutils/version.py Modified: python/branches/release30-maint/Lib/distutils/version.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/version.py (original) +++ python/branches/release30-maint/Lib/distutils/version.py Mon Feb 16 19:25:19 2009 @@ -338,7 +338,12 @@ if isinstance(other, str): other = LooseVersion(other) - return cmp(self.version, other.version) + if self.version == other.version: + return 0 + if self.version < other.version: + return -1 + if self.version > other.version: + return 1 # end class LooseVersion From buildbot at python.org Mon Feb 16 20:16:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 16 Feb 2009 19:16:15 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090216191615.6976A1E4002@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/325 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: sincerely, -The Buildbot From python-checkins at python.org Mon Feb 16 21:37:54 2009 From: python-checkins at python.org (brett.cannon) Date: Mon, 16 Feb 2009 21:37:54 +0100 (CET) Subject: [Python-checkins] r69684 - peps/trunk/pep-0374.txt Message-ID: <20090216203754.C02301E4044@bag.python.org> Author: brett.cannon Date: Mon Feb 16 21:37:54 2009 New Revision: 69684 Log: Add Stephen's git changes for the Feb 15th deadline. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Mon Feb 16 21:37:54 2009 @@ -17,10 +17,6 @@ This PEP is in the draft stages and is still under active development. -.. note:: - Final implementations for scenarios (sans `Coordinated Development of a New - Feature`_) are schedule to be completed by Feb. 15th. - Rationale ========= @@ -389,36 +385,14 @@ echo '*~' >> ~/.gitignore echo '.msg' >> ~/.gitignore -If you use multiple branches, you can save a lot of space by putting -all objects in a common object store. This can be done physically, -by making them branches in a single repository. It can alternatively -be done logically, with the environment variables -``GIT_OBJECT_DIRECTORY`` (a single directory where new repository -objects will be written) and ``GIT_ALTERNATE_OBJECT_DIRECTORIES`` -(a colon-separated path -- on Windows, semicolon-separated -- of -directories containing read-only object stores to search). Note that -when making a local clone, git will hard-link objects rather than -creating copies if the OS supports that, which also saves space in -the child repository. Here's a complicated example:: - - # clone the trunk and py3k repositories - cd /path/to/myrepos - git clone git://code.python.org/python/trunk - git clone git://code.python.org/python/branches/py3k - # set up environment for my personal copies of the trunk and py3k - # they will read the objects in the pristine clones, but never write - # anything there export - # GIT_ALTERNATE_OBJECT_DIRECTORIES=/path/to/myrepos/trunk:/path/to/myrepos/py3k - git clone trunk trunk-sandbox - # set up environment for my personal copy of py3k - # read/write: if a file introduced in py3k is imported to trunk - # verbatim, the trunk sandbox will - # use the object created in the py3k sandbox - export GIT_OBJECT_DIRECTORY=/path/to/myrepos/trunk-sandbox - git clone py3k py3k-sandbox - -If you want more complexity, git clone has a plethora of options to -optimize space. +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 @@ -507,13 +481,12 @@ (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.:: +description of the git-format-patch format. +:: # Get the mainline code. git clone git://code.python.org/python/trunk cd trunk - # Make a personal branch to keep the trunk ("master" branch) clean. - git checkout -b stuff # Edit some code. git commit -a -m 'Stuff I did.' # Create patch for my changes (i.e, relative to master). @@ -580,12 +553,9 @@ # Assume the change to revert is the grandfather of a revision tagged "newhotness". git revert newhotness~2 - #if CONFLICTS - # Resolve conflicts if any. + # 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." - #else - # Edit log message, commit will be done automatically. - #endif git push @@ -686,6 +656,8 @@ 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 @@ -823,7 +795,7 @@ git ''' -In git I would have an "integration" workspace which contains all of +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. @@ -832,21 +804,16 @@ # Assume patch applied to 2.7 in revision release27~3 (4th patch back from tip). cd integration git checkout release26 - # The "-x" option automatically notes which commit is being - # cherry-picked in the log. - git cherry-pick -x release27~3 + 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 -x release27~3 + git cherry-pick release27~3 # Do any conflict resolution and test failure fixups. # Revert Misc/NEWS changes. git checkout HEAD^ -- Misc/NEWS - # This creates a new commit on top of the cherry-pick. An alternative workflow - # would use the -n (aka --no-commit)flag to git-cherry-pick, and then commit - # here with an appropriate log message. git commit -m 'Revert cherry-picked Misc/NEWS changes.' Misc/NEWS # Push both ports. git push release26 master @@ -1090,53 +1057,43 @@ :: cd trunk - # Actually, I wouldn't tag here in most cases; it's easy enough to get the - # appropriate revision to rewind to via git-show-branches. - git tag checkpoint - git checkout -b bug-0000 - # Edit some code, commit some changes. - git commit -a -m "Fixed urllib bug, part 1." - # Dang, we need to fix something lower level now. - # This is independent of urllib, so create a new branch at master. - git checkout -b fix-socket master + # 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." - # Can't test urllib unless the socket fix is present. - # So we rebase on top of fix-socket (which is where we happen to be). - # git-rebase is interactive,so we resolve conflicts as we go along. - git rebase fix-socket bug-0000 - # Edit me some more code, commit some more fixes to bug-0000. + # 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." - # Merge in the fixes. - git checkout master - git merge bug-0000 - # And push them to the public repository. + # And push both patches to the public repository. git push - # Bonus points: someone else fixes socket in the exact same way - # you just did, and landed that in the trunk. - # Merge their changes in and delete your now redundant thread. - # Note that we find this out because the git push fails with - # "not a fast forward." +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 - # Gag me, we got conflicts. - # Call the doctor, who says "you've got duplicate patchiosis". - # The second opinion is that it really is exactly what I had in fix-socket. - # OK, abandon my work, and clean up the bloody wreck of - # conflicts with the same mop: - git reset --hard checkpoint + + # 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 - git rebase --onto master fix-socket bug-0000 - # If there were any conflicts, we fixed them during rebase. But - # there shouldn't be any, - # since we assumed the socket bug is independent of the urllib bug. - git checkout master - git merge bug-0000 - git push - # Clean up. We don't delete bug-0000 because the merge obsoleted it already. - git tag -d checkpoint - git branch -d fix-socket - # Now our HEAD has an up-to-date trunk and just the urllib fix. + +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 From python-checkins at python.org Mon Feb 16 21:39:13 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 16 Feb 2009 21:39:13 +0100 (CET) Subject: [Python-checkins] r69685 - in python/trunk: Lib/test/test_itertools.py Modules/itertoolsmodule.c Message-ID: <20090216203913.210F11E4045@bag.python.org> Author: raymond.hettinger Date: Mon Feb 16 21:39:12 2009 New Revision: 69685 Log: Add GC support to count() objects. Backport candidate. Modified: python/trunk/Lib/test/test_itertools.py python/trunk/Modules/itertoolsmodule.c Modified: python/trunk/Lib/test/test_itertools.py ============================================================================== --- python/trunk/Lib/test/test_itertools.py (original) +++ python/trunk/Lib/test/test_itertools.py Mon Feb 16 21:39:12 2009 @@ -966,6 +966,11 @@ a = [] self.makecycle(compress('ABCDEF', [1,0,1,0,1,0]), a) + def test_count(self): + a = [] + Int = type('Int', (int,), dict(x=a)) + self.makecycle(count(Int(0), Int(1)), a) + def test_cycle(self): a = [] self.makecycle(cycle([a]*2), a) Modified: python/trunk/Modules/itertoolsmodule.c ============================================================================== --- python/trunk/Modules/itertoolsmodule.c (original) +++ python/trunk/Modules/itertoolsmodule.c Mon Feb 16 21:39:12 2009 @@ -3271,7 +3271,7 @@ cnt == PY_SSIZE_T_MAX && long_cnt != NULL); /* create countobject structure */ - lz = (countobject *)PyObject_New(countobject, &count_type); + lz = (countobject *)type->tp_alloc(type, 0); if (lz == NULL) { Py_XDECREF(long_cnt); return NULL; @@ -3286,9 +3286,17 @@ static void count_dealloc(countobject *lz) { + PyObject_GC_UnTrack(lz); Py_XDECREF(lz->long_cnt); Py_XDECREF(lz->long_step); - PyObject_Del(lz); + Py_TYPE(lz)->tp_free(lz); +} + +count_traverse(countobject *lz, visitproc visit, void *arg) +{ + Py_VISIT(lz->long_cnt); + Py_VISIT(lz->long_step); + return 0; } static PyObject * @@ -3384,9 +3392,10 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | + Py_TPFLAGS_BASETYPE, /* tp_flags */ count_doc, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)count_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -3403,6 +3412,7 @@ 0, /* tp_init */ 0, /* tp_alloc */ count_new, /* tp_new */ + PyObject_GC_Del, /* tp_free */ }; From brett at python.org Mon Feb 16 21:45:17 2009 From: brett at python.org (Brett Cannon) Date: Mon, 16 Feb 2009 12:45:17 -0800 Subject: [Python-checkins] r69663 - peps/trunk/pep-0374.txt In-Reply-To: <499934EC.1040807@trueblade.com> References: <20090216053324.EB40F1E4002@bag.python.org> <499934EC.1040807@trueblade.com> Message-ID: On Mon, Feb 16, 2009 at 01:42, Eric Smith wrote: > alexandre.vassalotti wrote: > >> Author: alexandre.vassalotti >> Date: Mon Feb 16 06:33:23 2009 >> New Revision: 69663 >> > ... > >> + hg unselve >> > ... > I assume this is a typo. Someone fixed it so I am assuming someone agreed with you. =) -Brett -------------- next part -------------- An HTML attachment was scrubbed... URL: From python-checkins at python.org Mon Feb 16 21:50:56 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 16 Feb 2009 21:50:56 +0100 (CET) Subject: [Python-checkins] r69686 - in python/branches/py3k: Lib/test/test_itertools.py Modules/itertoolsmodule.c Message-ID: <20090216205056.7796D1E402F@bag.python.org> Author: raymond.hettinger Date: Mon Feb 16 21:50:56 2009 New Revision: 69686 Log: Add GC support to count() objects. Modified: python/branches/py3k/Lib/test/test_itertools.py python/branches/py3k/Modules/itertoolsmodule.c Modified: python/branches/py3k/Lib/test/test_itertools.py ============================================================================== --- python/branches/py3k/Lib/test/test_itertools.py (original) +++ python/branches/py3k/Lib/test/test_itertools.py Mon Feb 16 21:50:56 2009 @@ -979,6 +979,11 @@ a = [] self.makecycle(compress('ABCDEF', [1,0,1,0,1,0]), a) + def test_count(self): + a = [] + Int = type('Int', (int,), dict(x=a)) + self.makecycle(count(Int(0), Int(1)), a) + def test_cycle(self): a = [] self.makecycle(cycle([a]*2), a) Modified: python/branches/py3k/Modules/itertoolsmodule.c ============================================================================== --- python/branches/py3k/Modules/itertoolsmodule.c (original) +++ python/branches/py3k/Modules/itertoolsmodule.c Mon Feb 16 21:50:56 2009 @@ -2954,7 +2954,7 @@ cnt == PY_SSIZE_T_MAX && long_cnt != NULL); /* create countobject structure */ - lz = (countobject *)PyObject_New(countobject, &count_type); + lz = (countobject *)type->tp_alloc(type, 0); if (lz == NULL) { Py_XDECREF(long_cnt); return NULL; @@ -2969,9 +2969,17 @@ static void count_dealloc(countobject *lz) { + PyObject_GC_UnTrack(lz); Py_XDECREF(lz->long_cnt); Py_XDECREF(lz->long_step); - PyObject_Del(lz); + Py_TYPE(lz)->tp_free(lz); +} + +count_traverse(countobject *lz, visitproc visit, void *arg) +{ + Py_VISIT(lz->long_cnt); + Py_VISIT(lz->long_step); + return 0; } static PyObject * @@ -3058,9 +3066,10 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | + Py_TPFLAGS_BASETYPE, /* tp_flags */ count_doc, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)count_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -3077,6 +3086,7 @@ 0, /* tp_init */ 0, /* tp_alloc */ count_new, /* tp_new */ + PyObject_GC_Del, /* tp_free */ }; From benjamin at python.org Mon Feb 16 21:52:14 2009 From: benjamin at python.org (Benjamin Peterson) Date: Mon, 16 Feb 2009 14:52:14 -0600 Subject: [Python-checkins] r69685 - in python/trunk: Lib/test/test_itertools.py Modules/itertoolsmodule.c In-Reply-To: <20090216203913.210F11E4045@bag.python.org> References: <20090216203913.210F11E4045@bag.python.org> Message-ID: <1afaf6160902161252k1c42771gbb0c3cae0ac2e181@mail.gmail.com> On Mon, Feb 16, 2009 at 2:39 PM, raymond. hettinger wrote: > Author: raymond.hettinger > Date: Mon Feb 16 21:39:12 2009 > New Revision: 69685 > > Log: > Add GC support to count() objects. Backport candidate. > + def test_count(self): > + a = [] > + Int = type('Int', (int,), dict(x=a)) Is there a reason to use type() directly instead of class MyInt(int): x = a IMO, that's more readable. -- Regards, Benjamin From python-checkins at python.org Mon Feb 16 22:02:16 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 22:02:16 +0100 (CET) Subject: [Python-checkins] r69687 - python/branches/py3k Message-ID: <20090216210216.AE14A1E400C@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 22:02:16 2009 New Revision: 69687 Log: Blocked revisions 69685 via svnmerge ........ r69685 | raymond.hettinger | 2009-02-16 14:39:12 -0600 (Mon, 16 Feb 2009) | 1 line Add GC support to count() objects. Backport candidate. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Mon Feb 16 22:07:52 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 22:07:52 +0100 (CET) Subject: [Python-checkins] r69688 - python/trunk/Modules/itertoolsmodule.c Message-ID: <20090216210752.D12FA1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 22:07:52 2009 New Revision: 69688 Log: fix compiler warnings Modified: python/trunk/Modules/itertoolsmodule.c Modified: python/trunk/Modules/itertoolsmodule.c ============================================================================== --- python/trunk/Modules/itertoolsmodule.c (original) +++ python/trunk/Modules/itertoolsmodule.c Mon Feb 16 22:07:52 2009 @@ -3239,8 +3239,8 @@ kwlist, &long_cnt, &long_step)) return NULL; - if (long_cnt != NULL && !PyNumber_Check(long_cnt) || - long_step != NULL && !PyNumber_Check(long_step)) { + if ((long_cnt != NULL && !PyNumber_Check(long_cnt)) || + (long_step != NULL && !PyNumber_Check(long_step))) { PyErr_SetString(PyExc_TypeError, "a number is required"); return NULL; } @@ -3267,8 +3267,8 @@ } else long_cnt = NULL; } - assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL || - cnt == PY_SSIZE_T_MAX && long_cnt != NULL); + assert((cnt != PY_SSIZE_T_MAX && long_cnt == NULL) || + (cnt == PY_SSIZE_T_MAX && long_cnt != NULL)); /* create countobject structure */ lz = (countobject *)type->tp_alloc(type, 0); @@ -3292,6 +3292,7 @@ Py_TYPE(lz)->tp_free(lz); } +static int count_traverse(countobject *lz, visitproc visit, void *arg) { Py_VISIT(lz->long_cnt); @@ -3302,7 +3303,6 @@ static PyObject * count_nextlong(countobject *lz) { - static PyObject *one = NULL; PyObject *long_cnt; PyObject *stepped_up; From python-checkins at python.org Mon Feb 16 22:09:09 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 22:09:09 +0100 (CET) Subject: [Python-checkins] r69689 - in python/trunk: Include/bytesobject.h Misc/NEWS Message-ID: <20090216210909.6EE5D1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 22:09:09 2009 New Revision: 69689 Log: remove some PyBytes_* aliases that are not in 3.x Modified: python/trunk/Include/bytesobject.h python/trunk/Misc/NEWS Modified: python/trunk/Include/bytesobject.h ============================================================================== --- python/trunk/Include/bytesobject.h (original) +++ python/trunk/Include/bytesobject.h Mon Feb 16 22:09:09 2009 @@ -23,11 +23,5 @@ #define _PyBytes_FormatLong _PyString_FormatLong #define PyBytes_DecodeEscape PyString_DecodeEscape #define _PyBytes_Join _PyString_Join -#define PyBytes_Decode PyString_Decode -#define PyBytes_Encode PyString_Encode -#define PyBytes_AsEncodedObject PyString_AsEncodedObject -#define PyBytes_AsEncodedString PyString_AsEncodedString -#define PyBytes_AsDecodedObject PyString_AsDecodedObject -#define PyBytes_AsDecodedString PyString_AsDecodedString #define PyBytes_AsStringAndSize PyString_AsStringAndSize #define _PyBytes_InsertThousandsGrouping _PyString_InsertThousandsGrouping Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Feb 16 22:09:09 2009 @@ -506,6 +506,8 @@ C-API ----- +- Some PyBytes_* aliases have been removed because they don't exist in 3.x. + - Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError for negative arguments. Previously, it raised TypeError. From buildbot at python.org Mon Feb 16 22:11:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 16 Feb 2009 21:11:13 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090216211113.5356A1E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/650 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_ftplib.py", line 203, in run asyncore.loop(timeout=0.1, count=1) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 204, in loop poll_fun(timeout, map) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 141, in poll read(obj) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 78, in read obj.handle_error() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 74, in read obj.handle_read_event() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 413, in handle_read_event self.handle_read() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_ssl.py", line 408, in handle_read self.send(data.lower()) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 519, in send self.initiate_send() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 506, in initiate_send num_sent = dispatcher.send(self, self.out_buffer[:512]) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 349, in send result = self.socket.send(data) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/socket.py", line 165, in _dummy raise error(EBADF, 'Bad file descriptor') error: [Errno 9] Bad file descriptor 1 test failed: test_ftplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Feb 16 22:23:04 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 22:23:04 +0100 (CET) Subject: [Python-checkins] r69690 - python/trunk/Modules/itertoolsmodule.c Message-ID: <20090216212304.ABA761E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 22:23:04 2009 New Revision: 69690 Log: PyList_Append() can fail Modified: python/trunk/Modules/itertoolsmodule.c Modified: python/trunk/Modules/itertoolsmodule.c ============================================================================== --- python/trunk/Modules/itertoolsmodule.c (original) +++ python/trunk/Modules/itertoolsmodule.c Mon Feb 16 22:23:04 2009 @@ -745,8 +745,10 @@ while (1) { item = PyIter_Next(lz->it); if (item != NULL) { - if (!lz->firstpass) - PyList_Append(lz->saved, item); + if (!lz->firstpass && PyList_Append(lz->saved, item)) { + Py_DECREF(item); + return NULL; + } return item; } if (PyErr_Occurred()) { From python-checkins at python.org Mon Feb 16 22:28:30 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 16 Feb 2009 22:28:30 +0100 (CET) Subject: [Python-checkins] r69691 - in python/branches/py3k: Modules/itertoolsmodule.c Message-ID: <20090216212830.061681E4018@bag.python.org> Author: benjamin.peterson Date: Mon Feb 16 22:28:29 2009 New Revision: 69691 Log: Merged revisions 69688,69690 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69688 | benjamin.peterson | 2009-02-16 15:07:52 -0600 (Mon, 16 Feb 2009) | 1 line fix compiler warnings ........ r69690 | benjamin.peterson | 2009-02-16 15:23:04 -0600 (Mon, 16 Feb 2009) | 1 line PyList_Append() can fail ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Modules/itertoolsmodule.c Modified: python/branches/py3k/Modules/itertoolsmodule.c ============================================================================== --- python/branches/py3k/Modules/itertoolsmodule.c (original) +++ python/branches/py3k/Modules/itertoolsmodule.c Mon Feb 16 22:28:29 2009 @@ -745,8 +745,10 @@ while (1) { item = PyIter_Next(lz->it); if (item != NULL) { - if (!lz->firstpass) - PyList_Append(lz->saved, item); + if (!lz->firstpass && PyList_Append(lz->saved, item)) { + Py_DECREF(item); + return NULL; + } return item; } if (PyErr_Occurred()) { @@ -2922,8 +2924,8 @@ kwlist, &long_cnt, &long_step)) return NULL; - if (long_cnt != NULL && !PyNumber_Check(long_cnt) || - long_step != NULL && !PyNumber_Check(long_step)) { + if ((long_cnt != NULL && !PyNumber_Check(long_cnt)) || + (long_step != NULL && !PyNumber_Check(long_step))) { PyErr_SetString(PyExc_TypeError, "a number is required"); return NULL; } @@ -2950,8 +2952,8 @@ } else long_cnt = NULL; } - assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL || - cnt == PY_SSIZE_T_MAX && long_cnt != NULL); + assert((cnt != PY_SSIZE_T_MAX && long_cnt == NULL) || + (cnt == PY_SSIZE_T_MAX && long_cnt != NULL)); /* create countobject structure */ lz = (countobject *)type->tp_alloc(type, 0); @@ -2975,6 +2977,7 @@ Py_TYPE(lz)->tp_free(lz); } +static int count_traverse(countobject *lz, visitproc visit, void *arg) { Py_VISIT(lz->long_cnt); @@ -2985,7 +2988,6 @@ static PyObject * count_nextlong(countobject *lz) { - static PyObject *one = NULL; PyObject *long_cnt; PyObject *stepped_up; From buildbot at python.org Mon Feb 16 22:35:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 16 Feb 2009 21:35:23 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090216213524.5FC091E401A@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/303 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 Mon Feb 16 22:38:01 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 16 Feb 2009 22:38:01 +0100 (CET) Subject: [Python-checkins] r69692 - in python/trunk: Doc/distutils/setupscript.rst Doc/distutils/sourcedist.rst Lib/distutils/command/sdist.py Lib/distutils/tests/support.py Lib/distutils/tests/test_sdist.py Misc/NEWS Message-ID: <20090216213801.B28621E4002@bag.python.org> Author: tarek.ziade Date: Mon Feb 16 22:38:01 2009 New Revision: 69692 Log: Fixed #2279: distutils.sdist.add_defaults now add files listed in package_data and data_files Modified: python/trunk/Doc/distutils/setupscript.rst python/trunk/Doc/distutils/sourcedist.rst python/trunk/Lib/distutils/command/sdist.py python/trunk/Lib/distutils/tests/support.py python/trunk/Lib/distutils/tests/test_sdist.py python/trunk/Misc/NEWS Modified: python/trunk/Doc/distutils/setupscript.rst ============================================================================== --- python/trunk/Doc/distutils/setupscript.rst (original) +++ python/trunk/Doc/distutils/setupscript.rst Mon Feb 16 22:38:01 2009 @@ -427,6 +427,7 @@ distribution being described. If no qualifiers are given, all versions of the named module or package are understood to be obsoleted. +.. _distutils-installing-scripts: Installing Scripts ================== @@ -449,6 +450,12 @@ scripts=['scripts/xmlproc_parse', 'scripts/xmlproc_val'] ) +All the scripts will also be added to the ``MANIFEST`` +file if no template is provided. See :ref:`manifest`. + +.. versionadded:: 2.7 + +.. _distutils-installing-package-data: Installing Package Data ======================= @@ -492,6 +499,12 @@ .. versionadded:: 2.4 +All the files that match ``package_data`` will be added to the ``MANIFEST`` +file if no template is provided. See :ref:`manifest`. + +.. versionadded:: 2.7 + +.. _distutils-additional-files: Installing Additional Files =========================== @@ -527,6 +540,11 @@ files directly in the target directory, an empty string should be given as the directory. +All the files that match ``data_files`` will be added to the ``MANIFEST`` +file if no template is provided. See :ref:`manifest`. + +.. versionadded:: 2.7 + .. _meta-data: Modified: python/trunk/Doc/distutils/sourcedist.rst ============================================================================== --- python/trunk/Doc/distutils/sourcedist.rst (original) +++ python/trunk/Doc/distutils/sourcedist.rst Mon Feb 16 22:38:01 2009 @@ -74,6 +74,7 @@ :meth:`get_source_files` method in :file:`build_clib.py`! **\*\***) * scripts identified by the :option:`scripts` option + See :ref:`distutils-installing-scripts`. * anything that looks like a test script: :file:`test/test\*.py` (currently, the Distutils don't do anything with test scripts except include them in source @@ -83,6 +84,17 @@ * :file:`README.txt` (or :file:`README`), :file:`setup.py` (or whatever you called your setup script), and :file:`setup.cfg` +* all files that matches the ``package_data`` metadata. + See :ref:`distutils-installing-package-data`. + + .. versionadded:: 2.7 + +* all files that matches the ``data_files`` metadata. + See :ref:`distutils-additional-files`. + + .. versionadded:: 2.7 + + Sometimes this is enough, but usually you will want to specify additional files to distribute. The typical way to do this is to write a *manifest template*, called :file:`MANIFEST.in` by default. The manifest template is just a list of Modified: python/trunk/Lib/distutils/command/sdist.py ============================================================================== --- python/trunk/Lib/distutils/command/sdist.py (original) +++ python/trunk/Lib/distutils/command/sdist.py Mon Feb 16 22:38:01 2009 @@ -259,6 +259,9 @@ - setup.py - test/test*.py - all pure Python modules mentioned in setup script + - all files pointed by package_data (build_py) + - all files defined in data_files. + - all files defined as scripts. - all C sources listed as part of extensions or C libraries in the setup script (doesn't catch C headers!) Warns if (README or README.txt) or setup.py are missing; everything @@ -291,10 +294,27 @@ if files: self.filelist.extend(files) + # build_py is used to get: + # - python modules + # - files defined in package_data + build_py = self.get_finalized_command('build_py') + + # getting python files if self.distribution.has_pure_modules(): - build_py = self.get_finalized_command('build_py') self.filelist.extend(build_py.get_source_files()) + # getting package_data files + # (computed in build_py.data_files by build_py.finalize_options) + for pkg, src_dir, build_dir, filenames in build_py.data_files: + for filename in filenames: + self.filelist.append(os.path.join(src_dir, filename)) + + # getting distribution.data_files + if self.distribution.has_data_files(): + for dirname, filenames in self.distribution.data_files: + for filename in filenames: + self.filelist.append(os.path.join(dirname, filename)) + if self.distribution.has_ext_modules(): build_ext = self.get_finalized_command('build_ext') self.filelist.extend(build_ext.get_source_files()) Modified: python/trunk/Lib/distutils/tests/support.py ============================================================================== --- python/trunk/Lib/distutils/tests/support.py (original) +++ python/trunk/Lib/distutils/tests/support.py Mon Feb 16 22:38:01 2009 @@ -42,6 +42,19 @@ self.tempdirs.append(d) return d + def write_file(self, path, content): + """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/trunk/Lib/distutils/tests/test_sdist.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_sdist.py (original) +++ python/trunk/Lib/distutils/tests/test_sdist.py Mon Feb 16 22:38:01 2009 @@ -12,6 +12,7 @@ from distutils.tests.test_config import PyPIRCCommandTestCase from distutils.errors import DistutilsExecError from distutils.spawn import find_executable +from distutils.tests import support SETUP_PY = """ from distutils.core import setup @@ -20,13 +21,20 @@ setup(name='fake') """ -MANIFEST_IN = """ -recursive-include somecode * +MANIFEST = """\ +README +setup.py +data/data.dt +scripts/script.py +somecode/__init__.py +somecode/doc.dat +somecode/doc.txt """ -class sdistTestCase(PyPIRCCommandTestCase): +class sdistTestCase(support.LoggingSilencer, PyPIRCCommandTestCase): def setUp(self): + support.LoggingSilencer.setUp(self) # PyPIRCCommandTestCase creates a temp dir already # and put it in self.tmp_dir PyPIRCCommandTestCase.setUp(self) @@ -34,24 +42,34 @@ self.old_path = os.getcwd() os.mkdir(join(self.tmp_dir, 'somecode')) os.mkdir(join(self.tmp_dir, 'dist')) - # creating a MANIFEST, a package, and a README - self._write(join(self.tmp_dir, 'MANIFEST.in'), MANIFEST_IN) - self._write(join(self.tmp_dir, 'README'), 'xxx') - self._write(join(self.tmp_dir, 'somecode', '__init__.py'), '#') - self._write(join(self.tmp_dir, 'setup.py'), SETUP_PY) + # a package, and a README + self.write_file((self.tmp_dir, 'README'), 'xxx') + self.write_file((self.tmp_dir, 'somecode', '__init__.py'), '#') + self.write_file((self.tmp_dir, 'setup.py'), SETUP_PY) os.chdir(self.tmp_dir) def tearDown(self): # back to normal os.chdir(self.old_path) PyPIRCCommandTestCase.tearDown(self) + support.LoggingSilencer.tearDown(self) - def _write(self, path, content): - f = open(path, 'w') - try: - f.write(content) - finally: - f.close() + def get_cmd(self, metadata=None): + """Returns a cmd""" + if metadata is None: + metadata = {'name': 'fake', 'version': '1.0', + 'url': 'xxx', 'author': 'xxx', + 'author_email': 'xxx'} + dist = Distribution(metadata) + dist.script_name = 'setup.py' + dist.packages = ['somecode'] + dist.include_package_data = True + cmd = sdist(dist) + cmd.dist_dir = 'dist' + def _warn(*args): + pass + cmd.warn = _warn + return dist, cmd def test_prune_file_list(self): # this test creates a package with some vcs dirs in it @@ -60,33 +78,24 @@ # creating VCS directories with some files in them os.mkdir(join(self.tmp_dir, 'somecode', '.svn')) - self._write(join(self.tmp_dir, 'somecode', '.svn', 'ok.py'), 'xxx') + self.write_file((self.tmp_dir, 'somecode', '.svn', 'ok.py'), 'xxx') os.mkdir(join(self.tmp_dir, 'somecode', '.hg')) - self._write(join(self.tmp_dir, 'somecode', '.hg', + self.write_file((self.tmp_dir, 'somecode', '.hg', 'ok'), 'xxx') os.mkdir(join(self.tmp_dir, 'somecode', '.git')) - self._write(join(self.tmp_dir, 'somecode', '.git', + self.write_file((self.tmp_dir, 'somecode', '.git', 'ok'), 'xxx') # now building a sdist - dist = Distribution() - dist.script_name = 'setup.py' - dist.metadata.name = 'fake' - dist.metadata.version = '1.0' - dist.metadata.url = 'http://xxx' - dist.metadata.author = dist.metadata.author_email = 'xxx' - dist.packages = ['somecode'] - dist.include_package_data = True - cmd = sdist(dist) - cmd.manifest = 'MANIFEST' - cmd.template = 'MANIFEST.in' - cmd.dist_dir = 'dist' + dist, cmd = self.get_cmd() # zip is available universally # (tar might not be installed under win32) cmd.formats = ['zip'] + + cmd.ensure_finalized() cmd.run() # now let's check what we have @@ -111,21 +120,11 @@ return # now building a sdist - dist = Distribution() - dist.script_name = 'setup.py' - dist.metadata.name = 'fake' - dist.metadata.version = '1.0' - dist.metadata.url = 'http://xxx' - dist.metadata.author = dist.metadata.author_email = 'xxx' - dist.packages = ['somecode'] - dist.include_package_data = True - cmd = sdist(dist) - cmd.manifest = 'MANIFEST' - cmd.template = 'MANIFEST.in' - cmd.dist_dir = 'dist' + dist, cmd = self.get_cmd() # creating a gztar then a tar cmd.formats = ['gztar', 'tar'] + cmd.ensure_finalized() cmd.run() # making sure we have two files @@ -140,6 +139,8 @@ # now trying a tar then a gztar cmd.formats = ['tar', 'gztar'] + + cmd.ensure_finalized() cmd.run() result = os.listdir(dist_folder) @@ -147,6 +148,58 @@ self.assertEquals(result, ['fake-1.0.tar', 'fake-1.0.tar.gz']) + def test_add_defaults(self): + + # http://bugs.python.org/issue2279 + + # add_default should also include + # data_files and package_data + dist, cmd = self.get_cmd() + + # filling data_files by pointing files + # in package_data + dist.package_data = {'': ['*.cfg', '*.dat'], + 'somecode': ['*.txt']} + self.write_file((self.tmp_dir, 'somecode', 'doc.txt'), '#') + self.write_file((self.tmp_dir, 'somecode', 'doc.dat'), '#') + + # adding some data in data_files + data_dir = join(self.tmp_dir, 'data') + os.mkdir(data_dir) + self.write_file((data_dir, 'data.dt'), '#') + dist.data_files = [('data', ['data.dt'])] + + # adding a script + script_dir = join(self.tmp_dir, 'scripts') + os.mkdir(script_dir) + self.write_file((script_dir, 'script.py'), '#') + dist.scripts = [join('scripts', 'script.py')] + + + cmd.formats = ['zip'] + cmd.use_defaults = True + + cmd.ensure_finalized() + cmd.run() + + # now let's check what we have + dist_folder = join(self.tmp_dir, 'dist') + files = os.listdir(dist_folder) + self.assertEquals(files, ['fake-1.0.zip']) + + zip_file = zipfile.ZipFile(join(dist_folder, 'fake-1.0.zip')) + try: + content = zip_file.namelist() + finally: + zip_file.close() + + # making sure everything was added + self.assertEquals(len(content), 8) + + # checking the MANIFEST + manifest = open(join(self.tmp_dir, 'MANIFEST')).read() + self.assertEquals(manifest, MANIFEST) + def test_suite(): return unittest.makeSuite(sdistTestCase) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Feb 16 22:38:01 2009 @@ -159,6 +159,9 @@ Library ------- +- Issue #2279: distutils.sdist.add_defaults now add files + from the package_data and the data_files metadata. + - Issue #5257: refactored all tests in distutils, so they use support.TempdirManager, to avoid writing in the tests directory. From g.brandl at gmx.net Mon Feb 16 22:39:27 2009 From: g.brandl at gmx.net (Georg Brandl) Date: Mon, 16 Feb 2009 22:39:27 +0100 Subject: [Python-checkins] r69678 - peps/trunk/pep-0375.txt In-Reply-To: <20090216164522.ECF021E4002@bag.python.org> References: <20090216164522.ECF021E4002@bag.python.org> Message-ID: benjamin.peterson schrieb: > Author: benjamin.peterson > Date: Mon Feb 16 17:45:21 2009 > New Revision: 69678 > > Log: > new schedule; this time with only one beta Your real reason being that you want to have Independence Day off to fend off aliens? ;) 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 Mon Feb 16 22:41:54 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 16 Feb 2009 22:41:54 +0100 (CET) Subject: [Python-checkins] r69693 - python/trunk/Lib/distutils/tests/test_sdist.py Message-ID: <20090216214154.91E831E4002@bag.python.org> Author: tarek.ziade Date: Mon Feb 16 22:41:54 2009 New Revision: 69693 Log: #2279: use os.sep so the MANIFEST file test work on win32 Modified: python/trunk/Lib/distutils/tests/test_sdist.py 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 Mon Feb 16 22:41:54 2009 @@ -24,11 +24,11 @@ MANIFEST = """\ README setup.py -data/data.dt -scripts/script.py -somecode/__init__.py -somecode/doc.dat -somecode/doc.txt +data%(sep)sdata.dt +scripts%(sep)sscript.py +somecode%(sep)s__init__.py +somecode%(sep)sdoc.dat +somecode%(sep)sdoc.txt """ class sdistTestCase(support.LoggingSilencer, PyPIRCCommandTestCase): @@ -198,7 +198,7 @@ # checking the MANIFEST manifest = open(join(self.tmp_dir, 'MANIFEST')).read() - self.assertEquals(manifest, MANIFEST) + self.assertEquals(manifest, MANIFEST % {'sep': os.sep}) def test_suite(): return unittest.makeSuite(sdistTestCase) From python-checkins at python.org Mon Feb 16 22:43:32 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 16 Feb 2009 22:43:32 +0100 (CET) Subject: [Python-checkins] r69694 - python/branches/release26-maint Message-ID: <20090216214332.BA5CA1E4002@bag.python.org> Author: tarek.ziade Date: Mon Feb 16 22:43:32 2009 New Revision: 69694 Log: Blocked revisions 69692 via svnmerge ........ r69692 | tarek.ziade | 2009-02-16 22:38:01 +0100 (Mon, 16 Feb 2009) | 1 line Fixed #2279: distutils.sdist.add_defaults now add files listed in package_data and data_files ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Mon Feb 16 22:44:25 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 16 Feb 2009 22:44:25 +0100 (CET) Subject: [Python-checkins] r69695 - python/branches/release26-maint Message-ID: <20090216214425.320FB1E4002@bag.python.org> Author: tarek.ziade Date: Mon Feb 16 22:44:25 2009 New Revision: 69695 Log: Blocked revisions 69693 via svnmerge ........ r69693 | tarek.ziade | 2009-02-16 22:41:54 +0100 (Mon, 16 Feb 2009) | 1 line #2279: use os.sep so the MANIFEST file test work on win32 ........ Modified: python/branches/release26-maint/ (props changed) From buildbot at python.org Mon Feb 16 22:46:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 16 Feb 2009 21:46:19 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090216214619.3CB6D1E4002@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/372 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: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Mon Feb 16 22:49:13 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 16 Feb 2009 22:49:13 +0100 (CET) Subject: [Python-checkins] r69696 - in python/branches/py3k: Doc/distutils/setupscript.rst Doc/distutils/sourcedist.rst Lib/distutils/command/sdist.py Lib/distutils/tests/support.py Lib/distutils/tests/test_sdist.py Misc/NEWS Message-ID: <20090216214913.42D2E1E4002@bag.python.org> Author: tarek.ziade Date: Mon Feb 16 22:49:12 2009 New Revision: 69696 Log: Merged revisions 69692 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69692 | tarek.ziade | 2009-02-16 22:38:01 +0100 (Mon, 16 Feb 2009) | 1 line Fixed #2279: distutils.sdist.add_defaults now add files listed in package_data and data_files ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/distutils/setupscript.rst python/branches/py3k/Doc/distutils/sourcedist.rst python/branches/py3k/Lib/distutils/command/sdist.py python/branches/py3k/Lib/distutils/tests/support.py python/branches/py3k/Lib/distutils/tests/test_sdist.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Doc/distutils/setupscript.rst ============================================================================== --- python/branches/py3k/Doc/distutils/setupscript.rst (original) +++ python/branches/py3k/Doc/distutils/setupscript.rst Mon Feb 16 22:49:12 2009 @@ -427,6 +427,7 @@ distribution being described. If no qualifiers are given, all versions of the named module or package are understood to be obsoleted. +.. _distutils-installing-scripts: Installing Scripts ================== @@ -449,6 +450,12 @@ scripts=['scripts/xmlproc_parse', 'scripts/xmlproc_val'] ) +All the scripts will also be added to the ``MANIFEST`` +file if no template is provided. See :ref:`manifest`. + +.. versionadded:: 2.7 + +.. _distutils-installing-package-data: Installing Package Data ======================= @@ -491,6 +498,13 @@ ) +All the files that match ``package_data`` will be added to the ``MANIFEST`` +file if no template is provided. See :ref:`manifest`. + +.. versionadded:: 2.7 + +.. _distutils-additional-files: + Installing Additional Files =========================== @@ -525,6 +539,11 @@ files directly in the target directory, an empty string should be given as the directory. +All the files that match ``data_files`` will be added to the ``MANIFEST`` +file if no template is provided. See :ref:`manifest`. + +.. versionadded:: 2.7 + .. _meta-data: Modified: python/branches/py3k/Doc/distutils/sourcedist.rst ============================================================================== --- python/branches/py3k/Doc/distutils/sourcedist.rst (original) +++ python/branches/py3k/Doc/distutils/sourcedist.rst Mon Feb 16 22:49:12 2009 @@ -74,6 +74,7 @@ :meth:`get_source_files` method in :file:`build_clib.py`! **\*\***) * scripts identified by the :option:`scripts` option + See :ref:`distutils-installing-scripts`. * anything that looks like a test script: :file:`test/test\*.py` (currently, the Distutils don't do anything with test scripts except include them in source @@ -83,6 +84,17 @@ * :file:`README.txt` (or :file:`README`), :file:`setup.py` (or whatever you called your setup script), and :file:`setup.cfg` +* all files that matches the ``package_data`` metadata. + See :ref:`distutils-installing-package-data`. + + .. versionadded:: 2.7 + +* all files that matches the ``data_files`` metadata. + See :ref:`distutils-additional-files`. + + .. versionadded:: 2.7 + + Sometimes this is enough, but usually you will want to specify additional files to distribute. The typical way to do this is to write a *manifest template*, called :file:`MANIFEST.in` by default. The manifest template is just a list of 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 Mon Feb 16 22:49:12 2009 @@ -252,6 +252,9 @@ - setup.py - test/test*.py - all pure Python modules mentioned in setup script + - all files pointed by package_data (build_py) + - all files defined in data_files. + - all files defined as scripts. - all C sources listed as part of extensions or C libraries in the setup script (doesn't catch C headers!) Warns if (README or README.txt) or setup.py are missing; everything @@ -283,10 +286,27 @@ if files: self.filelist.extend(files) + # build_py is used to get: + # - python modules + # - files defined in package_data + build_py = self.get_finalized_command('build_py') + + # getting python files if self.distribution.has_pure_modules(): - build_py = self.get_finalized_command('build_py') self.filelist.extend(build_py.get_source_files()) + # getting package_data files + # (computed in build_py.data_files by build_py.finalize_options) + for pkg, src_dir, build_dir, filenames in build_py.data_files: + for filename in filenames: + self.filelist.append(os.path.join(src_dir, filename)) + + # getting distribution.data_files + if self.distribution.has_data_files(): + for dirname, filenames in self.distribution.data_files: + for filename in filenames: + self.filelist.append(os.path.join(dirname, filename)) + if self.distribution.has_ext_modules(): build_ext = self.get_finalized_command('build_ext') self.filelist.extend(build_ext.get_source_files()) 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 Mon Feb 16 22:49:12 2009 @@ -42,6 +42,19 @@ self.tempdirs.append(d) return d + def write_file(self, path, content): + """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/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 Mon Feb 16 22:49:12 2009 @@ -12,6 +12,7 @@ from distutils.tests.test_config import PyPIRCCommandTestCase from distutils.errors import DistutilsExecError from distutils.spawn import find_executable +from distutils.tests import support SETUP_PY = """ from distutils.core import setup @@ -20,13 +21,20 @@ setup(name='fake') """ -MANIFEST_IN = """ -recursive-include somecode * +MANIFEST = """\ +README +setup.py +data/data.dt +scripts/script.py +somecode/__init__.py +somecode/doc.dat +somecode/doc.txt """ -class sdistTestCase(PyPIRCCommandTestCase): +class sdistTestCase(support.LoggingSilencer, PyPIRCCommandTestCase): def setUp(self): + support.LoggingSilencer.setUp(self) # PyPIRCCommandTestCase creates a temp dir already # and put it in self.tmp_dir PyPIRCCommandTestCase.setUp(self) @@ -34,24 +42,34 @@ self.old_path = os.getcwd() os.mkdir(join(self.tmp_dir, 'somecode')) os.mkdir(join(self.tmp_dir, 'dist')) - # creating a MANIFEST, a package, and a README - self._write(join(self.tmp_dir, 'MANIFEST.in'), MANIFEST_IN) - self._write(join(self.tmp_dir, 'README'), 'xxx') - self._write(join(self.tmp_dir, 'somecode', '__init__.py'), '#') - self._write(join(self.tmp_dir, 'setup.py'), SETUP_PY) + # a package, and a README + self.write_file((self.tmp_dir, 'README'), 'xxx') + self.write_file((self.tmp_dir, 'somecode', '__init__.py'), '#') + self.write_file((self.tmp_dir, 'setup.py'), SETUP_PY) os.chdir(self.tmp_dir) def tearDown(self): # back to normal os.chdir(self.old_path) PyPIRCCommandTestCase.tearDown(self) + support.LoggingSilencer.tearDown(self) - def _write(self, path, content): - f = open(path, 'w') - try: - f.write(content) - finally: - f.close() + def get_cmd(self, metadata=None): + """Returns a cmd""" + if metadata is None: + metadata = {'name': 'fake', 'version': '1.0', + 'url': 'xxx', 'author': 'xxx', + 'author_email': 'xxx'} + dist = Distribution(metadata) + dist.script_name = 'setup.py' + dist.packages = ['somecode'] + dist.include_package_data = True + cmd = sdist(dist) + cmd.dist_dir = 'dist' + def _warn(*args): + pass + cmd.warn = _warn + return dist, cmd def test_prune_file_list(self): # this test creates a package with some vcs dirs in it @@ -60,33 +78,24 @@ # creating VCS directories with some files in them os.mkdir(join(self.tmp_dir, 'somecode', '.svn')) - self._write(join(self.tmp_dir, 'somecode', '.svn', 'ok.py'), 'xxx') + self.write_file((self.tmp_dir, 'somecode', '.svn', 'ok.py'), 'xxx') os.mkdir(join(self.tmp_dir, 'somecode', '.hg')) - self._write(join(self.tmp_dir, 'somecode', '.hg', + self.write_file((self.tmp_dir, 'somecode', '.hg', 'ok'), 'xxx') os.mkdir(join(self.tmp_dir, 'somecode', '.git')) - self._write(join(self.tmp_dir, 'somecode', '.git', + self.write_file((self.tmp_dir, 'somecode', '.git', 'ok'), 'xxx') # now building a sdist - dist = Distribution() - dist.script_name = 'setup.py' - dist.metadata.name = 'fake' - dist.metadata.version = '1.0' - dist.metadata.url = 'http://xxx' - dist.metadata.author = dist.metadata.author_email = 'xxx' - dist.packages = ['somecode'] - dist.include_package_data = True - cmd = sdist(dist) - cmd.manifest = 'MANIFEST' - cmd.template = 'MANIFEST.in' - cmd.dist_dir = 'dist' + dist, cmd = self.get_cmd() # zip is available universally # (tar might not be installed under win32) cmd.formats = ['zip'] + + cmd.ensure_finalized() cmd.run() # now let's check what we have @@ -111,21 +120,11 @@ return # now building a sdist - dist = Distribution() - dist.script_name = 'setup.py' - dist.metadata.name = 'fake' - dist.metadata.version = '1.0' - dist.metadata.url = 'http://xxx' - dist.metadata.author = dist.metadata.author_email = 'xxx' - dist.packages = ['somecode'] - dist.include_package_data = True - cmd = sdist(dist) - cmd.manifest = 'MANIFEST' - cmd.template = 'MANIFEST.in' - cmd.dist_dir = 'dist' + dist, cmd = self.get_cmd() # creating a gztar then a tar cmd.formats = ['gztar', 'tar'] + cmd.ensure_finalized() cmd.run() # making sure we have two files @@ -140,6 +139,8 @@ # now trying a tar then a gztar cmd.formats = ['tar', 'gztar'] + + cmd.ensure_finalized() cmd.run() result = os.listdir(dist_folder) @@ -147,6 +148,58 @@ self.assertEquals(result, ['fake-1.0.tar', 'fake-1.0.tar.gz']) + def test_add_defaults(self): + + # http://bugs.python.org/issue2279 + + # add_default should also include + # data_files and package_data + dist, cmd = self.get_cmd() + + # filling data_files by pointing files + # in package_data + dist.package_data = {'': ['*.cfg', '*.dat'], + 'somecode': ['*.txt']} + self.write_file((self.tmp_dir, 'somecode', 'doc.txt'), '#') + self.write_file((self.tmp_dir, 'somecode', 'doc.dat'), '#') + + # adding some data in data_files + data_dir = join(self.tmp_dir, 'data') + os.mkdir(data_dir) + self.write_file((data_dir, 'data.dt'), '#') + dist.data_files = [('data', ['data.dt'])] + + # adding a script + script_dir = join(self.tmp_dir, 'scripts') + os.mkdir(script_dir) + self.write_file((script_dir, 'script.py'), '#') + dist.scripts = [join('scripts', 'script.py')] + + + cmd.formats = ['zip'] + cmd.use_defaults = True + + cmd.ensure_finalized() + cmd.run() + + # now let's check what we have + dist_folder = join(self.tmp_dir, 'dist') + files = os.listdir(dist_folder) + self.assertEquals(files, ['fake-1.0.zip']) + + zip_file = zipfile.ZipFile(join(dist_folder, 'fake-1.0.zip')) + try: + content = zip_file.namelist() + finally: + zip_file.close() + + # making sure everything was added + self.assertEquals(len(content), 8) + + # checking the MANIFEST + manifest = open(join(self.tmp_dir, 'MANIFEST')).read() + self.assertEquals(manifest, MANIFEST) + def test_suite(): return unittest.makeSuite(sdistTestCase) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon Feb 16 22:49:12 2009 @@ -169,6 +169,9 @@ Library ------- +- Issue #2279: distutils.sdist.add_defaults now add files + from the package_data and the data_files metadata. + - Issue #5257: refactored all tests in distutils, so they use support.TempdirManager, to avoid writing in the tests directory. From guido at python.org Mon Feb 16 22:49:51 2009 From: guido at python.org (Guido van Rossum) Date: Mon, 16 Feb 2009 13:49:51 -0800 Subject: [Python-checkins] r69682 - python/branches/py3k/Lib/distutils/version.py In-Reply-To: <4999AF36.8030707@egenix.com> References: <20090216182215.F3F3F1E4002@bag.python.org> <4999AF36.8030707@egenix.com> Message-ID: On Mon, Feb 16, 2009 at 10:23 AM, M.-A. Lemburg wrote: > On 2009-02-16 19:22, benjamin.peterson wrote: >> Author: benjamin.peterson >> Date: Mon Feb 16 19:22:15 2009 >> New Revision: 69682 >> >> Log: >> remove another use of cmp() > > Sigh. It would be so much easier to just put this implementation somewhere > in the stdlib and reference it whenever necessary, instead of cluttering up > the whole stdlib with different versions of the same piece of code. I haven't looked at this particular case, but I expect that most of the time it's possible, and will look cleaner, to change the surrounding code not to use the cmp() style API any more. It would also be more work of course... -- --Guido van Rossum (home page: http://www.python.org/~guido/) From python-checkins at python.org Mon Feb 16 22:51:13 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 16 Feb 2009 22:51:13 +0100 (CET) Subject: [Python-checkins] r69697 - in python/branches/py3k: Lib/distutils/tests/test_sdist.py Message-ID: <20090216215113.DA2A91E4002@bag.python.org> Author: tarek.ziade Date: Mon Feb 16 22:51:13 2009 New Revision: 69697 Log: Merged revisions 69693 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69693 | tarek.ziade | 2009-02-16 22:41:54 +0100 (Mon, 16 Feb 2009) | 1 line #2279: use os.sep so the MANIFEST file test work on win32 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_sdist.py 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 Mon Feb 16 22:51:13 2009 @@ -24,11 +24,11 @@ MANIFEST = """\ README setup.py -data/data.dt -scripts/script.py -somecode/__init__.py -somecode/doc.dat -somecode/doc.txt +data%(sep)sdata.dt +scripts%(sep)sscript.py +somecode%(sep)s__init__.py +somecode%(sep)sdoc.dat +somecode%(sep)sdoc.txt """ class sdistTestCase(support.LoggingSilencer, PyPIRCCommandTestCase): @@ -198,7 +198,7 @@ # checking the MANIFEST manifest = open(join(self.tmp_dir, 'MANIFEST')).read() - self.assertEquals(manifest, MANIFEST) + self.assertEquals(manifest, MANIFEST % {'sep': os.sep}) def test_suite(): return unittest.makeSuite(sdistTestCase) From python-checkins at python.org Mon Feb 16 22:53:04 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 16 Feb 2009 22:53:04 +0100 (CET) Subject: [Python-checkins] r69698 - python/branches/release30-maint Message-ID: <20090216215304.340821E403A@bag.python.org> Author: tarek.ziade Date: Mon Feb 16 22:53:04 2009 New Revision: 69698 Log: Blocked revisions 69696 via svnmerge ................ r69696 | tarek.ziade | 2009-02-16 22:49:12 +0100 (Mon, 16 Feb 2009) | 9 lines Merged revisions 69692 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69692 | tarek.ziade | 2009-02-16 22:38:01 +0100 (Mon, 16 Feb 2009) | 1 line Fixed #2279: distutils.sdist.add_defaults now add files listed in package_data and data_files ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Mon Feb 16 22:55:10 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 16 Feb 2009 22:55:10 +0100 (CET) Subject: [Python-checkins] r69699 - python/branches/release30-maint Message-ID: <20090216215510.D5B4D1E4002@bag.python.org> Author: tarek.ziade Date: Mon Feb 16 22:55:10 2009 New Revision: 69699 Log: Blocked revisions 69697 via svnmerge ................ r69697 | tarek.ziade | 2009-02-16 22:51:13 +0100 (Mon, 16 Feb 2009) | 9 lines Merged revisions 69693 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69693 | tarek.ziade | 2009-02-16 22:41:54 +0100 (Mon, 16 Feb 2009) | 1 line #2279: use os.sep so the MANIFEST file test work on win32 ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Mon Feb 16 23:12:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 16 Feb 2009 22:12:50 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090216221251.0FF281E4002@bag.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/279 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: benjamin.peterson 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 Feb 17 02:19:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 17 Feb 2009 01:19:09 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090217011909.EB9261E4002@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/127 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: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From benjamin at python.org Tue Feb 17 02:26:33 2009 From: benjamin at python.org (Benjamin Peterson) Date: Mon, 16 Feb 2009 19:26:33 -0600 Subject: [Python-checkins] r69678 - peps/trunk/pep-0375.txt In-Reply-To: References: <20090216164522.ECF021E4002@bag.python.org> Message-ID: <1afaf6160902161726j26356feeo605515eeaf4a6835@mail.gmail.com> On Mon, Feb 16, 2009 at 3:39 PM, Georg Brandl wrote: > benjamin.peterson schrieb: >> Author: benjamin.peterson >> Date: Mon Feb 16 17:45:21 2009 >> New Revision: 69678 >> >> Log: >> new schedule; this time with only one beta > > Your real reason being that you want to have Independence Day off to > fend off aliens? ;) My family insists! :) -- Regards, Benjamin From jnoller at gmail.com Tue Feb 17 02:35:58 2009 From: jnoller at gmail.com (Jesse Noller) Date: Mon, 16 Feb 2009 20:35:58 -0500 Subject: [Python-checkins] r69678 - peps/trunk/pep-0375.txt In-Reply-To: <1afaf6160902161726j26356feeo605515eeaf4a6835@mail.gmail.com> References: <20090216164522.ECF021E4002@bag.python.org> <1afaf6160902161726j26356feeo605515eeaf4a6835@mail.gmail.com> Message-ID: <4222a8490902161735i46c6c83bu231654c38263711d@mail.gmail.com> On Mon, Feb 16, 2009 at 8:26 PM, Benjamin Peterson wrote: > On Mon, Feb 16, 2009 at 3:39 PM, Georg Brandl wrote: >> benjamin.peterson schrieb: >>> Author: benjamin.peterson >>> Date: Mon Feb 16 17:45:21 2009 >>> New Revision: 69678 >>> >>> Log: >>> new schedule; this time with only one beta >> >> Your real reason being that you want to have Independence Day off to >> fend off aliens? ;) > > My family insists! :) > Don't underestimate the alien threat. Never do that. From buildbot at python.org Tue Feb 17 02:41:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 17 Feb 2009 01:41:19 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090217014119.54AE81E4002@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/292 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,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Feb 17 02:53:19 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 17 Feb 2009 02:53:19 +0100 (CET) Subject: [Python-checkins] r69706 - python/branches/py3k/INTBENCH Message-ID: <20090217015319.EB7F81E4002@bag.python.org> Author: benjamin.peterson Date: Tue Feb 17 02:53:19 2009 New Revision: 69706 Log: I think this file has long outlived its usefulness Removed: python/branches/py3k/INTBENCH Deleted: python/branches/py3k/INTBENCH ============================================================================== --- python/branches/py3k/INTBENCH Tue Feb 17 02:53:19 2009 +++ (empty file) @@ -1,50 +0,0 @@ -Measurements of _testcapi.profile_int, on an 800MHz G3, OSX 10.4.7 -best of three runs - -r51476 (original p3yk) -Test 1: 1.601978s -Test 2: 1.696623s -Test 3: 1.900683s -Test 4: 5.307155s -Test 5: 2.546707s -Test 6: 1.670252s -Test 7: 1.910734s - -r51506 (int type dropped) -Test 1: 4.134757s -Test 2: 4.398235s -Test 3: 4.611636s -Test 4: 10.665429s - -r51509 (small int cache) -Test 1: 3.457184s -Test 2: 4.514800s -Test 3: 4.999010s -Test 4: 10.818277s - -r51452 (special-casing medium int allocation) -Test 1: 3.258219s -Test 2: 4.255007s -Test 3: 4.547923s -Test 4: 10.615123s -Test 5: 5.255545s -Test 6: 3.775941s -Test 7: 4.001805s - -r51562 (special-case one-digit operations) -Test 1: 3.527860s -Test 2: 3.975953s -Test 3: 4.226751s -Test 4: 10.605721s -Test 5: 5.233576s -Test 6: 2.161525s -Test 7: 3.421624s - -r51573 (speed up PyLong_FromLong) -Test 1: 3.149116s -Test 2: 3.948204s -Test 3: 4.012080s -Test 4: 8.589921s -Test 5: 4.481723s -Test 6: 2.259849s -Test 7: 3.453212s From buildbot at python.org Tue Feb 17 03:10:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 17 Feb 2009 02:10:19 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090217021019.AA67B1E4002@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/376 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_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Feb 17 03:45:05 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 17 Feb 2009 03:45:05 +0100 (CET) Subject: [Python-checkins] r69707 - in python/branches/py3k: Doc/library/importlib.rst Lib/importlib/NOTES Lib/importlib/_bootstrap.py Lib/importlib/test/test_util.py Lib/importlib/util.py Message-ID: <20090217024505.996F01E4002@bag.python.org> Author: brett.cannon Date: Tue Feb 17 03:45:03 2009 New Revision: 69707 Log: Implement the more specific PEP 302 semantics for loaders and what happens upon load failure in relation to reloads. Also expose importlib.util.module_for_loader to handle all of the details of this along with making sure all current loaders behave nicely. Added: python/branches/py3k/Lib/importlib/test/test_util.py python/branches/py3k/Lib/importlib/util.py Modified: python/branches/py3k/Doc/library/importlib.rst python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/_bootstrap.py Modified: python/branches/py3k/Doc/library/importlib.rst ============================================================================== --- python/branches/py3k/Doc/library/importlib.rst (original) +++ python/branches/py3k/Doc/library/importlib.rst Tue Feb 17 03:45:03 2009 @@ -151,3 +151,36 @@ searched for a finder for the path entry and, if found, is stored in :data:`sys.path_importer_cache` along with being queried about the module. + + +:mod:`importlib.util` -- Utility code for importers +--------------------------------------------------- + +.. module:: importlib.util + :synopsis: Importers and path hooks + +This module contains the various objects that help in the construction of +an :term:`importer`. + +.. function:: module_for_loader(method) + + A :term:`decorator` for a :term:`loader` which handles selecting the proper + module object to load with. The decorated method is expected to have a call + signature of ``method(self, module_object)`` for which the second argument + will be the module object to be used (note that the decorator will not work + on static methods because of the assumption of two arguments). + + The decorated method will take in the name of the module to be loaded as + normal. If the module is not found in :data:`sys.modules` then a new one is + constructed with its :attr:`__name__` attribute set. Otherwise the module + found in :data:`sys.modules` will be passed into the method. If an + exception is raised by the decorated method and a module was added to + :data:`sys.modules` it will be removed to prevent a partially initialized + module from being in left in :data:`sys.modules` If an exception is raised + by the decorated method and a module was added to :data:`sys.modules` it + will be removed to prevent a partially initialized module from being in + left in :data:`sys.modules`. If the module was already in + :data:`sys.modules` then it is left alone. + + Use of this decorator handles all the details of what module a loader + should use as specified by :pep:`302`. Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Tue Feb 17 03:45:03 2009 @@ -1,68 +1,66 @@ to do ///// -* Change failed loading based on PEP 302 changes. - * Refactor source/bytecode finder/loader code such that bytecode support is a subclass of source support (makes it nicer for VMs that don't use CPython bytecode). * Implement PEP 302 protocol for loaders (should just be a matter of testing). - + Built-in. - + Frozen. - + Extension. + Source/bytecode. * Public API left to expose (w/ docs!) - + abc + + abc + + - Finder - - Finder + * find_module - * find_module + - Loader - - Loader + * load_module - * load_module + - (?) Importer(Finder, Loader) + - ResourceLoader(Loader) - - (?) Importer(Finder, Loader) + * get_data - - ResourceLoader(Loader) + - InspectLoader(Loader) - * get_data + * is_package + * get_code + * get_source - - InspectLoader(Loader) + - (?) SourceLoader(ResourceLoader) - * is_package - * get_code - * get_source + * source_path + * bytecode_path + * write_bytecode (not abstract) - - (?) SourceLoader(ResourceLoader) + + util - * source_path - * bytecode_path - * write_bytecode (not abstract) + - set___package__ decorator - + util + + machinery - - get_module decorator (rename: module_for_loader) - - set___package__ decorator + - (?) Chained path hook/finder + - Extensions importers - + machinery + * ExtensionFinder + * (?) Loader - - (?) Chained path hook/finder - - Extensions importers + - Source/bytecode importers - * ExtensionFinder - * (?) Loader + * SourceFinder + * (?) Loader - - Source/bytecode importers + + test - * SourceFinder - * (?) Loader + - abc - - PathFinder + * FinderTests [doc] + * LoaderTests [doc] * Make sure that there is documentation *somewhere* fully explaining the semantics of import that can be referenced from the package's documentation Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Tue Feb 17 03:45:03 2009 @@ -136,8 +136,13 @@ """Load a built-in module.""" if fullname not in sys.builtin_module_names: raise ImportError("{0} is not a built-in module".format(fullname)) - module = imp.init_builtin(fullname) - return module + is_reload = fullname in sys.modules + try: + return imp.init_builtin(fullname) + except: + if not is_reload and fullname in sys.modules: + del sys.modules[fullname] + raise class FrozenImporter: @@ -160,8 +165,13 @@ """Load a frozen module.""" if cls.find_module(fullname) is None: raise ImportError("{0} is not a frozen module".format(fullname)) - module = imp.init_frozen(fullname) - return module + is_reload = fullname in sys.modules + try: + return imp.init_frozen(fullname) + except: + if not is_reload and fullname in sys.modules: + del sys.modules[fullname] + raise class ChainedImporter(object): @@ -249,14 +259,13 @@ @set___package__ def load_module(self, fullname): """Load an extension module.""" - assert self._name == fullname + is_reload = fullname in sys.modules try: module = imp.load_dynamic(fullname, self._path) module.__loader__ = self return module except: - # If an error occurred, don't leave a partially initialized module. - if fullname in sys.modules: + if not is_reload and fullname in sys.modules: del sys.modules[fullname] raise @@ -282,16 +291,17 @@ if suffix[2] == suffix_type] -# XXX Need a better name. -def get_module(fxn): - """Decorator to handle selecting the proper module for load_module - implementations. +def module_for_loader(fxn): + """Decorator to handle selecting the proper module for loaders. Decorated modules are passed the module to use instead of the module name. The module is either from sys.modules if it already exists (for reloading) or is a new module which has __name__ set. If any exception is raised by - the decorated method then __loader__, __name__, __file__, and __path__ are - all restored on the module to their original values. + the decorated method and the decorator added a module to sys.modules, then + the module is deleted from sys.modules. + + The decorator assumes that the decorated method takes self/cls as a first + argument and the module as the second argument. """ def decorated(self, fullname): @@ -302,27 +312,12 @@ # implicitly imports 'locale' and would otherwise trigger an # infinite loop. module = imp.new_module(fullname) - module.__name__ = fullname sys.modules[fullname] = module - else: - original_values = {} - modified_attrs = ['__loader__', '__name__', '__file__', '__path__'] - for attr in modified_attrs: - try: - original_values[attr] = getattr(module, attr) - except AttributeError: - pass try: return fxn(self, module) except: if not is_reload: del sys.modules[fullname] - else: - for attr in modified_attrs: - if attr in original_values: - setattr(module, attr, original_values[attr]) - elif hasattr(module, attr): - delattr(module, attr) raise wrap(decorated, fxn) return decorated @@ -375,7 +370,7 @@ return self._find_path(imp.PY_COMPILED) @check_name - @get_module + @module_for_loader def load_module(self, module): """Load a Python source or bytecode module.""" name = module.__name__ Added: python/branches/py3k/Lib/importlib/test/test_util.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/test/test_util.py Tue Feb 17 03:45:03 2009 @@ -0,0 +1,69 @@ +from importlib import util +from . import util as test_util +import imp +import sys +import types +import unittest + + +class ModuleForLoaderTests(unittest.TestCase): + + """Tests for importlib.util.module_for_loader.""" + + def return_module(self, name): + fxn = util.module_for_loader(lambda self, module: module) + return fxn(self, name) + + def raise_exception(self, name): + def to_wrap(self, module): + raise ImportError + fxn = util.module_for_loader(to_wrap) + try: + fxn(self, name) + except ImportError: + pass + + def test_new_module(self): + # Test that when no module exists in sys.modules a new module is + # created. + module_name = 'a.b.c' + with test_util.uncache(module_name): + module = self.return_module(module_name) + self.assert_(module_name in sys.modules) + self.assert_(isinstance(module, types.ModuleType)) + self.assertEqual(module.__name__, module_name) + + def test_reload(self): + # Test that a module is reused if already in sys.modules. + name = 'a.b.c' + module = imp.new_module('a.b.c') + with test_util.uncache(name): + sys.modules[name] = module + returned_module = self.return_module(name) + self.assert_(sys.modules[name] is returned_module) + + def test_new_module_failure(self): + # Test that a module is removed from sys.modules if added but an + # exception is raised. + name = 'a.b.c' + with test_util.uncache(name): + self.raise_exception(name) + self.assert_(name not in sys.modules) + + def test_reload_failure(self): + # Test that a failure on reload leaves the module in-place. + name = 'a.b.c' + module = imp.new_module(name) + with test_util.uncache(name): + sys.modules[name] = module + self.raise_exception(name) + self.assert_(sys.modules[name] is module) + + +def test_main(): + from test import support + support.run_unittest(ModuleForLoaderTests) + + +if __name__ == '__main__': + test_main() Added: python/branches/py3k/Lib/importlib/util.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/importlib/util.py Tue Feb 17 03:45:03 2009 @@ -0,0 +1,2 @@ +"""Utility code for constructing importers, etc.""" +from ._bootstrap import module_for_loader From buildbot at python.org Tue Feb 17 04:01:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 17 Feb 2009 03:01:25 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090217030127.5B4221E4002@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/329 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: sincerely, -The Buildbot From python-checkins at python.org Tue Feb 17 08:15:17 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 17 Feb 2009 08:15:17 +0100 (CET) Subject: [Python-checkins] r69708 - python/branches/py3k/Lib/importlib/NOTES Message-ID: <20090217071517.920341E4002@bag.python.org> Author: brett.cannon Date: Tue Feb 17 08:15:17 2009 New Revision: 69708 Log: Outline a possible way to separate out source loading from bytecode loading. Modified: python/branches/py3k/Lib/importlib/NOTES Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Tue Feb 17 08:15:17 2009 @@ -5,6 +5,27 @@ subclass of source support (makes it nicer for VMs that don't use CPython bytecode). + + chained_path_hook + + FileFinder + + - find_module + + + ExtensionFileFinder + + PyFileFinder + + PyPycFileFinder + + PyFileLoader + + - get_code for source only + - get_data + - source_mtime + - source_path + + + PyPycFileLoader(PyFileLoader) + + - get_code + - bytecode_path + - write_bytecode + * Implement PEP 302 protocol for loaders (should just be a matter of testing). + Source/bytecode. From buildbot at python.org Tue Feb 17 08:56:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 17 Feb 2009 07:56:05 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090217075605.B19A71E4002@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/295 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: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Feb 17 09:01:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 17 Feb 2009 08:01:05 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090217080105.C1DCA1E4002@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/309 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 Tue Feb 17 09:33:01 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 17 Feb 2009 09:33:01 +0100 (CET) Subject: [Python-checkins] r69709 - python/trunk/Doc/library/collections.rst Message-ID: <20090217083301.AF08B1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 17 09:33:01 2009 New Revision: 69709 Log: Fix-up intro paragraph for collections docs. 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 Feb 17 09:33:01 2009 @@ -16,30 +16,30 @@ __name__ = '' This module implements high-performance container datatypes. Currently, -there are two datatypes, :class:`deque` and :class:`defaultdict`, and -one datatype factory function, :func:`namedtuple`. +there are three datatypes, :class:`Counter`, :class:`deque` and +:class:`defaultdict`, and one datatype factory function, :func:`namedtuple`. + +The specialized containers provided in this module provide alternatives +to Python's general purpose built-in containers, :class:`dict`, +:class:`list`, :class:`set`, and :class:`tuple`. + +.. versionchanged:: 2.4 + Added :class:`deque`. .. versionchanged:: 2.5 Added :class:`defaultdict`. .. versionchanged:: 2.6 - Added :func:`namedtuple`. + Added :func:`namedtuple` and added abstract base classes. -The specialized containers provided in this module provide alternatives -to Python's general purpose built-in containers, :class:`dict`, -:class:`list`, :class:`set`, and :class:`tuple`. - -Besides the containers provided here, the optional :mod:`bsddb` -module offers the ability to create in-memory or file based ordered -dictionaries with string keys using the :meth:`bsddb.btopen` method. +.. versionchanged:: 2.7 + Added :class:`Counter`. In addition to containers, the collections module provides some ABCs (abstract base classes) that can be used to test whether a class -provides a particular interface, for example, is it hashable or +provides a particular interface, for example, whether it is hashable or a mapping. -.. versionchanged:: 2.6 - Added abstract base classes. ABCs - abstract base classes ---------------------------- From nnorwitz at gmail.com Tue Feb 17 10:10:33 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 17 Feb 2009 04:10:33 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090217091033.GA20248@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17142 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663793 refs] From nnorwitz at gmail.com Tue Feb 17 10:18:01 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 17 Feb 2009 04:18:01 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090217091801.GA22628@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 [17163 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663063 refs] From python-checkins at python.org Tue Feb 17 10:42:45 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 17 Feb 2009 10:42:45 +0100 (CET) Subject: [Python-checkins] r69710 - in python/trunk/Lib/distutils: command/sdist.py tests/test_sdist.py Message-ID: <20090217094245.30C8E1E4002@bag.python.org> Author: tarek.ziade Date: Tue Feb 17 10:42:44 2009 New Revision: 69710 Log: #2279 added the plain path case for data_files 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 Tue Feb 17 10:42:44 2009 @@ -14,7 +14,7 @@ from distutils.errors import * from distutils.filelist import FileList from distutils import log - +from distutils.util import convert_path def show_formats (): """Print all possible values for the 'formats' option (used by @@ -311,9 +311,17 @@ # getting distribution.data_files if self.distribution.has_data_files(): - for dirname, filenames in self.distribution.data_files: - for filename in filenames: - self.filelist.append(os.path.join(dirname, filename)) + for item in self.distribution.data_files: + if isinstance(item, str): # plain file + item = convert_path(item) + if os.path.isfile(item): + self.filelist.append(item) + else: # a (dirname, filenames) tuple + dirname, filenames = item + for f in filenames: + f = convert_path(os.path.join(dirname, f)) + if os.path.isfile(f): + self.filelist.append(f) if self.distribution.has_ext_modules(): build_ext = self.get_finalized_command('build_ext') 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 Tue Feb 17 10:42:44 2009 @@ -26,6 +26,8 @@ setup.py data%(sep)sdata.dt scripts%(sep)sscript.py +some%(sep)sfile.txt +some%(sep)sother_file.txt somecode%(sep)s__init__.py somecode%(sep)sdoc.dat somecode%(sep)sdoc.txt @@ -167,7 +169,14 @@ data_dir = join(self.tmp_dir, 'data') os.mkdir(data_dir) self.write_file((data_dir, 'data.dt'), '#') - dist.data_files = [('data', ['data.dt'])] + some_dir = join(self.tmp_dir, 'some') + os.mkdir(some_dir) + self.write_file((some_dir, 'file.txt'), '#') + self.write_file((some_dir, 'other_file.txt'), '#') + + dist.data_files = [('data', ['data.dt', 'notexisting']), + 'some/file.txt', + 'some/other_file.txt'] # adding a script script_dir = join(self.tmp_dir, 'scripts') @@ -175,7 +184,6 @@ self.write_file((script_dir, 'script.py'), '#') dist.scripts = [join('scripts', 'script.py')] - cmd.formats = ['zip'] cmd.use_defaults = True @@ -194,7 +202,7 @@ zip_file.close() # making sure everything was added - self.assertEquals(len(content), 8) + self.assertEquals(len(content), 10) # checking the MANIFEST manifest = open(join(self.tmp_dir, 'MANIFEST')).read() From python-checkins at python.org Tue Feb 17 10:45:57 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 17 Feb 2009 10:45:57 +0100 (CET) Subject: [Python-checkins] r69711 - python/branches/release26-maint Message-ID: <20090217094557.4B2E31E4023@bag.python.org> Author: tarek.ziade Date: Tue Feb 17 10:45:56 2009 New Revision: 69711 Log: Blocked revisions 69710 via svnmerge ........ r69710 | tarek.ziade | 2009-02-17 10:42:44 +0100 (Tue, 17 Feb 2009) | 1 line #2279 added the plain path case for data_files ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Tue Feb 17 10:47:25 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 17 Feb 2009 10:47:25 +0100 (CET) Subject: [Python-checkins] r69712 - in python/branches/py3k: Lib/distutils/command/sdist.py Lib/distutils/tests/test_sdist.py Message-ID: <20090217094725.E64831E4002@bag.python.org> Author: tarek.ziade Date: Tue Feb 17 10:47:25 2009 New Revision: 69712 Log: Merged revisions 69710 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69710 | tarek.ziade | 2009-02-17 10:42:44 +0100 (Tue, 17 Feb 2009) | 1 line #2279 added the plain path case for data_files ........ 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 Tue Feb 17 10:47:25 2009 @@ -15,7 +15,7 @@ from distutils.errors import * from distutils.filelist import FileList from distutils import log - +from distutils.util import convert_path def show_formats (): """Print all possible values for the 'formats' option (used by @@ -303,9 +303,17 @@ # getting distribution.data_files if self.distribution.has_data_files(): - for dirname, filenames in self.distribution.data_files: - for filename in filenames: - self.filelist.append(os.path.join(dirname, filename)) + for item in self.distribution.data_files: + if isinstance(item, str): # plain file + item = convert_path(item) + if os.path.isfile(item): + self.filelist.append(item) + else: # a (dirname, filenames) tuple + dirname, filenames = item + for f in filenames: + f = convert_path(os.path.join(dirname, f)) + if os.path.isfile(f): + self.filelist.append(f) if self.distribution.has_ext_modules(): build_ext = self.get_finalized_command('build_ext') 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 Tue Feb 17 10:47:25 2009 @@ -26,6 +26,8 @@ setup.py data%(sep)sdata.dt scripts%(sep)sscript.py +some%(sep)sfile.txt +some%(sep)sother_file.txt somecode%(sep)s__init__.py somecode%(sep)sdoc.dat somecode%(sep)sdoc.txt @@ -167,7 +169,14 @@ data_dir = join(self.tmp_dir, 'data') os.mkdir(data_dir) self.write_file((data_dir, 'data.dt'), '#') - dist.data_files = [('data', ['data.dt'])] + some_dir = join(self.tmp_dir, 'some') + os.mkdir(some_dir) + self.write_file((some_dir, 'file.txt'), '#') + self.write_file((some_dir, 'other_file.txt'), '#') + + dist.data_files = [('data', ['data.dt', 'notexisting']), + 'some/file.txt', + 'some/other_file.txt'] # adding a script script_dir = join(self.tmp_dir, 'scripts') @@ -175,7 +184,6 @@ self.write_file((script_dir, 'script.py'), '#') dist.scripts = [join('scripts', 'script.py')] - cmd.formats = ['zip'] cmd.use_defaults = True @@ -194,7 +202,7 @@ zip_file.close() # making sure everything was added - self.assertEquals(len(content), 8) + self.assertEquals(len(content), 10) # checking the MANIFEST manifest = open(join(self.tmp_dir, 'MANIFEST')).read() From python-checkins at python.org Tue Feb 17 10:48:40 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 17 Feb 2009 10:48:40 +0100 (CET) Subject: [Python-checkins] r69713 - python/branches/release30-maint Message-ID: <20090217094840.3977D1E4002@bag.python.org> Author: tarek.ziade Date: Tue Feb 17 10:48:40 2009 New Revision: 69713 Log: Blocked revisions 69712 via svnmerge ................ r69712 | tarek.ziade | 2009-02-17 10:47:25 +0100 (Tue, 17 Feb 2009) | 9 lines Merged revisions 69710 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69710 | tarek.ziade | 2009-02-17 10:42:44 +0100 (Tue, 17 Feb 2009) | 1 line #2279 added the plain path case for data_files ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Tue Feb 17 11:09:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 17 Feb 2009 10:09:15 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090217100916.1E9641E4002@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/885 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: raymond.hettinger,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_popen2 test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Feb 17 11:12:10 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Tue, 17 Feb 2009 11:12:10 +0100 (CET) Subject: [Python-checkins] r69714 - in python/trunk: Lib/test/test_mmap.py Misc/NEWS Modules/mmapmodule.c Message-ID: <20090217101210.C1DD31E4002@bag.python.org> Author: hirokazu.yamamoto Date: Tue Feb 17 11:12:10 2009 New Revision: 69714 Log: Issue #5292: Fixed mmap crash on its boundary access m[len(m)]. Modified: python/trunk/Lib/test/test_mmap.py python/trunk/Misc/NEWS python/trunk/Modules/mmapmodule.c Modified: python/trunk/Lib/test/test_mmap.py ============================================================================== --- python/trunk/Lib/test/test_mmap.py (original) +++ python/trunk/Lib/test/test_mmap.py Tue Feb 17 11:12:10 2009 @@ -41,6 +41,10 @@ self.assertEqual(m[0], '\0') self.assertEqual(m[0:3], '\0\0\0') + # Shouldn't crash on boundary (Issue #5292) + self.assertRaises(IndexError, m.__getitem__, len(m)) + self.assertRaises(IndexError, m.__setitem__, len(m), '\0') + # Modify the file's content m[0] = '3' m[PAGESIZE +3: PAGESIZE +3+3] = 'bar' Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Feb 17 11:12:10 2009 @@ -159,6 +159,8 @@ Library ------- +- Issue #5292: Fixed mmap crash on its boundary access m[len(m)]. + - Issue #2279: distutils.sdist.add_defaults now add files from the package_data and the data_files metadata. Modified: python/trunk/Modules/mmapmodule.c ============================================================================== --- python/trunk/Modules/mmapmodule.c (original) +++ python/trunk/Modules/mmapmodule.c Tue Feb 17 11:12:10 2009 @@ -731,7 +731,7 @@ return NULL; if (i < 0) i += self->size; - if (i < 0 || (size_t)i > self->size) { + if (i < 0 || (size_t)i >= self->size) { PyErr_SetString(PyExc_IndexError, "mmap index out of range"); return NULL; @@ -872,7 +872,7 @@ return -1; if (i < 0) i += self->size; - if (i < 0 || (size_t)i > self->size) { + if (i < 0 || (size_t)i >= self->size) { PyErr_SetString(PyExc_IndexError, "mmap index out of range"); return -1; From buildbot at python.org Tue Feb 17 11:28:33 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 17 Feb 2009 10:28:33 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090217102833.CB9D71E4002@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/162 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: raymond.hettinger,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue Feb 17 11:54:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 17 Feb 2009 10:54:45 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090217105445.A54741E4002@bag.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/285 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_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Feb 17 12:00:33 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 17 Feb 2009 12:00:33 +0100 (CET) Subject: [Python-checkins] r69715 - python/trunk/Doc/library/itertools.rst Message-ID: <20090217110033.EB9E91E4035@bag.python.org> Author: raymond.hettinger Date: Tue Feb 17 12:00:27 2009 New Revision: 69715 Log: Fixup intro paragraphs for the itertools docs. Add some tables for quick reference. Modified: python/trunk/Doc/library/itertools.rst Modified: python/trunk/Doc/library/itertools.rst ============================================================================== --- python/trunk/Doc/library/itertools.rst (original) +++ python/trunk/Doc/library/itertools.rst Tue Feb 17 12:00:27 2009 @@ -14,40 +14,65 @@ .. versionadded:: 2.3 -This module implements a number of :term:`iterator` building blocks inspired by -constructs from the Haskell and SML programming languages. Each has been recast -in a form suitable for Python. +This module implements a number of :term:`iterator` building blocks inspired +by constructs from APL, Haskell, and SML. Each has been recast in a form +suitable for Python. The module standardizes a core set of fast, memory efficient tools that are -useful by themselves or in combination. Standardization helps avoid the -readability and reliability problems which arise when many different individuals -create their own slightly varying implementations, each with their own quirks -and naming conventions. - -The tools are designed to combine readily with one another. This makes it easy -to construct more specialized tools succinctly and efficiently in pure Python. +useful by themselves or in combination. Together, they form an "iterator +algebra" making it possible to construct specialized tools succinctly and +efficiently in pure Python. For instance, SML provides a tabulation tool: ``tabulate(f)`` which produces a sequence ``f(0), f(1), ...``. This toolbox provides :func:`imap` and -:func:`count` which can be combined to form ``imap(f, count())`` and produce an +:func:`count` which can be combined to form ``imap(f, count())`` to produce an equivalent result. -Likewise, the functional tools are designed to work well with the high-speed -functions provided by the :mod:`operator` module. - -Whether cast in pure python form or compiled code, tools that use iterators are -more memory efficient (and often faster) than their list based counterparts. Adopting -the principles of just-in-time manufacturing, they create data when and where -needed instead of consuming memory with the computer equivalent of "inventory". - - -.. seealso:: - - The Standard ML Basis Library, `The Standard ML Basis Library - `_. - - Haskell, A Purely Functional Language, `Definition of Haskell and the Standard - Libraries `_. +The tools also work well with the high-speed functions in the :mod:`operator` +module. For example, the plus-operator can be mapped across two vectors to +form an efficient dot-product: ``sum(imap(operator.add, vector1, vector2))``. + + +**Infinite Iterators:** + + ================== ================= ================================================= + Iterator Arguments Results + ================== ================= ================================================= + :func:`count` start, [step] start, start+step, start+2*step, ... + :func:`cycle` p p0, p1, ... plast, p0, p1, ... + :func:`repeat` elem [,n] elem, elem, elem, ... endlessly or up to n times + ================== ================= ================================================= + +**Iterators terminating on the shortest input sequence:** + + ==================== ============================ ================================================= + Iterator Arguments Results + ==================== ============================ ================================================= + :func:`chain` p, q, ... p0, p1, ... plast, q0, q1, ... + :func:`compress` data, selectors (d[0] if s[0]), (d[1] if s[1]), ... + :func:`dropwhile` pred, seq seq[n], seq[n+1], starting when pred fails + :func:`groupby` iterable[, keyfunc] sub-iterators grouped by value of keyfunc(v) + :func:`ifilter` pred, seq elements of seq where pred(elem) is True + :func:`ifilterfalse` pred, seq elements of seq where pred(elem) is False + :func:`islice` seq, [start,] stop [, step] elements from seq[start:stop:step] + :func:`imap` func, p, q, ... func(p0, q0), fun(p1, q1), ... + :func:`starmap` func, seq func(\*seq[0]), fun(\*seq[1]), ... + :func:`tee` it, n it1, it2 , ... itn splits one iterator into n + :func:`takewhile` pred, seq seq[0], seq[1], until pred fails + :func:`izip` p, q, ... (p[0], q[0]), (p[1], q[1]), ... + :func:`izip_longest` p, q, ... (p[0], q[0]), (p[1], q[1]), ... + ==================== ============================ ================================================= + +**Combinatoric generators:** + + ===================================== ==================== ================================================= + Iterator Arguments Results + ===================================== ==================== ================================================= + :func:`product` p, q, ... [repeat=1] cartesian product + :func:`permutations` p[, r] r-length permutations (without repeated elements) + :func:`combinations` p[, r] r-length combinations (sorted and no repeats) + :func:`combinations_with_replacement` p[, r] r-length combinations (sorted but with repeats) + ===================================== ==================== ================================================= .. _itertools-functions: From nnorwitz at gmail.com Tue Feb 17 12:12:34 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 17 Feb 2009 06:12:34 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090217111234.GA21097@python.psfb.org> 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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-649 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... 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 test_slice test_smtplib test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17142 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [677493 refs] From buildbot at python.org Tue Feb 17 12:28:04 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 17 Feb 2009 11:28:04 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090217112804.A385D1E4002@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/122 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: sincerely, -The Buildbot From buildbot at python.org Tue Feb 17 12:41:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 17 Feb 2009 11:41:09 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090217114109.C83381E401E@bag.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/1877 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_locale test_pydoc test_site Traceback (most recent call last): File "./Lib/test/regrtest.py", line 558, in runtest_inner indirect_test() File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_locale.py", line 239, in test_main NameError: global name 'TestNumberFormatting' is not defined ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Feb 17 13:38:43 2009 From: python-checkins at python.org (ronald.oussoren) Date: Tue, 17 Feb 2009 13:38:43 +0100 (CET) Subject: [Python-checkins] r69716 - python/trunk/Mac/Modules/snd/_Sndmodule.c Message-ID: <20090217123843.6F1601E4002@bag.python.org> Author: ronald.oussoren Date: Tue Feb 17 13:38:42 2009 New Revision: 69716 Log: Fix issue776533. Modified: python/trunk/Mac/Modules/snd/_Sndmodule.c Modified: python/trunk/Mac/Modules/snd/_Sndmodule.c ============================================================================== --- python/trunk/Mac/Modules/snd/_Sndmodule.c (original) +++ python/trunk/Mac/Modules/snd/_Sndmodule.c Tue Feb 17 13:38:42 2009 @@ -1150,7 +1150,9 @@ SPB_Type.ob_type = &PyType_Type; if (PyType_Ready(&SPB_Type) < 0) return; Py_INCREF(&SPB_Type); +#if 0 PyModule_AddObject(m, "SPB", (PyObject *)&SPB_Type); +#endif /* Backward-compatible name */ Py_INCREF(&SPB_Type); PyModule_AddObject(m, "SPBType", (PyObject *)&SPB_Type); From python-checkins at python.org Tue Feb 17 13:48:19 2009 From: python-checkins at python.org (marc-andre.lemburg) Date: Tue, 17 Feb 2009 13:48:19 +0100 (CET) Subject: [Python-checkins] r69717 - python/trunk/Doc/library/platform.rst Message-ID: <20090217124819.D1BAB1E4002@bag.python.org> Author: marc-andre.lemburg Date: Tue Feb 17 13:48:19 2009 New Revision: 69717 Log: Clarify the deprecation of platform.dist(). Add versionadded tags. Modified: python/trunk/Doc/library/platform.rst Modified: python/trunk/Doc/library/platform.rst ============================================================================== --- python/trunk/Doc/library/platform.rst (original) +++ python/trunk/Doc/library/platform.rst Tue Feb 17 13:48:19 2009 @@ -234,7 +234,15 @@ .. function:: dist(distname='', version='', id='', supported_dists=('SuSE','debian','redhat','mandrake',...)) - This is another name for :func:`linux_distribution`. + This is an old version of the functionality now provided by + :func:`linux_distribution`. For new code, please use the + :func:`linux_distribution`. + + The only difference between the two is that ``dist()`` always + returns the short name of the distribution taken from the + ``supported_dists`` parameter. + + .. deprecated:: 2.6 .. function:: linux_distribution(distname='', version='', id='', supported_dists=('SuSE','debian','redhat','mandrake',...), full_distribution_name=1) @@ -252,6 +260,8 @@ parameters. ``id`` is the item in parentheses after the version number. It is usually the version codename. + .. versionadded:: 2.6 + .. function:: libc_ver(executable=sys.executable, lib='', version='', chunksize=2048) Tries to determine the libc version against which the file executable (defaults From buildbot at python.org Tue Feb 17 14:05:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 17 Feb 2009 13:05:09 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090217130510.1C3B01E402C@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/4652 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger,ronald.oussoren BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Feb 17 14:17:26 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Tue, 17 Feb 2009 14:17:26 +0100 (CET) Subject: [Python-checkins] r69718 - in python/trunk: Lib/test/test_mmap.py Misc/NEWS Modules/mmapmodule.c Message-ID: <20090217131726.870581E4002@bag.python.org> Author: hirokazu.yamamoto Date: Tue Feb 17 14:17:26 2009 New Revision: 69718 Log: Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0, The file was resized to wrong size. Modified: python/trunk/Lib/test/test_mmap.py python/trunk/Misc/NEWS python/trunk/Modules/mmapmodule.c Modified: python/trunk/Lib/test/test_mmap.py ============================================================================== --- python/trunk/Lib/test/test_mmap.py (original) +++ python/trunk/Lib/test/test_mmap.py Tue Feb 17 14:17:26 2009 @@ -417,6 +417,27 @@ m = mmap.mmap(f.fileno(), mapsize - halfsize, offset=halfsize) self.assertEqual(m[0:3], 'foo') f.close() + + # Try resizing map + try: + m.resize(512) + except SystemError: + pass + else: + # resize() is supported + self.assertEqual(len(m), 512) + # Check that we can no longer seek beyond the new size. + self.assertRaises(ValueError, m.seek, 513, 0) + # Check that the content is not changed + self.assertEqual(m[0:3], 'foo') + + # Check that the underlying file is truncated too + f = open(TESTFN) + f.seek(0, 2) + self.assertEqual(f.tell(), halfsize + 512) + f.close() + self.assertEqual(m.size(), halfsize + 512) + m.close() finally: Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Feb 17 14:17:26 2009 @@ -159,6 +159,9 @@ Library ------- +- Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0, + The file was resized to wrong size. + - Issue #5292: Fixed mmap crash on its boundary access m[len(m)]. - Issue #2279: distutils.sdist.add_defaults now add files Modified: python/trunk/Modules/mmapmodule.c ============================================================================== --- python/trunk/Modules/mmapmodule.c (original) +++ python/trunk/Modules/mmapmodule.c Tue Feb 17 14:17:26 2009 @@ -444,7 +444,7 @@ off_lo = (DWORD)(self->offset & 0xFFFFFFFF); #else newSizeHigh = 0; - newSizeLow = (DWORD)new_size; + newSizeLow = (DWORD)(self->offset + new_size); off_hi = 0; off_lo = (DWORD)self->offset; #endif @@ -490,7 +490,7 @@ } else { void *newmap; - if (ftruncate(self->fd, new_size) == -1) { + if (ftruncate(self->fd, self->offset + new_size) == -1) { PyErr_SetFromErrno(mmap_module_error); return NULL; } From buildbot at python.org Tue Feb 17 14:49:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 17 Feb 2009 13:49:25 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090217134925.DB7F31E4002@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/164 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: raymond.hettinger,ronald.oussoren BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Feb 17 15:28:17 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 17 Feb 2009 15:28:17 +0100 (CET) Subject: [Python-checkins] r69719 - peps/trunk/pep-0375.txt Message-ID: <20090217142817.412381E4002@bag.python.org> Author: benjamin.peterson Date: Tue Feb 17 15:28:17 2009 New Revision: 69719 Log: fix more cases of 2.7 Modified: peps/trunk/pep-0375.txt Modified: peps/trunk/pep-0375.txt ============================================================================== --- peps/trunk/pep-0375.txt (original) +++ peps/trunk/pep-0375.txt Tue Feb 17 15:28:17 2009 @@ -13,7 +13,7 @@ Abstract ======== -This document describes the development and release schedule for Python 2.7. +This document describes the development and release schedule for Python 3.1. The schedule primarily concerns itself with PEP-sized items. Small features may be added up to and including the first beta release. Bugs may be fixed until the final release. @@ -25,7 +25,7 @@ =================== ================== Position Name =================== ================== -2.7 Release Manager Benjamin Peterson +3.1 Release Manager Benjamin Peterson Windows installers Martin v. Loewis Mac installers Ronald Oussoren =================== ================== From python-checkins at python.org Tue Feb 17 18:47:16 2009 From: python-checkins at python.org (vinay.sajip) Date: Tue, 17 Feb 2009 18:47:16 +0100 (CET) Subject: [Python-checkins] r69721 - in python/branches/release26-maint: Lib/logging/__init__.py Misc/NEWS Message-ID: <20090217174716.5BF911E4002@bag.python.org> Author: vinay.sajip Date: Tue Feb 17 18:47:15 2009 New Revision: 69721 Log: #5287: Add exception handling around findCaller() call to help out IronPython. 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 Tue Feb 17 18:47:15 2009 @@ -1,4 +1,4 @@ -# Copyright 2001-2008 by Vinay Sajip. All Rights Reserved. +# Copyright 2001-2009 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, @@ -44,7 +44,7 @@ __author__ = "Vinay Sajip " __status__ = "production" __version__ = "0.5.0.5" -__date__ = "20 January 2009" +__date__ = "17 February 2009" #--------------------------------------------------------------------------- # Miscellaneous module data @@ -1118,7 +1118,12 @@ all the handlers of this logger to handle the record. """ if _srcfile: - fn, lno, func = self.findCaller() + #IronPython doesn't track Python frames, so findCaller throws an + #exception. We trap it here so that IronPython can use logging. + try: + fn, lno, func = self.findCaller() + except ValueError: + fn, lno, func = "(unknown file)", 0, "(unknown function)" else: fn, lno, func = "(unknown file)", 0, "(unknown function)" if exc_info: Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Tue Feb 17 18:47:15 2009 @@ -80,6 +80,9 @@ Library ------- +- Issue #5287: Add exception handling around findCaller() call in logging to + help out IronPython. + - Issue #4524: distutils build_script command failed with --with-suffix=3. Initial patch by Amaury Forgeot d'Arc. From python-checkins at python.org Tue Feb 17 21:00:59 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 17 Feb 2009 21:00:59 +0100 (CET) Subject: [Python-checkins] r69722 - python/branches/py3k/Doc/library/itertools.rst Message-ID: <20090217200059.4D17A1E4034@bag.python.org> Author: raymond.hettinger Date: Tue Feb 17 21:00:59 2009 New Revision: 69722 Log: Fixup intro paragraphs for the itertools docs. Add some tables for quick reference. 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 Tue Feb 17 21:00:59 2009 @@ -13,39 +13,61 @@ from itertools import * -This module implements a number of :term:`iterator` building blocks inspired by -constructs from the Haskell and SML programming languages. Each has been recast -in a form suitable for Python. +This module implements a number of :term:`iterator` building blocks inspired +by constructs from APL, Haskell, and SML. Each has been recast in a form +suitable for Python. The module standardizes a core set of fast, memory efficient tools that are -useful by themselves or in combination. Standardization helps avoid the -readability and reliability problems which arise when many different individuals -create their own slightly varying implementations, each with their own quirks -and naming conventions. - -The tools are designed to combine readily with one another. This makes it easy -to construct more specialized tools succinctly and efficiently in pure Python. +useful by themselves or in combination. Together, they form an "iterator +algebra" making it possible to construct specialized tools succinctly and +efficiently in pure Python. For instance, SML provides a tabulation tool: ``tabulate(f)`` which produces a sequence ``f(0), f(1), ...``. But, this effect can be achieved in Python by combining :func:`map` and :func:`count` to form ``map(f, count())``. -Likewise, the functional tools are designed to work well with the high-speed -functions provided by the :mod:`operator` module. - -Whether cast in pure python form or compiled code, tools that use iterators are -more memory efficient (and often faster) than their list based counterparts. Adopting -the principles of just-in-time manufacturing, they create data when and where -needed instead of consuming memory with the computer equivalent of "inventory". - - -.. seealso:: - - The Standard ML Basis Library, `The Standard ML Basis Library - `_. - - Haskell, A Purely Functional Language, `Definition of Haskell and the Standard - Libraries `_. +The tools also work well with the high-speed functions in the :mod:`operator` +module. For example, the plus-operator can be mapped across two vectors to +form an efficient dot-product: ``sum(map(operator.add, vector1, vector2))``. + + +**Infinite Iterators:** + + ================== ================= ================================================= + Iterator Arguments Results + ================== ================= ================================================= + :func:`count` start, [step] start, start+step, start+2*step, ... + :func:`cycle` p p0, p1, ... plast, p0, p1, ... + :func:`repeat` elem [,n] elem, elem, elem, ... endlessly or up to n times + ================== ================= ================================================= + +**Iterators terminating on the shortest input sequence:** + + ==================== ============================ ================================================= + Iterator Arguments Results + ==================== ============================ ================================================= + :func:`chain` p, q, ... p0, p1, ... plast, q0, q1, ... + :func:`compress` data, selectors (d[0] if s[0]), (d[1] if s[1]), ... + :func:`dropwhile` pred, seq seq[n], seq[n+1], starting when pred fails + :func:`filterfalse` pred, seq elements of seq where pred(elem) is False + :func:`groupby` iterable[, keyfunc] sub-iterators grouped by value of keyfunc(v) + :func:`islice` seq, [start,] stop [, step] elements from seq[start:stop:step] + :func:`starmap` func, seq func(\*seq[0]), fun(\*seq[1]), ... + :func:`tee` it, n it1, it2 , ... itn splits one iterator into n + :func:`takewhile` pred, seq seq[0], seq[1], until pred fails + :func:`zip_longest` p, q, ... (p[0], q[0]), (p[1], q[1]), ... + ==================== ============================ ================================================= + +**Combinatoric generators:** + + ===================================== ==================== ================================================= + Iterator Arguments Results + ===================================== ==================== ================================================= + :func:`product` p, q, ... [repeat=1] cartesian product + :func:`permutations` p[, r] r-length permutations (without repeated elements) + :func:`combinations` p[, r] r-length combinations (sorted and no repeats) + :func:`combinations_with_replacement` p[, r] r-length combinations (sorted but with repeats) + ===================================== ==================== ================================================= .. _itertools-functions: From python-checkins at python.org Tue Feb 17 21:06:51 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 17 Feb 2009 21:06:51 +0100 (CET) Subject: [Python-checkins] r69723 - python/branches/py3k/Doc/library/collections.rst Message-ID: <20090217200651.33AAB1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 17 21:06:51 2009 New Revision: 69723 Log: Fix-up intro paragraph for collections docs. 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 Feb 17 21:06:51 2009 @@ -14,11 +14,8 @@ __name__ = '' This module implements high-performance container datatypes. Currently, -there are two datatypes, :class:`deque` and :class:`defaultdict`, and -one datatype factory function, :func:`namedtuple`. This module also -provides the :class:`UserDict` and :class:`UserList` classes which may -be useful when inheriting directly from :class:`dict` or -:class:`list` isn't convenient. +there are three datatypes, :class:`Counter`, :class:`deque` and +:class:`defaultdict`, and one datatype factory function, :func:`namedtuple`. The specialized containers provided in this module provide alternatives to Python's general purpose built-in containers, :class:`dict`, @@ -26,8 +23,8 @@ In addition to containers, the collections module provides some ABCs (abstract base classes) that can be used to test whether a class -provides a particular interface, for example, is it hashable or -a mapping, and some of them can also be used as mixin classes. +provides a particular interface, for example, whether it is hashable or +a mapping. ABCs - abstract base classes ---------------------------- From nnorwitz at gmail.com Tue Feb 17 22:08:51 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 17 Feb 2009 16:08:51 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090217210851.GA16417@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663818 refs] From nnorwitz at gmail.com Tue Feb 17 22:16:15 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 17 Feb 2009 16:16:15 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090217211615.GA18812@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 [17163 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663088 refs] From nnorwitz at gmail.com Tue Feb 17 23:38:09 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 17 Feb 2009 17:38:09 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090217223809.GA8622@python.psfb.org> 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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-4947 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 test_slice test_smtplib test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [677522 refs] From python-checkins at python.org Wed Feb 18 00:06:52 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 18 Feb 2009 00:06:52 +0100 (CET) Subject: [Python-checkins] r69724 - in python/trunk: Lib/distutils/command/sdist.py Lib/distutils/tests/test_sdist.py Misc/ACKS Message-ID: <20090217230652.3C1241E400C@bag.python.org> Author: tarek.ziade Date: Wed Feb 18 00:06:51 2009 New Revision: 69724 Log: fixed the data_files inclusion behavior Modified: python/trunk/Lib/distutils/command/sdist.py python/trunk/Lib/distutils/tests/test_sdist.py python/trunk/Misc/ACKS Modified: python/trunk/Lib/distutils/command/sdist.py ============================================================================== --- python/trunk/Lib/distutils/command/sdist.py (original) +++ python/trunk/Lib/distutils/command/sdist.py Wed Feb 18 00:06:51 2009 @@ -319,7 +319,7 @@ else: # a (dirname, filenames) tuple dirname, filenames = item for f in filenames: - f = convert_path(os.path.join(dirname, f)) + f = convert_path(f) if os.path.isfile(f): self.filelist.append(f) 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 Wed Feb 18 00:06:51 2009 @@ -23,6 +23,7 @@ MANIFEST = """\ README +inroot.txt setup.py data%(sep)sdata.dt scripts%(sep)sscript.py @@ -171,10 +172,13 @@ self.write_file((data_dir, 'data.dt'), '#') some_dir = join(self.tmp_dir, 'some') os.mkdir(some_dir) + self.write_file((self.tmp_dir, 'inroot.txt'), '#') self.write_file((some_dir, 'file.txt'), '#') self.write_file((some_dir, 'other_file.txt'), '#') - dist.data_files = [('data', ['data.dt', 'notexisting']), + dist.data_files = [('data', ['data/data.dt', + 'inroot.txt', + 'notexisting']), 'some/file.txt', 'some/other_file.txt'] @@ -202,7 +206,7 @@ zip_file.close() # making sure everything was added - self.assertEquals(len(content), 10) + self.assertEquals(len(content), 11) # checking the MANIFEST manifest = open(join(self.tmp_dir, 'MANIFEST')).read() Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Wed Feb 18 00:06:51 2009 @@ -611,6 +611,7 @@ Mark Russell Nick Russo Hajime Saitou +George Sakkis Rich Salz Kevin Samborn Ilya Sandler From python-checkins at python.org Wed Feb 18 00:09:18 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 18 Feb 2009 00:09:18 +0100 (CET) Subject: [Python-checkins] r69725 - python/branches/release26-maint Message-ID: <20090217230918.4E88F1E4002@bag.python.org> Author: tarek.ziade Date: Wed Feb 18 00:09:17 2009 New Revision: 69725 Log: Blocked revisions 69724 via svnmerge ........ r69724 | tarek.ziade | 2009-02-18 00:06:51 +0100 (Wed, 18 Feb 2009) | 1 line fixed the data_files inclusion behavior ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Wed Feb 18 00:10:20 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 18 Feb 2009 00:10:20 +0100 (CET) Subject: [Python-checkins] r69726 - in python/branches/py3k: Lib/distutils/command/sdist.py Lib/distutils/tests/test_sdist.py Misc/ACKS Message-ID: <20090217231020.C96E71E401C@bag.python.org> Author: tarek.ziade Date: Wed Feb 18 00:10:18 2009 New Revision: 69726 Log: Merged revisions 69724 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69724 | tarek.ziade | 2009-02-18 00:06:51 +0100 (Wed, 18 Feb 2009) | 1 line fixed the data_files inclusion behavior ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/command/sdist.py python/branches/py3k/Lib/distutils/tests/test_sdist.py python/branches/py3k/Misc/ACKS 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 Wed Feb 18 00:10:18 2009 @@ -311,7 +311,7 @@ else: # a (dirname, filenames) tuple dirname, filenames = item for f in filenames: - f = convert_path(os.path.join(dirname, f)) + f = convert_path(f) if os.path.isfile(f): self.filelist.append(f) 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 Wed Feb 18 00:10:18 2009 @@ -23,6 +23,7 @@ MANIFEST = """\ README +inroot.txt setup.py data%(sep)sdata.dt scripts%(sep)sscript.py @@ -171,10 +172,13 @@ self.write_file((data_dir, 'data.dt'), '#') some_dir = join(self.tmp_dir, 'some') os.mkdir(some_dir) + self.write_file((self.tmp_dir, 'inroot.txt'), '#') self.write_file((some_dir, 'file.txt'), '#') self.write_file((some_dir, 'other_file.txt'), '#') - dist.data_files = [('data', ['data.dt', 'notexisting']), + dist.data_files = [('data', ['data/data.dt', + 'inroot.txt', + 'notexisting']), 'some/file.txt', 'some/other_file.txt'] @@ -202,7 +206,7 @@ zip_file.close() # making sure everything was added - self.assertEquals(len(content), 10) + self.assertEquals(len(content), 11) # checking the MANIFEST manifest = open(join(self.tmp_dir, 'MANIFEST')).read() Modified: python/branches/py3k/Misc/ACKS ============================================================================== --- python/branches/py3k/Misc/ACKS (original) +++ python/branches/py3k/Misc/ACKS Wed Feb 18 00:10:18 2009 @@ -613,6 +613,7 @@ Mark Russell Nick Russo Hajime Saitou +George Sakkis Rich Salz Kevin Samborn Ilya Sandler From python-checkins at python.org Wed Feb 18 00:11:13 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 18 Feb 2009 00:11:13 +0100 (CET) Subject: [Python-checkins] r69727 - python/branches/release30-maint Message-ID: <20090217231113.321271E4053@bag.python.org> Author: tarek.ziade Date: Wed Feb 18 00:11:12 2009 New Revision: 69727 Log: Blocked revisions 69726 via svnmerge ................ r69726 | tarek.ziade | 2009-02-18 00:10:18 +0100 (Wed, 18 Feb 2009) | 9 lines Merged revisions 69724 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69724 | tarek.ziade | 2009-02-18 00:06:51 +0100 (Wed, 18 Feb 2009) | 1 line fixed the data_files inclusion behavior ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Wed Feb 18 00:33:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 17 Feb 2009 23:33:14 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090217233314.32D3A1E4002@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/889 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: Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/threading.py", line 522, 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_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Feb 18 00:51:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 17 Feb 2009 23:51:52 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090217235152.A281C1E4002@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/166 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_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed Feb 18 01:22:56 2009 From: python-checkins at python.org (georg.brandl) Date: Wed, 18 Feb 2009 01:22:56 +0100 (CET) Subject: [Python-checkins] r69728 - python/trunk/Doc/library/socketserver.rst Message-ID: <20090218002256.1DB8F1E4002@bag.python.org> Author: georg.brandl Date: Wed Feb 18 01:22:55 2009 New Revision: 69728 Log: #5297: fix example. Modified: python/trunk/Doc/library/socketserver.rst Modified: python/trunk/Doc/library/socketserver.rst ============================================================================== --- python/trunk/Doc/library/socketserver.rst (original) +++ python/trunk/Doc/library/socketserver.rst Wed Feb 18 01:22:55 2009 @@ -517,7 +517,7 @@ # Exit the server thread when the main thread terminates server_thread.setDaemon(True) server_thread.start() - print "Server loop running in thread:", t.getName() + print "Server loop running in thread:", server_thread.getName() client(ip, port, "Hello World 1") client(ip, port, "Hello World 2") From python-checkins at python.org Wed Feb 18 01:25:13 2009 From: python-checkins at python.org (georg.brandl) Date: Wed, 18 Feb 2009 01:25:13 +0100 (CET) Subject: [Python-checkins] r69729 - python/trunk/Doc/reference/simple_stmts.rst Message-ID: <20090218002513.93DF21E4002@bag.python.org> Author: georg.brandl Date: Wed Feb 18 01:25:13 2009 New Revision: 69729 Log: #5296: sequence -> iterable. 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 Wed Feb 18 01:25:13 2009 @@ -118,8 +118,8 @@ * If the target list is a single target: The object is assigned to that target. -* If the target list is a comma-separated list of targets: The object must be a - sequence with the same number of items as there are targets in the target list, +* If the target list is a comma-separated list of targets: The object must be an + iterable with the same number of items as there are targets in the target list, and the items are assigned, from left to right, to the corresponding targets. (This rule is relaxed as of Python 1.5; in earlier versions, the object had to be a tuple. Since strings are sequences, an assignment like ``a, b = "xy"`` is @@ -143,9 +143,9 @@ be deallocated and its destructor (if it has one) to be called. * If the target is a target list enclosed in parentheses or in square brackets: - The object must be a sequence with the same number of items as there are targets - in the target list, and its items are assigned, from left to right, to the - corresponding targets. + The object must be an iterable with the same number of items as there are + targets in the target list, and its items are assigned, from left to right, + to the corresponding targets. .. index:: pair: attribute; assignment From python-checkins at python.org Wed Feb 18 01:31:36 2009 From: python-checkins at python.org (georg.brandl) Date: Wed, 18 Feb 2009 01:31:36 +0100 (CET) Subject: [Python-checkins] r69730 - python/trunk/Doc/library/exceptions.rst Message-ID: <20090218003136.6CFF71E4002@bag.python.org> Author: georg.brandl Date: Wed Feb 18 01:31:36 2009 New Revision: 69730 Log: #5268: mention VMSError. 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 Wed Feb 18 01:31:36 2009 @@ -398,6 +398,11 @@ more precise exception such as :exc:`IndexError`. +.. exception:: VMSError + + Only available on VMS. Raised when a VMS-specific error occurs. + + .. exception:: WindowsError Raised when a Windows-specific error occurs or when the error number does not From buildbot at python.org Wed Feb 18 01:44:58 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 18 Feb 2009 00:44:58 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090218004458.5B8481E4010@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/311 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,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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 buildbot at python.org Wed Feb 18 02:05:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 18 Feb 2009 01:05:19 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090218010519.7448F1E4002@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/333 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,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_pipes test_site make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Feb 18 02:08:27 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 18 Feb 2009 01:08:27 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090218010827.8874C1E4002@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/124 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_ftplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Feb 18 02:34:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 18 Feb 2009 01:34:09 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090218013409.B389C1E4002@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/164 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 buildbot at python.org Wed Feb 18 02:57:46 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 18 Feb 2009 01:57:46 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090218015746.78EDF1E4002@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/297 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,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Wed Feb 18 06:46:11 2009 From: python-checkins at python.org (gregory.p.smith) Date: Wed, 18 Feb 2009 06:46:11 +0100 (CET) Subject: [Python-checkins] r69731 - python/trunk/Doc/library/socket.rst Message-ID: <20090218054611.89C761E4002@bag.python.org> Author: gregory.p.smith Date: Wed Feb 18 06:46:11 2009 New Revision: 69731 Log: Clarify socket timeout behavior vs system network stack behavior on connect for issue5293. 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 Wed Feb 18 06:46:11 2009 @@ -726,12 +726,13 @@ Some notes on socket blocking and timeouts: A socket object can be in one of three modes: blocking, non-blocking, or timeout. Sockets are always created in -blocking mode. In blocking mode, operations block until complete. In +blocking mode. In blocking mode, operations block until complete or +the system returns an error (such as connection timed out). In non-blocking mode, operations fail (with an error that is unfortunately system-dependent) if they cannot be completed immediately. In timeout mode, operations fail if they cannot be completed within the timeout specified for the -socket. The :meth:`setblocking` method is simply a shorthand for certain -:meth:`settimeout` calls. +socket or if the system returns an error. The :meth:`setblocking` method is simply +a shorthand for certain :meth:`settimeout` calls. Timeout mode internally sets the socket in non-blocking mode. The blocking and timeout modes are shared between file descriptors and socket objects that refer @@ -742,7 +743,9 @@ Note that the :meth:`connect` operation is subject to the timeout setting, and in general it is recommended to call :meth:`settimeout` before calling -:meth:`connect`. +:meth:`connect` or pass a timeout parameter to :meth:`create_connection`. +The system network stack may return a connection timeout error +of its own regardless of any python socket timeout setting. .. method:: socket.setsockopt(level, optname, value) From nnorwitz at gmail.com Wed Feb 18 10:09:04 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 18 Feb 2009 04:09:04 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090218090904.GA12712@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663820 refs] From nnorwitz at gmail.com Wed Feb 18 10:16:32 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 18 Feb 2009 04:16:32 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090218091632.GA15114@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 [17163 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17142 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663085 refs] From nnorwitz at gmail.com Wed Feb 18 11:39:39 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 18 Feb 2009 05:39:39 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090218103939.GA4781@python.psfb.org> 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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-1160 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 test_slice test_smtplib test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [677520 refs] From python-checkins at python.org Wed Feb 18 13:43:23 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 18 Feb 2009 13:43:23 +0100 (CET) Subject: [Python-checkins] r69732 - in distutils/trunk: EXTERNALS.txt README.txt setup.cfg setup.py Message-ID: <20090218124323.94A5D1E4002@bag.python.org> Author: tarek.ziade Date: Wed Feb 18 13:43:23 2009 New Revision: 69732 Log: setting up an external to release Python's Distutils at PyPI Added: distutils/trunk/EXTERNALS.txt (contents, props changed) distutils/trunk/setup.cfg (contents, props changed) distutils/trunk/setup.py (contents, props changed) Modified: distutils/trunk/ (props changed) distutils/trunk/README.txt Added: distutils/trunk/EXTERNALS.txt ============================================================================== --- (empty file) +++ distutils/trunk/EXTERNALS.txt Wed Feb 18 13:43:23 2009 @@ -0,0 +1 @@ +distutils http://svn.python.org/projects/python/trunk/Lib/distutils/ Modified: distutils/trunk/README.txt ============================================================================== --- distutils/trunk/README.txt (original) +++ distutils/trunk/README.txt Wed Feb 18 13:43:23 2009 @@ -1,12 +1,17 @@ -======= -Warning -======= +========= +Distutils +========= -The Distutils standalone project is no longer maintained. -You may find the latest trunk version in the branches in `latest_trunk_r318`. +This is the standalone distribution of Distutils, +that gets Distutils from Python into its own package. -The Distutils package is now part of the Standard Library and is maintained -and evolves there. +To install it, just run:: + + $ python setup.py install + +And remove or rename the Distutils version located +in your Python library directory. Distutils-SIG home page : http://www.python.org/community/sigs/current/distutils-sig + Added: distutils/trunk/setup.cfg ============================================================================== --- (empty file) +++ distutils/trunk/setup.cfg Wed Feb 18 13:43:23 2009 @@ -0,0 +1,48 @@ +# +# setup.cfg +# +# the Distutils config file. Just as with the Distutils setup script, this +# has the dual purpose of being used to distribute the Distutils and +# serving as an example of some of the things you can do with Distutils +# config files. Currently, this is only useful for me (assuming I'm the +# only person who creates Distutils source and RPM distributions), but you +# could add build and installation preferences here, too. (Although those +# sorts of things are probably best handled on a site-wide or per-user +# basis, rather than in the config file for each module distribution.) +# +# $Id: setup.cfg 317 2003-10-24 18:50:38Z akuchling $ +# + +[sdist] +formats=gztar,zip + +[bdist_rpm] +release = 1 +packager = A.M. Kuchling +doc_files = CHANGES.txt + README.txt + doc/ + examples/ + +changelog = + * Fri Oct 24 2003 A.M. Kuchling 1.1 + - Updated for the Distutils 1.1 code base. + + * Thu Jun 29 2000 Greg Ward 0.9 + - Made myself the packager, since I can now create the RPM on my own + + * Sun Jun 04 2000 Harry Henry Gebel 0.9pre-1 + - Made sure scripts are file names, filled in some help strings, formatted + changelog correctly + + * Wed May 31 2000 Greg Ward 0.8.3pre-1 + - Hacked up bdist_rpm.py, moved meta-data into setup.cfg + + * Thu May 10 2000 Harry Henry Gebel 0.8.2-3 + - Added new options to package_data + + * Tue May 09 2000 Harry Henry Gebel 0.8.2-2 + - Include RPM_OPT_FLAGS in distutils + + * Wed Apr 26 2000 Harry Henry Gebel 0.8.2-1 + - First test of bdist_rpm Added: distutils/trunk/setup.py ============================================================================== --- (empty file) +++ distutils/trunk/setup.py Wed Feb 18 13:43:23 2009 @@ -0,0 +1,76 @@ +#!/usr/bin/env python +# -*- encoding: utf8 -*- +__revision__ = "$Id$" +import sys +import re +import os + +from distutils.core import setup + +# to be removed for stable releases +TRUNK_VERSION = True + +# the reStructuredText contained in +# README.txt will be displayed in PyPI +README_FILE = open('README.txt') +try: + description = README_FILE.read() +finally: + README_FILE.close() + +# taken from setuptools +def get_svn_revision(): + """Will get the svn revision out of .svn""" + revision = 0 + urlre = re.compile('url="([^"]+)"') + revre = re.compile('committed-rev="(\d+)"') + + for base, dirs, files in os.walk(os.curdir): + if '.svn' not in dirs: + dirs[:] = [] + continue + dirs.remove('.svn') + f = open(os.path.join(base, '.svn', 'entries')) + data = f.read() + f.close() + + if data.startswith('9') or data.startswith('8'): + data = map(str.splitlines,data.split('\n\x0c\n')) + del data[0][0] # get rid of the '8' or '9' + dirurl = data[0][3] + localrev = max([int(d[9]) for d in data if len(d)>9 and d[9]]+[0]) + elif data.startswith(' Author: hirokazu.yamamoto Date: Wed Feb 18 16:11:55 2009 New Revision: 69734 Log: Merged revisions 69714,69718 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69714 | hirokazu.yamamoto | 2009-02-17 19:12:10 +0900 | 1 line Issue #5292: Fixed mmap crash on its boundary access m[len(m)]. ........ r69718 | hirokazu.yamamoto | 2009-02-17 22:17:26 +0900 | 3 lines Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0, The file was resized to wrong size. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_mmap.py python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/mmapmodule.c Modified: python/branches/release26-maint/Lib/test/test_mmap.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_mmap.py (original) +++ python/branches/release26-maint/Lib/test/test_mmap.py Wed Feb 18 16:11:55 2009 @@ -41,6 +41,10 @@ self.assertEqual(m[0], '\0') self.assertEqual(m[0:3], '\0\0\0') + # Shouldn't crash on boundary (Issue #5292) + self.assertRaises(IndexError, m.__getitem__, len(m)) + self.assertRaises(IndexError, m.__setitem__, len(m), '\0') + # Modify the file's content m[0] = '3' m[PAGESIZE +3: PAGESIZE +3+3] = 'bar' @@ -413,6 +417,27 @@ m = mmap.mmap(f.fileno(), mapsize - halfsize, offset=halfsize) self.assertEqual(m[0:3], 'foo') f.close() + + # Try resizing map + try: + m.resize(512) + except SystemError: + pass + else: + # resize() is supported + self.assertEqual(len(m), 512) + # Check that we can no longer seek beyond the new size. + self.assertRaises(ValueError, m.seek, 513, 0) + # Check that the content is not changed + self.assertEqual(m[0:3], 'foo') + + # Check that the underlying file is truncated too + f = open(TESTFN) + f.seek(0, 2) + self.assertEqual(f.tell(), halfsize + 512) + f.close() + self.assertEqual(m.size(), halfsize + 512) + m.close() finally: Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Wed Feb 18 16:11:55 2009 @@ -80,6 +80,11 @@ Library ------- +- Issue #5292: Fixed mmap crash on its boundary access m[len(m)]. + +- Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0, + The file was resized to wrong size. + - Issue #5287: Add exception handling around findCaller() call in logging to help out IronPython. Modified: python/branches/release26-maint/Modules/mmapmodule.c ============================================================================== --- python/branches/release26-maint/Modules/mmapmodule.c (original) +++ python/branches/release26-maint/Modules/mmapmodule.c Wed Feb 18 16:11:55 2009 @@ -444,7 +444,7 @@ off_lo = (DWORD)(self->offset & 0xFFFFFFFF); #else newSizeHigh = 0; - newSizeLow = (DWORD)new_size; + newSizeLow = (DWORD)(self->offset + new_size); off_hi = 0; off_lo = (DWORD)self->offset; #endif @@ -490,7 +490,7 @@ } else { void *newmap; - if (ftruncate(self->fd, new_size) == -1) { + if (ftruncate(self->fd, self->offset + new_size) == -1) { PyErr_SetFromErrno(mmap_module_error); return NULL; } @@ -731,7 +731,7 @@ return NULL; if (i < 0) i += self->size; - if (i < 0 || (size_t)i > self->size) { + if (i < 0 || (size_t)i >= self->size) { PyErr_SetString(PyExc_IndexError, "mmap index out of range"); return NULL; @@ -872,7 +872,7 @@ return -1; if (i < 0) i += self->size; - if (i < 0 || (size_t)i > self->size) { + if (i < 0 || (size_t)i >= self->size) { PyErr_SetString(PyExc_IndexError, "mmap index out of range"); return -1; From buildbot at python.org Wed Feb 18 16:57:04 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 18 Feb 2009 15:57:04 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090218155705.0658C1E4028@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/131 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: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Wed Feb 18 17:38:00 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Wed, 18 Feb 2009 17:38:00 +0100 (CET) Subject: [Python-checkins] r69736 - in python/branches/py3k: Lib/test/test_mmap.py Misc/NEWS Modules/mmapmodule.c Message-ID: <20090218163800.BF8441E400C@bag.python.org> Author: hirokazu.yamamoto Date: Wed Feb 18 17:38:00 2009 New Revision: 69736 Log: Merged revisions 69714,69718 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69714 | hirokazu.yamamoto | 2009-02-17 19:12:10 +0900 | 1 line Issue #5292: Fixed mmap crash on its boundary access m[len(m)]. ........ r69718 | hirokazu.yamamoto | 2009-02-17 22:17:26 +0900 | 3 lines Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0, The file was resized to wrong size. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_mmap.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/mmapmodule.c Modified: python/branches/py3k/Lib/test/test_mmap.py ============================================================================== --- python/branches/py3k/Lib/test/test_mmap.py (original) +++ python/branches/py3k/Lib/test/test_mmap.py Wed Feb 18 17:38:00 2009 @@ -42,6 +42,10 @@ self.assertEqual(m[0], 0) self.assertEqual(m[0:3], b'\0\0\0') + # Shouldn't crash on boundary (Issue #5292) + self.assertRaises(IndexError, m.__getitem__, len(m)) + self.assertRaises(IndexError, m.__setitem__, len(m), b'\0') + # Modify the file's content m[0] = b'3'[0] m[PAGESIZE +3: PAGESIZE +3+3] = b'bar' @@ -412,6 +416,27 @@ m = mmap.mmap(f.fileno(), mapsize - halfsize, offset=halfsize) self.assertEqual(m[0:3], b'foo') f.close() + + # Try resizing map + try: + m.resize(512) + except SystemError: + pass + else: + # resize() is supported + self.assertEqual(len(m), 512) + # Check that we can no longer seek beyond the new size. + self.assertRaises(ValueError, m.seek, 513, 0) + # Check that the content is not changed + self.assertEqual(m[0:3], b'foo') + + # Check that the underlying file is truncated too + f = open(TESTFN) + f.seek(0, 2) + self.assertEqual(f.tell(), halfsize + 512) + f.close() + self.assertEqual(m.size(), halfsize + 512) + m.close() finally: Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed Feb 18 17:38:00 2009 @@ -169,6 +169,11 @@ Library ------- +- Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0, + The file was resized to wrong size. + +- Issue #5292: Fixed mmap crash on its boundary access m[len(m)]. + - Issue #2279: distutils.sdist.add_defaults now add files from the package_data and the data_files metadata. Modified: python/branches/py3k/Modules/mmapmodule.c ============================================================================== --- python/branches/py3k/Modules/mmapmodule.c (original) +++ python/branches/py3k/Modules/mmapmodule.c Wed Feb 18 17:38:00 2009 @@ -455,7 +455,7 @@ off_lo = (DWORD)(self->offset & 0xFFFFFFFF); #else newSizeHigh = 0; - newSizeLow = (DWORD)new_size; + newSizeLow = (DWORD)(self->offset + new_size); off_hi = 0; off_lo = (DWORD)self->offset; #endif @@ -501,7 +501,7 @@ } else { void *newmap; - if (ftruncate(self->fd, new_size) == -1) { + if (ftruncate(self->fd, self->offset + new_size) == -1) { PyErr_SetFromErrno(mmap_module_error); return NULL; } @@ -692,7 +692,7 @@ return NULL; if (i < 0) i += self->size; - if (i < 0 || (size_t)i > self->size) { + if (i < 0 || (size_t)i >= self->size) { PyErr_SetString(PyExc_IndexError, "mmap index out of range"); return NULL; @@ -797,7 +797,7 @@ return -1; if (i < 0) i += self->size; - if (i < 0 || (size_t)i > self->size) { + if (i < 0 || (size_t)i >= self->size) { PyErr_SetString(PyExc_IndexError, "mmap index out of range"); return -1; From python-checkins at python.org Wed Feb 18 17:47:06 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Wed, 18 Feb 2009 17:47:06 +0100 (CET) Subject: [Python-checkins] r69737 - in python/branches/release30-maint: Lib/test/test_mmap.py Misc/NEWS Modules/mmapmodule.c Message-ID: <20090218164706.2B0A01E4002@bag.python.org> Author: hirokazu.yamamoto Date: Wed Feb 18 17:47:04 2009 New Revision: 69737 Log: Merged revisions 69736 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69736 | hirokazu.yamamoto | 2009-02-19 01:38:00 +0900 | 14 lines Merged revisions 69714,69718 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69714 | hirokazu.yamamoto | 2009-02-17 19:12:10 +0900 | 1 line Issue #5292: Fixed mmap crash on its boundary access m[len(m)]. ........ r69718 | hirokazu.yamamoto | 2009-02-17 22:17:26 +0900 | 3 lines Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0, The file was resized to wrong size. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_mmap.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/mmapmodule.c Modified: python/branches/release30-maint/Lib/test/test_mmap.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_mmap.py (original) +++ python/branches/release30-maint/Lib/test/test_mmap.py Wed Feb 18 17:47:04 2009 @@ -42,6 +42,10 @@ self.assertEqual(m[0], 0) self.assertEqual(m[0:3], b'\0\0\0') + # Shouldn't crash on boundary (Issue #5292) + self.assertRaises(IndexError, m.__getitem__, len(m)) + self.assertRaises(IndexError, m.__setitem__, len(m), b'\0') + # Modify the file's content m[0] = b'3'[0] m[PAGESIZE +3: PAGESIZE +3+3] = b'bar' @@ -412,6 +416,27 @@ m = mmap.mmap(f.fileno(), mapsize - halfsize, offset=halfsize) self.assertEqual(m[0:3], b'foo') f.close() + + # Try resizing map + try: + m.resize(512) + except SystemError: + pass + else: + # resize() is supported + self.assertEqual(len(m), 512) + # Check that we can no longer seek beyond the new size. + self.assertRaises(ValueError, m.seek, 513, 0) + # Check that the content is not changed + self.assertEqual(m[0:3], b'foo') + + # Check that the underlying file is truncated too + f = open(TESTFN) + f.seek(0, 2) + self.assertEqual(f.tell(), halfsize + 512) + f.close() + self.assertEqual(m.size(), halfsize + 512) + m.close() finally: Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Wed Feb 18 17:47:04 2009 @@ -131,6 +131,11 @@ Library ------- +- Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0, + The file was resized to wrong size. + +- Issue #5292: Fixed mmap crash on its boundary access m[len(m)]. + - Issue #4524: distutils build_script command failed with --with-suffix=3. Initial patch by Amaury Forgeot d'Arc. Modified: python/branches/release30-maint/Modules/mmapmodule.c ============================================================================== --- python/branches/release30-maint/Modules/mmapmodule.c (original) +++ python/branches/release30-maint/Modules/mmapmodule.c Wed Feb 18 17:47:04 2009 @@ -455,7 +455,7 @@ off_lo = (DWORD)(self->offset & 0xFFFFFFFF); #else newSizeHigh = 0; - newSizeLow = (DWORD)new_size; + newSizeLow = (DWORD)(self->offset + new_size); off_hi = 0; off_lo = (DWORD)self->offset; #endif @@ -501,7 +501,7 @@ } else { void *newmap; - if (ftruncate(self->fd, new_size) == -1) { + if (ftruncate(self->fd, self->offset + new_size) == -1) { PyErr_SetFromErrno(mmap_module_error); return NULL; } @@ -692,7 +692,7 @@ return NULL; if (i < 0) i += self->size; - if (i < 0 || (size_t)i > self->size) { + if (i < 0 || (size_t)i >= self->size) { PyErr_SetString(PyExc_IndexError, "mmap index out of range"); return NULL; @@ -797,7 +797,7 @@ return -1; if (i < 0) i += self->size; - if (i < 0 || (size_t)i > self->size) { + if (i < 0 || (size_t)i >= self->size) { PyErr_SetString(PyExc_IndexError, "mmap index out of range"); return -1; From buildbot at python.org Wed Feb 18 18:17:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 18 Feb 2009 17:17:28 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090218171728.3442D1E4002@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/381 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: sincerely, -The Buildbot From buildbot at python.org Wed Feb 18 20:05:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 18 Feb 2009 19:05:53 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian 3.x Message-ID: <20090218190553.BB22A1E4002@bag.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/60 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: hirokazu.yamamoto,raymond.hettinger,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed Feb 18 21:54:54 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 18 Feb 2009 21:54:54 +0100 (CET) Subject: [Python-checkins] r69739 - python/trunk/Doc/library/itertools.rst Message-ID: <20090218205454.350CA1E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 18 21:54:53 2009 New Revision: 69739 Log: Generalize the itertools.tee() recipe. Modified: python/trunk/Doc/library/itertools.rst Modified: python/trunk/Doc/library/itertools.rst ============================================================================== --- python/trunk/Doc/library/itertools.rst (original) +++ python/trunk/Doc/library/itertools.rst Wed Feb 18 21:54:53 2009 @@ -137,7 +137,7 @@ return indices = range(r) yield tuple(pool[i] for i in indices) - while 1: + while True: for i in reversed(range(r)): if indices[i] != i + n - r: break @@ -187,7 +187,7 @@ return indices = [0] * r yield tuple(pool[i] for i in indices) - while 1: + while True: for i in reversed(range(r)): if indices[i] != n - 1: break @@ -610,28 +610,28 @@ .. function:: tee(iterable[, n=2]) - Return *n* independent iterators from a single iterable. The case where ``n==2`` - is equivalent to:: + Return *n* independent iterators from a single iterable. Equivalent to:: - def tee(iterable): - def gen(next, data={}): - for i in count(): - if i in data: - yield data.pop(i) - else: - data[i] = next() - yield data[i] - it = iter(iterable) - return gen(it.next), gen(it.next) - - Note, once :func:`tee` has made a split, the original *iterable* should not be - used anywhere else; otherwise, the *iterable* could get advanced without the tee - objects being informed. - - Note, this member of the toolkit may require significant auxiliary storage - (depending on how much temporary data needs to be stored). In general, if one - iterator is going to use most or all of the data before the other iterator, it - is faster to use :func:`list` instead of :func:`tee`. + def tee(iterable, n=2): + it = iter(iterable) + deques = [collections.deque() for i in range(n)] + def gen(mydeque): + while True: + if not mydeque: # when the local deque is empty + newval = next(it) # fetch a new value and + for d in deques: # load it to all the deques + d.append(newval) + yield mydeque.popleft() + return tuple(gen(d) for d in deques) + + Once :func:`tee` has made a split, the original *iterable* should not be + used anywhere else; otherwise, the *iterable* could get advanced without + the tee objects being informed. + + This itertool may require significant auxiliary storage (depending on how + much temporary data needs to be stored). In general, if one iterator uses + most or all of the data before another iterator starts, it is faster to use + :func:`list` instead of :func:`tee`. .. versionadded:: 2.4 From python-checkins at python.org Wed Feb 18 21:56:52 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 18 Feb 2009 21:56:52 +0100 (CET) Subject: [Python-checkins] r69740 - python/branches/py3k/Doc/library/itertools.rst Message-ID: <20090218205652.E38EE1E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 18 21:56:51 2009 New Revision: 69740 Log: Generalize the itertools.tee() recipe. 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 Wed Feb 18 21:56:51 2009 @@ -130,7 +130,7 @@ return indices = list(range(r)) yield tuple(pool[i] for i in indices) - while 1: + while True: for i in reversed(range(r)): if indices[i] != i + n - r: break @@ -178,7 +178,7 @@ return indices = [0] * r yield tuple(pool[i] for i in indices) - while 1: + while True: for i in reversed(range(r)): if indices[i] != n - 1: break @@ -501,28 +501,28 @@ .. function:: tee(iterable[, n=2]) - Return *n* independent iterators from a single iterable. The case where ``n==2`` - is equivalent to:: + Return *n* independent iterators from a single iterable. Equivalent to:: - def tee(iterable): - def gen(next, data={}): - for i in count(): - if i in data: - yield data.pop(i) - else: - data[i] = next() - yield data[i] - it = iter(iterable) - return (gen(it.__next__), gen(it.__next__)) - - Note, once :func:`tee` has made a split, the original *iterable* should not be - used anywhere else; otherwise, the *iterable* could get advanced without the tee - objects being informed. - - Note, this member of the toolkit may require significant auxiliary storage - (depending on how much temporary data needs to be stored). In general, if one - iterator is going to use most or all of the data before the other iterator, it - is faster to use :func:`list` instead of :func:`tee`. + def tee(iterable, n=2): + it = iter(iterable) + deques = [collections.deque() for i in range(n)] + def gen(mydeque): + while True: + if not mydeque: # when the local deque is empty + newval = next(it) # fetch a new value and + for d in deques: # load it to all the deques + d.append(newval) + yield mydeque.popleft() + return tuple(gen(d) for d in deques) + + Once :func:`tee` has made a split, the original *iterable* should not be + used anywhere else; otherwise, the *iterable* could get advanced without + the tee objects being informed. + + This itertool may require significant auxiliary storage (depending on how + much temporary data needs to be stored). In general, if one iterator uses + most or all of the data before another iterator starts, it is faster to use + :func:`list` instead of :func:`tee`. .. function:: zip_longest(*iterables[, fillvalue]) From python-checkins at python.org Wed Feb 18 22:04:17 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 18 Feb 2009 22:04:17 +0100 (CET) Subject: [Python-checkins] r69741 - python/branches/release26-maint/Doc/library/itertools.rst Message-ID: <20090218210417.137D71E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 18 22:04:16 2009 New Revision: 69741 Log: Generalize itertools.tee() recipe. Modified: python/branches/release26-maint/Doc/library/itertools.rst Modified: python/branches/release26-maint/Doc/library/itertools.rst ============================================================================== --- python/branches/release26-maint/Doc/library/itertools.rst (original) +++ python/branches/release26-maint/Doc/library/itertools.rst Wed Feb 18 22:04:16 2009 @@ -112,7 +112,7 @@ return indices = range(r) yield tuple(pool[i] for i in indices) - while 1: + while True: for i in reversed(range(r)): if indices[i] != i + n - r: break @@ -521,28 +521,28 @@ .. function:: tee(iterable[, n=2]) - Return *n* independent iterators from a single iterable. The case where ``n==2`` - is equivalent to:: + Return *n* independent iterators from a single iterable. Equivalent to:: - def tee(iterable): - def gen(next, data={}): - for i in count(): - if i in data: - yield data.pop(i) - else: - data[i] = next() - yield data[i] - it = iter(iterable) - return gen(it.next), gen(it.next) - - Note, once :func:`tee` has made a split, the original *iterable* should not be - used anywhere else; otherwise, the *iterable* could get advanced without the tee - objects being informed. - - Note, this member of the toolkit may require significant auxiliary storage - (depending on how much temporary data needs to be stored). In general, if one - iterator is going to use most or all of the data before the other iterator, it - is faster to use :func:`list` instead of :func:`tee`. + def tee(iterable, n=2): + it = iter(iterable) + deques = [collections.deque() for i in range(n)] + def gen(mydeque): + while True: + if not mydeque: # when the local deque is empty + newval = next(it) # fetch a new value and + for d in deques: # load it to all the deques + d.append(newval) + yield mydeque.popleft() + return tuple(gen(d) for d in deques) + + Once :func:`tee` has made a split, the original *iterable* should not be + used anywhere else; otherwise, the *iterable* could get advanced without + the tee objects being informed. + + This itertool may require significant auxiliary storage (depending on how + much temporary data needs to be stored). In general, if one iterator uses + most or all of the data before another iterator starts, it is faster to use + :func:`list` instead of :func:`tee`. .. versionadded:: 2.4 @@ -690,7 +690,7 @@ return indices = [0] * r yield tuple(pool[i] for i in indices) - while 1: + while True: for i in reversed(range(r)): if indices[i] != n - 1: break From nnorwitz at gmail.com Wed Feb 18 22:08:59 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 18 Feb 2009 16:08:59 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090218210859.GA28639@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663820 refs] From nnorwitz at gmail.com Wed Feb 18 22:16:37 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 18 Feb 2009 16:16:37 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090218211637.GA31039@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 [17163 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663085 refs] From python-checkins at python.org Wed Feb 18 23:30:56 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 18 Feb 2009 23:30:56 +0100 (CET) Subject: [Python-checkins] r69742 - distutils/trunk/README.txt Message-ID: <20090218223056.4BC5B1E4035@bag.python.org> Author: tarek.ziade Date: Wed Feb 18 23:30:55 2009 New Revision: 69742 Log: preparing README.txt for the diffent releases versions Modified: distutils/trunk/README.txt Modified: distutils/trunk/README.txt ============================================================================== --- distutils/trunk/README.txt (original) +++ distutils/trunk/README.txt Wed Feb 18 23:30:55 2009 @@ -2,16 +2,75 @@ Distutils ========= -This is the standalone distribution of Distutils, -that gets Distutils from Python into its own package. +This is the standalone distribution of Distutils. + +..contents :: + +Installation +============ To install it, just run:: $ python setup.py install -And remove or rename the Distutils version located -in your Python library directory. +Then remove or rename the Distutils version located in your Python library +directory. + +Feedback +======== + +- Bug tracker : http://bugs.python.org +- Distutils Home page : http://www.python.org/community/sigs/current/distutils-sig + +More information on Distutils releases +====================================== + +Distutils comes in different flavors: + +- stable releases +- development releases + +Stable releases +--------------- + +One distutils standalone release was made for each latest stable version of +Python of since the 2.3.x series. + +- distutils 2.3.7: XXX +- distutils 2.4.5: XXX +- distutils 2.5.4: XXX +- distutils 2.6.1: XXX +- distutils 3.0.1: XXX + +Development releases +-------------------- + +While Distutils lives in the standard library, it is evolving a lot. But the +release cycle of Python is too long to get an early taste of the new features +and bugfixes that were made. + +You can checkout the current Python trunk version of course, but you need to +build a new Python interpreter or extract the distutils directory to add it +manually in your Python installation. + +For conveniency, regular development snapshots will be packaged and uploaded at +PyPI. They will be installable in your Python installation the same way the stable +versions are. + +The version number will be computed using the current Python trunk version +and the svn revision number. + +For example, if the current Python trunk is at revision r69732, the Distutils +release version will be **2.7a0dev-r69732**. + +Compatibility +============= + +Distutils is intended to be compatible with any Python version from Python +2.3.7 to the current Python trunk. -Distutils-SIG home page : http://www.python.org/community/sigs/current/distutils-sig +If you want to get the latest Distutils features and bugfixes, consider +getting the latest release even if you are using Python 2.3, 2.4, 2.5 or 2.6. +And if you dare, try out the development release and help us improve Distutils ! From nnorwitz at gmail.com Wed Feb 18 23:39:19 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 18 Feb 2009 17:39:19 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090218223919.GA20824@python.psfb.org> 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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-17187 Exception in thread reader 6: Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/threading.py", line 522, in __bootstrap_inner self.run() File "/tmp/python-test/local/lib/python2.7/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/tmp/python-test/local/lib/python2.7/bsddb/test/test_thread.py", line 306, in readerThread rec = dbutils.DeadlockWrap(c.next, max_retries=10) File "/tmp/python-test/local/lib/python2.7/bsddb/dbutils.py", line 68, in DeadlockWrap return function(*_args, **_kwargs) DBLockDeadlockError: (-30996, 'DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock') 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 test_slice test_smtplib test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [677519 refs] From python-checkins at python.org Thu Feb 19 00:10:19 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 00:10:19 +0100 (CET) Subject: [Python-checkins] r69743 - in python/trunk: Misc/NEWS Modules/main.c Message-ID: <20090218231019.B68EA1E4011@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 00:10:19 2009 New Revision: 69743 Log: Py3k warnings now automatically include -Qwarn for division. Modified: python/trunk/Misc/NEWS python/trunk/Modules/main.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Feb 19 00:10:19 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Running Python with the -3 option now also warns about classic division + for ints and longs. + - Issue #5260: Long integers now consume less memory: average saving is 2 bytes per long on a 32-bit system and 6 bytes per long on a 64-bit system. Modified: python/trunk/Modules/main.c ============================================================================== --- python/trunk/Modules/main.c (original) +++ python/trunk/Modules/main.c Thu Feb 19 00:10:19 2009 @@ -317,6 +317,8 @@ case '3': Py_Py3kWarningFlag++; + if (!Py_DivisionWarningFlag) + Py_DivisionWarningFlag = 1; break; case 'Q': From python-checkins at python.org Thu Feb 19 00:12:49 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 00:12:49 +0100 (CET) Subject: [Python-checkins] r69744 - in python/branches/release26-maint: Misc/NEWS Modules/main.c Message-ID: <20090218231249.1D8151E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 00:12:48 2009 New Revision: 69744 Log: Py3k warnings now automatically include -Qwarn for division. Modified: python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/main.c Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Thu Feb 19 00:12:48 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Running Python with the -3 option now also warns about classic division + for ints and longs. + - Issue #5013: Fixed a bug in FileHandler which occurred when the delay parameter was set. Modified: python/branches/release26-maint/Modules/main.c ============================================================================== --- python/branches/release26-maint/Modules/main.c (original) +++ python/branches/release26-maint/Modules/main.c Thu Feb 19 00:12:48 2009 @@ -317,6 +317,8 @@ case '3': Py_Py3kWarningFlag++; + if (!Py_DivisionWarningFlag) + Py_DivisionWarningFlag = 1; break; case 'Q': From python-checkins at python.org Thu Feb 19 02:25:52 2009 From: python-checkins at python.org (gregory.p.smith) Date: Thu, 19 Feb 2009 02:25:52 +0100 (CET) Subject: [Python-checkins] r69745 - in python/branches/py3k: Doc/library/socket.rst Message-ID: <20090219012552.B0C7B1E4002@bag.python.org> Author: gregory.p.smith Date: Thu Feb 19 02:25:51 2009 New Revision: 69745 Log: merge socket module documentation update from trunk r69731. 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 Thu Feb 19 02:25:51 2009 @@ -673,12 +673,13 @@ Some notes on socket blocking and timeouts: A socket object can be in one of three modes: blocking, non-blocking, or timeout. Sockets are always created in -blocking mode. In blocking mode, operations block until complete. In +blocking mode. In blocking mode, operations block until complete or +the system returns an error (such as connection timed out). In non-blocking mode, operations fail (with an error that is unfortunately system-dependent) if they cannot be completed immediately. In timeout mode, operations fail if they cannot be completed within the timeout specified for the -socket. The :meth:`setblocking` method is simply a shorthand for certain -:meth:`settimeout` calls. +socket or if the system returns an error. The :meth:`setblocking` method is simply +a shorthand for certain :meth:`settimeout` calls. Timeout mode internally sets the socket in non-blocking mode. The blocking and timeout modes are shared between file descriptors and socket objects that refer @@ -689,7 +690,9 @@ Note that the :meth:`connect` operation is subject to the timeout setting, and in general it is recommended to call :meth:`settimeout` before calling -:meth:`connect`. +:meth:`connect` or pass a timeout parameter to :meth:`create_connection`. +The system network stack may return a connection timeout error +of its own regardless of any python socket timeout setting. .. method:: socket.setsockopt(level, optname, value) From python-checkins at python.org Thu Feb 19 03:05:08 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 19 Feb 2009 03:05:08 +0100 (CET) Subject: [Python-checkins] r69746 - in python/branches/release26-maint: Doc/tools/sphinxext/download.html Message-ID: <20090219020508.128441E4002@bag.python.org> Author: benjamin.peterson Date: Thu Feb 19 03:05:06 2009 New Revision: 69746 Log: Merged revisions 69348 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69348 | benjamin.peterson | 2009-02-05 19:47:31 -0600 (Thu, 05 Feb 2009) | 1 line fix download link ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/tools/sphinxext/download.html Modified: python/branches/release26-maint/Doc/tools/sphinxext/download.html ============================================================================== --- python/branches/release26-maint/Doc/tools/sphinxext/download.html (original) +++ python/branches/release26-maint/Doc/tools/sphinxext/download.html Thu Feb 19 03:05:06 2009 @@ -31,7 +31,7 @@ Download (ca. 4 MB) Plain Text - Download (ca. 2 MB) + Download (ca. 2 MB) Download (ca. 1.5 MB) From python-checkins at python.org Thu Feb 19 03:12:27 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 19 Feb 2009 03:12:27 +0100 (CET) Subject: [Python-checkins] r69747 - python/branches/py3k Message-ID: <20090219021227.0C9D21E4002@bag.python.org> Author: benjamin.peterson Date: Thu Feb 19 03:12:26 2009 New Revision: 69747 Log: Blocked revisions 69414,69561,69604,69672,69689,69709,69715,69717,69739,69743 via svnmerge ........ r69414 | georg.brandl | 2009-02-07 12:49:54 -0600 (Sat, 07 Feb 2009) | 1 line make "super only for new-style classes" a note. ........ r69561 | gregory.p.smith | 2009-02-12 21:00:00 -0600 (Thu, 12 Feb 2009) | 5 lines - 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). (backported from a py3k branch) ........ r69604 | raymond.hettinger | 2009-02-13 18:25:51 -0600 (Fri, 13 Feb 2009) | 1 line Add keyword argument support to itertools.count(). ........ r69672 | benjamin.peterson | 2009-02-16 08:54:34 -0600 (Mon, 16 Feb 2009) | 1 line note functions that are not aliased to PyBytes_ #5280 ........ r69689 | benjamin.peterson | 2009-02-16 15:09:09 -0600 (Mon, 16 Feb 2009) | 1 line remove some PyBytes_* aliases that are not in 3.x ........ r69709 | raymond.hettinger | 2009-02-17 02:33:01 -0600 (Tue, 17 Feb 2009) | 1 line Fix-up intro paragraph for collections docs. ........ r69715 | raymond.hettinger | 2009-02-17 05:00:27 -0600 (Tue, 17 Feb 2009) | 1 line Fixup intro paragraphs for the itertools docs. Add some tables for quick reference. ........ r69717 | marc-andre.lemburg | 2009-02-17 06:48:19 -0600 (Tue, 17 Feb 2009) | 5 lines Clarify the deprecation of platform.dist(). Add versionadded tags. ........ r69739 | raymond.hettinger | 2009-02-18 14:54:53 -0600 (Wed, 18 Feb 2009) | 1 line Generalize the itertools.tee() recipe. ........ r69743 | raymond.hettinger | 2009-02-18 17:10:19 -0600 (Wed, 18 Feb 2009) | 1 line Py3k warnings now automatically include -Qwarn for division. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Thu Feb 19 03:15:15 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 03:15:15 +0100 (CET) Subject: [Python-checkins] r69748 - in python/trunk: Lib/test/test_itertools.py Modules/itertoolsmodule.c Message-ID: <20090219021515.2D3CD1E401D@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 03:15:14 2009 New Revision: 69748 Log: Add keyword arg support to itertools.compress(). Modified: python/trunk/Lib/test/test_itertools.py python/trunk/Modules/itertoolsmodule.c Modified: python/trunk/Lib/test/test_itertools.py ============================================================================== --- python/trunk/Lib/test/test_itertools.py (original) +++ python/trunk/Lib/test/test_itertools.py Thu Feb 19 03:15:14 2009 @@ -306,6 +306,7 @@ self.assertEqual(comb, sorted(set(cwr) & set(perm))) # comb: both a cwr and a perm def test_compress(self): + self.assertEqual(list(compress(data='ABCDEF', selectors=[1,0,1,0,1,1])), list('ACEF')) self.assertEqual(list(compress('ABCDEF', [1,0,1,0,1,1])), list('ACEF')) self.assertEqual(list(compress('ABCDEF', [0,0,0,0,0,0])), list('')) self.assertEqual(list(compress('ABCDEF', [1,1,1,1,1,1])), list('ABCDEF')) Modified: python/trunk/Modules/itertoolsmodule.c ============================================================================== --- python/trunk/Modules/itertoolsmodule.c (original) +++ python/trunk/Modules/itertoolsmodule.c Thu Feb 19 03:15:14 2009 @@ -2782,11 +2782,9 @@ PyObject *seq1, *seq2; PyObject *data=NULL, *selectors=NULL; compressobject *lz; - - if (type == &compress_type && !_PyArg_NoKeywords("compress()", kwds)) - return NULL; - - if (!PyArg_UnpackTuple(args, "compress", 2, 2, &seq1, &seq2)) + static char *kwargs[] = {"data", "selectors", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO:compress", kwargs, &seq1, &seq2)) return NULL; data = PyObject_GetIter(seq1); @@ -2864,7 +2862,7 @@ } PyDoc_STRVAR(compress_doc, -"compress(data sequence, selector sequence) --> iterator over selected data\n\ +"compress(data, selectors) --> iterator over selected data\n\ \n\ Return data elements corresponding to true selector elements.\n\ Forms a shorter iterator from selected data elements using the\n\ From python-checkins at python.org Thu Feb 19 03:17:25 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 19 Feb 2009 03:17:25 +0100 (CET) Subject: [Python-checkins] r69749 - python/branches/py3k Message-ID: <20090219021725.570E91E4002@bag.python.org> Author: benjamin.peterson Date: Thu Feb 19 03:17:08 2009 New Revision: 69749 Log: Blocked revisions 69716 via svnmerge ........ r69716 | ronald.oussoren | 2009-02-17 06:38:42 -0600 (Tue, 17 Feb 2009) | 2 lines Fix issue776533. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Thu Feb 19 03:17:26 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 03:17:26 +0100 (CET) Subject: [Python-checkins] r69750 - in python/branches/py3k: Lib/test/test_itertools.py Modules/itertoolsmodule.c Message-ID: <20090219021726.0EFEB1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 03:17:09 2009 New Revision: 69750 Log: Add keyword arg support to itertools.compress(). Modified: python/branches/py3k/Lib/test/test_itertools.py python/branches/py3k/Modules/itertoolsmodule.c Modified: python/branches/py3k/Lib/test/test_itertools.py ============================================================================== --- python/branches/py3k/Lib/test/test_itertools.py (original) +++ python/branches/py3k/Lib/test/test_itertools.py Thu Feb 19 03:17:09 2009 @@ -310,6 +310,7 @@ self.assertEqual(comb, sorted(set(cwr) & set(perm))) # comb: both a cwr and a perm def test_compress(self): + self.assertEqual(list(compress(data='ABCDEF', selectors=[1,0,1,0,1,1])), list('ACEF')) self.assertEqual(list(compress('ABCDEF', [1,0,1,0,1,1])), list('ACEF')) self.assertEqual(list(compress('ABCDEF', [0,0,0,0,0,0])), list('')) self.assertEqual(list(compress('ABCDEF', [1,1,1,1,1,1])), list('ABCDEF')) Modified: python/branches/py3k/Modules/itertoolsmodule.c ============================================================================== --- python/branches/py3k/Modules/itertoolsmodule.c (original) +++ python/branches/py3k/Modules/itertoolsmodule.c Thu Feb 19 03:17:09 2009 @@ -2607,11 +2607,9 @@ PyObject *seq1, *seq2; PyObject *data=NULL, *selectors=NULL; compressobject *lz; - - if (type == &compress_type && !_PyArg_NoKeywords("compress()", kwds)) - return NULL; - - if (!PyArg_UnpackTuple(args, "compress", 2, 2, &seq1, &seq2)) + static char *kwargs[] = {"data", "selectors", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO:compress", kwargs, &seq1, &seq2)) return NULL; data = PyObject_GetIter(seq1); @@ -2689,7 +2687,7 @@ } PyDoc_STRVAR(compress_doc, -"compress(data sequence, selector sequence) --> iterator over selected data\n\ +"compress(data, selectors) --> iterator over selected data\n\ \n\ Return data elements corresponding to true selector elements.\n\ Forms a shorter iterator from selected data elements using the\n\ From buildbot at python.org Thu Feb 19 03:23:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 02:23:34 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090219022334.4E7841E4002@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/335 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,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Thu Feb 19 03:31:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 02:31:06 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 2.6 Message-ID: <20090219023107.71E9C1E4047@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/136 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: 1 test failed: test_urllib2 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Feb 19 03:38:25 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 03:38:25 +0100 (CET) Subject: [Python-checkins] r69751 - in python/trunk: Lib/test/test_itertools.py Modules/itertoolsmodule.c Message-ID: <20090219023825.80EC71E400C@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 03:38:25 2009 New Revision: 69751 Log: Add keyword arg support to itertools.repeat(). Modified: python/trunk/Lib/test/test_itertools.py python/trunk/Modules/itertoolsmodule.c Modified: python/trunk/Lib/test/test_itertools.py ============================================================================== --- python/trunk/Lib/test/test_itertools.py (original) +++ python/trunk/Lib/test/test_itertools.py Thu Feb 19 03:38:25 2009 @@ -632,6 +632,7 @@ self.assertNotEqual(len(set(map(id, list(product('abc', 'def'))))), 1) def test_repeat(self): + self.assertEqual(list(repeat(object='a', times=3)), ['a', 'a', 'a']) self.assertEqual(zip(xrange(3),repeat('a')), [(0, 'a'), (1, 'a'), (2, 'a')]) self.assertEqual(list(repeat('a', 3)), ['a', 'a', 'a']) Modified: python/trunk/Modules/itertoolsmodule.c ============================================================================== --- python/trunk/Modules/itertoolsmodule.c (original) +++ python/trunk/Modules/itertoolsmodule.c Thu Feb 19 03:38:25 2009 @@ -3617,11 +3617,10 @@ repeatobject *ro; PyObject *element; Py_ssize_t cnt = -1; - - if (type == &repeat_type && !_PyArg_NoKeywords("repeat()", kwds)) - return NULL; - - if (!PyArg_ParseTuple(args, "O|n:repeat", &element, &cnt)) + static char *kwargs[] = {"object", "times", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|n:repeat", kwargs, + &element, &cnt)) return NULL; if (PyTuple_Size(args) == 2 && cnt < 0) @@ -3699,8 +3698,8 @@ }; PyDoc_STRVAR(repeat_doc, -"repeat(element [,times]) -> create an iterator which returns the element\n\ -for the specified number of times. If not specified, returns the element\n\ +"repeat(object [,times]) -> create an iterator which returns the object\n\ +for the specified number of times. If not specified, returns the object\n\ endlessly."); static PyTypeObject repeat_type = { From python-checkins at python.org Thu Feb 19 03:44:01 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 03:44:01 +0100 (CET) Subject: [Python-checkins] r69752 - in python/branches/py3k: Lib/test/test_itertools.py Modules/itertoolsmodule.c Message-ID: <20090219024401.A0B2C1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 03:44:01 2009 New Revision: 69752 Log: Add keyword arg support to itertools.repeat(). Modified: python/branches/py3k/Lib/test/test_itertools.py python/branches/py3k/Modules/itertoolsmodule.c Modified: python/branches/py3k/Lib/test/test_itertools.py ============================================================================== --- python/branches/py3k/Lib/test/test_itertools.py (original) +++ python/branches/py3k/Lib/test/test_itertools.py Thu Feb 19 03:44:01 2009 @@ -640,6 +640,7 @@ self.assertNotEqual(len(set(map(id, list(product('abc', 'def'))))), 1) def test_repeat(self): + self.assertEqual(list(repeat(object='a', times=3)), ['a', 'a', 'a']) self.assertEqual(lzip(range(3),repeat('a')), [(0, 'a'), (1, 'a'), (2, 'a')]) self.assertEqual(list(repeat('a', 3)), ['a', 'a', 'a']) Modified: python/branches/py3k/Modules/itertoolsmodule.c ============================================================================== --- python/branches/py3k/Modules/itertoolsmodule.c (original) +++ python/branches/py3k/Modules/itertoolsmodule.c Thu Feb 19 03:44:01 2009 @@ -3106,11 +3106,10 @@ repeatobject *ro; PyObject *element; Py_ssize_t cnt = -1; - - if (type == &repeat_type && !_PyArg_NoKeywords("repeat()", kwds)) - return NULL; - - if (!PyArg_ParseTuple(args, "O|n:repeat", &element, &cnt)) + static char *kwargs[] = {"object", "times", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|n:repeat", kwargs, + &element, &cnt)) return NULL; if (PyTuple_Size(args) == 2 && cnt < 0) @@ -3178,8 +3177,8 @@ }; PyDoc_STRVAR(repeat_doc, -"repeat(element [,times]) -> create an iterator which returns the element\n\ -for the specified number of times. If not specified, returns the element\n\ +"repeat(object [,times]) -> create an iterator which returns the object\n\ +for the specified number of times. If not specified, returns the object\n\ endlessly."); static PyTypeObject repeat_type = { From buildbot at python.org Thu Feb 19 03:52:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 02:52:23 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090219025223.6981B1E4002@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/891 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: raymond.hettinger 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 522, 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_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Feb 19 03:53:46 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 02:53:46 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090219025346.681461E4002@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/4656 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Feb 19 04:24:17 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 19 Feb 2009 04:24:17 +0100 (CET) Subject: [Python-checkins] r69753 - python/branches/py3k Message-ID: <20090219032417.2C1FF1E4002@bag.python.org> Author: benjamin.peterson Date: Thu Feb 19 04:24:17 2009 New Revision: 69753 Log: Blocked revisions 69748,69751 via svnmerge ........ r69748 | raymond.hettinger | 2009-02-18 20:15:14 -0600 (Wed, 18 Feb 2009) | 1 line Add keyword arg support to itertools.compress(). ........ r69751 | raymond.hettinger | 2009-02-18 20:38:25 -0600 (Wed, 18 Feb 2009) | 1 line Add keyword arg support to itertools.repeat(). ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Thu Feb 19 05:22:04 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 19 Feb 2009 05:22:04 +0100 (CET) Subject: [Python-checkins] r69754 - in python/branches/py3k: Doc/library/base64.rst Doc/library/exceptions.rst Doc/library/functions.rst Doc/library/socketserver.rst Doc/reference/simple_stmts.rst Lib/subprocess.py Lib/test/test_pep263.py Lib/test/test_subprocess.py Modules/_ctypes/_ctypes.c Objects/unicodeobject.c PCbuild/sqlite3.vcproj Message-ID: <20090219042204.433E01E4002@bag.python.org> Author: benjamin.peterson Date: Thu Feb 19 05:22:03 2009 New Revision: 69754 Log: Merged revisions 69576,69579-69580,69589,69619-69620,69633,69703-69704,69728-69730 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69576 | georg.brandl | 2009-02-13 04:56:50 -0600 (Fri, 13 Feb 2009) | 1 line #1661108: note that urlsafe encoded string can contain "=". ........ r69579 | georg.brandl | 2009-02-13 05:06:59 -0600 (Fri, 13 Feb 2009) | 2 lines Fix warnings GCC emits where the argument of PyErr_Format is a single variable. ........ r69580 | georg.brandl | 2009-02-13 05:10:04 -0600 (Fri, 13 Feb 2009) | 2 lines Fix warnings GCC emits where the argument of PyErr_Format is a single variable. ........ r69589 | martin.v.loewis | 2009-02-13 14:11:34 -0600 (Fri, 13 Feb 2009) | 2 lines Move amd64 properties further to the top, so that they override the linker options correctly. ........ r69619 | benjamin.peterson | 2009-02-14 11:00:51 -0600 (Sat, 14 Feb 2009) | 1 line this needn't be a shebang line ........ r69620 | georg.brandl | 2009-02-14 11:01:36 -0600 (Sat, 14 Feb 2009) | 1 line #5179: don't leak PIPE fds when child execution fails. ........ r69633 | hirokazu.yamamoto | 2009-02-15 03:19:48 -0600 (Sun, 15 Feb 2009) | 1 line Fixed typo. ........ r69703 | raymond.hettinger | 2009-02-16 16:42:54 -0600 (Mon, 16 Feb 2009) | 3 lines Issue 5229: Documentation for super() neglects to say what super() actually does ........ r69704 | raymond.hettinger | 2009-02-16 17:00:25 -0600 (Mon, 16 Feb 2009) | 1 line Add explanation for super(type1, type2). ........ r69728 | georg.brandl | 2009-02-17 18:22:55 -0600 (Tue, 17 Feb 2009) | 2 lines #5297: fix example. ........ r69729 | georg.brandl | 2009-02-17 18:25:13 -0600 (Tue, 17 Feb 2009) | 2 lines #5296: sequence -> iterable. ........ r69730 | georg.brandl | 2009-02-17 18:31:36 -0600 (Tue, 17 Feb 2009) | 2 lines #5268: mention VMSError. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/base64.rst python/branches/py3k/Doc/library/exceptions.rst python/branches/py3k/Doc/library/functions.rst python/branches/py3k/Doc/library/socketserver.rst python/branches/py3k/Doc/reference/simple_stmts.rst python/branches/py3k/Lib/subprocess.py python/branches/py3k/Lib/test/test_pep263.py python/branches/py3k/Lib/test/test_subprocess.py python/branches/py3k/Modules/_ctypes/_ctypes.c python/branches/py3k/Objects/unicodeobject.c python/branches/py3k/PCbuild/sqlite3.vcproj Modified: python/branches/py3k/Doc/library/base64.rst ============================================================================== --- python/branches/py3k/Doc/library/base64.rst (original) +++ python/branches/py3k/Doc/library/base64.rst Thu Feb 19 05:22:03 2009 @@ -62,7 +62,8 @@ .. function:: urlsafe_b64encode(s) Encode string *s* using a URL-safe alphabet, which substitutes ``-`` instead of - ``+`` and ``_`` instead of ``/`` in the standard Base64 alphabet. + ``+`` and ``_`` instead of ``/`` in the standard Base64 alphabet. The result + can still contain ``=``. .. function:: urlsafe_b64decode(s) Modified: python/branches/py3k/Doc/library/exceptions.rst ============================================================================== --- python/branches/py3k/Doc/library/exceptions.rst (original) +++ python/branches/py3k/Doc/library/exceptions.rst Thu Feb 19 05:22:03 2009 @@ -348,6 +348,11 @@ more precise exception such as :exc:`IndexError`. +.. exception:: VMSError + + Only available on VMS. Raised when a VMS-specific error occurs. + + .. exception:: WindowsError Raised when a Windows-specific error occurs or when the error number does not Modified: python/branches/py3k/Doc/library/functions.rst ============================================================================== --- python/branches/py3k/Doc/library/functions.rst (original) +++ python/branches/py3k/Doc/library/functions.rst Thu Feb 19 05:22:03 2009 @@ -1035,16 +1035,19 @@ .. function:: super([type[, object-or-type]]) - Return a *super* object that acts as a proxy to superclasses of *type*. + Return a proxy object that delegates method calls to a parent class of + *type*. This is useful for accessing inherited methods that have been + overriden in a child class. The search order for parent classes is + determined by the ``__mro__`` attribute of the *type* and can change + whenever the parent classes are updated. If the second argument is omitted the super object returned is unbound. If the second argument is an object, ``isinstance(obj, type)`` must be true. If - the second argument is a type, ``issubclass(type2, type)`` must be true. - Calling :func:`super` without arguments is equivalent to ``super(this_class, - first_arg)``. + the second argument is a type, ``issubclass(type2, type)`` must be true (this + is useful for classmethods). - There are two typical use cases for :func:`super`. In a class hierarchy with - single inheritance, :func:`super` can be used to refer to parent classes without + There are two typical use cases for "super". In a class hierarchy with + single inheritance, "super" can be used to refer to parent classes without naming them explicitly, thus making the code more maintainable. This use closely parallels the use of "super" in other programming languages. Modified: python/branches/py3k/Doc/library/socketserver.rst ============================================================================== --- python/branches/py3k/Doc/library/socketserver.rst (original) +++ python/branches/py3k/Doc/library/socketserver.rst Thu Feb 19 05:22:03 2009 @@ -508,7 +508,7 @@ # Exit the server thread when the main thread terminates server_thread.setDaemon(True) server_thread.start() - print("Server loop running in thread:", server_thread.getName()) + print("Server loop running in thread:", server_thread.name) client(ip, port, b"Hello World 1") client(ip, port, b"Hello World 2") Modified: python/branches/py3k/Doc/reference/simple_stmts.rst ============================================================================== --- python/branches/py3k/Doc/reference/simple_stmts.rst (original) +++ python/branches/py3k/Doc/reference/simple_stmts.rst Thu Feb 19 05:22:03 2009 @@ -116,7 +116,12 @@ * If the target list is a single target: The object is assigned to that target. -* If the target list is a comma-separated list of targets: +* If the target list is a comma-separated list of targets: The object must be an + iterable with the same number of items as there are targets in the target list, + and the items are assigned, from left to right, to the corresponding targets. + (This rule is relaxed as of Python 1.5; in earlier versions, the object had to + be a tuple. Since strings are sequences, an assignment like ``a, b = "xy"`` is + now legal as long as the string has the right length.) * If the target list contains one target prefixed with an asterisk, called a "starred" target: The object must be a sequence with at least as many items @@ -152,9 +157,9 @@ be deallocated and its destructor (if it has one) to be called. * If the target is a target list enclosed in parentheses or in square brackets: - The object must be a sequence with the same number of items as there are targets - in the target list, and its items are assigned, from left to right, to the - corresponding targets. + The object must be an iterable with the same number of items as there are + targets in the target list, and its items are assigned, from left to right, + to the corresponding targets. .. index:: pair: attribute; assignment Modified: python/branches/py3k/Lib/subprocess.py ============================================================================== --- python/branches/py3k/Lib/subprocess.py (original) +++ python/branches/py3k/Lib/subprocess.py Thu Feb 19 05:22:03 2009 @@ -1139,6 +1139,9 @@ if data: os.waitpid(self.pid, 0) child_exception = pickle.loads(data) + for fd in (p2cwrite, c2pread, errread): + if fd is not None: + os.close(fd) raise child_exception Modified: python/branches/py3k/Lib/test/test_pep263.py ============================================================================== --- python/branches/py3k/Lib/test/test_pep263.py (original) +++ python/branches/py3k/Lib/test/test_pep263.py Thu Feb 19 05:22:03 2009 @@ -1,4 +1,4 @@ -#! -*- coding: koi8-r -*- +# -*- coding: koi8-r -*- import unittest from test import support Modified: python/branches/py3k/Lib/test/test_subprocess.py ============================================================================== --- python/branches/py3k/Lib/test/test_subprocess.py (original) +++ python/branches/py3k/Lib/test/test_subprocess.py Thu Feb 19 05:22:03 2009 @@ -521,6 +521,22 @@ p = subprocess.Popen([sys.executable, "-c", "pass"], bufsize=None) self.assertEqual(p.wait(), 0) + def test_leaking_fds_on_error(self): + # see bug #5179: Popen leaks file descriptors to PIPEs if + # the child fails to execute; this will eventually exhaust + # the maximum number of open fds. 1024 seems a very common + # value for that limit, but Windows has 2048, so we loop + # 1024 times (each call leaked two fds). + for i in range(1024): + try: + subprocess.Popen(['nonexisting_i_hope'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + # Windows raises IOError + except (IOError, OSError) as err: + if err.errno != 2: # ignore "no such file" + pass # XXX see #5312 + # # POSIX tests # Modified: python/branches/py3k/Modules/_ctypes/_ctypes.c ============================================================================== --- python/branches/py3k/Modules/_ctypes/_ctypes.c (original) +++ python/branches/py3k/Modules/_ctypes/_ctypes.c Thu Feb 19 05:22:03 2009 @@ -566,13 +566,14 @@ #else address = (void *)ctypes_dlsym(handle, name); if (!address) { - PyErr_Format(PyExc_ValueError, #ifdef __CYGWIN__ /* dlerror() isn't very helpful on cygwin */ + PyErr_Format(PyExc_ValueError, "symbol '%s' not found (%s) ", - name, + name); +#else + PyErr_SetString(PyExc_ValueError, ctypes_dlerror()); #endif - ctypes_dlerror()); return NULL; } #endif @@ -3208,13 +3209,14 @@ #else address = (PPROC)ctypes_dlsym(handle, name); if (!address) { - PyErr_Format(PyExc_AttributeError, #ifdef __CYGWIN__ /* dlerror() isn't very helpful on cygwin */ + PyErr_Format(PyExc_AttributeError, "function '%s' not found (%s) ", - name, + name); +#else + PyErr_SetString(PyExc_AttributeError, ctypes_dlerror()); #endif - ctypes_dlerror()); return NULL; } #endif Modified: python/branches/py3k/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k/Objects/unicodeobject.c (original) +++ python/branches/py3k/Objects/unicodeobject.c Thu Feb 19 05:22:03 2009 @@ -1591,7 +1591,7 @@ if (restuple == NULL) goto onError; if (!PyTuple_Check(restuple)) { - PyErr_Format(PyExc_TypeError, &argparse[4]); + PyErr_SetString(PyExc_TypeError, &argparse[4]); goto onError; } if (!PyArg_ParseTuple(restuple, argparse, &PyUnicode_Type, &repunicode, &newpos)) @@ -3854,7 +3854,7 @@ if (restuple == NULL) return NULL; if (!PyTuple_Check(restuple)) { - PyErr_Format(PyExc_TypeError, &argparse[4]); + PyErr_SetString(PyExc_TypeError, &argparse[4]); Py_DECREF(restuple); return NULL; } @@ -5128,7 +5128,7 @@ if (restuple == NULL) return NULL; if (!PyTuple_Check(restuple)) { - PyErr_Format(PyExc_TypeError, &argparse[4]); + PyErr_SetString(PyExc_TypeError, &argparse[4]); Py_DECREF(restuple); return NULL; } Modified: python/branches/py3k/PCbuild/sqlite3.vcproj ============================================================================== --- python/branches/py3k/PCbuild/sqlite3.vcproj (original) +++ python/branches/py3k/PCbuild/sqlite3.vcproj Thu Feb 19 05:22:03 2009 @@ -82,7 +82,7 @@ @@ -327,7 +327,7 @@ @@ -449,7 +449,7 @@ From buildbot at python.org Thu Feb 19 05:33:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 04:33:45 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian 3.0 Message-ID: <20090219043345.47B291E4002@bag.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/59 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-alpha Build Reason: The web-page 'force build' button was pressed by 'peter j': cant install app Build Source Stamp: [branch bittorrent] python Blamelist: BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Thu Feb 19 05:34:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 04:34:38 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090219043438.C94421E4002@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/315 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,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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 buildbot at python.org Thu Feb 19 05:39:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 04:39:14 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090219043915.04C601E4002@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/386 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_site make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Feb 19 05:45:08 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 05:45:08 +0100 (CET) Subject: [Python-checkins] r69755 - in python/branches/py3k: Doc/library/functions.rst Doc/library/itertools.rst Lib/test/test_itertools.py Message-ID: <20090219044508.23C2C1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 05:45:07 2009 New Revision: 69755 Log: Add some cross-references to the docs. Simplify the python code equivalent for zip(). Supply an optional argument for the nth() recipe. Modified: python/branches/py3k/Doc/library/functions.rst python/branches/py3k/Doc/library/itertools.rst python/branches/py3k/Lib/test/test_itertools.py Modified: python/branches/py3k/Doc/library/functions.rst ============================================================================== --- python/branches/py3k/Doc/library/functions.rst (original) +++ python/branches/py3k/Doc/library/functions.rst Thu Feb 19 05:45:07 2009 @@ -380,6 +380,9 @@ not ``None`` and ``(item for item in iterable if item)`` if function is ``None``. + See :func:`itertools.filterfalse` for the complementary function that returns + elements of *iterable* for which *function* returns false. + .. function:: float([x]) @@ -595,7 +598,8 @@ yielding the results. If additional *iterable* arguments are passed, *function* must take that many arguments and is applied to the items from all iterables in parallel. With multiple iterables, the iterator stops when the - shortest iterable is exhausted. + shortest iterable is exhausted. For cases where the function inputs are + already arranged into argument tuples, see :func:`itertools.starmap`\. .. function:: max(iterable[, args...], *[, key]) @@ -953,7 +957,8 @@ default). They have no other explicit functionality; however they are used by Numerical Python and other third party extensions. Slice objects are also generated when extended indexing syntax is used. For example: - ``a[start:stop:step]`` or ``a[start:stop, i]``. + ``a[start:stop:step]`` or ``a[start:stop, i]``. See :func:`itertools.islice` + for an alternate version that returns an iterator. .. function:: sorted(iterable[, key[, reverse]]) @@ -1030,7 +1035,8 @@ Sums *start* and the items of an *iterable* from left to right and returns the total. *start* defaults to ``0``. The *iterable*'s items are normally numbers, and are not allowed to be strings. The fast, correct way to concatenate a - sequence of strings is by calling ``''.join(sequence)``. + sequence of strings is by calling ``''.join(sequence)``. To add floating + point values with extended precision, see :func:`math.fsum`\. .. function:: super([type[, object-or-type]]) @@ -1145,8 +1151,7 @@ # zip('ABCD', 'xy') --> Ax By iterables = map(iter, iterables) while iterables: - result = [it.next() for it in iterables] - yield tuple(result) + yield tuple(map(next, iterables)) The left-to-right evaluation order of the iterables is guaranteed. This makes possible an idiom for clustering a data series into n-length groups Modified: python/branches/py3k/Doc/library/itertools.rst ============================================================================== --- python/branches/py3k/Doc/library/itertools.rst (original) +++ python/branches/py3k/Doc/library/itertools.rst Thu Feb 19 05:45:07 2009 @@ -615,9 +615,9 @@ "Return function(0), function(1), ..." return map(function, count(start)) - def nth(iterable, n): - "Returns the nth item or None" - return next(islice(iterable, n, None), None) + def nth(iterable, n, default=None): + "Returns the nth item or a default value" + return next(islice(iterable, n, None), default) def quantify(iterable, pred=bool): "Count how many times the predicate is true" Modified: python/branches/py3k/Lib/test/test_itertools.py ============================================================================== --- python/branches/py3k/Lib/test/test_itertools.py (original) +++ python/branches/py3k/Lib/test/test_itertools.py Thu Feb 19 05:45:07 2009 @@ -1419,9 +1419,9 @@ ... "Return function(0), function(1), ..." ... return map(function, count(start)) ->>> def nth(iterable, n): -... "Returns the nth item or None" -... return next(islice(iterable, n, None), None) +>>> def nth(iterable, n, default=None): +... "Returns the nth item or a default value" +... return next(islice(iterable, n, None), default) >>> def quantify(iterable, pred=bool): ... "Count how many times the predicate is true" From buildbot at python.org Thu Feb 19 05:49:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 04:49:13 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090219044913.95DAF1E4002@bag.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/292 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: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Feb 19 05:49:40 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 05:49:40 +0100 (CET) Subject: [Python-checkins] r69756 - in python/branches/release30-maint: Doc/library/functions.rst Doc/library/itertools.rst Lib/test/test_itertools.py Message-ID: <20090219044940.325A81E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 05:49:39 2009 New Revision: 69756 Log: Add some cross-references to the docs. Simplify the python code equivalent for zip(). Supply an optional argument for the nth() recipe. Modified: python/branches/release30-maint/Doc/library/functions.rst python/branches/release30-maint/Doc/library/itertools.rst python/branches/release30-maint/Lib/test/test_itertools.py Modified: python/branches/release30-maint/Doc/library/functions.rst ============================================================================== --- python/branches/release30-maint/Doc/library/functions.rst (original) +++ python/branches/release30-maint/Doc/library/functions.rst Thu Feb 19 05:49:39 2009 @@ -380,6 +380,9 @@ not ``None`` and ``(item for item in iterable if item)`` if function is ``None``. + See :func:`itertools.filterfalse` for the complementary function that returns + elements of *iterable* for which *function* returns false. + .. function:: float([x]) @@ -595,7 +598,8 @@ yielding the results. If additional *iterable* arguments are passed, *function* must take that many arguments and is applied to the items from all iterables in parallel. With multiple iterables, the iterator stops when the - shortest iterable is exhausted. + shortest iterable is exhausted. For cases where the function inputs are + already arranged into argument tuples, see :func:`itertools.starmap`\. .. function:: max(iterable[, args...], *[, key]) @@ -948,7 +952,8 @@ default). They have no other explicit functionality; however they are used by Numerical Python and other third party extensions. Slice objects are also generated when extended indexing syntax is used. For example: - ``a[start:stop:step]`` or ``a[start:stop, i]``. + ``a[start:stop:step]`` or ``a[start:stop, i]``. See :func:`itertools.islice` + for an alternate version that returns an iterator. .. function:: sorted(iterable[, key[, reverse]]) @@ -1025,7 +1030,8 @@ Sums *start* and the items of an *iterable* from left to right and returns the total. *start* defaults to ``0``. The *iterable*'s items are normally numbers, and are not allowed to be strings. The fast, correct way to concatenate a - sequence of strings is by calling ``''.join(sequence)``. + sequence of strings is by calling ``''.join(sequence)``. To add floating + point values with extended precision, see :func:`math.fsum`\. .. function:: super([type[, object-or-type]]) @@ -1137,8 +1143,7 @@ # zip('ABCD', 'xy') --> Ax By iterables = map(iter, iterables) while iterables: - result = [it.next() for it in iterables] - yield tuple(result) + yield tuple(map(next, iterables)) The left-to-right evaluation order of the iterables is guaranteed. This makes possible an idiom for clustering a data series into n-length groups 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 Feb 19 05:49:39 2009 @@ -529,9 +529,9 @@ "Return function(0), function(1), ..." return map(function, count(start)) - def nth(iterable, n): - "Returns the nth item or None" - return next(islice(iterable, n, None), None) + def nth(iterable, n, default=None): + "Returns the nth item or a default value" + return next(islice(iterable, n, None), default) def quantify(iterable, pred=bool): "Count how many times the predicate is true" Modified: python/branches/release30-maint/Lib/test/test_itertools.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_itertools.py (original) +++ python/branches/release30-maint/Lib/test/test_itertools.py Thu Feb 19 05:49:39 2009 @@ -1219,9 +1219,9 @@ ... "Return function(0), function(1), ..." ... return map(function, count(start)) ->>> def nth(iterable, n): -... "Returns the nth item or None" -... return next(islice(iterable, n, None), None) +>>> def nth(iterable, n, default=None): +... "Returns the nth item or a default value" +... return next(islice(iterable, n, None), default) >>> def quantify(iterable, pred=bool): ... "Count how many times the predicate is true" From buildbot at python.org Thu Feb 19 06:05:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 05:05:07 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090219050508.BC8DB1E4002@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/169 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: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Feb 19 06:33:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 05:33:47 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.0 Message-ID: <20090219053347.9A4341E4002@bag.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/186 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: raymond.hettinger 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 Thu Feb 19 06:34:36 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 06:34:36 +0100 (CET) Subject: [Python-checkins] r69757 - in python/trunk: Doc/library/functions.rst Doc/library/itertools.rst Lib/test/test_itertools.py Message-ID: <20090219053436.9B2191E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 06:34:35 2009 New Revision: 69757 Log: Add some cross-references to the docs. Simplify the python code equivalent for izip(). Supply an optional argument for the nth() recipe. Modified: python/trunk/Doc/library/functions.rst python/trunk/Doc/library/itertools.rst python/trunk/Lib/test/test_itertools.py Modified: python/trunk/Doc/library/functions.rst ============================================================================== --- python/trunk/Doc/library/functions.rst (original) +++ python/trunk/Doc/library/functions.rst Thu Feb 19 06:34:35 2009 @@ -397,6 +397,9 @@ iterable if function(item)]`` if function is not ``None`` and ``[item for item in iterable if item]`` if function is ``None``. + See :func:`itertools.filterfalse` for the complementary function that returns + elements of *iterable* for which *function* returns false. + .. function:: float([x]) @@ -1077,7 +1080,8 @@ default). They have no other explicit functionality; however they are used by Numerical Python and other third party extensions. Slice objects are also generated when extended indexing syntax is used. For example: - ``a[start:stop:step]`` or ``a[start:stop, i]``. + ``a[start:stop:step]`` or ``a[start:stop, i]``. See :func:`itertools.islice` + for an alternate version that returns an iterator. .. function:: sorted(iterable[, cmp[, key[, reverse]]]) @@ -1160,6 +1164,7 @@ and are not allowed to be strings. The fast, correct way to concatenate a sequence of strings is by calling ``''.join(sequence)``. Note that ``sum(range(n), m)`` is equivalent to ``reduce(operator.add, range(n), m)`` + To add floating point values with extended precision, see :func:`math.fsum`\. .. versionadded:: 2.3 @@ -1329,7 +1334,9 @@ :func:`xrange` is intended to be simple and fast. Implementations may impose restrictions to achieve this. The C implementation of Python restricts all arguments to native C longs ("short" Python integers), and also requires that - the number of elements fit in a native C long. + the number of elements fit in a native C long. If a larger range is needed, + an alternate version can be crafted using the :mod:`itertools` module: + ``islice(count(start, step), (stop-start+step-1)//step)``. .. function:: zip([iterable, ...]) Modified: python/trunk/Doc/library/itertools.rst ============================================================================== --- python/trunk/Doc/library/itertools.rst (original) +++ python/trunk/Doc/library/itertools.rst Thu Feb 19 06:34:35 2009 @@ -427,8 +427,7 @@ # izip('ABCD', 'xy') --> Ax By iterables = map(iter, iterables) while iterables: - result = [it.next() for it in iterables] - yield tuple(result) + yield yield tuple(map(next, iterables)) .. versionchanged:: 2.4 When no iterables are specified, returns a zero length iterator instead of @@ -702,9 +701,9 @@ "Return function(0), function(1), ..." return imap(function, count(start)) - def nth(iterable, n): - "Returns the nth item or None" - return next(islice(iterable, n, None), None) + def nth(iterable, n, default=None): + "Returns the nth item or a default value" + return next(islice(iterable, n, None), default) def quantify(iterable, pred=bool): "Count how many times the predicate is true" Modified: python/trunk/Lib/test/test_itertools.py ============================================================================== --- python/trunk/Lib/test/test_itertools.py (original) +++ python/trunk/Lib/test/test_itertools.py Thu Feb 19 06:34:35 2009 @@ -1401,9 +1401,9 @@ ... "Return function(0), function(1), ..." ... return imap(function, count(start)) ->>> def nth(iterable, n): -... "Returns the nth item or None" -... return next(islice(iterable, n, None), None) +>>> def nth(iterable, n, default=None): +... "Returns the nth item or a default value" +... return next(islice(iterable, n, None), default) >>> def quantify(iterable, pred=bool): ... "Count how many times the predicate is true" From python-checkins at python.org Thu Feb 19 06:38:55 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 06:38:55 +0100 (CET) Subject: [Python-checkins] r69758 - in python/branches/release26-maint: Doc/library/functions.rst Doc/library/itertools.rst Lib/test/test_itertools.py Message-ID: <20090219053855.015761E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 06:38:53 2009 New Revision: 69758 Log: Add some cross-references to the docs. Simplify the python code equivalent for izip(). Supply an optional argument for the nth() recipe. Modified: python/branches/release26-maint/Doc/library/functions.rst python/branches/release26-maint/Doc/library/itertools.rst python/branches/release26-maint/Lib/test/test_itertools.py 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 Thu Feb 19 06:38:53 2009 @@ -397,6 +397,9 @@ iterable if function(item)]`` if function is not ``None`` and ``[item for item in iterable if item]`` if function is ``None``. + See :func:`itertools.filterfalse` for the complementary function that returns + elements of *iterable* for which *function* returns false. + .. function:: float([x]) @@ -1077,7 +1080,8 @@ default). They have no other explicit functionality; however they are used by Numerical Python and other third party extensions. Slice objects are also generated when extended indexing syntax is used. For example: - ``a[start:stop:step]`` or ``a[start:stop, i]``. + ``a[start:stop:step]`` or ``a[start:stop, i]``. See :func:`itertools.islice` + for an alternate version that returns an iterator. .. function:: sorted(iterable[, cmp[, key[, reverse]]]) @@ -1160,6 +1164,7 @@ and are not allowed to be strings. The fast, correct way to concatenate a sequence of strings is by calling ``''.join(sequence)``. Note that ``sum(range(n), m)`` is equivalent to ``reduce(operator.add, range(n), m)`` + To add floating point values with extended precision, see :func:`math.fsum`\. .. versionadded:: 2.3 @@ -1323,7 +1328,9 @@ :func:`xrange` is intended to be simple and fast. Implementations may impose restrictions to achieve this. The C implementation of Python restricts all arguments to native C longs ("short" Python integers), and also requires that - the number of elements fit in a native C long. + the number of elements fit in a native C long. If a larger range is needed, + an alternate version can be crafted using the :mod:`itertools` module: + ``islice(count(start, step), (stop-start+step-1)//step)``. .. function:: zip([iterable, ...]) Modified: python/branches/release26-maint/Doc/library/itertools.rst ============================================================================== --- python/branches/release26-maint/Doc/library/itertools.rst (original) +++ python/branches/release26-maint/Doc/library/itertools.rst Thu Feb 19 06:38:53 2009 @@ -338,8 +338,7 @@ # izip('ABCD', 'xy') --> Ax By iterables = map(iter, iterables) while iterables: - result = [it.next() for it in iterables] - yield tuple(result) + yield yield tuple(map(next, iterables)) .. versionchanged:: 2.4 When no iterables are specified, returns a zero length iterator instead of @@ -613,9 +612,9 @@ "Return function(0), function(1), ..." return imap(function, count(start)) - def nth(iterable, n): - "Returns the nth item or None" - return next(islice(iterable, n, None), None) + def nth(iterable, n, default=None): + "Returns the nth item or a default value" + return next(islice(iterable, n, None), default) def quantify(iterable, pred=bool): "Count how many times the predicate is true" Modified: python/branches/release26-maint/Lib/test/test_itertools.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_itertools.py (original) +++ python/branches/release26-maint/Lib/test/test_itertools.py Thu Feb 19 06:38:53 2009 @@ -1200,9 +1200,9 @@ ... "Return function(0), function(1), ..." ... return imap(function, count(start)) ->>> def nth(iterable, n): -... "Returns the nth item or None" -... return next(islice(iterable, n, None), None) +>>> def nth(iterable, n, default=None): +... "Returns the nth item or a default value" +... return next(islice(iterable, n, None), default) >>> def quantify(iterable, pred=bool): ... "Count how many times the predicate is true" From python-checkins at python.org Thu Feb 19 06:48:06 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 06:48:06 +0100 (CET) Subject: [Python-checkins] r69759 - python/branches/py3k/Doc/library/math.rst Message-ID: <20090219054806.A3D731E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 06:48:05 2009 New Revision: 69759 Log: Add an example for math.fsum() and elaborate on the accurary note. Modified: python/branches/py3k/Doc/library/math.rst Modified: python/branches/py3k/Doc/library/math.rst ============================================================================== --- python/branches/py3k/Doc/library/math.rst (original) +++ python/branches/py3k/Doc/library/math.rst Thu Feb 19 06:48:05 2009 @@ -80,14 +80,18 @@ .. function:: fsum(iterable) Return an accurate floating point sum of values in the iterable. Avoids - loss of precision by tracking multiple intermediate partial sums. The - algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the - typical case where the rounding mode is half-even. + loss of precision by tracking multiple intermediate partial sums:: - .. note:: - - The accuracy of fsum() may be impaired on builds that use - extended precision addition and then double-round the results. + >>> sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1]) + 0.99999999999999989 + >>> fsum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1]) + 1.0 + + The algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the + typical case where the rounding mode is half-even. On some non-Windows + builds, the underlying C library uses extended precision addition and may + occasionally double-round an intermediate sum causing it to be off in its + least significant bit. .. function:: isinf(x) From python-checkins at python.org Thu Feb 19 06:49:53 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 06:49:53 +0100 (CET) Subject: [Python-checkins] r69760 - python/branches/release30-maint/Doc/library/math.rst Message-ID: <20090219054953.58D241E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 06:49:53 2009 New Revision: 69760 Log: Add an example for math.fsum() and elaborate on the accurary note. Modified: python/branches/release30-maint/Doc/library/math.rst Modified: python/branches/release30-maint/Doc/library/math.rst ============================================================================== --- python/branches/release30-maint/Doc/library/math.rst (original) +++ python/branches/release30-maint/Doc/library/math.rst Thu Feb 19 06:49:53 2009 @@ -80,14 +80,18 @@ .. function:: fsum(iterable) Return an accurate floating point sum of values in the iterable. Avoids - loss of precision by tracking multiple intermediate partial sums. The - algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the - typical case where the rounding mode is half-even. + loss of precision by tracking multiple intermediate partial sums:: - .. note:: - - The accuracy of fsum() may be impaired on builds that use - extended precision addition and then double-round the results. + >>> sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1]) + 0.99999999999999989 + >>> fsum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1]) + 1.0 + + The algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the + typical case where the rounding mode is half-even. On some non-Windows + builds, the underlying C library uses extended precision addition and may + occasionally double-round an intermediate sum causing it to be off in its + least significant bit. .. function:: isinf(x) From python-checkins at python.org Thu Feb 19 06:51:41 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 06:51:41 +0100 (CET) Subject: [Python-checkins] r69761 - python/trunk/Doc/library/math.rst Message-ID: <20090219055141.F260A1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 06:51:41 2009 New Revision: 69761 Log: Add an example for math.fsum() and elaborate on the accurary note. Modified: python/trunk/Doc/library/math.rst Modified: python/trunk/Doc/library/math.rst ============================================================================== --- python/trunk/Doc/library/math.rst (original) +++ python/trunk/Doc/library/math.rst Thu Feb 19 06:51:41 2009 @@ -87,14 +87,18 @@ .. function:: fsum(iterable) Return an accurate floating point sum of values in the iterable. Avoids - loss of precision by tracking multiple intermediate partial sums. The - algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the - typical case where the rounding mode is half-even. + loss of precision by tracking multiple intermediate partial sums:: - .. note:: - - The accuracy of fsum() may be impaired on builds that use - extended precision addition and then double-round the results. + >>> sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1]) + 0.99999999999999989 + >>> fsum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1]) + 1.0 + + The algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the + typical case where the rounding mode is half-even. On some non-Windows + builds, the underlying C library uses extended precision addition and may + occasionally double-round an intermediate sum causing it to be off in its + least significant bit. .. versionadded:: 2.6 From python-checkins at python.org Thu Feb 19 06:53:23 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 06:53:23 +0100 (CET) Subject: [Python-checkins] r69762 - python/branches/release26-maint/Doc/library/math.rst Message-ID: <20090219055323.1CD2D1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 06:53:22 2009 New Revision: 69762 Log: Add an example for math.fsum() and elaborate on the accurary note. Modified: python/branches/release26-maint/Doc/library/math.rst Modified: python/branches/release26-maint/Doc/library/math.rst ============================================================================== --- python/branches/release26-maint/Doc/library/math.rst (original) +++ python/branches/release26-maint/Doc/library/math.rst Thu Feb 19 06:53:22 2009 @@ -87,14 +87,18 @@ .. function:: fsum(iterable) Return an accurate floating point sum of values in the iterable. Avoids - loss of precision by tracking multiple intermediate partial sums. The - algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the - typical case where the rounding mode is half-even. + loss of precision by tracking multiple intermediate partial sums:: - .. note:: - - The accuracy of fsum() may be impaired on builds that use - extended precision addition and then double-round the results. + >>> sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1]) + 0.99999999999999989 + >>> fsum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1]) + 1.0 + + The algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the + typical case where the rounding mode is half-even. On some non-Windows + builds, the underlying C library uses extended precision addition and may + occasionally double-round an intermediate sum causing it to be off in its + least significant bit. .. versionadded:: 2.6 From buildbot at python.org Thu Feb 19 07:35:58 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 06:35:58 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090219063558.6DAB91E4002@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/301 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,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Feb 19 07:38:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 06:38:45 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090219063845.8DFB61E4002@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/338 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,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_pipes test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Feb 19 07:44:30 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 07:44:30 +0100 (CET) Subject: [Python-checkins] r69763 - in python/branches/py3k/Doc/library: functions.rst math.rst Message-ID: <20090219064430.A802D1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 07:44:30 2009 New Revision: 69763 Log: Add links to helpful external resources. Modified: python/branches/py3k/Doc/library/functions.rst python/branches/py3k/Doc/library/math.rst Modified: python/branches/py3k/Doc/library/functions.rst ============================================================================== --- python/branches/py3k/Doc/library/functions.rst (original) +++ python/branches/py3k/Doc/library/functions.rst Thu Feb 19 07:44:30 2009 @@ -973,6 +973,9 @@ *reverse* is a boolean value. If set to ``True``, then the list elements are sorted as if each comparison were reversed. + To convert an old-style *cmp* function to a *key* function, see the + `CmpToKey recipe in the ASPN cookbook + `_\. .. function:: staticmethod(function) Modified: python/branches/py3k/Doc/library/math.rst ============================================================================== --- python/branches/py3k/Doc/library/math.rst (original) +++ python/branches/py3k/Doc/library/math.rst Thu Feb 19 07:44:30 2009 @@ -93,6 +93,10 @@ occasionally double-round an intermediate sum causing it to be off in its least significant bit. + For further discussion and two alternative approaches, see the `ASPN cookbook + recipes for accurate floating point summation + `_\. + .. function:: isinf(x) From python-checkins at python.org Thu Feb 19 07:47:42 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 07:47:42 +0100 (CET) Subject: [Python-checkins] r69764 - in python/branches/release30-maint/Doc/library: functions.rst math.rst Message-ID: <20090219064742.C8B2E1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 07:47:42 2009 New Revision: 69764 Log: Add links to helpful external resources. Modified: python/branches/release30-maint/Doc/library/functions.rst python/branches/release30-maint/Doc/library/math.rst Modified: python/branches/release30-maint/Doc/library/functions.rst ============================================================================== --- python/branches/release30-maint/Doc/library/functions.rst (original) +++ python/branches/release30-maint/Doc/library/functions.rst Thu Feb 19 07:47:42 2009 @@ -968,6 +968,9 @@ *reverse* is a boolean value. If set to ``True``, then the list elements are sorted as if each comparison were reversed. + To convert an old-style *cmp* function to a *key* function, see the + `CmpToKey recipe in the ASPN cookbook + `_\. .. function:: staticmethod(function) Modified: python/branches/release30-maint/Doc/library/math.rst ============================================================================== --- python/branches/release30-maint/Doc/library/math.rst (original) +++ python/branches/release30-maint/Doc/library/math.rst Thu Feb 19 07:47:42 2009 @@ -93,6 +93,10 @@ occasionally double-round an intermediate sum causing it to be off in its least significant bit. + For further discussion and two alternative approaches, see the `ASPN cookbook + recipes for accurate floating point summation + `_\. + .. function:: isinf(x) From python-checkins at python.org Thu Feb 19 07:55:03 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 07:55:03 +0100 (CET) Subject: [Python-checkins] r69765 - in python/trunk/Doc/library: functions.rst math.rst Message-ID: <20090219065503.B875C1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 07:55:03 2009 New Revision: 69765 Log: Add links to helpful external resources. Modified: python/trunk/Doc/library/functions.rst python/trunk/Doc/library/math.rst Modified: python/trunk/Doc/library/functions.rst ============================================================================== --- python/trunk/Doc/library/functions.rst (original) +++ python/trunk/Doc/library/functions.rst Thu Feb 19 07:55:03 2009 @@ -1104,10 +1104,12 @@ *reverse* is a boolean value. If set to ``True``, then the list elements are sorted as if each comparison were reversed. - In general, the *key* and *reverse* conversion processes are much faster than - specifying an equivalent *cmp* function. This is because *cmp* is called - multiple times for each list element while *key* and *reverse* touch each - element only once. + In general, the *key* and *reverse* conversion processes are much faster + than specifying an equivalent *cmp* function. This is because *cmp* is + called multiple times for each list element while *key* and *reverse* touch + each element only once. To convert an old-style *cmp* function to a *key* + function, see the `CmpToKey recipe in the ASPN cookbook + `_\. .. versionadded:: 2.4 Modified: python/trunk/Doc/library/math.rst ============================================================================== --- python/trunk/Doc/library/math.rst (original) +++ python/trunk/Doc/library/math.rst Thu Feb 19 07:55:03 2009 @@ -100,6 +100,10 @@ occasionally double-round an intermediate sum causing it to be off in its least significant bit. + For further discussion and two alternative approaches, see the `ASPN cookbook + recipes for accurate floating point summation + `_\. + .. versionadded:: 2.6 From python-checkins at python.org Thu Feb 19 07:57:24 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 07:57:24 +0100 (CET) Subject: [Python-checkins] r69766 - in python/branches/release26-maint/Doc/library: functions.rst math.rst Message-ID: <20090219065724.2B64E1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 07:57:23 2009 New Revision: 69766 Log: Add links to helpful external resources. Modified: python/branches/release26-maint/Doc/library/functions.rst python/branches/release26-maint/Doc/library/math.rst 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 Thu Feb 19 07:57:23 2009 @@ -1104,10 +1104,12 @@ *reverse* is a boolean value. If set to ``True``, then the list elements are sorted as if each comparison were reversed. - In general, the *key* and *reverse* conversion processes are much faster than - specifying an equivalent *cmp* function. This is because *cmp* is called - multiple times for each list element while *key* and *reverse* touch each - element only once. + In general, the *key* and *reverse* conversion processes are much faster + than specifying an equivalent *cmp* function. This is because *cmp* is + called multiple times for each list element while *key* and *reverse* touch + each element only once. To convert an old-style *cmp* function to a *key* + function, see the `CmpToKey recipe in the ASPN cookbook + `_\. .. versionadded:: 2.4 Modified: python/branches/release26-maint/Doc/library/math.rst ============================================================================== --- python/branches/release26-maint/Doc/library/math.rst (original) +++ python/branches/release26-maint/Doc/library/math.rst Thu Feb 19 07:57:23 2009 @@ -100,6 +100,10 @@ occasionally double-round an intermediate sum causing it to be off in its least significant bit. + For further discussion and two alternative approaches, see the `ASPN cookbook + recipes for accurate floating point summation + `_\. + .. versionadded:: 2.6 From python-checkins at python.org Thu Feb 19 08:12:22 2009 From: python-checkins at python.org (matthias.klose) Date: Thu, 19 Feb 2009 08:12:22 +0100 (CET) Subject: [Python-checkins] r69767 - in python/branches/release30-maint/Doc/tools/sphinxext: pyspecific.py suspicious.py Message-ID: <20090219071222.55F3E1E4002@bag.python.org> Author: matthias.klose Date: Thu Feb 19 08:12:22 2009 New Revision: 69767 Log: Taken from the 2.6 branch: r68984 | georg.brandl | 2009-01-27 00:06:17 +0100 (Di, 27. Jan 2009) | 2 lines Allow docs to be built with Sphinx 0.5.x. Modified: python/branches/release30-maint/Doc/tools/sphinxext/pyspecific.py python/branches/release30-maint/Doc/tools/sphinxext/suspicious.py Modified: python/branches/release30-maint/Doc/tools/sphinxext/pyspecific.py ============================================================================== --- python/branches/release30-maint/Doc/tools/sphinxext/pyspecific.py (original) +++ python/branches/release30-maint/Doc/tools/sphinxext/pyspecific.py Thu Feb 19 08:12:22 2009 @@ -54,8 +54,15 @@ from docutils.io import StringOutput from docutils.utils import new_document -from sphinx.builders import Builder -from sphinx.writers.text import TextWriter +try: + from sphinx.builders import Builder +except ImportError: + from sphinx.builder import Builder + +try: + from sphinx.writers.text import TextWriter +except ImportError: + from sphinx.textwriter import TextWriter class PydocTopicsBuilder(Builder): Modified: python/branches/release30-maint/Doc/tools/sphinxext/suspicious.py ============================================================================== --- python/branches/release30-maint/Doc/tools/sphinxext/suspicious.py (original) +++ python/branches/release30-maint/Doc/tools/sphinxext/suspicious.py Thu Feb 19 08:12:22 2009 @@ -45,7 +45,12 @@ import csv import re from docutils import nodes -from sphinx.builders import Builder + +try: + from sphinx.builders import Builder +except ImportError: + from sphinx.builder import Builder + detect_all = re.compile(ur''' ::(?=[^=])| # two :: (but NOT ::=) From buildbot at python.org Thu Feb 19 08:42:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 07:42:52 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090219074252.BEA411E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/661 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_poplib.py", line 131, in run asyncore.loop(timeout=0.1, count=1) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 204, in loop poll_fun(timeout, map) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 141, in poll read(obj) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 78, in read obj.handle_error() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 74, in read obj.handle_read_event() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 413, in handle_read_event self.handle_read() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_ssl.py", line 408, in handle_read self.send(data.lower()) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 519, in send self.initiate_send() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 506, in initiate_send num_sent = dispatcher.send(self, self.out_buffer[:512]) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 349, in send result = self.socket.send(data) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/socket.py", line 165, in _dummy raise error(EBADF, 'Bad file descriptor') error: [Errno 9] Bad file descriptor sincerely, -The Buildbot From python-checkins at python.org Thu Feb 19 08:51:54 2009 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 19 Feb 2009 08:51:54 +0100 (CET) Subject: [Python-checkins] r69768 - in python/branches/py3k: configure pyconfig.h.in Message-ID: <20090219075154.BBC781E4002@bag.python.org> Author: martin.v.loewis Date: Thu Feb 19 08:51:52 2009 New Revision: 69768 Log: Regenerate with autoconf 2.61. Modified: python/branches/py3k/configure python/branches/py3k/pyconfig.h.in Modified: python/branches/py3k/configure ============================================================================== --- python/branches/py3k/configure (original) +++ python/branches/py3k/configure Thu Feb 19 08:51:52 2009 @@ -1,12 +1,12 @@ #! /bin/sh -# From configure.in Revision: 68440 . +# From configure.in Revision: 68924 . # 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,153 +616,123 @@ # 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 -AR -RANLIB -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 +RANLIB +AR +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_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 -with_wide_unicode -with_computed_gotos -' ac_precious_vars='build_alias host_alias target_alias @@ -799,8 +747,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 @@ -899,21 +845,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 ;; @@ -926,21 +864,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- \ @@ -1131,38 +1061,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. @@ -1182,7 +1096,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; }; } ;; @@ -1191,16 +1105,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} ;; @@ -1209,38 +1123,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 @@ -1255,7 +1153,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 @@ -1271,10 +1169,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; }; } @@ -1282,12 +1180,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 @@ -1314,12 +1212,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=. @@ -1368,9 +1266,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 @@ -1380,25 +1278,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 @@ -1412,7 +1310,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] @@ -1480,17 +1377,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/ ;; @@ -1526,7 +1421,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 @@ -1536,10 +1431,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 @@ -1550,7 +1445,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 $@ @@ -1586,7 +1481,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 @@ -1621,7 +1516,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'" ;; @@ -1673,12 +1568,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 @@ -1708,9 +1602,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 @@ -1725,9 +1619,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 @@ -1743,8 +1637,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 && @@ -1786,24 +1680,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 @@ -1813,16 +1704,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 @@ -1836,38 +1727,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 @@ -1877,12 +1759,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 @@ -2019,20 +1899,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 @@ -2152,8 +2032,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` @@ -2316,8 +2196,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 @@ -2327,11 +2207,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 @@ -2343,8 +2223,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 @@ -2369,15 +2249,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 @@ -2390,10 +2270,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. @@ -2406,7 +2286,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 @@ -2417,11 +2297,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 @@ -2430,10 +2310,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. @@ -2446,7 +2326,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 @@ -2457,11 +2337,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 @@ -2469,8 +2349,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 @@ -2483,10 +2367,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. @@ -2499,7 +2383,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 @@ -2510,11 +2394,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 @@ -2523,10 +2407,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. @@ -2544,7 +2428,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 @@ -2567,11 +2451,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 @@ -2582,10 +2466,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. @@ -2598,7 +2482,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 @@ -2609,11 +2493,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 @@ -2626,10 +2510,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. @@ -2642,7 +2526,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 @@ -2653,11 +2537,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 @@ -2669,8 +2553,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 @@ -2680,50 +2568,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 @@ -2742,22 +2624,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 @@ -2768,11 +2655,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' @@ -2783,7 +2669,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 @@ -2810,27 +2696,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 @@ -2839,53 +2723,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 @@ -2894,33 +2774,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. */ @@ -2943,43 +2821,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. */ @@ -3005,21 +2880,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 @@ -3029,19 +2903,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 @@ -3068,21 +2938,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="" @@ -3107,21 +2976,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 @@ -3147,21 +3015,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 @@ -3176,8 +3043,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 @@ -3193,10 +3060,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 @@ -3267,21 +3134,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 @@ -3297,15 +3163,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 @@ -3318,8 +3184,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 @@ -3344,8 +3210,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" @@ -3353,10 +3219,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 [\\/]* | ?:[\\/]*) @@ -3371,7 +3237,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 @@ -3384,20 +3250,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 [\\/]* | ?:[\\/]*) @@ -3412,7 +3278,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 @@ -3425,11 +3291,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 ;; @@ -3445,10 +3311,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. @@ -3461,7 +3327,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 @@ -3472,11 +3338,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 @@ -3491,12 +3357,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. @@ -3511,15 +3377,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" @@ -3551,21 +3417,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. @@ -3589,14 +3454,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 @@ -3604,7 +3468,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. @@ -3629,8 +3493,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 @@ -3658,21 +3522,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. @@ -3696,14 +3559,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 @@ -3711,7 +3573,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. @@ -3727,13 +3589,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 @@ -3743,37 +3603,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` @@ -3788,60 +3653,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` @@ -3856,510 +3735,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://www.python.org/python-bugs ## -## ------------------------------------------------ ## -_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 +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 "$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 +else + ac_cv_path_EGREP=$EGREP fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + fi 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 +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" - cat >>confdefs.h <<\_ACEOF -#define _ALL_SOURCE 1 -_ACEOF - cat >>confdefs.h <<\_ACEOF -#define _GNU_SOURCE 1 -_ACEOF - cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 +{ 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* @@ -4372,8 +3804,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 @@ -4385,26 +3817,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 @@ -4437,14 +3869,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 @@ -4479,8 +3911,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)' @@ -4500,11 +3932,11 @@ 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; } -{ $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; @@ -4520,11 +3952,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" @@ -4546,32 +3978,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 @@ -4579,8 +4008,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") @@ -4589,8 +4018,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 @@ -4674,16 +4103,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. @@ -4696,7 +4125,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 @@ -4707,11 +4136,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 @@ -4720,10 +4149,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. @@ -4736,7 +4165,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 @@ -4747,11 +4176,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 @@ -4759,8 +4188,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 @@ -4774,10 +4207,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. @@ -4790,7 +4223,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 @@ -4801,11 +4234,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 @@ -4817,10 +4250,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. @@ -4833,7 +4266,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 @@ -4845,11 +4278,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 @@ -4885,8 +4318,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 @@ -4912,12 +4345,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 @@ -4946,29 +4378,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 @@ -4981,8 +4401,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. @@ -5004,8 +4424,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 @@ -5017,15 +4437,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 @@ -5103,8 +4523,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 @@ -5124,39 +4544,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" @@ -5195,8 +4612,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 @@ -5270,10 +4687,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" @@ -5294,32 +4711,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 @@ -5327,8 +4741,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 @@ -5341,10 +4755,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" @@ -5365,32 +4779,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 @@ -5398,8 +4809,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 @@ -5408,8 +4819,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 @@ -5435,14 +4846,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 @@ -5452,14 +4862,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 @@ -5472,10 +4882,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 @@ -5506,21 +4916,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 @@ -5528,14 +4936,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 @@ -5543,8 +4950,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 @@ -5556,10 +4963,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" @@ -5592,32 +4999,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 @@ -5625,8 +5029,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 @@ -5636,10 +5040,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" @@ -5672,32 +5076,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 @@ -5705,8 +5106,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 @@ -5716,10 +5117,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" @@ -5752,32 +5153,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 @@ -5785,8 +5183,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 @@ -5794,8 +5192,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" @@ -5825,17 +5223,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. */ @@ -5862,21 +5260,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 @@ -5968,40 +5365,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 @@ -6010,6 +5404,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 + + @@ -6077,21 +5540,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 @@ -6107,33 +5569,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 @@ -6147,52 +5608,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://www.python.org/python-bugs ## @@ -6201,24 +5661,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 @@ -6232,11 +5689,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. */ @@ -6262,21 +5719,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" @@ -6284,15 +5740,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 @@ -6301,10 +5754,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 @@ -6342,30 +5795,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 @@ -6380,8 +5829,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" @@ -6389,10 +5838,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 @@ -6430,30 +5879,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 @@ -6468,8 +5913,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" @@ -6478,10 +5923,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. */ @@ -6504,50 +5949,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 @@ -6563,33 +6004,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 @@ -6603,52 +6043,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://www.python.org/python-bugs ## @@ -6657,18 +6096,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 @@ -6680,17 +6119,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 @@ -6706,33 +6145,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 @@ -6746,52 +6184,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://www.python.org/python-bugs ## @@ -6800,18 +6237,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 @@ -6828,11 +6265,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. */ @@ -6854,21 +6291,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" @@ -6876,15 +6312,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 @@ -6896,11 +6329,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. */ @@ -6925,21 +6358,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" @@ -6947,15 +6379,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 @@ -6965,8 +6394,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 @@ -6990,12 +6419,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 @@ -7017,30 +6446,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 @@ -7069,30 +6494,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 @@ -7103,8 +6524,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 @@ -7121,8 +6542,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 @@ -7148,29 +6569,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 @@ -7198,46 +6618,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 @@ -7245,11 +6630,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; } @@ -7260,39 +6648,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 @@ -7302,46 +6681,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 @@ -7349,11 +6693,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; } @@ -7364,39 +6711,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 @@ -7406,46 +6744,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 @@ -7453,11 +6756,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; } @@ -7468,39 +6774,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 - : + 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=yes + ac_cv_type_pid_t=no 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 - -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 @@ -7510,10 +6807,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. */ @@ -7538,76 +6835,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 + +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; } + +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 @@ -7615,11 +6876,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; } @@ -7630,39 +6894,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 @@ -7672,10 +6927,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. */ @@ -7695,8 +6950,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 @@ -7710,24 +6965,26 @@ fi -{ $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; } @@ -7738,18 +6995,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 @@ -7757,11 +7041,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; } @@ -7772,57 +7059,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. @@ -7833,10 +7101,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 ; @@ -7849,14 +7118,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 @@ -7870,10 +7138,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 ; @@ -7886,21 +7155,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` @@ -7914,7 +7182,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 @@ -7924,10 +7192,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 ; @@ -7940,14 +7209,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 @@ -7961,10 +7229,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 ; @@ -7977,21 +7246,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` @@ -8005,7 +7273,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= @@ -8025,10 +7293,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 ; @@ -8041,21 +7310,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` @@ -8066,13 +7334,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 ;; @@ -8085,8 +7351,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 @@ -8096,22 +7363,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; ; @@ -8124,48 +7389,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; } @@ -8174,14 +7434,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. @@ -8192,10 +7506,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 ; @@ -8208,14 +7523,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 @@ -8229,10 +7543,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 ; @@ -8245,21 +7560,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` @@ -8273,7 +7587,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 @@ -8283,10 +7597,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 ; @@ -8299,14 +7614,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 @@ -8320,10 +7634,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 ; @@ -8336,21 +7651,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` @@ -8364,7 +7678,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= @@ -8384,10 +7698,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 ; @@ -8400,21 +7715,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` @@ -8425,13 +7739,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 ;; @@ -8444,8 +7756,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 @@ -8455,22 +7768,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; ; @@ -8483,48 +7794,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; } @@ -8533,14 +7839,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. @@ -8551,10 +7911,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 ; @@ -8567,14 +7928,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 @@ -8588,10 +7948,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 ; @@ -8604,21 +7965,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` @@ -8632,7 +7992,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 @@ -8642,10 +8002,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 ; @@ -8658,14 +8019,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 @@ -8679,10 +8039,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 ; @@ -8695,21 +8056,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` @@ -8723,7 +8083,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= @@ -8743,10 +8103,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 ; @@ -8759,21 +8120,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` @@ -8784,13 +8144,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 ;; @@ -8803,8 +8161,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 @@ -8814,22 +8173,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; ; @@ -8842,48 +8199,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; } @@ -8892,14 +8244,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. @@ -8910,10 +8316,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 ; @@ -8926,14 +8333,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 @@ -8947,10 +8353,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 ; @@ -8963,21 +8370,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` @@ -8991,7 +8397,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 @@ -9001,10 +8407,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 ; @@ -9017,14 +8424,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 @@ -9038,10 +8444,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 ; @@ -9054,21 +8461,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` @@ -9082,7 +8488,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= @@ -9102,10 +8508,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 ; @@ -9118,21 +8525,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` @@ -9143,13 +8549,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 ;; @@ -9162,8 +8566,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 @@ -9173,22 +8578,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; ; @@ -9201,48 +8604,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; } @@ -9251,14 +8649,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. @@ -9269,10 +8721,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 ; @@ -9285,14 +8738,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 @@ -9306,10 +8758,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 ; @@ -9322,21 +8775,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` @@ -9350,7 +8802,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 @@ -9360,10 +8812,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 ; @@ -9376,14 +8829,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 @@ -9397,10 +8849,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 ; @@ -9413,21 +8866,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` @@ -9441,7 +8893,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= @@ -9461,10 +8913,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 ; @@ -9477,21 +8930,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` @@ -9502,13 +8954,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 ;; @@ -9521,8 +8971,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 @@ -9532,22 +8983,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; ; @@ -9560,64 +9009,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. @@ -9628,10 +9126,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 ; @@ -9644,14 +9143,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 @@ -9665,10 +9163,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 ; @@ -9681,21 +9180,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` @@ -9709,7 +9207,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 @@ -9719,10 +9217,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 ; @@ -9735,14 +9234,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 @@ -9756,10 +9254,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 ; @@ -9772,21 +9271,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` @@ -9800,7 +9298,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= @@ -9820,10 +9318,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 ; @@ -9836,21 +9335,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` @@ -9861,13 +9359,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 ;; @@ -9880,8 +9376,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 @@ -9891,22 +9388,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; ; @@ -9919,48 +9414,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; } @@ -9969,14 +9459,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. @@ -9987,10 +9531,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 ; @@ -10003,14 +9548,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 @@ -10024,10 +9568,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 ; @@ -10040,21 +9585,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` @@ -10068,7 +9612,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 @@ -10078,10 +9622,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 ; @@ -10094,14 +9639,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 @@ -10115,10 +9659,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 ; @@ -10131,21 +9676,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` @@ -10159,7 +9703,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= @@ -10179,10 +9723,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 ; @@ -10195,21 +9740,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` @@ -10220,13 +9764,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 ;; @@ -10239,8 +9781,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 @@ -10250,22 +9793,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; ; @@ -10278,48 +9819,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; } @@ -10328,14 +9864,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. @@ -10346,10 +9936,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 ; @@ -10362,14 +9953,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 @@ -10383,10 +9973,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 ; @@ -10399,21 +9990,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` @@ -10427,7 +10017,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 @@ -10437,10 +10027,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 ; @@ -10453,14 +10044,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 @@ -10474,10 +10064,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 ; @@ -10490,21 +10081,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` @@ -10518,7 +10108,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= @@ -10538,10 +10128,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 ; @@ -10554,21 +10145,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` @@ -10579,13 +10169,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 ;; @@ -10598,8 +10186,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 @@ -10609,22 +10198,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; ; @@ -10637,48 +10224,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; } @@ -10687,14 +10269,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. @@ -10705,10 +10341,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 ; @@ -10721,14 +10358,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 @@ -10742,10 +10378,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 ; @@ -10758,21 +10395,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` @@ -10786,7 +10422,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 @@ -10796,10 +10432,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 ; @@ -10812,14 +10449,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 @@ -10833,10 +10469,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 ; @@ -10849,21 +10486,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` @@ -10877,7 +10513,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= @@ -10897,10 +10533,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 ; @@ -10913,21 +10550,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` @@ -10938,13 +10574,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 ;; @@ -10957,8 +10591,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 @@ -10968,22 +10603,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; ; @@ -10996,48 +10629,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; } @@ -11047,8 +10675,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. */ @@ -11071,14 +10699,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 @@ -11092,24 +10719,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. @@ -11120,10 +10801,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 ; @@ -11136,14 +10818,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 @@ -11157,10 +10838,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 ; @@ -11173,21 +10855,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` @@ -11201,7 +10882,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 @@ -11211,10 +10892,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 ; @@ -11227,14 +10909,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 @@ -11248,10 +10929,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 ; @@ -11264,21 +10946,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` @@ -11292,7 +10973,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= @@ -11312,10 +10993,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 ; @@ -11328,21 +11010,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` @@ -11353,13 +11034,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 ;; @@ -11372,8 +11051,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 @@ -11383,22 +11063,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; ; @@ -11411,48 +11089,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; } @@ -11463,8 +11136,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. */ @@ -11487,14 +11160,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 @@ -11508,24 +11180,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. @@ -11536,10 +11262,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 ; @@ -11552,14 +11279,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 @@ -11573,10 +11299,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 ; @@ -11589,21 +11316,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` @@ -11617,7 +11343,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 @@ -11627,10 +11353,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 ; @@ -11643,14 +11370,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 @@ -11664,10 +11390,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 ; @@ -11680,21 +11407,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` @@ -11708,7 +11434,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= @@ -11728,10 +11454,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 ; @@ -11744,21 +11471,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` @@ -11769,13 +11495,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 ;; @@ -11788,8 +11512,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 @@ -11799,22 +11524,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; ; @@ -11827,48 +11550,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; } @@ -11877,23 +11595,83 @@ _ACEOF -fi +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 + + +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 -{ $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 +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; } @@ -11904,45 +11682,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. @@ -11953,10 +11724,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 ; @@ -11969,14 +11741,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 @@ -11990,10 +11761,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 ; @@ -12006,21 +11778,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` @@ -12034,7 +11805,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 @@ -12044,10 +11815,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 ; @@ -12060,14 +11832,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 @@ -12081,10 +11852,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 ; @@ -12097,21 +11869,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` @@ -12125,7 +11896,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= @@ -12145,10 +11916,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 ; @@ -12161,21 +11933,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` @@ -12186,13 +11957,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 ;; @@ -12205,8 +11974,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 @@ -12216,22 +11986,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; ; @@ -12244,48 +12012,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; } @@ -12296,13 +12059,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 @@ -12312,11 +12074,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; } @@ -12327,33 +12092,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; } @@ -12364,52 +12151,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. @@ -12420,10 +12193,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 ; @@ -12436,14 +12210,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 @@ -12457,10 +12230,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 ; @@ -12473,21 +12247,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` @@ -12501,7 +12274,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 @@ -12511,10 +12284,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 ; @@ -12527,14 +12301,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 @@ -12548,10 +12321,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 ; @@ -12564,21 +12338,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` @@ -12592,7 +12365,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= @@ -12612,10 +12385,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 ; @@ -12628,21 +12402,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` @@ -12653,13 +12426,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 ;; @@ -12672,8 +12443,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 @@ -12683,22 +12455,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; ; @@ -12711,48 +12481,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; } @@ -12766,10 +12531,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 @@ -12796,32 +12561,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 @@ -12829,16 +12591,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 @@ -12847,18 +12609,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 @@ -12885,32 +12647,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 @@ -12918,8 +12677,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 @@ -12936,8 +12695,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. */ @@ -12960,35 +12719,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 @@ -13015,32 +12773,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 @@ -13048,8 +12803,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 @@ -13094,8 +12849,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" @@ -13106,15 +12861,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/*) @@ -13122,12 +12877,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 @@ -13139,8 +12894,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 @@ -13165,8 +12920,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 @@ -13177,8 +12932,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 @@ -13280,13 +13035,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 @@ -13321,12 +13076,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 @@ -13381,13 +13136,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 @@ -13399,8 +13154,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). @@ -13411,22 +13166,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" @@ -13458,37 +13213,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 @@ -13498,10 +13249,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" @@ -13533,37 +13284,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 @@ -13575,10 +13322,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 @@ -13616,30 +13363,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 @@ -13654,8 +13397,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" @@ -13667,10 +13410,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" @@ -13702,37 +13445,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 @@ -13743,8 +13482,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 @@ -13766,47 +13505,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" @@ -13838,44 +13573,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" @@ -13907,60 +13638,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 @@ -13968,14 +13695,14 @@ 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; } # 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 @@ -13986,8 +13713,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="" @@ -14001,22 +13728,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 @@ -14029,8 +13756,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 @@ -14049,8 +13776,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" @@ -14116,8 +13843,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 @@ -14139,25 +13866,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 @@ -14173,33 +13900,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 @@ -14213,52 +13939,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://www.python.org/python-bugs ## @@ -14267,18 +13992,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 @@ -14297,17 +14022,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 @@ -14323,33 +14048,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 @@ -14363,52 +14087,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://www.python.org/python-bugs ## @@ -14417,18 +14140,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 @@ -14445,13 +14168,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 @@ -14464,16 +14187,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 @@ -14498,24 +14221,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 @@ -14523,15 +14243,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. */ @@ -14584,36 +14304,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 @@ -14623,17 +14339,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 @@ -14649,33 +14365,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 @@ -14689,52 +14404,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://www.python.org/python-bugs ## @@ -14743,18 +14457,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 @@ -14767,10 +14481,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" @@ -14802,37 +14516,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 @@ -14842,10 +14552,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" @@ -14877,37 +14587,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 @@ -14917,10 +14623,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" @@ -14952,37 +14658,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 @@ -14992,10 +14694,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" @@ -15027,37 +14729,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 @@ -15084,7 +14782,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 @@ -15096,10 +14793,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" @@ -15131,37 +14828,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 @@ -15173,10 +14866,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" @@ -15208,37 +14901,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 @@ -15291,10 +14980,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 @@ -15324,32 +15013,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 @@ -15357,8 +15043,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 @@ -15369,11 +15055,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. */ @@ -15426,42 +15112,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*) @@ -15481,18 +15160,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 @@ -15503,8 +15182,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 @@ -15532,44 +15211,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 @@ -15593,27 +15269,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 @@ -15635,8 +15310,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 @@ -15792,8 +15467,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 @@ -15812,8 +15487,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 @@ -15835,14 +15510,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 @@ -15852,22 +15526,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 @@ -15886,12 +15560,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 @@ -15903,20 +15577,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 @@ -15935,12 +15609,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 @@ -15952,14 +15626,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 @@ -15972,11 +15646,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. */ @@ -16029,42 +15703,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 @@ -16074,8 +15741,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 @@ -16099,8 +15766,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 @@ -16113,16 +15780,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 @@ -16221,11 +15888,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=`$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. */ @@ -16278,42 +15945,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 @@ -16322,8 +15982,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 @@ -16345,14 +16005,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 @@ -16362,20 +16021,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 @@ -16397,14 +16056,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 @@ -16414,20 +16072,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 @@ -16449,14 +16107,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 @@ -16466,20 +16123,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 @@ -16501,14 +16158,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 @@ -16518,20 +16174,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 @@ -16553,14 +16209,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 @@ -16570,20 +16225,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 @@ -16605,14 +16260,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 @@ -16622,20 +16276,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 @@ -16657,14 +16311,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 @@ -16674,20 +16327,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 @@ -16712,14 +16365,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 @@ -16729,14 +16381,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 @@ -16747,8 +16399,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 @@ -16773,14 +16425,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 @@ -16790,21 +16441,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 @@ -16829,14 +16480,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 @@ -16846,21 +16496,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 @@ -16885,14 +16535,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 @@ -16902,14 +16551,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 @@ -16919,10 +16568,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. @@ -16935,7 +16584,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 @@ -16946,11 +16595,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 @@ -16959,10 +16608,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" @@ -16994,44 +16643,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" @@ -17063,37 +16708,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 @@ -17108,16 +16749,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. */ @@ -17142,55 +16781,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. */ @@ -17215,40 +16849,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 @@ -17263,10 +16894,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" @@ -17298,37 +16929,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 @@ -17344,8 +16971,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 @@ -17370,43 +16997,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 @@ -17434,43 +17057,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 @@ -17498,14 +17117,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 @@ -17515,22 +17133,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 @@ -17558,14 +17176,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 @@ -17575,14 +17192,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 @@ -17593,11 +17210,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. */ @@ -17650,49 +17267,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" @@ -17724,46 +17334,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" @@ -17795,37 +17401,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 @@ -17842,11 +17444,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. */ @@ -17899,49 +17501,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" @@ -17973,46 +17568,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" @@ -18044,37 +17635,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 @@ -18093,11 +17680,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. */ @@ -18150,42 +17737,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 @@ -18201,11 +17781,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. */ @@ -18258,42 +17838,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 @@ -18305,11 +17878,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. */ @@ -18362,42 +17935,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 @@ -18414,11 +17980,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. */ @@ -18471,42 +18037,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. */ @@ -18529,14 +18088,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 @@ -18548,7 +18106,7 @@ else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -18562,11 +18120,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. */ @@ -18619,42 +18177,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. */ @@ -18677,14 +18228,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 @@ -18696,7 +18246,7 @@ else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -18710,11 +18260,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. */ @@ -18767,42 +18317,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. */ @@ -18825,21 +18368,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 @@ -18856,8 +18398,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 @@ -18889,48 +18431,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 @@ -18959,29 +18497,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 @@ -19084,52 +18619,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 @@ -19149,11 +18680,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. */ @@ -19206,42 +18737,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 @@ -19249,10 +18773,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. */ @@ -19279,21 +18803,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 @@ -19301,8 +18824,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 @@ -19311,10 +18834,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. */ @@ -19330,7 +18853,7 @@ { struct tm tm; int *p = &tm.tm_sec; - return !p; + return !p; ; return 0; } @@ -19341,21 +18864,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 @@ -19363,8 +18885,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 @@ -19373,10 +18895,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. */ @@ -19404,21 +18926,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 @@ -19447,21 +18968,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 @@ -19472,9 +18992,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 @@ -19490,10 +19010,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. */ @@ -19520,21 +19040,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 @@ -19542,9 +19061,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 @@ -19560,10 +19079,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. */ @@ -19590,35 +19109,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 @@ -19628,10 +19143,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. */ @@ -19656,21 +19171,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 @@ -19696,21 +19210,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 @@ -19721,9 +19234,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 @@ -19732,10 +19245,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. */ @@ -19760,21 +19273,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 @@ -19800,21 +19312,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 @@ -19825,9 +19336,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 @@ -19836,10 +19347,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. */ @@ -19864,21 +19375,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 @@ -19904,21 +19414,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 @@ -19929,9 +19438,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 @@ -19940,10 +19449,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. */ @@ -19968,21 +19477,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 @@ -20008,21 +19516,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 @@ -20033,9 +19540,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 @@ -20044,10 +19551,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. */ @@ -20072,21 +19579,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 @@ -20112,21 +19618,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 @@ -20137,9 +19642,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 @@ -20148,10 +19653,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. */ @@ -20176,21 +19681,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 @@ -20216,21 +19720,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 @@ -20241,9 +19744,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 @@ -20265,10 +19768,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. */ @@ -20291,21 +19794,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 @@ -20314,8 +19816,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 @@ -20325,8 +19827,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 @@ -20352,14 +19854,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 @@ -20373,20 +19874,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. */ @@ -20410,21 +19911,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 @@ -20433,8 +19933,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 @@ -20443,10 +19943,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. */ @@ -20471,21 +19971,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 @@ -20494,8 +19993,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 @@ -20507,10 +20006,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. */ @@ -20535,21 +20034,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 @@ -20557,8 +20055,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 @@ -20566,10 +20064,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. */ @@ -20641,21 +20139,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 @@ -20663,20 +20160,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 @@ -20698,38 +20195,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 @@ -20751,38 +20247,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 @@ -20804,14 +20299,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 @@ -20825,19 +20319,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 @@ -20869,14 +20363,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 @@ -20890,19 +20383,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 @@ -20927,14 +20420,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 @@ -20944,22 +20436,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 @@ -20983,38 +20475,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 @@ -21042,21 +20533,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 @@ -21070,17 +20560,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. */ @@ -21133,43 +20623,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 @@ -21203,14 +20689,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 @@ -21225,18 +20710,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 @@ -21268,14 +20753,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 @@ -21290,18 +20774,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 @@ -21331,14 +20815,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 @@ -21353,16 +20836,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 @@ -21382,11 +20865,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. */ @@ -21439,42 +20922,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 @@ -21493,10 +20969,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. */ @@ -21549,43 +21025,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" @@ -21617,37 +21089,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 @@ -21661,8 +21129,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 @@ -21674,14 +21142,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 @@ -21691,53 +21159,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 @@ -21753,10 +21221,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. -{ $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; } if test "${ac_cv_x87_double_rounding+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then @@ -21795,40 +21263,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_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 fi -{ $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 @@ -21841,10 +21306,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 @@ -21875,40 +21340,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 @@ -21928,11 +21390,11 @@ for ac_func in acosh asinh atanh copysign expm1 finite hypot log1p 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. */ @@ -21985,51 +21447,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. */ @@ -22056,21 +21511,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 @@ -22078,9 +21532,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 @@ -22094,10 +21548,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. */ @@ -22124,21 +21578,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 @@ -22146,9 +21599,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 @@ -22162,10 +21615,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. */ @@ -22192,21 +21645,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 @@ -22214,9 +21666,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 @@ -22237,17 +21689,17 @@ # 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 @@ -22263,33 +21715,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 @@ -22303,52 +21754,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://www.python.org/python-bugs ## @@ -22357,18 +21807,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 @@ -22387,14 +21837,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. @@ -22406,10 +21911,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 ; @@ -22422,14 +21928,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 @@ -22444,10 +21949,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 ; @@ -22460,21 +21966,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` @@ -22488,7 +21993,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 @@ -22499,10 +22004,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 ; @@ -22515,14 +22021,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 @@ -22537,10 +22042,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 ; @@ -22553,21 +22059,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` @@ -22581,7 +22086,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= @@ -22602,10 +22107,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 ; @@ -22618,21 +22124,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` @@ -22643,13 +22148,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 ;; @@ -22663,8 +22166,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 @@ -22674,22 +22178,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; ; @@ -22702,48 +22204,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; } @@ -22754,8 +22251,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. */ @@ -22782,14 +22279,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 @@ -22803,24 +22299,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 @@ -22847,44 +22343,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 @@ -22934,195 +22427,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; @@ -23134,33 +22481,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; @@ -23172,21 +22519,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 @@ -23194,44 +22540,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; } @@ -23242,31 +22573,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 @@ -23285,14 +22615,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; @@ -23304,70 +22634,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 @@ -23392,40 +22715,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 @@ -23436,10 +22756,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 @@ -23468,36 +22788,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 @@ -23515,8 +22831,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" @@ -23552,30 +22868,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 @@ -23585,11 +22897,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 @@ -23598,10 +22910,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" @@ -23633,37 +22945,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 @@ -23686,21 +22994,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 @@ -23731,10 +23038,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" @@ -23766,37 +23073,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 @@ -23806,10 +23109,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" @@ -23841,37 +23144,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 @@ -23881,10 +23180,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" @@ -23916,37 +23215,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 @@ -23969,21 +23264,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 @@ -24016,10 +23310,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 @@ -24047,40 +23341,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 @@ -24090,8 +23381,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 @@ -24133,38 +23424,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 @@ -24177,10 +23465,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. */ @@ -24208,21 +23496,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 @@ -24251,21 +23538,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 @@ -24276,9 +23562,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 @@ -24294,10 +23580,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. */ @@ -24324,21 +23610,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 @@ -24346,9 +23631,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 @@ -24364,10 +23649,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. */ @@ -24394,35 +23679,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 @@ -24434,10 +23715,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 @@ -24520,40 +23801,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 @@ -24564,10 +23842,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. */ @@ -24593,21 +23871,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 @@ -24616,8 +23893,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 @@ -24628,10 +23905,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. */ @@ -24657,21 +23934,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 @@ -24680,8 +23956,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 @@ -24692,10 +23968,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. */ @@ -24721,21 +23997,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 @@ -24744,8 +24019,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 @@ -24756,10 +24031,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. */ @@ -24785,21 +24060,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 @@ -24808,8 +24082,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 @@ -24821,8 +24095,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 @@ -24844,14 +24118,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 @@ -24861,21 +24134,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 @@ -24897,14 +24170,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 @@ -24914,21 +24186,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 @@ -24950,14 +24222,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 @@ -24967,63 +24238,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. */ @@ -25072,92 +24341,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 @@ -25173,11 +24396,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; } @@ -25188,39 +24414,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 @@ -25231,8 +24448,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 @@ -25258,38 +24475,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 @@ -25300,8 +24514,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 @@ -25313,14 +24527,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 @@ -25334,15 +24548,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" @@ -25374,12 +24588,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 @@ -25412,12 +24625,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 @@ -25433,7 +24646,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" @@ -25445,14 +24658,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. @@ -25465,7 +24676,7 @@ SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -25475,7 +24686,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 @@ -25497,45 +24708,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. @@ -25551,6 +24734,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. @@ -25573,7 +24758,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 @@ -25586,10 +24771,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 && @@ -25611,7 +24803,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 @@ -25662,7 +24854,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 @@ -25690,6 +24882,7 @@ *) ECHO_N='-n';; esac + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -25702,22 +24895,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 @@ -25742,10 +24932,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 @@ -25768,7 +24958,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 @@ -25781,39 +24971,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 @@ -25824,24 +25004,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 @@ -25863,36 +25043,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; }; } ;; @@ -25911,32 +25085,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 @@ -25950,8 +25122,8 @@ "Makefile.pre") CONFIG_FILES="$CONFIG_FILES Makefile.pre" ;; "Modules/Setup.config") CONFIG_FILES="$CONFIG_FILES Modules/Setup.config" ;; - *) { { $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 @@ -25991,145 +25163,222 @@ (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 +RANLIB!$RANLIB$ac_delim +AR!$AR$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 +SHLIBS!$SHLIBS$ac_delim +USE_SIGNAL_MODULE!$USE_SIGNAL_MODULE$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 +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` = 19; 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 @@ -26145,133 +25394,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;; @@ -26300,38 +25435,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 @@ -26341,7 +25464,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 @@ -26367,7 +25490,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" @@ -26376,7 +25499,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 @@ -26397,17 +25520,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/ ;; @@ -26447,13 +25570,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 } @@ -26462,14 +25584,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 @@ -26483,16 +25604,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 @@ -26502,58 +25622,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" ;; @@ -26567,11 +25748,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. @@ -26593,10 +25769,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/pyconfig.h.in ============================================================================== --- python/branches/py3k/pyconfig.h.in (original) +++ python/branches/py3k/pyconfig.h.in Thu Feb 19 08:51:52 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 @@ -955,28 +952,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 @@ -1014,21 +989,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 @@ -1047,25 +1021,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 From buildbot at python.org Thu Feb 19 09:03:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 08:03:05 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090219080305.5541E1E4002@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/128 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: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Thu Feb 19 09:30:06 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 19 Feb 2009 09:30:06 +0100 (CET) Subject: [Python-checkins] r69769 - python/trunk/Doc/reference/expressions.rst Message-ID: <20090219083006.E2A6A1E401F@bag.python.org> Author: georg.brandl Date: Thu Feb 19 09:30:06 2009 New Revision: 69769 Log: #5310, #3558: fix operator precedence table. Modified: python/trunk/Doc/reference/expressions.rst Modified: python/trunk/Doc/reference/expressions.rst ============================================================================== --- python/trunk/Doc/reference/expressions.rst (original) +++ python/trunk/Doc/reference/expressions.rst Thu Feb 19 09:30:06 2009 @@ -816,14 +816,14 @@ .. _unary: -Unary arithmetic operations -=========================== +Unary arithmetic and bitwise operations +======================================= .. index:: triple: unary; arithmetic; operation triple: unary; bitwise; operation -All unary arithmetic (and bitwise) operations have the same priority: +All unary arithmetic and bitwise operations have the same priority: .. productionlist:: u_expr: `power` | "-" `u_expr` | "+" `u_expr` | "~" `u_expr` @@ -1276,12 +1276,9 @@ +-----------------------------------------------+-------------------------------------+ | :keyword:`not` *x* | Boolean NOT | +-----------------------------------------------+-------------------------------------+ -| :keyword:`in`, :keyword:`not` :keyword:`in` | Membership tests | -+-----------------------------------------------+-------------------------------------+ -| :keyword:`is`, :keyword:`is not` | Identity tests | -+-----------------------------------------------+-------------------------------------+ -| ``<``, ``<=``, ``>``, ``>=``, ``<>``, ``!=``, | Comparisons | -| ``==`` | | +| :keyword:`in`, :keyword:`not` :keyword:`in`, | Comparisons, including membership | +| :keyword:`is`, :keyword:`is not`, ``<``, | tests and identity tests, | +| ``<=``, ``>``, ``>=``, ``<>``, ``!=``, ``==`` | | +-----------------------------------------------+-------------------------------------+ | ``|`` | Bitwise OR | +-----------------------------------------------+-------------------------------------+ @@ -1293,29 +1290,19 @@ +-----------------------------------------------+-------------------------------------+ | ``+``, ``-`` | Addition and subtraction | +-----------------------------------------------+-------------------------------------+ -| ``*``, ``/``, ``%`` | Multiplication, division, remainder | -+-----------------------------------------------+-------------------------------------+ -| ``+x``, ``-x`` | Positive, negative | -+-----------------------------------------------+-------------------------------------+ -| ``~x`` | Bitwise not | -+-----------------------------------------------+-------------------------------------+ -| ``**`` | Exponentiation | +| ``*``, ``/``, ``//``, ``%`` | Multiplication, division, remainder | +-----------------------------------------------+-------------------------------------+ -| ``x[index]`` | Subscription | +| ``+x``, ``-x``, ``~x`` | Positive, negative, bitwise NOT | +-----------------------------------------------+-------------------------------------+ -| ``x[index:index]`` | Slicing | +| ``**`` | Exponentiation [#]_ | +-----------------------------------------------+-------------------------------------+ -| ``x(arguments...)`` | Call | +| ``x[index]``, ``x[index:index]``, | Subscription, slicing, | +| ``x(arguments...)``, ``x.attribute`` | call, attribute reference | +-----------------------------------------------+-------------------------------------+ -| ``x.attribute`` | Attribute reference | -+-----------------------------------------------+-------------------------------------+ -| ``(expressions...)`` | Binding or tuple display | -+-----------------------------------------------+-------------------------------------+ -| ``[expressions...]`` | List display | -+-----------------------------------------------+-------------------------------------+ -| ``{key:datum...}`` | Dictionary display | -+-----------------------------------------------+-------------------------------------+ -| ```expressions...``` | String conversion | +| ``(expressions...)``, | Binding or tuple display, | +| ``[expressions...]``, | list display, | +| ``{key:datum...}``, | dictionary display, | +| ```expressions...``` | string conversion | +-----------------------------------------------+-------------------------------------+ .. rubric:: Footnotes @@ -1358,3 +1345,6 @@ descriptors, you may notice seemingly unusual behaviour in certain uses of the :keyword:`is` operator, like those involving comparisons between instance methods, or constants. Check their documentation for more info. + +.. [#] The power operator ``**`` binds less tightly than an arithmetic or + bitwise unary operator on its right, that is, ``2**-1`` is ``0.5``. From nnorwitz at gmail.com Thu Feb 19 10:08:45 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 19 Feb 2009 04:08:45 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090219090845.GA23396@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663824 refs] From nnorwitz at gmail.com Thu Feb 19 10:15:50 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 19 Feb 2009 04:15:50 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (2) Message-ID: <20090219091550.GA25789@python.psfb.org> 329 tests OK. 2 tests failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 [17163 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 test_slice test_smtplib test test_smtplib produced unexpected output: ********************************************************************** error: uncaptured python exception, closing channel (:[Errno 9] Bad file descriptor [/tmp/python-test/local/lib/python2.7/asyncore.py|readwrite|101] [/tmp/python-test/local/lib/python2.7/asyncore.py|handle_write_event|427] [|getsockopt|1] [/tmp/python-test/local/lib/python2.7/socket.py|_dummy|165]) ********************************************************************** 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 329 tests OK. 2 tests failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663089 refs] From python-checkins at python.org Thu Feb 19 10:50:26 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 10:50:26 +0100 (CET) Subject: [Python-checkins] r69770 - python/trunk/Lib/test/test_random.py Message-ID: <20090219095026.359C21E402F@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 10:50:24 2009 New Revision: 69770 Log: Inline coefficients in gamma(). Add reflection formula. Add comments. Modified: python/trunk/Lib/test/test_random.py Modified: python/trunk/Lib/test/test_random.py ============================================================================== --- python/trunk/Lib/test/test_random.py (original) +++ python/trunk/Lib/test/test_random.py Thu Feb 19 10:50:24 2009 @@ -5,7 +5,7 @@ import time import pickle import warnings -from math import log, exp, sqrt, pi, fsum as msum +from math import log, exp, sqrt, pi, fsum, sin from test import test_support class TestBasicOps(unittest.TestCase): @@ -459,15 +459,23 @@ self.assert_(stop < x <= start) self.assertEqual((x+stop)%step, 0) -_gammacoeff = (0.9999999999995183, 676.5203681218835, -1259.139216722289, - 771.3234287757674, -176.6150291498386, 12.50734324009056, - -0.1385710331296526, 0.9934937113930748e-05, 0.1659470187408462e-06) - -def gamma(z, cof=_gammacoeff, g=7): - z -= 1.0 - s = msum([cof[0]] + [cof[i] / (z+i) for i in range(1,len(cof))]) - z += 0.5 - return (z+g)**z / exp(z+g) * sqrt(2.0*pi) * s +def gamma(z, sqrt2pi=(2.0*pi)**0.5): + # Reflection to right half of complex plane + if z < 0.5: + return pi / sin(pi*z) / gamma(1.0-z) + # Lanczos approximation with g=7 + az = z + (7.0 - 0.5) + return az ** (z-0.5) / exp(az) * sqrt2pi * fsum([ + 0.9999999999995183, + 676.5203681218835 / z, + -1259.139216722289 / (z+1.0), + 771.3234287757674 / (z+2.0), + -176.6150291498386 / (z+3.0), + 12.50734324009056 / (z+4.0), + -0.1385710331296526 / (z+5.0), + 0.9934937113930748e-05 / (z+6.0), + 0.1659470187408462e-06 / (z+7.0), + ]) class TestDistributions(unittest.TestCase): def test_zeroinputs(self): From python-checkins at python.org Thu Feb 19 10:53:19 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 19 Feb 2009 10:53:19 +0100 (CET) Subject: [Python-checkins] r69771 - python/branches/py3k/Lib/test/test_random.py Message-ID: <20090219095319.94E3F1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 19 10:53:18 2009 New Revision: 69771 Log: Inline coefficients in gamma(). Add reflection formula. Add comments. Modified: python/branches/py3k/Lib/test/test_random.py Modified: python/branches/py3k/Lib/test/test_random.py ============================================================================== --- python/branches/py3k/Lib/test/test_random.py (original) +++ python/branches/py3k/Lib/test/test_random.py Thu Feb 19 10:53:18 2009 @@ -5,7 +5,7 @@ import time import pickle import warnings -from math import log, exp, sqrt, pi, fsum as msum +from math import log, exp, sqrt, pi, fsum, sin from test import support class TestBasicOps(unittest.TestCase): @@ -383,15 +383,23 @@ self.assert_(stop < x <= start) self.assertEqual((x+stop)%step, 0) -_gammacoeff = (0.9999999999995183, 676.5203681218835, -1259.139216722289, - 771.3234287757674, -176.6150291498386, 12.50734324009056, - -0.1385710331296526, 0.9934937113930748e-05, 0.1659470187408462e-06) - -def gamma(z, cof=_gammacoeff, g=7): - z -= 1.0 - s = msum([cof[0]] + [cof[i] / (z+i) for i in range(1,len(cof))]) - z += 0.5 - return (z+g)**z / exp(z+g) * sqrt(2.0*pi) * s +def gamma(z, sqrt2pi=(2.0*pi)**0.5): + # Reflection to right half of complex plane + if z < 0.5: + return pi / sin(pi*z) / gamma(1.0-z) + # Lanczos approximation with g=7 + az = z + (7.0 - 0.5) + return az ** (z-0.5) / exp(az) * sqrt2pi * fsum([ + 0.9999999999995183, + 676.5203681218835 / z, + -1259.139216722289 / (z+1.0), + 771.3234287757674 / (z+2.0), + -176.6150291498386 / (z+3.0), + 12.50734324009056 / (z+4.0), + -0.1385710331296526 / (z+5.0), + 0.9934937113930748e-05 / (z+6.0), + 0.1659470187408462e-06 / (z+7.0), + ]) class TestDistributions(unittest.TestCase): def test_zeroinputs(self): From buildbot at python.org Thu Feb 19 11:16:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 10:16:17 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090219101617.E0DE11E4026@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/894 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,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Feb 19 11:26:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 10:26:20 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090219102621.8E0341E4002@bag.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/1885 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_urllib2 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Feb 19 12:05:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 11:05:54 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090219110555.304241E4002@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/319 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: 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.x.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From amauryfa at gmail.com Thu Feb 19 13:15:15 2009 From: amauryfa at gmail.com (Amaury Forgeot d'Arc) Date: Thu, 19 Feb 2009 13:15:15 +0100 Subject: [Python-checkins] r69771 - python/branches/py3k/Lib/test/test_random.py Message-ID: Hello, I'm just curious about your recent change: http://mail.python.org/pipermail/python-checkins/2009-February/079036.html > Author: raymond.hettinger > Date: Thu Feb 19 10:53:18 2009 > New Revision: 69771 > > Log: > Inline coefficients in gamma(). Add reflection formula. Add comments. > > Modified: > python/branches/py3k/Lib/test/test_random.py why are the coefficients slightly different from http://en.wikipedia.org/wiki/Lanczos_approximation#Simple_implementation (another python implementation)? Regards, -- Amaury Forgeot d'Arc From python-checkins at python.org Thu Feb 19 13:31:32 2009 From: python-checkins at python.org (vinay.sajip) Date: Thu, 19 Feb 2009 13:31:32 +0100 (CET) Subject: [Python-checkins] r69772 - in python/trunk: Lib/logging/__init__.py Misc/NEWS Message-ID: <20090219123132.851201E4002@bag.python.org> Author: vinay.sajip Date: Thu Feb 19 13:31:32 2009 New Revision: 69772 Log: #5287: Add exception handling around findCaller() call to help out IronPython. 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 Thu Feb 19 13:31:32 2009 @@ -1128,7 +1128,12 @@ all the handlers of this logger to handle the record. """ if _srcfile: - fn, lno, func = self.findCaller() + #IronPython doesn't track Python frames, so findCaller throws an + #exception. We trap it here so that IronPython can use logging. + try: + fn, lno, func = self.findCaller() + except ValueError: + fn, lno, func = "(unknown file)", 0, "(unknown function)" else: fn, lno, func = "(unknown file)", 0, "(unknown function)" if exc_info: Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Feb 19 13:31:32 2009 @@ -161,16 +161,18 @@ Library ------- +- Issue #5287: Add exception handling around findCaller() call to help out + IronPython. - Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0, The file was resized to wrong size. - Issue #5292: Fixed mmap crash on its boundary access m[len(m)]. -- Issue #2279: distutils.sdist.add_defaults now add files +- Issue #2279: distutils.sdist.add_defaults now add files from the package_data and the data_files metadata. -- Issue #5257: refactored all tests in distutils, so they use +- Issue #5257: refactored all tests in distutils, so they use support.TempdirManager, to avoid writing in the tests directory. - Issue #4524: distutils build_script command failed with --with-suffix=3. From python-checkins at python.org Thu Feb 19 13:36:11 2009 From: python-checkins at python.org (vinay.sajip) Date: Thu, 19 Feb 2009 13:36:11 +0100 (CET) Subject: [Python-checkins] r69773 - in python/branches/py3k: Lib/logging/__init__.py Misc/NEWS Message-ID: <20090219123611.815EF1E4002@bag.python.org> Author: vinay.sajip Date: Thu Feb 19 13:36:11 2009 New Revision: 69773 Log: #5287: Add exception handling around findCaller() call to help out IronPython. Modified: python/branches/py3k/Lib/logging/__init__.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/logging/__init__.py ============================================================================== --- python/branches/py3k/Lib/logging/__init__.py (original) +++ python/branches/py3k/Lib/logging/__init__.py Thu Feb 19 13:36:11 2009 @@ -1,4 +1,4 @@ -# Copyright 2001-2008 by Vinay Sajip. All Rights Reserved. +# Copyright 2001-2009 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, @@ -1127,7 +1127,12 @@ all the handlers of this logger to handle the record. """ if _srcfile: - fn, lno, func = self.findCaller() + #IronPython doesn't track Python frames, so findCaller throws an + #exception. We trap it here so that IronPython can use logging. + try: + fn, lno, func = self.findCaller() + except ValueError: + fn, lno, func = "(unknown file)", 0, "(unknown function)" else: fn, lno, func = "(unknown file)", 0, "(unknown function)" if exc_info: Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu Feb 19 13:36:11 2009 @@ -169,15 +169,18 @@ Library ------- +- Issue #5287: Add exception handling around findCaller() call to help out + IronPython. + - Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0, The file was resized to wrong size. - Issue #5292: Fixed mmap crash on its boundary access m[len(m)]. -- Issue #2279: distutils.sdist.add_defaults now add files +- Issue #2279: distutils.sdist.add_defaults now add files from the package_data and the data_files metadata. -- Issue #5257: refactored all tests in distutils, so they use +- Issue #5257: refactored all tests in distutils, so they use support.TempdirManager, to avoid writing in the tests directory. - Issue #4524: distutils build_script command failed with --with-suffix=3. @@ -227,13 +230,13 @@ - Issue #4285: Change sys.version_info to be a named tuple. Patch by Ross Light. -- Issue #1520877: Now distutils.sysconfig reads $AR from the +- Issue #1520877: Now distutils.sysconfig reads $AR from the environment/Makefile. Patch by Douglas Greiman. - Issue #1276768: The verbose option was not used in the code of distutils.file_util and distutils.dir_util. -- Issue #5132: Fixed trouble building extensions under Solaris with +- Issue #5132: Fixed trouble building extensions under Solaris with --enabled-shared activated. Initial patch by Dave Peterson. - Issue #1581476: Always use the Tcl global namespace when calling into Tcl. @@ -283,7 +286,7 @@ - Issue #4710: Extract directories properly in the zipfile module; allow adding directories to a zipfile. -- Issue #3807: _multiprocessing build fails when configure is passed +- Issue #3807: _multiprocessing build fails when configure is passed --without-threads argument. When this occurs, _multiprocessing will be disabled, and not compiled. From buildbot at python.org Thu Feb 19 13:59:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 12:59:23 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090219125923.D1B571E400C@bag.python.org> The Buildbot has detected a new failure of OS X x86 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/165 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: vinay.sajip BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Feb 19 14:10:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 13:10:53 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090219131053.AE6231E403B@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/390 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: vinay.sajip BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Feb 19 14:16:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 13:16:57 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090219131657.A778C1E4002@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/172 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: vinay.sajip BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu Feb 19 14:23:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 13:23:28 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090219132328.C656D1E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/663 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: vinay.sajip BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Thu Feb 19 14:28:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 13:28:30 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090219132830.53D111E4002@bag.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/296 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: vinay.sajip 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 Feb 19 15:53:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 19 Feb 2009 14:53:29 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090219145330.01AB21E4002@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/305 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: vinay.sajip BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Feb 19 17:34:51 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 19 Feb 2009 17:34:51 +0100 (CET) Subject: [Python-checkins] r69776 - python/trunk/Doc/reference/introduction.rst Message-ID: <20090219163451.979151E4002@bag.python.org> Author: georg.brandl Date: Thu Feb 19 17:34:51 2009 New Revision: 69776 Log: #5317: update IronPython URL. Modified: python/trunk/Doc/reference/introduction.rst Modified: python/trunk/Doc/reference/introduction.rst ============================================================================== --- python/trunk/Doc/reference/introduction.rst (original) +++ python/trunk/Doc/reference/introduction.rst Thu Feb 19 17:34:51 2009 @@ -65,8 +65,7 @@ An alternate Python for .NET. Unlike Python.NET, this is a complete Python implementation that generates IL, and compiles Python code directly to .NET assemblies. It was created by Jim Hugunin, the original creator of Jython. For - more information, see `the IronPython website - `_. + more information, see `the IronPython website `_. PyPy An implementation of Python written in Python; even the bytecode interpreter is From python-checkins at python.org Thu Feb 19 19:52:21 2009 From: python-checkins at python.org (jeroen.ruigrok) Date: Thu, 19 Feb 2009 19:52:21 +0100 (CET) Subject: [Python-checkins] r69777 - in python/trunk/Doc: howto/doanddont.rst howto/webservers.rst includes/sqlite3/adapter_datetime.py library/asyncore.rst library/cgi.rst library/configparser.rst library/cookielib.rst library/crypt.rst library/csv.rst library/difflib.rst library/doctest.rst library/fcntl.rst library/getopt.rst library/gl.rst library/imaplib.rst library/imputil.rst library/logging.rst library/modulefinder.rst library/pickle.rst library/poplib.rst library/signal.rst library/sqlite3.rst library/ssl.rst library/stat.rst library/sunaudio.rst library/termios.rst library/traceback.rst library/xmlrpclib.rst tutorial/interactive.rst tutorial/stdlib2.rst whatsnew/2.6.rst Message-ID: <20090219185221.C235C1E4053@bag.python.org> Author: jeroen.ruigrok Date: Thu Feb 19 19:52:21 2009 New Revision: 69777 Log: Since we recommend one module per import line, reflect this also in the documentation. Modified: python/trunk/Doc/howto/doanddont.rst python/trunk/Doc/howto/webservers.rst python/trunk/Doc/includes/sqlite3/adapter_datetime.py python/trunk/Doc/library/asyncore.rst python/trunk/Doc/library/cgi.rst python/trunk/Doc/library/configparser.rst python/trunk/Doc/library/cookielib.rst python/trunk/Doc/library/crypt.rst python/trunk/Doc/library/csv.rst python/trunk/Doc/library/difflib.rst python/trunk/Doc/library/doctest.rst python/trunk/Doc/library/fcntl.rst python/trunk/Doc/library/getopt.rst python/trunk/Doc/library/gl.rst python/trunk/Doc/library/imaplib.rst python/trunk/Doc/library/imputil.rst python/trunk/Doc/library/logging.rst python/trunk/Doc/library/modulefinder.rst python/trunk/Doc/library/pickle.rst python/trunk/Doc/library/poplib.rst python/trunk/Doc/library/signal.rst python/trunk/Doc/library/sqlite3.rst python/trunk/Doc/library/ssl.rst python/trunk/Doc/library/stat.rst python/trunk/Doc/library/sunaudio.rst python/trunk/Doc/library/termios.rst python/trunk/Doc/library/traceback.rst python/trunk/Doc/library/xmlrpclib.rst python/trunk/Doc/tutorial/interactive.rst python/trunk/Doc/tutorial/stdlib2.rst python/trunk/Doc/whatsnew/2.6.rst Modified: python/trunk/Doc/howto/doanddont.rst ============================================================================== --- python/trunk/Doc/howto/doanddont.rst (original) +++ python/trunk/Doc/howto/doanddont.rst Thu Feb 19 19:52:21 2009 @@ -267,7 +267,8 @@ :func:`max`/:func:`min`. Another highly useful function is :func:`reduce`. A classical use of :func:`reduce` is something like :: - import sys, operator + import operator + import sys nums = map(float, sys.argv[1:]) print reduce(operator.add, nums)/len(nums) Modified: python/trunk/Doc/howto/webservers.rst ============================================================================== --- python/trunk/Doc/howto/webservers.rst (original) +++ python/trunk/Doc/howto/webservers.rst Thu Feb 19 19:52:21 2009 @@ -99,7 +99,8 @@ # -*- coding: UTF-8 -*- # enable debugging - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() print "Content-Type: text/plain;charset=utf-8" print @@ -279,7 +280,9 @@ # -*- coding: UTF-8 -*- from cgi import escape - import sys, os + import os + import sys + from flup.server.fcgi import WSGIServer def app(environ, start_response): Modified: python/trunk/Doc/includes/sqlite3/adapter_datetime.py ============================================================================== --- python/trunk/Doc/includes/sqlite3/adapter_datetime.py (original) +++ python/trunk/Doc/includes/sqlite3/adapter_datetime.py Thu Feb 19 19:52:21 2009 @@ -1,5 +1,6 @@ +import datetime import sqlite3 -import datetime, time +import time def adapt_datetime(ts): return time.mktime(ts.timetuple()) Modified: python/trunk/Doc/library/asyncore.rst ============================================================================== --- python/trunk/Doc/library/asyncore.rst (original) +++ python/trunk/Doc/library/asyncore.rst Thu Feb 19 19:52:21 2009 @@ -246,7 +246,8 @@ Here is a very basic HTTP client that uses the :class:`dispatcher` class to implement its socket handling:: - import asyncore, socket + import asyncore + import socket class http_client(asyncore.dispatcher): Modified: python/trunk/Doc/library/cgi.rst ============================================================================== --- python/trunk/Doc/library/cgi.rst (original) +++ python/trunk/Doc/library/cgi.rst Thu Feb 19 19:52:21 2009 @@ -67,16 +67,20 @@ module defines all sorts of names for its own use or for backward compatibility that you don't want in your namespace. -When you write a new script, consider adding the line:: +When you write a new script, consider adding the following:: - import cgitb; cgitb.enable() + import cgitb + + cgitb.enable() This activates a special exception handler that will display detailed reports in the Web browser if any errors occur. If you'd rather not show the guts of your program to users of your script, you can have the reports saved to files -instead, with a line like this:: +instead, with something like this:: + + import cgitb - import cgitb; cgitb.enable(display=0, logdir="/tmp") + cgitb.enable(display=0, logdir="/tmp") It's very helpful to use this feature during script development. The reports produced by :mod:`cgitb` provide information that can save you a lot of time in Modified: python/trunk/Doc/library/configparser.rst ============================================================================== --- python/trunk/Doc/library/configparser.rst (original) +++ python/trunk/Doc/library/configparser.rst Thu Feb 19 19:52:21 2009 @@ -231,7 +231,8 @@ load the required file or files using :meth:`readfp` before calling :meth:`read` for any optional files:: - import ConfigParser, os + import ConfigParser + import os config = ConfigParser.ConfigParser() config.readfp(open('defaults.cfg')) Modified: python/trunk/Doc/library/cookielib.rst ============================================================================== --- python/trunk/Doc/library/cookielib.rst (original) +++ python/trunk/Doc/library/cookielib.rst Thu Feb 19 19:52:21 2009 @@ -747,7 +747,8 @@ The first example shows the most common usage of :mod:`cookielib`:: - import cookielib, urllib2 + import cookielib + import urllib2 cj = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) r = opener.open("http://example.com/") @@ -755,7 +756,9 @@ This example illustrates how to open a URL using your Netscape, Mozilla, or Lynx cookies (assumes Unix/Netscape convention for location of the cookies file):: - import os, cookielib, urllib2 + import cookielib + import os + import urllib2 cj = cookielib.MozillaCookieJar() cj.load(os.path.join(os.environ["HOME"], ".netscape/cookies.txt")) opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) Modified: python/trunk/Doc/library/crypt.rst ============================================================================== --- python/trunk/Doc/library/crypt.rst (original) +++ python/trunk/Doc/library/crypt.rst Thu Feb 19 19:52:21 2009 @@ -45,7 +45,9 @@ A simple example illustrating typical use:: - import crypt, getpass, pwd + import crypt + import getpass + import pwd def login(): username = raw_input('Python login:') Modified: python/trunk/Doc/library/csv.rst ============================================================================== --- python/trunk/Doc/library/csv.rst (original) +++ python/trunk/Doc/library/csv.rst Thu Feb 19 19:52:21 2009 @@ -460,7 +460,8 @@ A slightly more advanced use of the reader --- catching and reporting errors:: - import csv, sys + import csv + import sys filename = "some.csv" reader = csv.reader(open(filename, "rb")) try: @@ -506,7 +507,9 @@ parameter in their constructor and make sure that the data passes the real reader or writer encoded as UTF-8:: - import csv, codecs, cStringIO + import codecs + import cStringIO + import csv class UTF8Recoder: """ Modified: python/trunk/Doc/library/difflib.rst ============================================================================== --- python/trunk/Doc/library/difflib.rst (original) +++ python/trunk/Doc/library/difflib.rst Thu Feb 19 19:52:21 2009 @@ -708,7 +708,11 @@ """ - import sys, os, time, difflib, optparse + import difflib + import os + import optparse + import sys + import time def main(): # Configure the option parser Modified: python/trunk/Doc/library/doctest.rst ============================================================================== --- python/trunk/Doc/library/doctest.rst (original) +++ python/trunk/Doc/library/doctest.rst Thu Feb 19 19:52:21 2009 @@ -951,9 +951,11 @@ test suites from modules and text files containing doctests. These test suites can then be run using :mod:`unittest` test runners:: - import unittest import doctest - import my_module_with_doctests, and_another + import unittest + + import my_module_with_doctests + import my_other_module_with_doctests suite = unittest.TestSuite() for mod in my_module_with_doctests, and_another: Modified: python/trunk/Doc/library/fcntl.rst ============================================================================== --- python/trunk/Doc/library/fcntl.rst (original) +++ python/trunk/Doc/library/fcntl.rst Thu Feb 19 19:52:21 2009 @@ -133,7 +133,9 @@ Examples (all on a SVR4 compliant system):: - import struct, fcntl, os + import fcntl + import os + import struct f = open(...) rv = fcntl.fcntl(f, fcntl.F_SETFL, os.O_NDELAY) Modified: python/trunk/Doc/library/getopt.rst ============================================================================== --- python/trunk/Doc/library/getopt.rst (original) +++ python/trunk/Doc/library/getopt.rst Thu Feb 19 19:52:21 2009 @@ -114,7 +114,8 @@ In a script, typical usage is something like this:: - import getopt, sys + import getopt + import sys def main(): try: Modified: python/trunk/Doc/library/gl.rst ============================================================================== --- python/trunk/Doc/library/gl.rst (original) +++ python/trunk/Doc/library/gl.rst Thu Feb 19 19:52:21 2009 @@ -124,7 +124,9 @@ Here is a tiny but complete example GL program in Python:: - import gl, GL, time + import gl + import GL + import time def main(): gl.foreground() Modified: python/trunk/Doc/library/imaplib.rst ============================================================================== --- python/trunk/Doc/library/imaplib.rst (original) +++ python/trunk/Doc/library/imaplib.rst Thu Feb 19 19:52:21 2009 @@ -521,7 +521,8 @@ Here is a minimal example (without error checking) that opens a mailbox and retrieves and prints all messages:: - import getpass, imaplib + import getpass + import imaplib M = imaplib.IMAP4() M.login(getpass.getuser(), getpass.getpass()) Modified: python/trunk/Doc/library/imputil.rst ============================================================================== --- python/trunk/Doc/library/imputil.rst (original) +++ python/trunk/Doc/library/imputil.rst Thu Feb 19 19:52:21 2009 @@ -112,7 +112,9 @@ :: - import sys, imp, __builtin__ + import __builtin__ + import imp + import sys # Replacement for __import__() def import_hook(name, globals=None, locals=None, fromlist=None): Modified: python/trunk/Doc/library/logging.rst ============================================================================== --- python/trunk/Doc/library/logging.rst (original) +++ python/trunk/Doc/library/logging.rst Thu Feb 19 19:52:21 2009 @@ -1347,7 +1347,8 @@ the receiving end. A simple way of doing this is attaching a :class:`SocketHandler` instance to the root logger at the sending end:: - import logging, logging.handlers + import logging + import logging.handlers rootLogger = logging.getLogger('') rootLogger.setLevel(logging.DEBUG) @@ -2600,7 +2601,9 @@ configuration:: #!/usr/bin/env python - import socket, sys, struct + import socket + import struct + import sys data_to_send = open(sys.argv[1], "r").read() Modified: python/trunk/Doc/library/modulefinder.rst ============================================================================== --- python/trunk/Doc/library/modulefinder.rst (original) +++ python/trunk/Doc/library/modulefinder.rst Thu Feb 19 19:52:21 2009 @@ -64,7 +64,8 @@ The script that is going to get analyzed later on (bacon.py):: - import re, itertools + import itertools + import re try: import baconhameggs Modified: python/trunk/Doc/library/pickle.rst ============================================================================== --- python/trunk/Doc/library/pickle.rst (original) +++ python/trunk/Doc/library/pickle.rst Thu Feb 19 19:52:21 2009 @@ -708,7 +708,8 @@ pickle-containing file, you should open the file in binary mode because you can't be sure if the ASCII or binary format was used. :: - import pprint, pickle + import pickle + import pprint pkl_file = open('data.pkl', 'rb') Modified: python/trunk/Doc/library/poplib.rst ============================================================================== --- python/trunk/Doc/library/poplib.rst (original) +++ python/trunk/Doc/library/poplib.rst Thu Feb 19 19:52:21 2009 @@ -182,7 +182,8 @@ Here is a minimal example (without error checking) that opens a mailbox and retrieves and prints all messages:: - import getpass, poplib + import getpass + import poplib M = poplib.POP3('localhost') M.user(getpass.getuser()) Modified: python/trunk/Doc/library/signal.rst ============================================================================== --- python/trunk/Doc/library/signal.rst (original) +++ python/trunk/Doc/library/signal.rst Thu Feb 19 19:52:21 2009 @@ -228,7 +228,8 @@ before opening the file; if the operation takes too long, the alarm signal will be sent, and the handler raises an exception. :: - import signal, os + import os + import signal def handler(signum, frame): print 'Signal handler called with signal', signum Modified: python/trunk/Doc/library/sqlite3.rst ============================================================================== --- python/trunk/Doc/library/sqlite3.rst (original) +++ python/trunk/Doc/library/sqlite3.rst Thu Feb 19 19:52:21 2009 @@ -423,7 +423,8 @@ Example:: # Convert file existing_db.db to SQL dump file dump.sql - import sqlite3, os + import os + import sqlite3 con = sqlite3.connect('existing_db.db') with open('dump.sql', 'w') as f: Modified: python/trunk/Doc/library/ssl.rst ============================================================================== --- python/trunk/Doc/library/ssl.rst (original) +++ python/trunk/Doc/library/ssl.rst Thu Feb 19 19:52:21 2009 @@ -481,7 +481,9 @@ This example connects to an SSL server, prints the server's address and certificate, sends some bytes, and reads part of the response:: - import socket, ssl, pprint + import pprint + import socket + import ssl s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) @@ -535,7 +537,8 @@ You'd open a socket, bind it to a port, call :meth:`listen` on it, then start waiting for clients to connect:: - import socket, ssl + import socket + import ssl bindsocket = socket.socket() bindsocket.bind(('myaddr.mydomain.com', 10023)) Modified: python/trunk/Doc/library/stat.rst ============================================================================== --- python/trunk/Doc/library/stat.rst (original) +++ python/trunk/Doc/library/stat.rst Thu Feb 19 19:52:21 2009 @@ -139,7 +139,8 @@ Example:: - import os, sys + import os + import sys from stat import * def walktree(top, callback): Modified: python/trunk/Doc/library/sunaudio.rst ============================================================================== --- python/trunk/Doc/library/sunaudio.rst (original) +++ python/trunk/Doc/library/sunaudio.rst Thu Feb 19 19:52:21 2009 @@ -135,11 +135,13 @@ The audio device supports asynchronous notification of various events, through the SIGPOLL signal. Here's an example of how you might enable this in Python:: + import fcntl + import signal + import STROPTS + def handle_sigpoll(signum, frame): print 'I got a SIGPOLL update' - import fcntl, signal, STROPTS - signal.signal(signal.SIGPOLL, handle_sigpoll) fcntl.ioctl(audio_obj.fileno(), STROPTS.I_SETSIG, STROPTS.S_MSG) Modified: python/trunk/Doc/library/termios.rst ============================================================================== --- python/trunk/Doc/library/termios.rst (original) +++ python/trunk/Doc/library/termios.rst Thu Feb 19 19:52:21 2009 @@ -91,7 +91,8 @@ exactly no matter what happens:: def getpass(prompt = "Password: "): - import termios, sys + import sys + import termios fd = sys.stdin.fileno() old = termios.tcgetattr(fd) new = termios.tcgetattr(fd) Modified: python/trunk/Doc/library/traceback.rst ============================================================================== --- python/trunk/Doc/library/traceback.rst (original) +++ python/trunk/Doc/library/traceback.rst Thu Feb 19 19:52:21 2009 @@ -145,7 +145,8 @@ complete implementation of the interpreter loop, refer to the :mod:`code` module. :: - import sys, traceback + import sys + import traceback def run_user_code(envdir): source = raw_input(">>> ") @@ -165,7 +166,8 @@ The following example demonstrates the different ways to print and format the exception and traceback:: - import sys, traceback + import sys + import traceback def lumberjack(): bright_side_of_death() Modified: python/trunk/Doc/library/xmlrpclib.rst ============================================================================== --- python/trunk/Doc/library/xmlrpclib.rst (original) +++ python/trunk/Doc/library/xmlrpclib.rst Thu Feb 19 19:52:21 2009 @@ -551,7 +551,8 @@ :: - import xmlrpclib, httplib + import httplib + import xmlrpclib class ProxiedTransport(xmlrpclib.Transport): def set_proxy(self, proxy): Modified: python/trunk/Doc/tutorial/interactive.rst ============================================================================== --- python/trunk/Doc/tutorial/interactive.rst (original) +++ python/trunk/Doc/tutorial/interactive.rst Thu Feb 19 19:52:21 2009 @@ -99,7 +99,8 @@ enable it in the interpreter's interactive mode, add the following to your startup file: [#]_ :: - import rlcompleter, readline + import readline + import rlcompleter readline.parse_and_bind('tab: complete') This binds the :kbd:`Tab` key to the completion function, so hitting the Modified: python/trunk/Doc/tutorial/stdlib2.rst ============================================================================== --- python/trunk/Doc/tutorial/stdlib2.rst (original) +++ python/trunk/Doc/tutorial/stdlib2.rst Thu Feb 19 19:52:21 2009 @@ -170,7 +170,8 @@ The following code shows how the high level :mod:`threading` module can run tasks in background while the main program continues to run:: - import threading, zipfile + import threading + import zipfile class AsyncZip(threading.Thread): def __init__(self, infile, outfile): Modified: python/trunk/Doc/whatsnew/2.6.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.6.rst (original) +++ python/trunk/Doc/whatsnew/2.6.rst Thu Feb 19 19:52:21 2009 @@ -473,7 +473,8 @@ Finally, the :func:`closing(object)` function returns *object* so that it can be bound to a variable, and calls ``object.close`` at the end of the block. :: - import urllib, sys + import sys + import urllib from contextlib import closing with closing(urllib.urlopen('http://www.yahoo.com')) as f: From python-checkins at python.org Thu Feb 19 20:57:48 2009 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 19 Feb 2009 20:57:48 +0100 (CET) Subject: [Python-checkins] r69778 - tracker/instances/spambayes_integration/detectors/spambayes.py Message-ID: <20090219195748.5A4A21E404E@bag.python.org> Author: martin.v.loewis Date: Thu Feb 19 20:57:48 2009 New Revision: 69778 Log: Issue #237: Make spambayes settings optional. Modified: tracker/instances/spambayes_integration/detectors/spambayes.py Modified: tracker/instances/spambayes_integration/detectors/spambayes.py ============================================================================== --- tracker/instances/spambayes_integration/detectors/spambayes.py (original) +++ tracker/instances/spambayes_integration/detectors/spambayes.py Thu Feb 19 20:57:48 2009 @@ -38,8 +38,16 @@ return (content, tokens) def check_spambayes(db, content, tokens): - spambayes_uri = db.config.detectors['SPAMBAYES_URI'] - server = xmlrpclib.ServerProxy(spambayes_uri, verbose=False) + try: + spambayes_uri = db.config.detectors['SPAMBAYES_URI'] + except KeyError, e: + return (False, str(e)) + + try: + server = xmlrpclib.ServerProxy(spambayes_uri, verbose=False) + except IOError, e: + return (False, str(e)) + try: prob = server.score({'content':content}, tokens, {}) From python-checkins at python.org Thu Feb 19 21:01:13 2009 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 19 Feb 2009 21:01:13 +0100 (CET) Subject: [Python-checkins] r69779 - in tracker/instances/python-dev/html: home.html page.html Message-ID: <20090219200113.B02471E4041@bag.python.org> Author: martin.v.loewis Date: Thu Feb 19 21:01:13 2009 New Revision: 69779 Log: Issue #180: Add type to issue listings. Modified: tracker/instances/python-dev/html/home.html tracker/instances/python-dev/html/page.html Modified: tracker/instances/python-dev/html/home.html ============================================================================== --- tracker/instances/python-dev/html/home.html (original) +++ tracker/instances/python-dev/html/home.html Thu Feb 19 21:01:13 2009 @@ -6,5 +6,5 @@ --> Modified: tracker/instances/python-dev/html/page.html ============================================================================== --- tracker/instances/python-dev/html/page.html (original) +++ tracker/instances/python-dev/html/page.html Thu Feb 19 21:01:13 2009 @@ -21,7 +21,7 @@ tal:define=" kw_create python:request.user.hasPermission('Create', 'keyword'); columns string:id,activity,title,creator,status; -columns_showall string:id,activity,title,creator,assignee,status; +columns_showall string:id,activity,title,creator,assignee,status,type; status_notresolved string:-1,1,3; "> From python-checkins at python.org Thu Feb 19 21:03:12 2009 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 19 Feb 2009 21:03:12 +0100 (CET) Subject: [Python-checkins] r69780 - tracker/instances/python-dev/html/issue.search.html Message-ID: <20090219200312.2D5621E4002@bag.python.org> Author: martin.v.loewis Date: Thu Feb 19 21:03:11 2009 New Revision: 69780 Log: Issue #239: Add searching for stage. Modified: tracker/instances/python-dev/html/issue.search.html Modified: tracker/instances/python-dev/html/issue.search.html ============================================================================== --- tracker/instances/python-dev/html/issue.search.html (original) +++ tracker/instances/python-dev/html/issue.search.html Thu Feb 19 21:03:11 2009 @@ -57,6 +57,19 @@   + + Stage: + + + + + + +   + Creation Date: From amk at amk.ca Thu Feb 19 21:05:08 2009 From: amk at amk.ca (A.M. Kuchling) Date: Thu, 19 Feb 2009 15:05:08 -0500 Subject: [Python-checkins] r69777 - in python/trunk/Doc: howto/doanddont.rst howto/webservers.rst includes/sqlite3/adapter_datetime.py library/asyncore.rst library/cgi.rst library/configparser.rst library/cookielib.rst library/crypt.rst library/csv.rst library/difflib.rst library/doctest.rst library/fcntl.rst library/getopt.rst library/gl.rst library/imaplib.rst library/imputil.rst library/logging.rst library/modulefinder.rst library/pickle.rst library/poplib.rst library/signal.rst library/sqlite3.rst library/ssl.rst library/stat.rst library/sunaudio.rst library/termios.rst library/traceback.rst library/xmlrpclib.rst tutorial/interactive.rst tutorial/stdlib2.rst whatsnew/2.6.rst In-Reply-To: <20090219185221.C235C1E4053@bag.python.org> References: <20090219185221.C235C1E4053@bag.python.org> Message-ID: <20090219200508.GA13132@amk-desktop.matrixgroup.net> On Thu, Feb 19, 2009 at 07:52:21PM +0100, jeroen.ruigrok wrote: > Since we recommend one module per import line, reflect this also in the > documentation. I disagree with this change because it makes examples longer, but the extra length is not contributing anything interesting. For example, look at the example in the difflib docs: > Modified: python/trunk/Doc/library/difflib.rst > ============================================================================== > --- python/trunk/Doc/library/difflib.rst (original) > +++ python/trunk/Doc/library/difflib.rst Thu Feb 19 19:52:21 2009 > @@ -708,7 +708,11 @@ > > """ > > - import sys, os, time, difflib, optparse > + import difflib > + import os > + import optparse > + import sys > + import time > > def main(): > # Configure the option parser So instead of one line that handles all the boring import details, there are five, but the person reading the example doesn't care about those lines of code; the interesting stuff is below. In some cases, I've left out import statements for this reason. --amk From python-checkins at python.org Thu Feb 19 21:05:48 2009 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 19 Feb 2009 21:05:48 +0100 (CET) Subject: [Python-checkins] r69781 - tracker/instances/python-dev/html/issue.search.html Message-ID: <20090219200548.4C3011E4002@bag.python.org> Author: martin.v.loewis Date: Thu Feb 19 21:05:48 2009 New Revision: 69781 Log: Issue #240: Fix searching for "not closed". Modified: tracker/instances/python-dev/html/issue.search.html Modified: tracker/instances/python-dev/html/issue.search.html ============================================================================== --- tracker/instances/python-dev/html/issue.search.html (original) +++ tracker/instances/python-dev/html/issue.search.html Thu Feb 19 21:05:48 2009 @@ -232,8 +232,8 @@ Status: - + From guido at python.org Thu Feb 19 21:10:07 2009 From: guido at python.org (Guido van Rossum) Date: Thu, 19 Feb 2009 12:10:07 -0800 Subject: [Python-checkins] r69777 - in python/trunk/Doc: howto/doanddont.rst howto/webservers.rst includes/sqlite3/adapter_datetime.py library/asyncore.rst library/cgi.rst library/configparser.rst library/cookielib.rst library/crypt.rst library/csv.rst li Message-ID: Seconded. On Thu, Feb 19, 2009 at 12:05 PM, A.M. Kuchling wrote: > On Thu, Feb 19, 2009 at 07:52:21PM +0100, jeroen.ruigrok wrote: >> Since we recommend one module per import line, reflect this also in the >> documentation. > > I disagree with this change because it makes examples longer, > but the extra length is not contributing anything interesting. > For example, look at the example in the difflib docs: > >> Modified: python/trunk/Doc/library/difflib.rst >> ============================================================================== >> --- python/trunk/Doc/library/difflib.rst (original) >> +++ python/trunk/Doc/library/difflib.rst Thu Feb 19 19:52:21 2009 >> @@ -708,7 +708,11 @@ >> >> """ >> >> - import sys, os, time, difflib, optparse >> + import difflib >> + import os >> + import optparse >> + import sys >> + import time >> >> def main(): >> # Configure the option parser > > So instead of one line that handles all the boring import details, > there are five, but the person reading the example doesn't care about > those lines of code; the interesting stuff is below. In some cases, > I've left out import statements for this reason. > > --amk > _______________________________________________ > Python-checkins mailing list > Python-checkins at python.org > http://mail.python.org/mailman/listinfo/python-checkins > -- --Guido van Rossum (home page: http://www.python.org/~guido/) From python-checkins at python.org Thu Feb 19 21:11:31 2009 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 19 Feb 2009 21:11:31 +0100 (CET) Subject: [Python-checkins] r69782 - in tracker/instances/python-dev/html: issue.item.html style.css Message-ID: <20090219201131.771641E4002@bag.python.org> Author: martin.v.loewis Date: Thu Feb 19 21:11:31 2009 New Revision: 69782 Log: Issue #207: style dependencies by status. Modified: tracker/instances/python-dev/html/issue.item.html tracker/instances/python-dev/html/style.css Modified: tracker/instances/python-dev/html/issue.item.html ============================================================================== --- tracker/instances/python-dev/html/issue.item.html (original) +++ tracker/instances/python-dev/html/issue.item.html Thu Feb 19 21:11:31 2009 @@ -89,12 +89,12 @@ Dependencies: + tal:replace="structure python:db.issue.classhelp('id,title,status', filter='status=0,1', property='dependencies')" /> -
View: +
View:
Modified: tracker/instances/python-dev/html/style.css ============================================================================== --- tracker/instances/python-dev/html/style.css (original) +++ tracker/instances/python-dev/html/style.css Thu Feb 19 21:11:31 2009 @@ -465,3 +465,16 @@ font-size: 110%; color: red; } + + +.open { + +} + +.pending { + +} + +.closed { +text-decoration: line-through !important; +} From python-checkins at python.org Thu Feb 19 21:21:17 2009 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 19 Feb 2009 21:21:17 +0100 (CET) Subject: [Python-checkins] r69783 - tracker/instances/python-dev/html/query.edit.html Message-ID: <20090219202117.9346D1E4002@bag.python.org> Author: martin.v.loewis Date: Thu Feb 19 21:21:17 2009 New Revision: 69783 Log: Issue #202: Add an "Add" button to the query list to simplify creation of new named queries. Modified: tracker/instances/python-dev/html/query.edit.html Modified: tracker/instances/python-dev/html/query.edit.html ============================================================================== --- tracker/instances/python-dev/html/query.edit.html (original) +++ tracker/instances/python-dev/html/query.edit.html Thu Feb 19 21:21:17 2009 @@ -102,7 +102,13 @@ - + +
+ + + +New Query Name: +
From python-checkins at python.org Thu Feb 19 21:27:04 2009 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 19 Feb 2009 21:27:04 +0100 (CET) Subject: [Python-checkins] r69784 - in tracker/instances/python-dev/detectors: cia.py config.ini.template Message-ID: <20090219202704.BA8931E4002@bag.python.org> Author: martin.v.loewis Date: Thu Feb 19 21:27:04 2009 New Revision: 69784 Log: Issue #236: Disable cia.vc by default. Modified: tracker/instances/python-dev/detectors/cia.py tracker/instances/python-dev/detectors/config.ini.template Modified: tracker/instances/python-dev/detectors/cia.py ============================================================================== --- tracker/instances/python-dev/detectors/cia.py (original) +++ tracker/instances/python-dev/detectors/cia.py Thu Feb 19 21:27:04 2009 @@ -2,8 +2,6 @@ import xmlrpclib import cgi -server = "http://CIA.vc" - # CHANGE THESE WHEN INTEGRATING THIS INTO YOUR TRACKER!!!! parameters = { 'name':'Roundup Reactor for CIA', @@ -39,6 +37,12 @@ def sendcia(db, cl, nodeid, oldvalues): + try: + server = db.config.detectors["CIAVC_SERVER"] + if not server: + return + except KeyError: + return messages = set(cl.get(nodeid, 'messages')) if oldvalues: messages -= set(oldvalues.get('messages',())) Modified: tracker/instances/python-dev/detectors/config.ini.template ============================================================================== --- tracker/instances/python-dev/detectors/config.ini.template (original) +++ tracker/instances/python-dev/detectors/config.ini.template Thu Feb 19 21:27:04 2009 @@ -6,7 +6,7 @@ busybody_email= busybody at example.com # URI to XMLRPC server doing the actual spam check. -spambayes_uri = http://www.webfast.com:80/sbrpc +spambayes_uri = http://localhost/not_here # These must match the {ham,spam}_cutoff setting in the SpamBayes server # config. spambayes_ham_cutoff = 0.2 @@ -15,3 +15,5 @@ spambayes_may_view_spam = User,Coordinator,Developer spambayes_may_classify = Coordinator spambayes_may_report_misclassified = User,Coordinator,Developer + +ciavc_server = http://localhost/not_here From nnorwitz at gmail.com Thu Feb 19 22:08:54 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 19 Feb 2009 16:08:54 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090219210854.GA20842@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17142 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663827 refs] From nnorwitz at gmail.com Thu Feb 19 22:16:13 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 19 Feb 2009 16:16:13 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090219211613.GA23241@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 [17163 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663097 refs] From python-checkins at python.org Thu Feb 19 22:31:07 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 19 Feb 2009 22:31:07 +0100 (CET) Subject: [Python-checkins] r69785 - distutils/trunk/README.txt Message-ID: <20090219213107.19E5D1E400C@bag.python.org> Author: tarek.ziade Date: Thu Feb 19 22:31:06 2009 New Revision: 69785 Log: versions are enough Modified: distutils/trunk/README.txt Modified: distutils/trunk/README.txt ============================================================================== --- distutils/trunk/README.txt (original) +++ distutils/trunk/README.txt Thu Feb 19 22:31:06 2009 @@ -36,11 +36,11 @@ One distutils standalone release was made for each latest stable version of Python of since the 2.3.x series. -- distutils 2.3.7: XXX -- distutils 2.4.5: XXX -- distutils 2.5.4: XXX -- distutils 2.6.1: XXX -- distutils 3.0.1: XXX +- distutils 2.3.7 +- distutils 2.4.5 +- distutils 2.5.4 +- distutils 2.6.1 +- distutils 3.0.1 Development releases -------------------- From python-checkins at python.org Thu Feb 19 22:33:37 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 19 Feb 2009 22:33:37 +0100 (CET) Subject: [Python-checkins] r69786 - distutils/trunk/setup.py Message-ID: <20090219213337.209131E4002@bag.python.org> Author: tarek.ziade Date: Thu Feb 19 22:33:36 2009 New Revision: 69786 Log: PEP8-ified arguments Modified: distutils/trunk/setup.py Modified: distutils/trunk/setup.py ============================================================================== --- distutils/trunk/setup.py (original) +++ distutils/trunk/setup.py Thu Feb 19 22:33:36 2009 @@ -63,14 +63,13 @@ setup (name="distutils", version=version, - description = "Python Distribution Utilities", - author = "Greg Ward", - author_email = "gward at python.net", - maintainer = "Tarek Ziad?", - maintainer_email = "tarek at ziade.org", - url = "http://www.python.org/sigs/distutils-sig", - license = "Python", - long_description = description, - packages = ['distutils'], - ) + description="Python Distribution Utilities", + author="Greg Ward", + author_email="gward at python.net", + maintainer="Tarek Ziad?", + maintainer_email="tarek at ziade.org", + url="http://www.python.org/sigs/distutils-sig", + license="Python", + long_description=description, + packages=['distutils']) From python-checkins at python.org Thu Feb 19 22:34:41 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 19 Feb 2009 22:34:41 +0100 (CET) Subject: [Python-checkins] r69787 - distutils/tags/Distutils-2.6.1 Message-ID: <20090219213441.DBC401E4002@bag.python.org> Author: tarek.ziade Date: Thu Feb 19 22:34:41 2009 New Revision: 69787 Log: tag for Distutils 2.6.1 release Added: distutils/tags/Distutils-2.6.1/ - copied from r69786, /distutils/trunk/ From python-checkins at python.org Thu Feb 19 22:37:42 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 19 Feb 2009 22:37:42 +0100 (CET) Subject: [Python-checkins] r69788 - in distutils/tags/Distutils-2.6.1: EXTERNALS.txt setup.py Message-ID: <20090219213742.E87AD1E4002@bag.python.org> Author: tarek.ziade Date: Thu Feb 19 22:37:42 2009 New Revision: 69788 Log: tagged 2.6.1 Modified: distutils/tags/Distutils-2.6.1/ (props changed) distutils/tags/Distutils-2.6.1/EXTERNALS.txt distutils/tags/Distutils-2.6.1/setup.py Modified: distutils/tags/Distutils-2.6.1/EXTERNALS.txt ============================================================================== --- distutils/tags/Distutils-2.6.1/EXTERNALS.txt (original) +++ distutils/tags/Distutils-2.6.1/EXTERNALS.txt Thu Feb 19 22:37:42 2009 @@ -1 +1 @@ -distutils http://svn.python.org/projects/python/trunk/Lib/distutils/ +distutils http://svn.python.org/projects/python/tags/r261/Lib/distutils/ Modified: distutils/tags/Distutils-2.6.1/setup.py ============================================================================== --- distutils/tags/Distutils-2.6.1/setup.py (original) +++ distutils/tags/Distutils-2.6.1/setup.py Thu Feb 19 22:37:42 2009 @@ -8,7 +8,7 @@ from distutils.core import setup # to be removed for stable releases -TRUNK_VERSION = True +TRUNK_VERSION = False # the reStructuredText contained in # README.txt will be displayed in PyPI From python-checkins at python.org Thu Feb 19 22:48:10 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 19 Feb 2009 22:48:10 +0100 (CET) Subject: [Python-checkins] r69789 - distutils/tags/Distutils-2.5.4 Message-ID: <20090219214810.28CF61E4002@bag.python.org> Author: tarek.ziade Date: Thu Feb 19 22:48:09 2009 New Revision: 69789 Log: tag for Distutils 2.5.4 Added: distutils/tags/Distutils-2.5.4/ - copied from r69788, /distutils/trunk/ From python-checkins at python.org Thu Feb 19 23:02:01 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 19 Feb 2009 23:02:01 +0100 (CET) Subject: [Python-checkins] r69790 - in distutils/tags/Distutils-2.5.4: EXTERNALS.txt MANIFEST.in setup.py Message-ID: <20090219220201.5E1DF1E4002@bag.python.org> Author: tarek.ziade Date: Thu Feb 19 23:02:00 2009 New Revision: 69790 Log: tagged 2.5.4 Added: distutils/tags/Distutils-2.5.4/MANIFEST.in (contents, props changed) Modified: distutils/tags/Distutils-2.5.4/ (props changed) distutils/tags/Distutils-2.5.4/EXTERNALS.txt distutils/tags/Distutils-2.5.4/setup.py Modified: distutils/tags/Distutils-2.5.4/EXTERNALS.txt ============================================================================== --- distutils/tags/Distutils-2.5.4/EXTERNALS.txt (original) +++ distutils/tags/Distutils-2.5.4/EXTERNALS.txt Thu Feb 19 23:02:00 2009 @@ -1 +1 @@ -distutils http://svn.python.org/projects/python/trunk/Lib/distutils/ +distutils http://svn.python.org/projects/python/tags/r254/Lib/distutils Added: distutils/tags/Distutils-2.5.4/MANIFEST.in ============================================================================== --- (empty file) +++ distutils/tags/Distutils-2.5.4/MANIFEST.in Thu Feb 19 23:02:00 2009 @@ -0,0 +1,5 @@ +include README.txt +include setup.py +include setup.cfg +include distutils/README +recursive-include distutils *.py Modified: distutils/tags/Distutils-2.5.4/setup.py ============================================================================== --- distutils/tags/Distutils-2.5.4/setup.py (original) +++ distutils/tags/Distutils-2.5.4/setup.py Thu Feb 19 23:02:00 2009 @@ -8,7 +8,7 @@ from distutils.core import setup # to be removed for stable releases -TRUNK_VERSION = True +TRUNK_VERSION = False # the reStructuredText contained in # README.txt will be displayed in PyPI From python-checkins at python.org Thu Feb 19 23:19:25 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 19 Feb 2009 23:19:25 +0100 (CET) Subject: [Python-checkins] r69791 - distutils/tags/Distutils-2.4.5 Message-ID: <20090219221925.409E41E4002@bag.python.org> Author: tarek.ziade Date: Thu Feb 19 23:19:25 2009 New Revision: 69791 Log: tag for Distutils 2.4.5 Added: distutils/tags/Distutils-2.4.5/ - copied from r69790, /distutils/trunk/ From python-checkins at python.org Thu Feb 19 23:23:02 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 19 Feb 2009 23:23:02 +0100 (CET) Subject: [Python-checkins] r69792 - in distutils/tags/Distutils-2.4.5: EXTERNALS.txt setup.py Message-ID: <20090219222302.81BBA1E4002@bag.python.org> Author: tarek.ziade Date: Thu Feb 19 23:23:02 2009 New Revision: 69792 Log: tagged 2.4.5 Modified: distutils/tags/Distutils-2.4.5/ (props changed) distutils/tags/Distutils-2.4.5/EXTERNALS.txt distutils/tags/Distutils-2.4.5/setup.py Modified: distutils/tags/Distutils-2.4.5/EXTERNALS.txt ============================================================================== --- distutils/tags/Distutils-2.4.5/EXTERNALS.txt (original) +++ distutils/tags/Distutils-2.4.5/EXTERNALS.txt Thu Feb 19 23:23:02 2009 @@ -1 +1 @@ -distutils http://svn.python.org/projects/python/trunk/Lib/distutils/ +distutils http://svn.python.org/projects/python/tags/r245/Lib/distutils/ Modified: distutils/tags/Distutils-2.4.5/setup.py ============================================================================== --- distutils/tags/Distutils-2.4.5/setup.py (original) +++ distutils/tags/Distutils-2.4.5/setup.py Thu Feb 19 23:23:02 2009 @@ -8,7 +8,7 @@ from distutils.core import setup # to be removed for stable releases -TRUNK_VERSION = True +TRUNK_VERSION = False # the reStructuredText contained in # README.txt will be displayed in PyPI From python at rcn.com Thu Feb 19 23:33:40 2009 From: python at rcn.com (Raymond Hettinger) Date: Thu, 19 Feb 2009 14:33:40 -0800 Subject: [Python-checkins] r69777 - in python/trunk/Doc:howto/doanddont.rst howto/webservers.rstincludes/sqlite3/adapter_datetime.py library/asyncore.rstlibrary/cgi.rst library/configparser.rstlibrary/cookielib.rst library/crypt.rst library/csv.rst li References: Message-ID: Thirded :-) ----- Original Message ----- From: "Guido van Rossum" To: Cc: Sent: Thursday, February 19, 2009 12:10 PM Subject: Re: [Python-checkins] r69777 - in python/trunk/Doc:howto/doanddont.rst howto/webservers.rstincludes/sqlite3/adapter_datetime.py library/asyncore.rstlibrary/cgi.rst library/configparser.rstlibrary/cookielib.rst library/crypt.rst library/csv.rst li > Seconded. > > On Thu, Feb 19, 2009 at 12:05 PM, A.M. Kuchling wrote: >> On Thu, Feb 19, 2009 at 07:52:21PM +0100, jeroen.ruigrok wrote: >>> Since we recommend one module per import line, reflect this also in the >>> documentation. >> >> I disagree with this change because it makes examples longer, >> but the extra length is not contributing anything interesting. >> For example, look at the example in the difflib docs: From nnorwitz at gmail.com Thu Feb 19 23:37:01 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 19 Feb 2009 17:37:01 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090219223701.GA13078@python.psfb.org> 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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-9444 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 test_slice test_smtplib test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [677526 refs] From python-checkins at python.org Fri Feb 20 00:23:47 2009 From: python-checkins at python.org (amaury.forgeotdarc) Date: Fri, 20 Feb 2009 00:23:47 +0100 (CET) Subject: [Python-checkins] r69793 - in python/branches/py3k: Lib/test/test_os.py Modules/posixmodule.c Message-ID: <20090219232347.9B7BF1E4002@bag.python.org> Author: amaury.forgeotdarc Date: Fri Feb 20 00:23:47 2009 New Revision: 69793 Log: #5306: Fix compilation on Windows by properly merging change 69495. + fixed an obvious merge glitch in a windows-only test. Patch by Hirokazu Yamamoto. I added a _PyVerify_fd() call to os.device_encoding() (new in python 3.0) which also uses a raw file descriptor. Modified: python/branches/py3k/Lib/test/test_os.py python/branches/py3k/Modules/posixmodule.c 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 Fri Feb 20 00:23:47 2009 @@ -576,12 +576,12 @@ self.assertRaises(WindowsError, os.chdir, support.TESTFN) def test_mkdir(self): - f = open(test_support.TESTFN, "w") + f = open(support.TESTFN, "w") try: self.assertRaises(WindowsError, os.mkdir, support.TESTFN) finally: f.close() - os.unlink(test_support.TESTFN) + os.unlink(support.TESTFN) def test_utime(self): self.assertRaises(WindowsError, os.utime, support.TESTFN, None) Modified: python/branches/py3k/Modules/posixmodule.c ============================================================================== --- python/branches/py3k/Modules/posixmodule.c (original) +++ python/branches/py3k/Modules/posixmodule.c Fri Feb 20 00:23:47 2009 @@ -331,6 +331,109 @@ #endif #endif +#if defined _MSC_VER && _MSC_VER >= 1400 +/* Microsoft CRT in VS2005 and higher will verify that a filehandle is + * valid and throw an assertion if it isn't. + * Normally, an invalid fd is likely to be a C program error and therefore + * an assertion can be useful, but it does contradict the POSIX standard + * which for write(2) states: + * "Otherwise, -1 shall be returned and errno set to indicate the error." + * "[EBADF] The fildes argument is not a valid file descriptor open for + * writing." + * Furthermore, python allows the user to enter any old integer + * as a fd and should merely raise a python exception on error. + * The Microsoft CRT doesn't provide an official way to check for the + * validity of a file descriptor, but we can emulate its internal behaviour + * by using the exported __pinfo data member and knowledge of the + * internal structures involved. + * The structures below must be updated for each version of visual studio + * according to the file internal.h in the CRT source, until MS comes + * up with a less hacky way to do this. + * (all of this is to avoid globally modifying the CRT behaviour using + * _set_invalid_parameter_handler() and _CrtSetReportMode()) + */ +#if _MSC_VER >= 1500 /* VS 2008 */ +typedef struct { + intptr_t osfhnd; + char osfile; + char pipech; + int lockinitflag; + CRITICAL_SECTION lock; +#ifndef _SAFECRT_IMPL + char textmode : 7; + char unicode : 1; + char pipech2[2]; + __int64 startpos; + BOOL utf8translations; + char dbcsBuffer; + BOOL dbcsBufferUsed; +#endif /* _SAFECRT_IMPL */ + } ioinfo; +#elif _MSC_VER >= 1400 /* VS 2005 */ +typedef struct { + intptr_t osfhnd; + char osfile; + char pipech; + int lockinitflag; + CRITICAL_SECTION lock; +#ifndef _SAFECRT_IMPL + char textmode : 7; + char unicode : 1; + char pipech2[2]; + __int64 startpos; + BOOL utf8translations; +#endif /* _SAFECRT_IMPL */ + } ioinfo; +#endif + +extern __declspec(dllimport) ioinfo * __pioinfo[]; +#define IOINFO_L2E 5 +#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) +#define IOINFO_ARRAYS 64 +#define _NHANDLE_ (IOINFO_ARRAYS * IOINFO_ARRAY_ELTS) +#define FOPEN 0x01 +#define _NO_CONSOLE_FILENO (intptr_t)-2 + +/* This function emulates what the windows CRT does to validate file handles */ +int +_PyVerify_fd(int fd) +{ + const int i1 = fd >> IOINFO_L2E; + const int i2 = fd & ((1 << IOINFO_L2E) - 1); + + /* See that it isn't a special CLEAR fileno */ + if (fd != _NO_CONSOLE_FILENO) { + /* Microsoft CRT would check that 0<=fd<_nhandle but we can't do that. Instead + * we check pointer validity and other info + */ + if (0 <= i1 && i1 < IOINFO_ARRAYS && __pioinfo[i1] != NULL) { + /* finally, check that the file is open */ + if (__pioinfo[i1][i2].osfile & FOPEN) + return 1; + } + } + errno = EBADF; + return 0; +} + +/* the special case of checking dup2. The target fd must be in a sensible range */ +static int +_PyVerify_fd_dup2(int fd1, int fd2) +{ + if (!_PyVerify_fd(fd1)) + return 0; + if (fd2 == _NO_CONSOLE_FILENO) + return 0; + if ((unsigned)fd2 < _NHANDLE_) + return 1; + else + return 0; +} +#else +/* dummy version. _PyVerify_fd() is already defined in fileobject.h */ +#define _PyVerify_fd_dup2(A, B) (1) +#endif + /* Return a dictionary corresponding to the POSIX environment table */ #ifdef WITH_NEXT_FRAMEWORK /* On Darwin/MacOSX a shared library or framework has no access to @@ -606,6 +709,8 @@ fd = PyObject_AsFileDescriptor(fdobj); if (fd < 0) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS res = (*func)(fd); Py_END_ALLOW_THREADS @@ -4725,6 +4830,8 @@ int fd, res; if (!PyArg_ParseTuple(args, "i:close", &fd)) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS res = close(fd); Py_END_ALLOW_THREADS @@ -4747,7 +4854,8 @@ return NULL; Py_BEGIN_ALLOW_THREADS for (i = fd_from; i < fd_to; i++) - close(i); + if (_PyVerify_fd(i)) + close(i); Py_END_ALLOW_THREADS Py_RETURN_NONE; } @@ -4763,6 +4871,8 @@ int fd; if (!PyArg_ParseTuple(args, "i:dup", &fd)) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS fd = dup(fd); Py_END_ALLOW_THREADS @@ -4782,6 +4892,8 @@ int fd, fd2, res; if (!PyArg_ParseTuple(args, "ii:dup2", &fd, &fd2)) return NULL; + if (!_PyVerify_fd_dup2(fd, fd2)) + return posix_error(); Py_BEGIN_ALLOW_THREADS res = dup2(fd, fd2); Py_END_ALLOW_THREADS @@ -4826,6 +4938,8 @@ if (PyErr_Occurred()) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS #if defined(MS_WIN64) || defined(MS_WINDOWS) res = _lseeki64(fd, pos, how); @@ -4863,6 +4977,8 @@ buffer = PyBytes_FromStringAndSize((char *)NULL, size); if (buffer == NULL) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS n = read(fd, PyBytes_AS_STRING(buffer), size); Py_END_ALLOW_THREADS @@ -4889,6 +5005,8 @@ if (!PyArg_ParseTuple(args, "iy*:write", &fd, &pbuf)) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS size = write(fd, pbuf.buf, (size_t)pbuf.len); Py_END_ALLOW_THREADS @@ -4915,6 +5033,8 @@ /* on OpenVMS we must ensure that all bytes are written to the file */ fsync(fd); #endif + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS res = FSTAT(fd, &st); Py_END_ALLOW_THREADS @@ -4940,6 +5060,8 @@ int fd; if (!PyArg_ParseTuple(args, "i:isatty", &fd)) return NULL; + if (!_PyVerify_fd(fd)) + return PyBool_FromLong(0); return PyBool_FromLong(isatty(fd)); } @@ -6702,6 +6824,8 @@ int fd; if (!PyArg_ParseTuple(args, "i:device_encoding", &fd)) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); if (!isatty(fd)) { Py_INCREF(Py_None); return Py_None; From buildbot at python.org Fri Feb 20 01:17:27 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 20 Feb 2009 00:17:27 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090220001727.18FA01E4002@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/321 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: amaury.forgeotdarc BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_posix test_site ====================================================================== 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 benjamin at python.org Fri Feb 20 03:34:37 2009 From: benjamin at python.org (Benjamin Peterson) Date: Thu, 19 Feb 2009 20:34:37 -0600 Subject: [Python-checkins] r69777 - in python/trunk/Doc:howto/doanddont.rst howto/webservers.rstincludes/sqlite3/adapter_datetime.py library/asyncore.rstlibrary/cgi.rst library/configparser.rstlibrary/cookielib.rst library/crypt.rst library/csv.rst li In-Reply-To: References: Message-ID: <1afaf6160902191834o60d8193ei325a301ebd8394da@mail.gmail.com> Do we know that Jeron is subscribed to Python-checkins? On Thu, Feb 19, 2009 at 4:33 PM, Raymond Hettinger wrote: > Thirded :-) > > ----- Original Message ----- From: "Guido van Rossum" > To: > Cc: > Sent: Thursday, February 19, 2009 12:10 PM > Subject: Re: [Python-checkins] r69777 - in > python/trunk/Doc:howto/doanddont.rst > howto/webservers.rstincludes/sqlite3/adapter_datetime.py > library/asyncore.rstlibrary/cgi.rst > library/configparser.rstlibrary/cookielib.rst library/crypt.rst > library/csv.rst li > > >> Seconded. >> >> On Thu, Feb 19, 2009 at 12:05 PM, A.M. Kuchling wrote: >>> >>> On Thu, Feb 19, 2009 at 07:52:21PM +0100, jeroen.ruigrok wrote: >>>> >>>> Since we recommend one module per import line, reflect this also in the >>>> documentation. >>> >>> I disagree with this change because it makes examples longer, >>> but the extra length is not contributing anything interesting. >>> For example, look at the example in the difflib docs: > > _______________________________________________ > Python-checkins mailing list > Python-checkins at python.org > http://mail.python.org/mailman/listinfo/python-checkins > -- Regards, Benjamin From python-checkins at python.org Fri Feb 20 04:19:25 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 20 Feb 2009 04:19:25 +0100 (CET) Subject: [Python-checkins] r69794 - in python/branches/py3k/Lib: os.py test/test_subprocess.py Message-ID: <20090220031925.9FACA1E4047@bag.python.org> Author: benjamin.peterson Date: Fri Feb 20 04:19:25 2009 New Revision: 69794 Log: fix None errno #5312 Modified: python/branches/py3k/Lib/os.py python/branches/py3k/Lib/test/test_subprocess.py Modified: python/branches/py3k/Lib/os.py ============================================================================== --- python/branches/py3k/Lib/os.py (original) +++ python/branches/py3k/Lib/os.py Fri Feb 20 04:19:25 2009 @@ -372,8 +372,8 @@ saved_exc = e saved_tb = tb if saved_exc: - raise error(saved_exc).with_traceback(saved_tb) - raise error(last_exc).with_traceback(tb) + raise saved_exc.with_traceback(saved_tb) + raise last_exc.with_traceback(tb) # Change environ to automatically call putenv(), unsetenv if they exist. Modified: python/branches/py3k/Lib/test/test_subprocess.py ============================================================================== --- python/branches/py3k/Lib/test/test_subprocess.py (original) +++ python/branches/py3k/Lib/test/test_subprocess.py Fri Feb 20 04:19:25 2009 @@ -535,7 +535,7 @@ # Windows raises IOError except (IOError, OSError) as err: if err.errno != 2: # ignore "no such file" - pass # XXX see #5312 + raise # # POSIX tests From python-checkins at python.org Fri Feb 20 04:31:24 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 20 Feb 2009 04:31:24 +0100 (CET) Subject: [Python-checkins] r69795 - in python/trunk/Doc: howto/doanddont.rst howto/webservers.rst includes/sqlite3/adapter_datetime.py library/asyncore.rst library/cgi.rst library/configparser.rst library/cookielib.rst library/crypt.rst library/csv.rst library/difflib.rst library/doctest.rst library/fcntl.rst library/getopt.rst library/gl.rst library/imaplib.rst library/imputil.rst library/logging.rst library/modulefinder.rst library/pickle.rst library/poplib.rst library/signal.rst library/sqlite3.rst library/ssl.rst library/stat.rst library/sunaudio.rst library/termios.rst library/traceback.rst library/xmlrpclib.rst tutorial/interactive.rst tutorial/stdlib2.rst whatsnew/2.6.rst Message-ID: <20090220033124.05C6A1E4030@bag.python.org> Author: benjamin.peterson Date: Fri Feb 20 04:31:23 2009 New Revision: 69795 Log: revert r69777 since all the experts agree that extra import lines distract from the code Modified: python/trunk/Doc/howto/doanddont.rst python/trunk/Doc/howto/webservers.rst python/trunk/Doc/includes/sqlite3/adapter_datetime.py python/trunk/Doc/library/asyncore.rst python/trunk/Doc/library/cgi.rst python/trunk/Doc/library/configparser.rst python/trunk/Doc/library/cookielib.rst python/trunk/Doc/library/crypt.rst python/trunk/Doc/library/csv.rst python/trunk/Doc/library/difflib.rst python/trunk/Doc/library/doctest.rst python/trunk/Doc/library/fcntl.rst python/trunk/Doc/library/getopt.rst python/trunk/Doc/library/gl.rst python/trunk/Doc/library/imaplib.rst python/trunk/Doc/library/imputil.rst python/trunk/Doc/library/logging.rst python/trunk/Doc/library/modulefinder.rst python/trunk/Doc/library/pickle.rst python/trunk/Doc/library/poplib.rst python/trunk/Doc/library/signal.rst python/trunk/Doc/library/sqlite3.rst python/trunk/Doc/library/ssl.rst python/trunk/Doc/library/stat.rst python/trunk/Doc/library/sunaudio.rst python/trunk/Doc/library/termios.rst python/trunk/Doc/library/traceback.rst python/trunk/Doc/library/xmlrpclib.rst python/trunk/Doc/tutorial/interactive.rst python/trunk/Doc/tutorial/stdlib2.rst python/trunk/Doc/whatsnew/2.6.rst Modified: python/trunk/Doc/howto/doanddont.rst ============================================================================== --- python/trunk/Doc/howto/doanddont.rst (original) +++ python/trunk/Doc/howto/doanddont.rst Fri Feb 20 04:31:23 2009 @@ -267,8 +267,7 @@ :func:`max`/:func:`min`. Another highly useful function is :func:`reduce`. A classical use of :func:`reduce` is something like :: - import operator - import sys + import sys, operator nums = map(float, sys.argv[1:]) print reduce(operator.add, nums)/len(nums) Modified: python/trunk/Doc/howto/webservers.rst ============================================================================== --- python/trunk/Doc/howto/webservers.rst (original) +++ python/trunk/Doc/howto/webservers.rst Fri Feb 20 04:31:23 2009 @@ -99,8 +99,7 @@ # -*- coding: UTF-8 -*- # enable debugging - import cgitb - cgitb.enable() + import cgitb; cgitb.enable() print "Content-Type: text/plain;charset=utf-8" print @@ -280,9 +279,7 @@ # -*- coding: UTF-8 -*- from cgi import escape - import os - import sys - + import sys, os from flup.server.fcgi import WSGIServer def app(environ, start_response): Modified: python/trunk/Doc/includes/sqlite3/adapter_datetime.py ============================================================================== --- python/trunk/Doc/includes/sqlite3/adapter_datetime.py (original) +++ python/trunk/Doc/includes/sqlite3/adapter_datetime.py Fri Feb 20 04:31:23 2009 @@ -1,6 +1,5 @@ -import datetime import sqlite3 -import time +import datetime, time def adapt_datetime(ts): return time.mktime(ts.timetuple()) Modified: python/trunk/Doc/library/asyncore.rst ============================================================================== --- python/trunk/Doc/library/asyncore.rst (original) +++ python/trunk/Doc/library/asyncore.rst Fri Feb 20 04:31:23 2009 @@ -246,8 +246,7 @@ Here is a very basic HTTP client that uses the :class:`dispatcher` class to implement its socket handling:: - import asyncore - import socket + import asyncore, socket class http_client(asyncore.dispatcher): Modified: python/trunk/Doc/library/cgi.rst ============================================================================== --- python/trunk/Doc/library/cgi.rst (original) +++ python/trunk/Doc/library/cgi.rst Fri Feb 20 04:31:23 2009 @@ -67,20 +67,16 @@ module defines all sorts of names for its own use or for backward compatibility that you don't want in your namespace. -When you write a new script, consider adding the following:: +When you write a new script, consider adding the line:: - import cgitb - - cgitb.enable() + import cgitb; cgitb.enable() This activates a special exception handler that will display detailed reports in the Web browser if any errors occur. If you'd rather not show the guts of your program to users of your script, you can have the reports saved to files -instead, with something like this:: - - import cgitb +instead, with a line like this:: - cgitb.enable(display=0, logdir="/tmp") + import cgitb; cgitb.enable(display=0, logdir="/tmp") It's very helpful to use this feature during script development. The reports produced by :mod:`cgitb` provide information that can save you a lot of time in Modified: python/trunk/Doc/library/configparser.rst ============================================================================== --- python/trunk/Doc/library/configparser.rst (original) +++ python/trunk/Doc/library/configparser.rst Fri Feb 20 04:31:23 2009 @@ -231,8 +231,7 @@ load the required file or files using :meth:`readfp` before calling :meth:`read` for any optional files:: - import ConfigParser - import os + import ConfigParser, os config = ConfigParser.ConfigParser() config.readfp(open('defaults.cfg')) Modified: python/trunk/Doc/library/cookielib.rst ============================================================================== --- python/trunk/Doc/library/cookielib.rst (original) +++ python/trunk/Doc/library/cookielib.rst Fri Feb 20 04:31:23 2009 @@ -747,8 +747,7 @@ The first example shows the most common usage of :mod:`cookielib`:: - import cookielib - import urllib2 + import cookielib, urllib2 cj = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) r = opener.open("http://example.com/") @@ -756,9 +755,7 @@ This example illustrates how to open a URL using your Netscape, Mozilla, or Lynx cookies (assumes Unix/Netscape convention for location of the cookies file):: - import cookielib - import os - import urllib2 + import os, cookielib, urllib2 cj = cookielib.MozillaCookieJar() cj.load(os.path.join(os.environ["HOME"], ".netscape/cookies.txt")) opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) Modified: python/trunk/Doc/library/crypt.rst ============================================================================== --- python/trunk/Doc/library/crypt.rst (original) +++ python/trunk/Doc/library/crypt.rst Fri Feb 20 04:31:23 2009 @@ -45,9 +45,7 @@ A simple example illustrating typical use:: - import crypt - import getpass - import pwd + import crypt, getpass, pwd def login(): username = raw_input('Python login:') Modified: python/trunk/Doc/library/csv.rst ============================================================================== --- python/trunk/Doc/library/csv.rst (original) +++ python/trunk/Doc/library/csv.rst Fri Feb 20 04:31:23 2009 @@ -460,8 +460,7 @@ A slightly more advanced use of the reader --- catching and reporting errors:: - import csv - import sys + import csv, sys filename = "some.csv" reader = csv.reader(open(filename, "rb")) try: @@ -507,9 +506,7 @@ parameter in their constructor and make sure that the data passes the real reader or writer encoded as UTF-8:: - import codecs - import cStringIO - import csv + import csv, codecs, cStringIO class UTF8Recoder: """ Modified: python/trunk/Doc/library/difflib.rst ============================================================================== --- python/trunk/Doc/library/difflib.rst (original) +++ python/trunk/Doc/library/difflib.rst Fri Feb 20 04:31:23 2009 @@ -708,11 +708,7 @@ """ - import difflib - import os - import optparse - import sys - import time + import sys, os, time, difflib, optparse def main(): # Configure the option parser Modified: python/trunk/Doc/library/doctest.rst ============================================================================== --- python/trunk/Doc/library/doctest.rst (original) +++ python/trunk/Doc/library/doctest.rst Fri Feb 20 04:31:23 2009 @@ -951,11 +951,9 @@ test suites from modules and text files containing doctests. These test suites can then be run using :mod:`unittest` test runners:: - import doctest import unittest - - import my_module_with_doctests - import my_other_module_with_doctests + import doctest + import my_module_with_doctests, and_another suite = unittest.TestSuite() for mod in my_module_with_doctests, and_another: Modified: python/trunk/Doc/library/fcntl.rst ============================================================================== --- python/trunk/Doc/library/fcntl.rst (original) +++ python/trunk/Doc/library/fcntl.rst Fri Feb 20 04:31:23 2009 @@ -133,9 +133,7 @@ Examples (all on a SVR4 compliant system):: - import fcntl - import os - import struct + import struct, fcntl, os f = open(...) rv = fcntl.fcntl(f, fcntl.F_SETFL, os.O_NDELAY) Modified: python/trunk/Doc/library/getopt.rst ============================================================================== --- python/trunk/Doc/library/getopt.rst (original) +++ python/trunk/Doc/library/getopt.rst Fri Feb 20 04:31:23 2009 @@ -114,8 +114,7 @@ In a script, typical usage is something like this:: - import getopt - import sys + import getopt, sys def main(): try: Modified: python/trunk/Doc/library/gl.rst ============================================================================== --- python/trunk/Doc/library/gl.rst (original) +++ python/trunk/Doc/library/gl.rst Fri Feb 20 04:31:23 2009 @@ -124,9 +124,7 @@ Here is a tiny but complete example GL program in Python:: - import gl - import GL - import time + import gl, GL, time def main(): gl.foreground() Modified: python/trunk/Doc/library/imaplib.rst ============================================================================== --- python/trunk/Doc/library/imaplib.rst (original) +++ python/trunk/Doc/library/imaplib.rst Fri Feb 20 04:31:23 2009 @@ -521,8 +521,7 @@ Here is a minimal example (without error checking) that opens a mailbox and retrieves and prints all messages:: - import getpass - import imaplib + import getpass, imaplib M = imaplib.IMAP4() M.login(getpass.getuser(), getpass.getpass()) Modified: python/trunk/Doc/library/imputil.rst ============================================================================== --- python/trunk/Doc/library/imputil.rst (original) +++ python/trunk/Doc/library/imputil.rst Fri Feb 20 04:31:23 2009 @@ -112,9 +112,7 @@ :: - import __builtin__ - import imp - import sys + import sys, imp, __builtin__ # Replacement for __import__() def import_hook(name, globals=None, locals=None, fromlist=None): Modified: python/trunk/Doc/library/logging.rst ============================================================================== --- python/trunk/Doc/library/logging.rst (original) +++ python/trunk/Doc/library/logging.rst Fri Feb 20 04:31:23 2009 @@ -1347,8 +1347,7 @@ the receiving end. A simple way of doing this is attaching a :class:`SocketHandler` instance to the root logger at the sending end:: - import logging - import logging.handlers + import logging, logging.handlers rootLogger = logging.getLogger('') rootLogger.setLevel(logging.DEBUG) @@ -2601,9 +2600,7 @@ configuration:: #!/usr/bin/env python - import socket - import struct - import sys + import socket, sys, struct data_to_send = open(sys.argv[1], "r").read() Modified: python/trunk/Doc/library/modulefinder.rst ============================================================================== --- python/trunk/Doc/library/modulefinder.rst (original) +++ python/trunk/Doc/library/modulefinder.rst Fri Feb 20 04:31:23 2009 @@ -64,8 +64,7 @@ The script that is going to get analyzed later on (bacon.py):: - import itertools - import re + import re, itertools try: import baconhameggs Modified: python/trunk/Doc/library/pickle.rst ============================================================================== --- python/trunk/Doc/library/pickle.rst (original) +++ python/trunk/Doc/library/pickle.rst Fri Feb 20 04:31:23 2009 @@ -708,8 +708,7 @@ pickle-containing file, you should open the file in binary mode because you can't be sure if the ASCII or binary format was used. :: - import pickle - import pprint + import pprint, pickle pkl_file = open('data.pkl', 'rb') Modified: python/trunk/Doc/library/poplib.rst ============================================================================== --- python/trunk/Doc/library/poplib.rst (original) +++ python/trunk/Doc/library/poplib.rst Fri Feb 20 04:31:23 2009 @@ -182,8 +182,7 @@ Here is a minimal example (without error checking) that opens a mailbox and retrieves and prints all messages:: - import getpass - import poplib + import getpass, poplib M = poplib.POP3('localhost') M.user(getpass.getuser()) Modified: python/trunk/Doc/library/signal.rst ============================================================================== --- python/trunk/Doc/library/signal.rst (original) +++ python/trunk/Doc/library/signal.rst Fri Feb 20 04:31:23 2009 @@ -228,8 +228,7 @@ before opening the file; if the operation takes too long, the alarm signal will be sent, and the handler raises an exception. :: - import os - import signal + import signal, os def handler(signum, frame): print 'Signal handler called with signal', signum Modified: python/trunk/Doc/library/sqlite3.rst ============================================================================== --- python/trunk/Doc/library/sqlite3.rst (original) +++ python/trunk/Doc/library/sqlite3.rst Fri Feb 20 04:31:23 2009 @@ -423,8 +423,7 @@ Example:: # Convert file existing_db.db to SQL dump file dump.sql - import os - import sqlite3 + import sqlite3, os con = sqlite3.connect('existing_db.db') with open('dump.sql', 'w') as f: Modified: python/trunk/Doc/library/ssl.rst ============================================================================== --- python/trunk/Doc/library/ssl.rst (original) +++ python/trunk/Doc/library/ssl.rst Fri Feb 20 04:31:23 2009 @@ -481,9 +481,7 @@ This example connects to an SSL server, prints the server's address and certificate, sends some bytes, and reads part of the response:: - import pprint - import socket - import ssl + import socket, ssl, pprint s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) @@ -537,8 +535,7 @@ You'd open a socket, bind it to a port, call :meth:`listen` on it, then start waiting for clients to connect:: - import socket - import ssl + import socket, ssl bindsocket = socket.socket() bindsocket.bind(('myaddr.mydomain.com', 10023)) Modified: python/trunk/Doc/library/stat.rst ============================================================================== --- python/trunk/Doc/library/stat.rst (original) +++ python/trunk/Doc/library/stat.rst Fri Feb 20 04:31:23 2009 @@ -139,8 +139,7 @@ Example:: - import os - import sys + import os, sys from stat import * def walktree(top, callback): Modified: python/trunk/Doc/library/sunaudio.rst ============================================================================== --- python/trunk/Doc/library/sunaudio.rst (original) +++ python/trunk/Doc/library/sunaudio.rst Fri Feb 20 04:31:23 2009 @@ -135,13 +135,11 @@ The audio device supports asynchronous notification of various events, through the SIGPOLL signal. Here's an example of how you might enable this in Python:: - import fcntl - import signal - import STROPTS - def handle_sigpoll(signum, frame): print 'I got a SIGPOLL update' + import fcntl, signal, STROPTS + signal.signal(signal.SIGPOLL, handle_sigpoll) fcntl.ioctl(audio_obj.fileno(), STROPTS.I_SETSIG, STROPTS.S_MSG) Modified: python/trunk/Doc/library/termios.rst ============================================================================== --- python/trunk/Doc/library/termios.rst (original) +++ python/trunk/Doc/library/termios.rst Fri Feb 20 04:31:23 2009 @@ -91,8 +91,7 @@ exactly no matter what happens:: def getpass(prompt = "Password: "): - import sys - import termios + import termios, sys fd = sys.stdin.fileno() old = termios.tcgetattr(fd) new = termios.tcgetattr(fd) Modified: python/trunk/Doc/library/traceback.rst ============================================================================== --- python/trunk/Doc/library/traceback.rst (original) +++ python/trunk/Doc/library/traceback.rst Fri Feb 20 04:31:23 2009 @@ -145,8 +145,7 @@ complete implementation of the interpreter loop, refer to the :mod:`code` module. :: - import sys - import traceback + import sys, traceback def run_user_code(envdir): source = raw_input(">>> ") @@ -166,8 +165,7 @@ The following example demonstrates the different ways to print and format the exception and traceback:: - import sys - import traceback + import sys, traceback def lumberjack(): bright_side_of_death() Modified: python/trunk/Doc/library/xmlrpclib.rst ============================================================================== --- python/trunk/Doc/library/xmlrpclib.rst (original) +++ python/trunk/Doc/library/xmlrpclib.rst Fri Feb 20 04:31:23 2009 @@ -551,8 +551,7 @@ :: - import httplib - import xmlrpclib + import xmlrpclib, httplib class ProxiedTransport(xmlrpclib.Transport): def set_proxy(self, proxy): Modified: python/trunk/Doc/tutorial/interactive.rst ============================================================================== --- python/trunk/Doc/tutorial/interactive.rst (original) +++ python/trunk/Doc/tutorial/interactive.rst Fri Feb 20 04:31:23 2009 @@ -99,8 +99,7 @@ enable it in the interpreter's interactive mode, add the following to your startup file: [#]_ :: - import readline - import rlcompleter + import rlcompleter, readline readline.parse_and_bind('tab: complete') This binds the :kbd:`Tab` key to the completion function, so hitting the Modified: python/trunk/Doc/tutorial/stdlib2.rst ============================================================================== --- python/trunk/Doc/tutorial/stdlib2.rst (original) +++ python/trunk/Doc/tutorial/stdlib2.rst Fri Feb 20 04:31:23 2009 @@ -170,8 +170,7 @@ The following code shows how the high level :mod:`threading` module can run tasks in background while the main program continues to run:: - import threading - import zipfile + import threading, zipfile class AsyncZip(threading.Thread): def __init__(self, infile, outfile): Modified: python/trunk/Doc/whatsnew/2.6.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.6.rst (original) +++ python/trunk/Doc/whatsnew/2.6.rst Fri Feb 20 04:31:23 2009 @@ -473,8 +473,7 @@ Finally, the :func:`closing(object)` function returns *object* so that it can be bound to a variable, and calls ``object.close`` at the end of the block. :: - import sys - import urllib + import urllib, sys from contextlib import closing with closing(urllib.urlopen('http://www.yahoo.com')) as f: From python-checkins at python.org Fri Feb 20 04:32:23 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 20 Feb 2009 04:32:23 +0100 (CET) Subject: [Python-checkins] r69796 - in python/branches/release30-maint: Doc/library/base64.rst Doc/library/exceptions.rst Doc/library/functions.rst Doc/library/socketserver.rst Doc/reference/simple_stmts.rst Lib/os.py Lib/subprocess.py Lib/test/test_pep263.py Lib/test/test_subprocess.py Modules/_ctypes/_ctypes.c Objects/unicodeobject.c PCbuild/sqlite3.vcproj Message-ID: <20090220033223.E84A51E4020@bag.python.org> Author: benjamin.peterson Date: Fri Feb 20 04:32:23 2009 New Revision: 69796 Log: Merged revisions 69754,69794 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69754 | benjamin.peterson | 2009-02-18 22:22:03 -0600 (Wed, 18 Feb 2009) | 54 lines Merged revisions 69576,69579-69580,69589,69619-69620,69633,69703-69704,69728-69730 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69576 | georg.brandl | 2009-02-13 04:56:50 -0600 (Fri, 13 Feb 2009) | 1 line #1661108: note that urlsafe encoded string can contain "=". ........ r69579 | georg.brandl | 2009-02-13 05:06:59 -0600 (Fri, 13 Feb 2009) | 2 lines Fix warnings GCC emits where the argument of PyErr_Format is a single variable. ........ r69580 | georg.brandl | 2009-02-13 05:10:04 -0600 (Fri, 13 Feb 2009) | 2 lines Fix warnings GCC emits where the argument of PyErr_Format is a single variable. ........ r69589 | martin.v.loewis | 2009-02-13 14:11:34 -0600 (Fri, 13 Feb 2009) | 2 lines Move amd64 properties further to the top, so that they override the linker options correctly. ........ r69619 | benjamin.peterson | 2009-02-14 11:00:51 -0600 (Sat, 14 Feb 2009) | 1 line this needn't be a shebang line ........ r69620 | georg.brandl | 2009-02-14 11:01:36 -0600 (Sat, 14 Feb 2009) | 1 line #5179: don't leak PIPE fds when child execution fails. ........ r69633 | hirokazu.yamamoto | 2009-02-15 03:19:48 -0600 (Sun, 15 Feb 2009) | 1 line Fixed typo. ........ r69703 | raymond.hettinger | 2009-02-16 16:42:54 -0600 (Mon, 16 Feb 2009) | 3 lines Issue 5229: Documentation for super() neglects to say what super() actually does ........ r69704 | raymond.hettinger | 2009-02-16 17:00:25 -0600 (Mon, 16 Feb 2009) | 1 line Add explanation for super(type1, type2). ........ r69728 | georg.brandl | 2009-02-17 18:22:55 -0600 (Tue, 17 Feb 2009) | 2 lines #5297: fix example. ........ r69729 | georg.brandl | 2009-02-17 18:25:13 -0600 (Tue, 17 Feb 2009) | 2 lines #5296: sequence -> iterable. ........ r69730 | georg.brandl | 2009-02-17 18:31:36 -0600 (Tue, 17 Feb 2009) | 2 lines #5268: mention VMSError. ........ ................ r69794 | benjamin.peterson | 2009-02-19 21:19:25 -0600 (Thu, 19 Feb 2009) | 1 line fix None errno #5312 ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/library/base64.rst python/branches/release30-maint/Doc/library/exceptions.rst python/branches/release30-maint/Doc/library/functions.rst python/branches/release30-maint/Doc/library/socketserver.rst python/branches/release30-maint/Doc/reference/simple_stmts.rst python/branches/release30-maint/Lib/os.py python/branches/release30-maint/Lib/subprocess.py python/branches/release30-maint/Lib/test/test_pep263.py python/branches/release30-maint/Lib/test/test_subprocess.py python/branches/release30-maint/Modules/_ctypes/_ctypes.c python/branches/release30-maint/Objects/unicodeobject.c python/branches/release30-maint/PCbuild/sqlite3.vcproj Modified: python/branches/release30-maint/Doc/library/base64.rst ============================================================================== --- python/branches/release30-maint/Doc/library/base64.rst (original) +++ python/branches/release30-maint/Doc/library/base64.rst Fri Feb 20 04:32:23 2009 @@ -62,7 +62,8 @@ .. function:: urlsafe_b64encode(s) Encode string *s* using a URL-safe alphabet, which substitutes ``-`` instead of - ``+`` and ``_`` instead of ``/`` in the standard Base64 alphabet. + ``+`` and ``_`` instead of ``/`` in the standard Base64 alphabet. The result + can still contain ``=``. .. function:: urlsafe_b64decode(s) Modified: python/branches/release30-maint/Doc/library/exceptions.rst ============================================================================== --- python/branches/release30-maint/Doc/library/exceptions.rst (original) +++ python/branches/release30-maint/Doc/library/exceptions.rst Fri Feb 20 04:32:23 2009 @@ -348,6 +348,11 @@ more precise exception such as :exc:`IndexError`. +.. exception:: VMSError + + Only available on VMS. Raised when a VMS-specific error occurs. + + .. exception:: WindowsError Raised when a Windows-specific error occurs or when the error number does not Modified: python/branches/release30-maint/Doc/library/functions.rst ============================================================================== --- python/branches/release30-maint/Doc/library/functions.rst (original) +++ python/branches/release30-maint/Doc/library/functions.rst Fri Feb 20 04:32:23 2009 @@ -1039,16 +1039,19 @@ .. function:: super([type[, object-or-type]]) - Return a *super* object that acts as a proxy to superclasses of *type*. + Return a proxy object that delegates method calls to a parent class of + *type*. This is useful for accessing inherited methods that have been + overriden in a child class. The search order for parent classes is + determined by the ``__mro__`` attribute of the *type* and can change + whenever the parent classes are updated. If the second argument is omitted the super object returned is unbound. If the second argument is an object, ``isinstance(obj, type)`` must be true. If - the second argument is a type, ``issubclass(type2, type)`` must be true. - Calling :func:`super` without arguments is equivalent to ``super(this_class, - first_arg)``. + the second argument is a type, ``issubclass(type2, type)`` must be true (this + is useful for classmethods). - There are two typical use cases for :func:`super`. In a class hierarchy with - single inheritance, :func:`super` can be used to refer to parent classes without + There are two typical use cases for "super". In a class hierarchy with + single inheritance, "super" can be used to refer to parent classes without naming them explicitly, thus making the code more maintainable. This use closely parallels the use of "super" in other programming languages. Modified: python/branches/release30-maint/Doc/library/socketserver.rst ============================================================================== --- python/branches/release30-maint/Doc/library/socketserver.rst (original) +++ python/branches/release30-maint/Doc/library/socketserver.rst Fri Feb 20 04:32:23 2009 @@ -508,7 +508,7 @@ # Exit the server thread when the main thread terminates server_thread.setDaemon(True) server_thread.start() - print("Server loop running in thread:", server_thread.getName()) + print("Server loop running in thread:", server_thread.name) client(ip, port, b"Hello World 1") client(ip, port, b"Hello World 2") Modified: python/branches/release30-maint/Doc/reference/simple_stmts.rst ============================================================================== --- python/branches/release30-maint/Doc/reference/simple_stmts.rst (original) +++ python/branches/release30-maint/Doc/reference/simple_stmts.rst Fri Feb 20 04:32:23 2009 @@ -116,7 +116,12 @@ * If the target list is a single target: The object is assigned to that target. -* If the target list is a comma-separated list of targets: +* If the target list is a comma-separated list of targets: The object must be an + iterable with the same number of items as there are targets in the target list, + and the items are assigned, from left to right, to the corresponding targets. + (This rule is relaxed as of Python 1.5; in earlier versions, the object had to + be a tuple. Since strings are sequences, an assignment like ``a, b = "xy"`` is + now legal as long as the string has the right length.) * If the target list contains one target prefixed with an asterisk, called a "starred" target: The object must be a sequence with at least as many items @@ -152,9 +157,9 @@ be deallocated and its destructor (if it has one) to be called. * If the target is a target list enclosed in parentheses or in square brackets: - The object must be a sequence with the same number of items as there are targets - in the target list, and its items are assigned, from left to right, to the - corresponding targets. + The object must be an iterable with the same number of items as there are + targets in the target list, and its items are assigned, from left to right, + to the corresponding targets. .. index:: pair: attribute; assignment Modified: python/branches/release30-maint/Lib/os.py ============================================================================== --- python/branches/release30-maint/Lib/os.py (original) +++ python/branches/release30-maint/Lib/os.py Fri Feb 20 04:32:23 2009 @@ -372,8 +372,8 @@ saved_exc = e saved_tb = tb if saved_exc: - raise error(saved_exc).with_traceback(saved_tb) - raise error(last_exc).with_traceback(tb) + raise saved_exc.with_traceback(saved_tb) + raise last_exc.with_traceback(tb) # Change environ to automatically call putenv(), unsetenv if they exist. Modified: python/branches/release30-maint/Lib/subprocess.py ============================================================================== --- python/branches/release30-maint/Lib/subprocess.py (original) +++ python/branches/release30-maint/Lib/subprocess.py Fri Feb 20 04:32:23 2009 @@ -1094,6 +1094,9 @@ if data: os.waitpid(self.pid, 0) child_exception = pickle.loads(data) + for fd in (p2cwrite, c2pread, errread): + if fd is not None: + os.close(fd) raise child_exception Modified: python/branches/release30-maint/Lib/test/test_pep263.py ============================================================================== Binary files. No diff available. Modified: python/branches/release30-maint/Lib/test/test_subprocess.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_subprocess.py (original) +++ python/branches/release30-maint/Lib/test/test_subprocess.py Fri Feb 20 04:32:23 2009 @@ -487,6 +487,22 @@ p = subprocess.Popen([sys.executable, "-c", "pass"], bufsize=None) self.assertEqual(p.wait(), 0) + def test_leaking_fds_on_error(self): + # see bug #5179: Popen leaks file descriptors to PIPEs if + # the child fails to execute; this will eventually exhaust + # the maximum number of open fds. 1024 seems a very common + # value for that limit, but Windows has 2048, so we loop + # 1024 times (each call leaked two fds). + for i in range(1024): + try: + subprocess.Popen(['nonexisting_i_hope'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + # Windows raises IOError + except (IOError, OSError) as err: + if err.errno != 2: # ignore "no such file" + raise + # # POSIX tests # 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 Fri Feb 20 04:32:23 2009 @@ -566,13 +566,14 @@ #else address = (void *)ctypes_dlsym(handle, name); if (!address) { - PyErr_Format(PyExc_ValueError, #ifdef __CYGWIN__ /* dlerror() isn't very helpful on cygwin */ + PyErr_Format(PyExc_ValueError, "symbol '%s' not found (%s) ", - name, + name); +#else + PyErr_SetString(PyExc_ValueError, ctypes_dlerror()); #endif - ctypes_dlerror()); return NULL; } #endif @@ -3208,13 +3209,14 @@ #else address = (PPROC)ctypes_dlsym(handle, name); if (!address) { - PyErr_Format(PyExc_AttributeError, #ifdef __CYGWIN__ /* dlerror() isn't very helpful on cygwin */ + PyErr_Format(PyExc_AttributeError, "function '%s' not found (%s) ", - name, + name); +#else + PyErr_SetString(PyExc_AttributeError, ctypes_dlerror()); #endif - ctypes_dlerror()); return NULL; } #endif Modified: python/branches/release30-maint/Objects/unicodeobject.c ============================================================================== --- python/branches/release30-maint/Objects/unicodeobject.c (original) +++ python/branches/release30-maint/Objects/unicodeobject.c Fri Feb 20 04:32:23 2009 @@ -1591,7 +1591,7 @@ if (restuple == NULL) goto onError; if (!PyTuple_Check(restuple)) { - PyErr_Format(PyExc_TypeError, &argparse[4]); + PyErr_SetString(PyExc_TypeError, &argparse[4]); goto onError; } if (!PyArg_ParseTuple(restuple, argparse, &PyUnicode_Type, &repunicode, &newpos)) @@ -3665,7 +3665,7 @@ if (restuple == NULL) return NULL; if (!PyTuple_Check(restuple)) { - PyErr_Format(PyExc_TypeError, &argparse[4]); + PyErr_SetString(PyExc_TypeError, &argparse[4]); Py_DECREF(restuple); return NULL; } @@ -4929,7 +4929,7 @@ if (restuple == NULL) return NULL; if (!PyTuple_Check(restuple)) { - PyErr_Format(PyExc_TypeError, &argparse[4]); + PyErr_SetString(PyExc_TypeError, &argparse[4]); Py_DECREF(restuple); return NULL; } Modified: python/branches/release30-maint/PCbuild/sqlite3.vcproj ============================================================================== --- python/branches/release30-maint/PCbuild/sqlite3.vcproj (original) +++ python/branches/release30-maint/PCbuild/sqlite3.vcproj Fri Feb 20 04:32:23 2009 @@ -82,7 +82,7 @@ @@ -327,7 +327,7 @@ @@ -449,7 +449,7 @@ From python-checkins at python.org Fri Feb 20 04:40:57 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 20 Feb 2009 04:40:57 +0100 (CET) Subject: [Python-checkins] r69797 - python/branches/py3k Message-ID: <20090220034057.5FB931E400C@bag.python.org> Author: benjamin.peterson Date: Fri Feb 20 04:40:57 2009 New Revision: 69797 Log: Blocked revisions 69268,69516,69757,69761,69765,69770,69772,69777,69795 via svnmerge ........ r69268 | kristjan.jonsson | 2009-02-04 04:05:25 -0600 (Wed, 04 Feb 2009) | 1 line issue 4804: Provide checks for the format string of strftime, and for the "mode" string of fopen on Windows. These strings are user provided from python and so we can avoid invoking the C runtime invalid parameter handler by first checking that they are valid. ........ r69516 | hirokazu.yamamoto | 2009-02-10 22:13:06 -0600 (Tue, 10 Feb 2009) | 2 lines Issue #5204: Define _PyVerify_fd on VC6 to make test_fdopen (test_os.py) pass. ........ r69757 | raymond.hettinger | 2009-02-18 23:34:35 -0600 (Wed, 18 Feb 2009) | 1 line Add some cross-references to the docs. Simplify the python code equivalent for izip(). Supply an optional argument for the nth() recipe. ........ r69761 | raymond.hettinger | 2009-02-18 23:51:41 -0600 (Wed, 18 Feb 2009) | 1 line Add an example for math.fsum() and elaborate on the accurary note. ........ r69765 | raymond.hettinger | 2009-02-19 00:55:03 -0600 (Thu, 19 Feb 2009) | 1 line Add links to helpful external resources. ........ r69770 | raymond.hettinger | 2009-02-19 03:50:24 -0600 (Thu, 19 Feb 2009) | 1 line Inline coefficients in gamma(). Add reflection formula. Add comments. ........ r69772 | vinay.sajip | 2009-02-19 06:31:32 -0600 (Thu, 19 Feb 2009) | 1 line #5287: Add exception handling around findCaller() call to help out IronPython. ........ r69777 | jeroen.ruigrok | 2009-02-19 12:52:21 -0600 (Thu, 19 Feb 2009) | 3 lines Since we recommend one module per import line, reflect this also in the documentation. ........ r69795 | benjamin.peterson | 2009-02-19 21:31:23 -0600 (Thu, 19 Feb 2009) | 1 line revert r69777 since all the experts agree that extra import lines distract from the code ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Fri Feb 20 05:02:40 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 20 Feb 2009 05:02:40 +0100 (CET) Subject: [Python-checkins] r69798 - in python/branches/py3k: Doc/reference/expressions.rst Doc/reference/introduction.rst Message-ID: <20090220040240.5E47E1E4002@bag.python.org> Author: benjamin.peterson Date: Fri Feb 20 05:02:38 2009 New Revision: 69798 Log: Merged revisions 69769,69776 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69769 | georg.brandl | 2009-02-19 02:30:06 -0600 (Thu, 19 Feb 2009) | 1 line #5310, #3558: fix operator precedence table. ........ r69776 | georg.brandl | 2009-02-19 10:34:51 -0600 (Thu, 19 Feb 2009) | 2 lines #5317: update IronPython URL. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/reference/expressions.rst python/branches/py3k/Doc/reference/introduction.rst Modified: python/branches/py3k/Doc/reference/expressions.rst ============================================================================== --- python/branches/py3k/Doc/reference/expressions.rst (original) +++ python/branches/py3k/Doc/reference/expressions.rst Fri Feb 20 05:02:38 2009 @@ -785,14 +785,14 @@ .. _unary: -Unary arithmetic operations -=========================== +Unary arithmetic and bitwise operations +======================================= .. index:: triple: unary; arithmetic; operation triple: unary; bitwise; operation -All unary arithmetic (and bitwise) operations have the same priority: +All unary arithmetic and bitwise operations have the same priority: .. productionlist:: u_expr: `power` | "-" `u_expr` | "+" `u_expr` | "~" `u_expr` @@ -1240,56 +1240,46 @@ left to right --- see section :ref:`comparisons` --- and exponentiation, which groups from right to left). -+----------------------------------------------+-------------------------------------+ -| Operator | Description | -+==============================================+=====================================+ -| :keyword:`lambda` | Lambda expression | -+----------------------------------------------+-------------------------------------+ -| :keyword:`or` | Boolean OR | -+----------------------------------------------+-------------------------------------+ -| :keyword:`and` | Boolean AND | -+----------------------------------------------+-------------------------------------+ -| :keyword:`not` *x* | Boolean NOT | -+----------------------------------------------+-------------------------------------+ -| :keyword:`in`, :keyword:`not` :keyword:`in` | Membership tests | -+----------------------------------------------+-------------------------------------+ -| :keyword:`is`, :keyword:`is not` | Identity tests | -+----------------------------------------------+-------------------------------------+ -| ``<``, ``<=``, ``>``, ``>=``, ``!=``, ``==`` | Comparisons | -+----------------------------------------------+-------------------------------------+ -| ``|`` | Bitwise OR | -+----------------------------------------------+-------------------------------------+ -| ``^`` | Bitwise XOR | -+----------------------------------------------+-------------------------------------+ -| ``&`` | Bitwise AND | -+----------------------------------------------+-------------------------------------+ -| ``<<``, ``>>`` | Shifts | -+----------------------------------------------+-------------------------------------+ -| ``+``, ``-`` | Addition and subtraction | -+----------------------------------------------+-------------------------------------+ -| ``*``, ``/``, ``//``, ``%`` | Multiplication, division, remainder | -+----------------------------------------------+-------------------------------------+ -| ``+x``, ``-x`` | Positive, negative | -+----------------------------------------------+-------------------------------------+ -| ``~x`` | Bitwise not | -+----------------------------------------------+-------------------------------------+ -| ``**`` | Exponentiation | -+----------------------------------------------+-------------------------------------+ -| ``x[index]`` | Subscription | -+----------------------------------------------+-------------------------------------+ -| ``x[index:index]`` | Slicing | -+----------------------------------------------+-------------------------------------+ -| ``x(arguments...)`` | Call | -+----------------------------------------------+-------------------------------------+ -| ``x.attribute`` | Attribute reference | -+----------------------------------------------+-------------------------------------+ -| ``(expressions...)`` | Binding, tuple display, generator | -| | expressions | -+----------------------------------------------+-------------------------------------+ -| ``[expressions...]`` | List display | -+----------------------------------------------+-------------------------------------+ -| ``{expressions...}`` | Dictionary or set display | -+----------------------------------------------+-------------------------------------+ + ++-----------------------------------------------+-------------------------------------+ +| Operator | Description | ++===============================================+=====================================+ +| :keyword:`lambda` | Lambda expression | ++-----------------------------------------------+-------------------------------------+ +| :keyword:`or` | Boolean OR | ++-----------------------------------------------+-------------------------------------+ +| :keyword:`and` | Boolean AND | ++-----------------------------------------------+-------------------------------------+ +| :keyword:`not` *x* | Boolean NOT | ++-----------------------------------------------+-------------------------------------+ +| :keyword:`in`, :keyword:`not` :keyword:`in`, | Comparisons, including membership | +| :keyword:`is`, :keyword:`is not`, ``<``, | tests and identity tests, | +| ``<=``, ``>``, ``>=``, ``<>``, ``!=``, ``==`` | | ++-----------------------------------------------+-------------------------------------+ +| ``|`` | Bitwise OR | ++-----------------------------------------------+-------------------------------------+ +| ``^`` | Bitwise XOR | ++-----------------------------------------------+-------------------------------------+ +| ``&`` | Bitwise AND | ++-----------------------------------------------+-------------------------------------+ +| ``<<``, ``>>`` | Shifts | ++-----------------------------------------------+-------------------------------------+ +| ``+``, ``-`` | Addition and subtraction | ++-----------------------------------------------+-------------------------------------+ +| ``*``, ``/``, ``//``, ``%`` | Multiplication, division, remainder | ++-----------------------------------------------+-------------------------------------+ +| ``+x``, ``-x``, ``~x`` | Positive, negative, bitwise NOT | ++-----------------------------------------------+-------------------------------------+ +| ``**`` | Exponentiation [#]_ | ++-----------------------------------------------+-------------------------------------+ +| ``x[index]``, ``x[index:index]``, | Subscription, slicing, | +| ``x(arguments...)``, ``x.attribute`` | call, attribute reference | ++-----------------------------------------------+-------------------------------------+ +| ``(expressions...)``, | Binding or tuple display, | +| ``[expressions...]``, | list display, | +| ``{key:datum...}``, | dictionary display, | ++-----------------------------------------------+-------------------------------------+ + .. rubric:: Footnotes @@ -1327,3 +1317,6 @@ descriptors, you may notice seemingly unusual behaviour in certain uses of the :keyword:`is` operator, like those involving comparisons between instance methods, or constants. Check their documentation for more info. + +.. [#] The power operator ``**`` binds less tightly than an arithmetic or + bitwise unary operator on its right, that is, ``2**-1`` is ``0.5``. Modified: python/branches/py3k/Doc/reference/introduction.rst ============================================================================== --- python/branches/py3k/Doc/reference/introduction.rst (original) +++ python/branches/py3k/Doc/reference/introduction.rst Fri Feb 20 05:02:38 2009 @@ -66,8 +66,7 @@ An alternate Python for .NET. Unlike Python.NET, this is a complete Python implementation that generates IL, and compiles Python code directly to .NET assemblies. It was created by Jim Hugunin, the original creator of Jython. For - more information, see `the IronPython website - `_. + more information, see `the IronPython website `_. PyPy An implementation of Python written in Python; even the bytecode interpreter is From python-checkins at python.org Fri Feb 20 05:05:33 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 20 Feb 2009 05:05:33 +0100 (CET) Subject: [Python-checkins] r69799 - in python/branches/release30-maint: Doc/reference/expressions.rst Doc/reference/introduction.rst Message-ID: <20090220040533.2D9921E4018@bag.python.org> Author: benjamin.peterson Date: Fri Feb 20 05:05:32 2009 New Revision: 69799 Log: Merged revisions 69798 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69798 | benjamin.peterson | 2009-02-19 22:02:38 -0600 (Thu, 19 Feb 2009) | 13 lines Merged revisions 69769,69776 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69769 | georg.brandl | 2009-02-19 02:30:06 -0600 (Thu, 19 Feb 2009) | 1 line #5310, #3558: fix operator precedence table. ........ r69776 | georg.brandl | 2009-02-19 10:34:51 -0600 (Thu, 19 Feb 2009) | 2 lines #5317: update IronPython URL. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/reference/expressions.rst python/branches/release30-maint/Doc/reference/introduction.rst Modified: python/branches/release30-maint/Doc/reference/expressions.rst ============================================================================== --- python/branches/release30-maint/Doc/reference/expressions.rst (original) +++ python/branches/release30-maint/Doc/reference/expressions.rst Fri Feb 20 05:05:32 2009 @@ -785,14 +785,14 @@ .. _unary: -Unary arithmetic operations -=========================== +Unary arithmetic and bitwise operations +======================================= .. index:: triple: unary; arithmetic; operation triple: unary; bitwise; operation -All unary arithmetic (and bitwise) operations have the same priority: +All unary arithmetic and bitwise operations have the same priority: .. productionlist:: u_expr: `power` | "-" `u_expr` | "+" `u_expr` | "~" `u_expr` @@ -1240,56 +1240,46 @@ left to right --- see section :ref:`comparisons` --- and exponentiation, which groups from right to left). -+----------------------------------------------+-------------------------------------+ -| Operator | Description | -+==============================================+=====================================+ -| :keyword:`lambda` | Lambda expression | -+----------------------------------------------+-------------------------------------+ -| :keyword:`or` | Boolean OR | -+----------------------------------------------+-------------------------------------+ -| :keyword:`and` | Boolean AND | -+----------------------------------------------+-------------------------------------+ -| :keyword:`not` *x* | Boolean NOT | -+----------------------------------------------+-------------------------------------+ -| :keyword:`in`, :keyword:`not` :keyword:`in` | Membership tests | -+----------------------------------------------+-------------------------------------+ -| :keyword:`is`, :keyword:`is not` | Identity tests | -+----------------------------------------------+-------------------------------------+ -| ``<``, ``<=``, ``>``, ``>=``, ``!=``, ``==`` | Comparisons | -+----------------------------------------------+-------------------------------------+ -| ``|`` | Bitwise OR | -+----------------------------------------------+-------------------------------------+ -| ``^`` | Bitwise XOR | -+----------------------------------------------+-------------------------------------+ -| ``&`` | Bitwise AND | -+----------------------------------------------+-------------------------------------+ -| ``<<``, ``>>`` | Shifts | -+----------------------------------------------+-------------------------------------+ -| ``+``, ``-`` | Addition and subtraction | -+----------------------------------------------+-------------------------------------+ -| ``*``, ``/``, ``//``, ``%`` | Multiplication, division, remainder | -+----------------------------------------------+-------------------------------------+ -| ``+x``, ``-x`` | Positive, negative | -+----------------------------------------------+-------------------------------------+ -| ``~x`` | Bitwise not | -+----------------------------------------------+-------------------------------------+ -| ``**`` | Exponentiation | -+----------------------------------------------+-------------------------------------+ -| ``x[index]`` | Subscription | -+----------------------------------------------+-------------------------------------+ -| ``x[index:index]`` | Slicing | -+----------------------------------------------+-------------------------------------+ -| ``x(arguments...)`` | Call | -+----------------------------------------------+-------------------------------------+ -| ``x.attribute`` | Attribute reference | -+----------------------------------------------+-------------------------------------+ -| ``(expressions...)`` | Binding, tuple display, generator | -| | expressions | -+----------------------------------------------+-------------------------------------+ -| ``[expressions...]`` | List display | -+----------------------------------------------+-------------------------------------+ -| ``{expressions...}`` | Dictionary or set display | -+----------------------------------------------+-------------------------------------+ + ++-----------------------------------------------+-------------------------------------+ +| Operator | Description | ++===============================================+=====================================+ +| :keyword:`lambda` | Lambda expression | ++-----------------------------------------------+-------------------------------------+ +| :keyword:`or` | Boolean OR | ++-----------------------------------------------+-------------------------------------+ +| :keyword:`and` | Boolean AND | ++-----------------------------------------------+-------------------------------------+ +| :keyword:`not` *x* | Boolean NOT | ++-----------------------------------------------+-------------------------------------+ +| :keyword:`in`, :keyword:`not` :keyword:`in`, | Comparisons, including membership | +| :keyword:`is`, :keyword:`is not`, ``<``, | tests and identity tests, | +| ``<=``, ``>``, ``>=``, ``<>``, ``!=``, ``==`` | | ++-----------------------------------------------+-------------------------------------+ +| ``|`` | Bitwise OR | ++-----------------------------------------------+-------------------------------------+ +| ``^`` | Bitwise XOR | ++-----------------------------------------------+-------------------------------------+ +| ``&`` | Bitwise AND | ++-----------------------------------------------+-------------------------------------+ +| ``<<``, ``>>`` | Shifts | ++-----------------------------------------------+-------------------------------------+ +| ``+``, ``-`` | Addition and subtraction | ++-----------------------------------------------+-------------------------------------+ +| ``*``, ``/``, ``//``, ``%`` | Multiplication, division, remainder | ++-----------------------------------------------+-------------------------------------+ +| ``+x``, ``-x``, ``~x`` | Positive, negative, bitwise NOT | ++-----------------------------------------------+-------------------------------------+ +| ``**`` | Exponentiation [#]_ | ++-----------------------------------------------+-------------------------------------+ +| ``x[index]``, ``x[index:index]``, | Subscription, slicing, | +| ``x(arguments...)``, ``x.attribute`` | call, attribute reference | ++-----------------------------------------------+-------------------------------------+ +| ``(expressions...)``, | Binding or tuple display, | +| ``[expressions...]``, | list display, | +| ``{key:datum...}``, | dictionary display, | ++-----------------------------------------------+-------------------------------------+ + .. rubric:: Footnotes @@ -1327,3 +1317,6 @@ descriptors, you may notice seemingly unusual behaviour in certain uses of the :keyword:`is` operator, like those involving comparisons between instance methods, or constants. Check their documentation for more info. + +.. [#] The power operator ``**`` binds less tightly than an arithmetic or + bitwise unary operator on its right, that is, ``2**-1`` is ``0.5``. Modified: python/branches/release30-maint/Doc/reference/introduction.rst ============================================================================== --- python/branches/release30-maint/Doc/reference/introduction.rst (original) +++ python/branches/release30-maint/Doc/reference/introduction.rst Fri Feb 20 05:05:32 2009 @@ -66,8 +66,7 @@ An alternate Python for .NET. Unlike Python.NET, this is a complete Python implementation that generates IL, and compiles Python code directly to .NET assemblies. It was created by Jim Hugunin, the original creator of Jython. For - more information, see `the IronPython website - `_. + more information, see `the IronPython website `_. PyPy An implementation of Python written in Python; even the bytecode interpreter is From python-checkins at python.org Fri Feb 20 05:09:19 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 20 Feb 2009 05:09:19 +0100 (CET) Subject: [Python-checkins] r69800 - in python/branches/py3k: Lib/shutil.py Lib/test/test_shutil.py PCbuild/build_tkinter.py Tools/msi/merge.py Message-ID: <20090220040919.6D4C01E4002@bag.python.org> Author: benjamin.peterson Date: Fri Feb 20 05:09:19 2009 New Revision: 69800 Log: Merged revisions 69415,69591,69593 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69415 | benjamin.peterson | 2009-02-07 13:08:22 -0600 (Sat, 07 Feb 2009) | 1 line make destinsrc private ........ r69591 | martin.v.loewis | 2009-02-13 14:26:16 -0600 (Fri, 13 Feb 2009) | 1 line Update Tix build procedure. ........ r69593 | martin.v.loewis | 2009-02-13 14:51:48 -0600 (Fri, 13 Feb 2009) | 1 line Add optional code signing after merging. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/shutil.py python/branches/py3k/Lib/test/test_shutil.py python/branches/py3k/PCbuild/build_tkinter.py python/branches/py3k/Tools/msi/merge.py Modified: python/branches/py3k/Lib/shutil.py ============================================================================== --- python/branches/py3k/Lib/shutil.py (original) +++ python/branches/py3k/Lib/shutil.py Fri Feb 20 05:09:19 2009 @@ -256,7 +256,7 @@ os.rename(src, real_dst) except OSError: if os.path.isdir(src): - if destinsrc(src, dst): + if _destinsrc(src, dst): raise Error("Cannot move a directory '%s' into itself '%s'." % (src, dst)) copytree(src, real_dst, symlinks=True) rmtree(src) @@ -264,7 +264,7 @@ copy2(src, real_dst) os.unlink(src) -def destinsrc(src, dst): +def _destinsrc(src, dst): src = abspath(src) dst = abspath(dst) if not src.endswith(os.path.sep): 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 Feb 20 05:09:19 2009 @@ -346,8 +346,8 @@ for src, dst in [('srcdir', 'srcdir/dest')]: src = os.path.join(TESTFN, src) dst = os.path.join(TESTFN, dst) - self.assert_(shutil.destinsrc(src, dst), - msg='destinsrc() wrongly concluded that ' + self.assert_(shutil._destinsrc(src, dst), + msg='_destinsrc() wrongly concluded that ' 'dst (%s) is not in src (%s)' % (dst, src)) finally: shutil.rmtree(TESTFN, ignore_errors=True) @@ -358,8 +358,8 @@ for src, dst in [('srcdir', 'src/dest'), ('srcdir', 'srcdir.new')]: src = os.path.join(TESTFN, src) dst = os.path.join(TESTFN, dst) - self.failIf(shutil.destinsrc(src, dst), - msg='destinsrc() wrongly concluded that ' + self.failIf(shutil._destinsrc(src, dst), + msg='_destinsrc() wrongly concluded that ' 'dst (%s) is in src (%s)' % (dst, src)) finally: shutil.rmtree(TESTFN, ignore_errors=True) Modified: python/branches/py3k/PCbuild/build_tkinter.py ============================================================================== --- python/branches/py3k/PCbuild/build_tkinter.py (original) +++ python/branches/py3k/PCbuild/build_tkinter.py Fri Feb 20 05:09:19 2009 @@ -52,18 +52,18 @@ if 1: os.chdir(os.path.join(ROOT, TK, "win")) if clean: - nmake("makefile.vc", "clean", TCLDIR=tcldir) - nmake("makefile.vc", TCLDIR=tcldir, MACHINE=machine) - nmake("makefile.vc", "install", TCLDIR=tcldir, INSTALLDIR=dest, MACHINE=machine) + nmake("makefile.vc", "clean", DEBUG=0, TCLDIR=tcldir) + nmake("makefile.vc", DEBUG=0, MACHINE=machine) + nmake("makefile.vc", "install", DEBUG=0, INSTALLDIR=dest, MACHINE=machine) # TIX if 1: # python9.mak is available at http://svn.python.org os.chdir(os.path.join(ROOT, TIX, "win")) if clean: - nmake("python9.mak", "clean") - nmake("python9.mak", MACHINE=machine, INSTALL_DIR=dest) - nmake("python9.mak", "install", INSTALL_DIR=dest) + nmake("python.mak", "clean") + nmake("python.mak", MACHINE=machine, INSTALL_DIR=dest) + nmake("python.mak", "install", INSTALL_DIR=dest) def main(): if len(sys.argv) < 2 or sys.argv[1] not in ("Win32", "AMD64"): Modified: python/branches/py3k/Tools/msi/merge.py ============================================================================== --- python/branches/py3k/Tools/msi/merge.py (original) +++ python/branches/py3k/Tools/msi/merge.py Fri Feb 20 05:09:19 2009 @@ -1,5 +1,6 @@ import msilib,os,win32com,tempfile,sys PCBUILD="PCBuild" +certname = None from config import * Win64 = "amd64" in PCBUILD @@ -76,3 +77,8 @@ db.Commit() merge(msi, "SharedCRT", "TARGETDIR", modules) + +# certname (from config.py) should be (a substring of) +# the certificate subject, e.g. "Python Software Foundation" +if certname: + os.system('signtool sign /n "%s" /t http://timestamp.verisign.com/scripts/timestamp.dll %s' % (certname, msi)) From python-checkins at python.org Fri Feb 20 05:11:02 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 20 Feb 2009 05:11:02 +0100 (CET) Subject: [Python-checkins] r69801 - python/branches/release30-maint Message-ID: <20090220041102.164611E4002@bag.python.org> Author: benjamin.peterson Date: Fri Feb 20 05:11:01 2009 New Revision: 69801 Log: Blocked revisions 69800 via svnmerge ................ r69800 | benjamin.peterson | 2009-02-19 22:09:19 -0600 (Thu, 19 Feb 2009) | 17 lines Merged revisions 69415,69591,69593 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69415 | benjamin.peterson | 2009-02-07 13:08:22 -0600 (Sat, 07 Feb 2009) | 1 line make destinsrc private ........ r69591 | martin.v.loewis | 2009-02-13 14:26:16 -0600 (Fri, 13 Feb 2009) | 1 line Update Tix build procedure. ........ r69593 | martin.v.loewis | 2009-02-13 14:51:48 -0600 (Fri, 13 Feb 2009) | 1 line Add optional code signing after merging. ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Fri Feb 20 06:15:24 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 20 Feb 2009 05:15:24 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090220051525.0103F1E4002@bag.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/300 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: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From guido at python.org Fri Feb 20 06:17:05 2009 From: guido at python.org (Guido van Rossum) Date: Thu, 19 Feb 2009 21:17:05 -0800 Subject: [Python-checkins] r69777 - in python/trunk/Doc:howto/doanddont.rst howto/webservers.rstincludes/sqlite3/adapter_datetime.py library/asyncore.rstlibrary/cgi.rst library/configparser.rstlibrary/cookielib.rst library/crypt.rst library/csv.rst li In-Reply-To: <1afaf6160902191834o60d8193ei325a301ebd8394da@mail.gmail.com> References: <1afaf6160902191834o60d8193ei325a301ebd8394da@mail.gmail.com> Message-ID: I guess we don't, though maybe you can ask him (as a regular contributor) to subscribe. In any case, I've CC'ed Jeroen on this message! --Guido On Thu, Feb 19, 2009 at 6:34 PM, Benjamin Peterson wrote: > Do we know that Jeron is subscribed to Python-checkins? > > On Thu, Feb 19, 2009 at 4:33 PM, Raymond Hettinger wrote: >> Thirded :-) >> >> ----- Original Message ----- From: "Guido van Rossum" >> To: >> Cc: >> Sent: Thursday, February 19, 2009 12:10 PM >> Subject: Re: [Python-checkins] r69777 - in >> python/trunk/Doc:howto/doanddont.rst >> howto/webservers.rstincludes/sqlite3/adapter_datetime.py >> library/asyncore.rstlibrary/cgi.rst >> library/configparser.rstlibrary/cookielib.rst library/crypt.rst >> library/csv.rst li >> >> >>> Seconded. >>> >>> On Thu, Feb 19, 2009 at 12:05 PM, A.M. Kuchling wrote: >>>> >>>> On Thu, Feb 19, 2009 at 07:52:21PM +0100, jeroen.ruigrok wrote: >>>>> >>>>> Since we recommend one module per import line, reflect this also in the >>>>> documentation. >>>> >>>> I disagree with this change because it makes examples longer, >>>> but the extra length is not contributing anything interesting. >>>> For example, look at the example in the difflib docs: >> >> _______________________________________________ >> Python-checkins mailing list >> Python-checkins at python.org >> http://mail.python.org/mailman/listinfo/python-checkins >> > > > > -- > Regards, > Benjamin > -- --Guido van Rossum (home page: http://www.python.org/~guido/) From buildbot at python.org Fri Feb 20 06:35:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 20 Feb 2009 05:35:28 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090220053529.0950D1E4045@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/308 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_urllibnet make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Feb 20 06:47:15 2009 From: python-checkins at python.org (brett.cannon) Date: Fri, 20 Feb 2009 06:47:15 +0100 (CET) Subject: [Python-checkins] r69802 - peps/trunk/pep-0374.txt Message-ID: <20090220054715.5CC751E400C@bag.python.org> Author: brett.cannon Date: Fri Feb 20 06:47:15 2009 New Revision: 69802 Log: Add a section discussing how people can continue to use their own DVCS if they so choose. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Fri Feb 20 06:47:15 2009 @@ -118,8 +118,6 @@ * git : http://book.git-scm.com/1_the_git_object_model.html - - branch A line of development; a collection of revisions, ordered by time. @@ -222,6 +220,24 @@ 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 =============== From buildbot at python.org Fri Feb 20 07:13:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 20 Feb 2009 06:13:22 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090220061323.2FA021E403D@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/323 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: 3 tests failed: test_posix test_site test_subprocess ====================================================================== 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From asmodai at in-nomine.org Fri Feb 20 07:18:27 2009 From: asmodai at in-nomine.org (Jeroen Ruigrok van der Werven) Date: Fri, 20 Feb 2009 07:18:27 +0100 Subject: [Python-checkins] r69777 - in python/trunk/Doc:howto/doanddont.rst howto/webservers.rstincludes/sqlite3/adapter_datetime.py library/asyncore.rstlibrary/cgi.rst library/configparser.rstlibrary/cookielib.rst library/crypt.rst library/csv.rst li In-Reply-To: References: <1afaf6160902191834o60d8193ei325a301ebd8394da@mail.gmail.com> Message-ID: <20090220061827.GP91939@nexus.in-nomine.org> -On [20090220 06:17], Guido van Rossum (guido at python.org) wrote: >I guess we don't, though maybe you can ask him (as a regular >contributor) to subscribe. In any case, I've CC'ed Jeroen on this >message! I am not actually subscribed to it. Should be fixed shortly. >>>> On Thu, Feb 19, 2009 at 12:05 PM, A.M. Kuchling wrote: >>>>> >>>>> I disagree with this change because it makes examples longer, >>>>> but the extra length is not contributing anything interesting. >>>>> For example, look at the example in the difflib docs: Prior to checking it in I discussed it with Georg for what it is worth. My commit was merely trying to get some consistency into the diverse examples, which in my experience tends to make things easier for people using the documentation. But it is not like I will defend said change with tooth and nail. So what will it be? -- Jeroen Ruigrok van der Werven / asmodai ????? ?????? ??? ?? ?????? http://www.in-nomine.org/ | http://www.rangaku.org/ | GPG: 2EAC625B Earth to earth, ashes to ashes, dust to dust... From buildbot at python.org Fri Feb 20 08:18:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 20 Feb 2009 07:18:47 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090220071852.89CF51E4002@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/168 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 g.brandl at gmx.net Fri Feb 20 08:44:28 2009 From: g.brandl at gmx.net (Georg Brandl) Date: Fri, 20 Feb 2009 08:44:28 +0100 Subject: [Python-checkins] r69777 - in python/trunk/Doc:howto/doanddont.rst howto/webservers.rstincludes/sqlite3/adapter_datetime.py library/asyncore.rstlibrary/cgi.rst library/configparser.rstlibrary/cookielib.rst library/crypt.rst library/csv.rst li In-Reply-To: <20090220061827.GP91939@nexus.in-nomine.org> References: <1afaf6160902191834o60d8193ei325a301ebd8394da@mail.gmail.com> <20090220061827.GP91939@nexus.in-nomine.org> Message-ID: Jeroen Ruigrok van der Werven schrieb: > -On [20090220 06:17], Guido van Rossum (guido at python.org) wrote: >>I guess we don't, though maybe you can ask him (as a regular >>contributor) to subscribe. In any case, I've CC'ed Jeroen on this >>message! > > I am not actually subscribed to it. Should be fixed shortly. > >>>>> On Thu, Feb 19, 2009 at 12:05 PM, A.M. Kuchling wrote: >>>>>> >>>>>> I disagree with this change because it makes examples longer, >>>>>> but the extra length is not contributing anything interesting. >>>>>> For example, look at the example in the difflib docs: > > Prior to checking it in I discussed it with Georg for what it is worth. My > commit was merely trying to get some consistency into the diverse examples, > which in my experience tends to make things easier for people using the > documentation. But it is not like I will defend said change with tooth and > nail. So what will it be? Well, you heard the authorities :) I had the feeling that following PEP 8 in our examples would be good; but I can see that brevity is also a virtue 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 Fri Feb 20 08:48:21 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 20 Feb 2009 08:48:21 +0100 (CET) Subject: [Python-checkins] r69803 - python/trunk/Doc/whatsnew/2.5.rst Message-ID: <20090220074821.447A61E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 20 08:48:21 2009 New Revision: 69803 Log: #5327: fix a broken link by joining it. Modified: python/trunk/Doc/whatsnew/2.5.rst Modified: python/trunk/Doc/whatsnew/2.5.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.5.rst (original) +++ python/trunk/Doc/whatsnew/2.5.rst Fri Feb 20 08:48:21 2009 @@ -1761,8 +1761,8 @@ included. The rest of this section will provide a brief overview of using ElementTree. -Full documentation for ElementTree is available at http://effbot.org/zone -/element-index.htm. +Full documentation for ElementTree is available at +http://effbot.org/zone/element-index.htm. ElementTree represents an XML document as a tree of element nodes. The text content of the document is stored as the :attr:`.text` and :attr:`.tail` From python-checkins at python.org Fri Feb 20 09:22:22 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 20 Feb 2009 09:22:22 +0100 (CET) Subject: [Python-checkins] r69804 - in python/trunk/Doc: howto/webservers.rst library/cgi.rst library/cgitb.rst Message-ID: <20090220082222.1F2931E4010@bag.python.org> Author: georg.brandl Date: Fri Feb 20 09:22:21 2009 New Revision: 69804 Log: At least separate imports from other statements. Modified: python/trunk/Doc/howto/webservers.rst python/trunk/Doc/library/cgi.rst python/trunk/Doc/library/cgitb.rst Modified: python/trunk/Doc/howto/webservers.rst ============================================================================== --- python/trunk/Doc/howto/webservers.rst (original) +++ python/trunk/Doc/howto/webservers.rst Fri Feb 20 09:22:21 2009 @@ -99,7 +99,8 @@ # -*- coding: UTF-8 -*- # enable debugging - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() print "Content-Type: text/plain;charset=utf-8" print Modified: python/trunk/Doc/library/cgi.rst ============================================================================== --- python/trunk/Doc/library/cgi.rst (original) +++ python/trunk/Doc/library/cgi.rst Fri Feb 20 09:22:21 2009 @@ -67,16 +67,18 @@ module defines all sorts of names for its own use or for backward compatibility that you don't want in your namespace. -When you write a new script, consider adding the line:: +When you write a new script, consider adding these lines:: - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() This activates a special exception handler that will display detailed reports in the Web browser if any errors occur. If you'd rather not show the guts of your program to users of your script, you can have the reports saved to files -instead, with a line like this:: +instead, with code like this:: - import cgitb; cgitb.enable(display=0, logdir="/tmp") + import cgitb + cgitb.enable(display=0, logdir="/tmp") It's very helpful to use this feature during script development. The reports produced by :mod:`cgitb` provide information that can save you a lot of time in @@ -470,9 +472,10 @@ Fortunately, once you have managed to get your script to execute *some* code, you can easily send tracebacks to the Web browser using the :mod:`cgitb` module. -If you haven't done so already, just add the line:: +If you haven't done so already, just add the lines:: - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() to the top of your script. Then try running it again; when a problem occurs, you should see a detailed report that will likely make apparent the cause of the Modified: python/trunk/Doc/library/cgitb.rst ============================================================================== --- python/trunk/Doc/library/cgitb.rst (original) +++ python/trunk/Doc/library/cgitb.rst Fri Feb 20 09:22:21 2009 @@ -26,9 +26,10 @@ functions, to help you debug the problem. Optionally, you can save this information to a file instead of sending it to the browser. -To enable this feature, simply add one line to the top of your CGI script:: +To enable this feature, simply add this to the top of your CGI script:: - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() The options to the :func:`enable` function control whether the report is displayed in the browser and whether the report is logged to a file for later From python-checkins at python.org Fri Feb 20 09:45:47 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 20 Feb 2009 09:45:47 +0100 (CET) Subject: [Python-checkins] r69805 - python/trunk/Doc/library/xml.etree.elementtree.rst Message-ID: <20090220084547.51DAC1E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 20 09:45:47 2009 New Revision: 69805 Log: Fix punctuation. Modified: python/trunk/Doc/library/xml.etree.elementtree.rst Modified: python/trunk/Doc/library/xml.etree.elementtree.rst ============================================================================== --- python/trunk/Doc/library/xml.etree.elementtree.rst (original) +++ python/trunk/Doc/library/xml.etree.elementtree.rst Fri Feb 20 09:45:47 2009 @@ -529,5 +529,5 @@ .. [#] The encoding string included in XML output should conform to the appropriate standards. For example, "UTF-8" is valid, but "UTF8" is not. See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl - and http://www.iana.org/assignments/character-sets . + and http://www.iana.org/assignments/character-sets. From nnorwitz at gmail.com Fri Feb 20 10:09:06 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 20 Feb 2009 04:09:06 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090220090906.GA531@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663827 refs] From nnorwitz at gmail.com Fri Feb 20 10:16:23 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 20 Feb 2009 04:16:23 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090220091623.GA2955@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 [17163 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17142 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663092 refs] From ncoghlan at gmail.com Fri Feb 20 10:18:33 2009 From: ncoghlan at gmail.com (Nick Coghlan) Date: Fri, 20 Feb 2009 19:18:33 +1000 Subject: [Python-checkins] r69777 - in python/trunk/Doc:howto/doanddont.rst howto/webservers.rstincludes/sqlite3/adapter_datetime.py library/asyncore.rstlibrary/cgi.rst library/configparser.rstlibrary/cookielib.rst library/crypt.rst library/csv.rst li In-Reply-To: References: <1afaf6160902191834o60d8193ei325a301ebd8394da@mail.gmail.com> <20090220061827.GP91939@nexus.in-nomine.org> Message-ID: <499E7569.6060205@gmail.com> Georg Brandl wrote: > I had the feeling that following PEP 8 in our examples would be good; but I > can see that brevity is also a virtue here. Of the various guidelines in PEP 8, that's the one I probably break most often in production code. Non-as imports of commonly used standard library modules can create a lot of clutter if you follow it all the time (especially for short module names like os, sys, time, re, etc). The PEP guideline is still a good default rule though - it's just a judgment call as to when the increased use of vertical screen real estate from following it becomes excessive. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- From nnorwitz at gmail.com Fri Feb 20 11:38:19 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 20 Feb 2009 05:38:19 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090220103819.GA25194@python.psfb.org> 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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-21573 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 test_slice test_smtplib test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [677527 refs] From python-checkins at python.org Fri Feb 20 15:02:37 2009 From: python-checkins at python.org (eric.smith) Date: Fri, 20 Feb 2009 15:02:37 +0100 (CET) Subject: [Python-checkins] r69806 - in python/trunk: Misc/NEWS Objects/stringlib/formatter.h Message-ID: <20090220140237.962041E4002@bag.python.org> Author: eric.smith Date: Fri Feb 20 15:02:36 2009 New Revision: 69806 Log: Issue #5247: Improve error message when unknown format codes are used when using str.format() with str, unicode, long, int, and float arguments. Modified: python/trunk/Misc/NEWS python/trunk/Objects/stringlib/formatter.h Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Feb 20 15:02:36 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #5247: Improve error message when unknown format codes are + used when using str.format() with str, unicode, long, int, and + float arguments. + - Running Python with the -3 option now also warns about classic division for ints and longs. Modified: python/trunk/Objects/stringlib/formatter.h ============================================================================== --- python/trunk/Objects/stringlib/formatter.h (original) +++ python/trunk/Objects/stringlib/formatter.h Fri Feb 20 15:02:36 2009 @@ -15,6 +15,34 @@ #define ALLOW_PARENS_FOR_SIGN 0 +/* Raises an exception about an unknown presentation type for this + * type. */ + +static void +unknown_presentation_type(STRINGLIB_CHAR presentation_type, + const char* type_name) +{ +#if STRINGLIB_IS_UNICODE + /* If STRINGLIB_CHAR is Py_UNICODE, %c might be out-of-range, + hence the two cases. If it is char, gcc complains that the + condition below is always true, hence the ifdef. */ + if (presentation_type > 32 && presentation_type < 128) +#endif + PyErr_Format(PyExc_ValueError, + "Unknown format code '%c' " + "for object of type '%.200s'", + presentation_type, + type_name); +#if STRINGLIB_IS_UNICODE + else + PyErr_Format(PyExc_ValueError, + "Unknown format code '\\x%x' " + "for object of type '%.200s'", + (unsigned int)presentation_type, + type_name); +#endif +} + /* get_integer consumes 0 or more decimal digit characters from an input string, updates *result with the corresponding positive @@ -854,19 +882,7 @@ break; default: /* unknown */ - #if STRINGLIB_IS_UNICODE - /* If STRINGLIB_CHAR is Py_UNICODE, %c might be out-of-range, - hence the two cases. If it is char, gcc complains that the - condition below is always true, hence the ifdef. */ - if (format.type > 32 && format.type <128) - #endif - PyErr_Format(PyExc_ValueError, "Unknown conversion type %c", - (char)format.type); - #if STRINGLIB_IS_UNICODE - else - PyErr_Format(PyExc_ValueError, "Unknown conversion type '\\x%x'", - (unsigned int)format.type); - #endif + unknown_presentation_type(format.type, obj->ob_type->tp_name); goto done; } @@ -928,8 +944,7 @@ default: /* unknown */ - PyErr_Format(PyExc_ValueError, "Unknown conversion type %c", - format.type); + unknown_presentation_type(format.type, obj->ob_type->tp_name); goto done; } @@ -1031,8 +1046,7 @@ default: /* unknown */ - PyErr_Format(PyExc_ValueError, "Unknown conversion type %c", - format.type); + unknown_presentation_type(format.type, obj->ob_type->tp_name); goto done; } From python-checkins at python.org Fri Feb 20 15:07:56 2009 From: python-checkins at python.org (eric.smith) Date: Fri, 20 Feb 2009 15:07:56 +0100 (CET) Subject: [Python-checkins] r69807 - in python/branches/release26-maint: Misc/NEWS Objects/stringlib/formatter.h Message-ID: <20090220140756.087D91E4002@bag.python.org> Author: eric.smith Date: Fri Feb 20 15:07:55 2009 New Revision: 69807 Log: Merged revisions 69806 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69806 | eric.smith | 2009-02-20 09:02:36 -0500 (Fri, 20 Feb 2009) | 1 line Issue #5247: Improve error message when unknown format codes are used when using str.format() with str, unicode, long, int, and float arguments. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Objects/stringlib/formatter.h Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Fri Feb 20 15:07:55 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #5247: Improve error message when unknown format codes are + used when using str.format() with str, unicode, long, int, and + float arguments. + - Running Python with the -3 option now also warns about classic division for ints and longs. Modified: python/branches/release26-maint/Objects/stringlib/formatter.h ============================================================================== --- python/branches/release26-maint/Objects/stringlib/formatter.h (original) +++ python/branches/release26-maint/Objects/stringlib/formatter.h Fri Feb 20 15:07:55 2009 @@ -15,6 +15,34 @@ #define ALLOW_PARENS_FOR_SIGN 0 +/* Raises an exception about an unknown presentation type for this + * type. */ + +static void +unknown_presentation_type(STRINGLIB_CHAR presentation_type, + const char* type_name) +{ +#if STRINGLIB_IS_UNICODE + /* If STRINGLIB_CHAR is Py_UNICODE, %c might be out-of-range, + hence the two cases. If it is char, gcc complains that the + condition below is always true, hence the ifdef. */ + if (presentation_type > 32 && presentation_type < 128) +#endif + PyErr_Format(PyExc_ValueError, + "Unknown format code '%c' " + "for object of type '%.200s'", + presentation_type, + type_name); +#if STRINGLIB_IS_UNICODE + else + PyErr_Format(PyExc_ValueError, + "Unknown format code '\\x%x' " + "for object of type '%.200s'", + (unsigned int)presentation_type, + type_name); +#endif +} + /* get_integer consumes 0 or more decimal digit characters from an input string, updates *result with the corresponding positive @@ -854,19 +882,7 @@ break; default: /* unknown */ - #if STRINGLIB_IS_UNICODE - /* If STRINGLIB_CHAR is Py_UNICODE, %c might be out-of-range, - hence the two cases. If it is char, gcc complains that the - condition below is always true, hence the ifdef. */ - if (format.type > 32 && format.type <128) - #endif - PyErr_Format(PyExc_ValueError, "Unknown conversion type %c", - (char)format.type); - #if STRINGLIB_IS_UNICODE - else - PyErr_Format(PyExc_ValueError, "Unknown conversion type '\\x%x'", - (unsigned int)format.type); - #endif + unknown_presentation_type(format.type, obj->ob_type->tp_name); goto done; } @@ -928,8 +944,7 @@ default: /* unknown */ - PyErr_Format(PyExc_ValueError, "Unknown conversion type %c", - format.type); + unknown_presentation_type(format.type, obj->ob_type->tp_name); goto done; } @@ -1031,8 +1046,7 @@ default: /* unknown */ - PyErr_Format(PyExc_ValueError, "Unknown conversion type %c", - format.type); + unknown_presentation_type(format.type, obj->ob_type->tp_name); goto done; } From python-checkins at python.org Fri Feb 20 15:25:04 2009 From: python-checkins at python.org (eric.smith) Date: Fri, 20 Feb 2009 15:25:04 +0100 (CET) Subject: [Python-checkins] r69808 - in python/branches/py3k: Misc/NEWS Objects/stringlib/formatter.h Message-ID: <20090220142504.9D50A1E4002@bag.python.org> Author: eric.smith Date: Fri Feb 20 15:25:03 2009 New Revision: 69808 Log: Merged revisions 69806 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69806 | eric.smith | 2009-02-20 09:02:36 -0500 (Fri, 20 Feb 2009) | 1 line Issue #5247: Improve error message when unknown format codes are used when using str.format() with str, int, and float arguments. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/stringlib/formatter.h Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri Feb 20 15:25:03 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +======= +- Issue #5247: Improve error message when unknown format codes are + used when using str.format() with str, int, and float arguments. + - Issue #5249: time.strftime returned malformed string when format string contained non ascii character on windows. Modified: python/branches/py3k/Objects/stringlib/formatter.h ============================================================================== --- python/branches/py3k/Objects/stringlib/formatter.h (original) +++ python/branches/py3k/Objects/stringlib/formatter.h Fri Feb 20 15:25:03 2009 @@ -15,6 +15,34 @@ #define ALLOW_PARENS_FOR_SIGN 0 +/* Raises an exception about an unknown presentation type for this + * type. */ + +static void +unknown_presentation_type(STRINGLIB_CHAR presentation_type, + const char* type_name) +{ +#if STRINGLIB_IS_UNICODE + /* If STRINGLIB_CHAR is Py_UNICODE, %c might be out-of-range, + hence the two cases. If it is char, gcc complains that the + condition below is always true, hence the ifdef. */ + if (presentation_type > 32 && presentation_type < 128) +#endif + PyErr_Format(PyExc_ValueError, + "Unknown format code '%c' " + "for object of type '%.200s'", + presentation_type, + type_name); +#if STRINGLIB_IS_UNICODE + else + PyErr_Format(PyExc_ValueError, + "Unknown format code '\\x%x' " + "for object of type '%.200s'", + (unsigned int)presentation_type, + type_name); +#endif +} + /* get_integer consumes 0 or more decimal digit characters from an input string, updates *result with the corresponding positive @@ -854,19 +882,7 @@ break; default: /* unknown */ - #if STRINGLIB_IS_UNICODE - /* If STRINGLIB_CHAR is Py_UNICODE, %c might be out-of-range, - hence the two cases. If it is char, gcc complains that the - condition below is always true, hence the ifdef. */ - if (format.type > 32 && format.type <128) - #endif - PyErr_Format(PyExc_ValueError, "Unknown conversion type %c", - (char)format.type); - #if STRINGLIB_IS_UNICODE - else - PyErr_Format(PyExc_ValueError, "Unknown conversion type '\\x%x'", - (unsigned int)format.type); - #endif + unknown_presentation_type(format.type, obj->ob_type->tp_name); goto done; } @@ -928,8 +944,7 @@ default: /* unknown */ - PyErr_Format(PyExc_ValueError, "Unknown conversion type %c", - format.type); + unknown_presentation_type(format.type, obj->ob_type->tp_name); goto done; } @@ -1031,8 +1046,7 @@ default: /* unknown */ - PyErr_Format(PyExc_ValueError, "Unknown conversion type %c", - format.type); + unknown_presentation_type(format.type, obj->ob_type->tp_name); goto done; } From python-checkins at python.org Fri Feb 20 15:30:15 2009 From: python-checkins at python.org (eric.smith) Date: Fri, 20 Feb 2009 15:30:15 +0100 (CET) Subject: [Python-checkins] r69809 - in python/branches/release30-maint: Misc/NEWS Objects/stringlib/formatter.h Message-ID: <20090220143015.E84301E401B@bag.python.org> Author: eric.smith Date: Fri Feb 20 15:30:15 2009 New Revision: 69809 Log: Merged revisions 69808 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69808 | eric.smith | 2009-02-20 09:25:03 -0500 (Fri, 20 Feb 2009) | 9 lines Merged revisions 69806 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69806 | eric.smith | 2009-02-20 09:02:36 -0500 (Fri, 20 Feb 2009) | 1 line Issue #5247: Improve error message when unknown format codes are used when using str.format() with str, int, and float arguments. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Objects/stringlib/formatter.h Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Fri Feb 20 15:30:15 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +======= +- Issue #5247: Improve error message when unknown format codes are + used when using str.format() with str, int, and float arguments. + - Issue #5249: time.strftime returned malformed string when format string contained non ascii character on windows. Modified: python/branches/release30-maint/Objects/stringlib/formatter.h ============================================================================== --- python/branches/release30-maint/Objects/stringlib/formatter.h (original) +++ python/branches/release30-maint/Objects/stringlib/formatter.h Fri Feb 20 15:30:15 2009 @@ -15,6 +15,34 @@ #define ALLOW_PARENS_FOR_SIGN 0 +/* Raises an exception about an unknown presentation type for this + * type. */ + +static void +unknown_presentation_type(STRINGLIB_CHAR presentation_type, + const char* type_name) +{ +#if STRINGLIB_IS_UNICODE + /* If STRINGLIB_CHAR is Py_UNICODE, %c might be out-of-range, + hence the two cases. If it is char, gcc complains that the + condition below is always true, hence the ifdef. */ + if (presentation_type > 32 && presentation_type < 128) +#endif + PyErr_Format(PyExc_ValueError, + "Unknown format code '%c' " + "for object of type '%.200s'", + presentation_type, + type_name); +#if STRINGLIB_IS_UNICODE + else + PyErr_Format(PyExc_ValueError, + "Unknown format code '\\x%x' " + "for object of type '%.200s'", + (unsigned int)presentation_type, + type_name); +#endif +} + /* get_integer consumes 0 or more decimal digit characters from an input string, updates *result with the corresponding positive @@ -854,19 +882,7 @@ break; default: /* unknown */ - #if STRINGLIB_IS_UNICODE - /* If STRINGLIB_CHAR is Py_UNICODE, %c might be out-of-range, - hence the two cases. If it is char, gcc complains that the - condition below is always true, hence the ifdef. */ - if (format.type > 32 && format.type <128) - #endif - PyErr_Format(PyExc_ValueError, "Unknown conversion type %c", - (char)format.type); - #if STRINGLIB_IS_UNICODE - else - PyErr_Format(PyExc_ValueError, "Unknown conversion type '\\x%x'", - (unsigned int)format.type); - #endif + unknown_presentation_type(format.type, obj->ob_type->tp_name); goto done; } @@ -928,8 +944,7 @@ default: /* unknown */ - PyErr_Format(PyExc_ValueError, "Unknown conversion type %c", - format.type); + unknown_presentation_type(format.type, obj->ob_type->tp_name); goto done; } @@ -1031,8 +1046,7 @@ default: /* unknown */ - PyErr_Format(PyExc_ValueError, "Unknown conversion type %c", - format.type); + unknown_presentation_type(format.type, obj->ob_type->tp_name); goto done; } From guido at python.org Fri Feb 20 16:39:46 2009 From: guido at python.org (Guido van Rossum) Date: Fri, 20 Feb 2009 07:39:46 -0800 Subject: [Python-checkins] r69777 - in python/trunk/Doc:howto/doanddont.rst howto/webservers.rstincludes/sqlite3/adapter_datetime.py library/asyncore.rstlibrary/cgi.rst library/configparser.rstlibrary/cookielib.rst library/crypt.rst library/csv.rst li In-Reply-To: <499E7569.6060205@gmail.com> References: <1afaf6160902191834o60d8193ei325a301ebd8394da@mail.gmail.com> <20090220061827.GP91939@nexus.in-nomine.org> <499E7569.6060205@gmail.com> Message-ID: PEP 8 was not designed with examples in mind. While many of its recommendations make sense in all contexts (like the horizontal spacing rules), the requirements for docstrings or comments, for example, don't make sense in examples, and in examples it is much more defensible to use short variable names. An example typical comes in a context that explains what it is about so the reader doesn't have to guess so much. Imports, in examples, are usually just a distraction from the action, so compacting them (or omitting them when they are obvious, perhaps from previous examples) makes sense. On Fri, Feb 20, 2009 at 1:18 AM, Nick Coghlan wrote: > Georg Brandl wrote: >> I had the feeling that following PEP 8 in our examples would be good; but I >> can see that brevity is also a virtue here. > > Of the various guidelines in PEP 8, that's the one I probably break most > often in production code. Non-as imports of commonly used standard > library modules can create a lot of clutter if you follow it all the > time (especially for short module names like os, sys, time, re, etc). > > The PEP guideline is still a good default rule though - it's just a > judgment call as to when the increased use of vertical screen real > estate from following it becomes excessive. -- --Guido van Rossum (home page: http://www.python.org/~guido/) From buildbot at python.org Fri Feb 20 16:40:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 20 Feb 2009 15:40:18 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090220154018.3612B1E4016@bag.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/141 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: eric.smith BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_threading_local make: *** [buildbottest] Error 1 sincerely, -The Buildbot From g.brandl at gmx.net Fri Feb 20 19:27:36 2009 From: g.brandl at gmx.net (Georg Brandl) Date: Fri, 20 Feb 2009 19:27:36 +0100 Subject: [Python-checkins] r69777 - in python/trunk/Doc:howto/doanddont.rst howto/webservers.rstincludes/sqlite3/adapter_datetime.py library/asyncore.rstlibrary/cgi.rst library/configparser.rstlibrary/cookielib.rst library/crypt.rst library/csv.rst li In-Reply-To: References: <1afaf6160902191834o60d8193ei325a301ebd8394da@mail.gmail.com> <20090220061827.GP91939@nexus.in-nomine.org> <499E7569.6060205@gmail.com> Message-ID: Amen! Georg Guido van Rossum schrieb: > PEP 8 was not designed with examples in mind. While many of its > recommendations make sense in all contexts (like the horizontal > spacing rules), the requirements for docstrings or comments, for > example, don't make sense in examples, and in examples it is much more > defensible to use short variable names. An example typical comes in a > context that explains what it is about so the reader doesn't have to > guess so much. Imports, in examples, are usually just a distraction > from the action, so compacting them (or omitting them when they are > obvious, perhaps from previous examples) makes sense. > > On Fri, Feb 20, 2009 at 1:18 AM, Nick Coghlan wrote: >> Georg Brandl wrote: >>> I had the feeling that following PEP 8 in our examples would be good; but I >>> can see that brevity is also a virtue here. >> >> Of the various guidelines in PEP 8, that's the one I probably break most >> often in production code. Non-as imports of commonly used standard >> library modules can create a lot of clutter if you follow it all the >> time (especially for short module names like os, sys, time, re, etc). >> >> The PEP guideline is still a good default rule though - it's just a >> judgment call as to when the increased use of vertical screen real >> estate from following it becomes excessive. > -- 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 Fri Feb 20 20:30:42 2009 From: python-checkins at python.org (collin.winter) Date: Fri, 20 Feb 2009 20:30:42 +0100 (CET) Subject: [Python-checkins] r69811 - in python/trunk: Lib/test/test_opcodes.py Python/ceval.c Message-ID: <20090220193042.30C551E4002@bag.python.org> Author: collin.winter Date: Fri Feb 20 20:30:41 2009 New Revision: 69811 Log: Issue 5176: special-case string formatting in BINARY_MODULO implementation. This shows a modest (1-3%) speed-up in templating systems, for example. Modified: python/trunk/Lib/test/test_opcodes.py python/trunk/Python/ceval.c Modified: python/trunk/Lib/test/test_opcodes.py ============================================================================== --- python/trunk/Lib/test/test_opcodes.py (original) +++ python/trunk/Lib/test/test_opcodes.py Fri Feb 20 20:30:41 2009 @@ -102,6 +102,12 @@ g = eval('lambda a=1: None') self.assertNotEquals(f, g) + def test_modulo_of_string_subclasses(self): + class MyString(str): + def __mod__(self, value): + return 42 + self.assertEqual(MyString() % 3, 42) + def test_main(): run_unittest(OpcodeTest) Modified: python/trunk/Python/ceval.c ============================================================================== --- python/trunk/Python/ceval.c (original) +++ python/trunk/Python/ceval.c Fri Feb 20 20:30:41 2009 @@ -1283,7 +1283,10 @@ case BINARY_MODULO: w = POP(); v = TOP(); - x = PyNumber_Remainder(v, w); + if (PyString_CheckExact(v)) + x = PyString_Format(v, w); + else + x = PyNumber_Remainder(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); From python-checkins at python.org Fri Feb 20 20:50:17 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 20 Feb 2009 20:50:17 +0100 (CET) Subject: [Python-checkins] r69812 - in python/branches/io-c: Lib/io.py Modules/Setup.dist Modules/_iomodule.h Modules/_stringio.c Modules/io.c Message-ID: <20090220195017.6C3D31E4002@bag.python.org> Author: antoine.pitrou Date: Fri Feb 20 20:50:16 2009 New Revision: 69812 Log: _StringIO now belongs to the _io modules, rather to its own _stringio module Modified: python/branches/io-c/Lib/io.py python/branches/io-c/Modules/Setup.dist python/branches/io-c/Modules/_iomodule.h python/branches/io-c/Modules/_stringio.c python/branches/io-c/Modules/io.c Modified: python/branches/io-c/Lib/io.py ============================================================================== --- python/branches/io-c/Lib/io.py (original) +++ python/branches/io-c/Lib/io.py Fri Feb 20 20:50:16 2009 @@ -1872,18 +1872,16 @@ return self.buffer.getvalue().decode(self._encoding, self._errors) try: - import _stringio - # This subclass is a reimplementation of the TextIOWrapper # interface without any of its text decoding facilities. All the # stored data is manipulated with the efficient - # _stringio._StringIO extension type. Also, the newline decoding + # _io._StringIO extension type. Also, the newline decoding # mechanism of IncrementalNewlineDecoder is reimplemented here for # efficiency. Doing otherwise, would require us to implement a # fake decoder which would add an additional and unnecessary layer # on top of the _StringIO methods. - class StringIO(_stringio._StringIO, TextIOBase): + class StringIO(_io._StringIO, TextIOBase): """Text I/O implementation using an in-memory buffer. The initial_value argument sets the value of object. The newline @@ -1972,12 +1970,12 @@ def seekable(self): return True - _read = _stringio._StringIO.read - _write = _stringio._StringIO.write - _tell = _stringio._StringIO.tell - _seek = _stringio._StringIO.seek - _truncate = _stringio._StringIO.truncate - _getvalue = _stringio._StringIO.getvalue + _read = _io._StringIO.read + _write = _io._StringIO.write + _tell = _io._StringIO.tell + _seek = _io._StringIO.seek + _truncate = _io._StringIO.truncate + _getvalue = _io._StringIO.getvalue def getvalue(self) -> str: """Retrieve the entire contents of the object.""" Modified: python/branches/io-c/Modules/Setup.dist ============================================================================== --- python/branches/io-c/Modules/Setup.dist (original) +++ python/branches/io-c/Modules/Setup.dist Fri Feb 20 20:50:16 2009 @@ -114,8 +114,7 @@ _weakref _weakref.c # weak references # Standard I/O baseline -_io io.c _iobase.c _fileio.c _bytesio.c _bufferedio.c _textio.c -_stringio _stringio.c +_io io.c _iobase.c _fileio.c _bytesio.c _bufferedio.c _textio.c _stringio.c # The zipimport module is always imported at startup. Having it as a # builtin module avoids some bootstrapping problems and reduces overhead. Modified: python/branches/io-c/Modules/_iomodule.h ============================================================================== --- python/branches/io-c/Modules/_iomodule.h (original) +++ python/branches/io-c/Modules/_iomodule.h Fri Feb 20 20:50:16 2009 @@ -11,6 +11,7 @@ /* Concrete classes */ extern PyTypeObject PyFileIO_Type; extern PyTypeObject PyBytesIO_Type; +extern PyTypeObject PyStringIO_Type; extern PyTypeObject PyBufferedReader_Type; extern PyTypeObject PyBufferedWriter_Type; extern PyTypeObject PyBufferedRWPair_Type; Modified: python/branches/io-c/Modules/_stringio.c ============================================================================== --- python/branches/io-c/Modules/_stringio.c (original) +++ python/branches/io-c/Modules/_stringio.c Fri Feb 20 20:50:16 2009 @@ -1,8 +1,6 @@ +#define PY_SSIZE_T_CLEAN #include "Python.h" - -/* This module is a stripped down version of _bytesio.c with a Py_UNICODE - buffer. Most of the functionality is provided by subclassing _StringIO. */ - +#include "_iomodule.h" typedef struct { PyObject_HEAD @@ -313,9 +311,9 @@ {NULL, NULL} /* sentinel */ }; -static PyTypeObject StringIO_Type = { +PyTypeObject PyStringIO_Type = { PyVarObject_HEAD_INIT(NULL, 0) - "_stringio._StringIO", /*tp_name*/ + "_StringIO", /*tp_name*/ sizeof(StringIOObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ (destructor)stringio_dealloc, /*tp_dealloc*/ @@ -353,31 +351,3 @@ 0, /*tp_alloc*/ stringio_new, /*tp_new*/ }; - -static struct PyModuleDef _stringiomodule = { - PyModuleDef_HEAD_INIT, - "_stringio", - NULL, - -1, - NULL, - NULL, - NULL, - NULL, - NULL -}; - -PyMODINIT_FUNC -PyInit__stringio(void) -{ - PyObject *m; - - if (PyType_Ready(&StringIO_Type) < 0) - return NULL; - m = PyModule_Create(&_stringiomodule); - if (m == NULL) - return NULL; - Py_INCREF(&StringIO_Type); - if (PyModule_AddObject(m, "_StringIO", (PyObject *)&StringIO_Type) < 0) - return NULL; - return m; -} Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Fri Feb 20 20:50:16 2009 @@ -636,26 +636,39 @@ state->unsupported_operation); /* BlockingIOError */ - base = (PyTypeObject *)PyExc_IOError; - _PyExc_BlockingIOError.tp_base = base; + _PyExc_BlockingIOError.tp_base = (PyTypeObject *) PyExc_IOError; if (PyType_Ready(&_PyExc_BlockingIOError) < 0) goto fail; Py_INCREF(&_PyExc_BlockingIOError); PyModule_AddObject(m, "BlockingIOError", (PyObject *)&_PyExc_BlockingIOError); + /* IOBase */ if (PyType_Ready(&PyIOBase_Type) < 0) goto fail; Py_INCREF(&PyIOBase_Type); PyModule_AddObject(m, "IOBase", (PyObject *)&PyIOBase_Type); + /* RawIOBase */ if (PyType_Ready(&PyRawIOBase_Type) < 0) goto fail; Py_INCREF(&PyRawIOBase_Type); PyModule_AddObject(m, "RawIOBase", (PyObject *)&PyRawIOBase_Type); + /* BufferedIOBase */ + if (PyType_Ready(&PyBufferedIOBase_Type) < 0) + goto fail; + Py_INCREF(&PyBufferedIOBase_Type); + PyModule_AddObject(m, "BufferedIOBase", (PyObject *) &PyBufferedIOBase_Type); + + /* TextIOBase */ + if (PyType_Ready(&PyTextIOBase_Type) < 0) + goto fail; + Py_INCREF(&PyTextIOBase_Type); + PyModule_AddObject(m, "TextIOBase", (PyObject *) &PyTextIOBase_Type); + /* FileIO */ PyFileIO_Type.tp_base = &PyRawIOBase_Type; if (PyType_Ready(&PyFileIO_Type) < 0) @@ -663,12 +676,6 @@ Py_INCREF(&PyFileIO_Type); PyModule_AddObject(m, "FileIO", (PyObject *) &PyFileIO_Type); - /* BufferedIOBase */ - if (PyType_Ready(&PyBufferedIOBase_Type) < 0) - goto fail; - Py_INCREF(&PyBufferedIOBase_Type); - PyModule_AddObject(m, "BufferedIOBase", (PyObject *) &PyBufferedIOBase_Type); - /* BytesIO */ PyBytesIO_Type.tp_base = &PyBufferedIOBase_Type; if (PyType_Ready(&PyBytesIO_Type) < 0) @@ -676,6 +683,13 @@ Py_INCREF(&PyBytesIO_Type); PyModule_AddObject(m, "BytesIO", (PyObject *) &PyBytesIO_Type); + /* StringIO */ + /* PyStringIO_Type.tp_base = &PyTextIOBase_Type; */ + if (PyType_Ready(&PyStringIO_Type) < 0) + goto fail; + Py_INCREF(&PyStringIO_Type); + PyModule_AddObject(m, "_StringIO", (PyObject *) &PyStringIO_Type); + /* BufferedReader */ PyBufferedReader_Type.tp_base = &PyBufferedIOBase_Type; if (PyType_Ready(&PyBufferedReader_Type) < 0) @@ -704,12 +718,6 @@ Py_INCREF(&PyBufferedRandom_Type); PyModule_AddObject(m, "BufferedRandom", (PyObject *) &PyBufferedRandom_Type); - /* BufferedIOBase */ - if (PyType_Ready(&PyTextIOBase_Type) < 0) - goto fail; - Py_INCREF(&PyTextIOBase_Type); - PyModule_AddObject(m, "TextIOBase", (PyObject *) &PyTextIOBase_Type); - /* TextIOWrapper */ PyTextIOWrapper_Type.tp_base = &PyTextIOBase_Type; if (PyType_Ready(&PyTextIOWrapper_Type) < 0) @@ -717,7 +725,7 @@ Py_INCREF(&PyTextIOWrapper_Type); PyModule_AddObject(m, "TextIOWrapper", (PyObject *) &PyTextIOWrapper_Type); - /* TextIOWrapper */ + /* IncrementalNewlineDecoder */ if (PyType_Ready(&PyIncrementalNewlineDecoder_Type) < 0) goto fail; Py_INCREF(&PyIncrementalNewlineDecoder_Type); From buildbot at python.org Fri Feb 20 20:56:58 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 20 Feb 2009 19:56:58 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090220195658.3F9461E4002@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/897 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: collin.winter 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 522, 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_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Feb 20 20:58:23 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 20 Feb 2009 20:58:23 +0100 (CET) Subject: [Python-checkins] r69813 - python/branches/io-c/Lib/test/test_memoryio.py Message-ID: <20090220195823.4F95C1E4002@bag.python.org> Author: antoine.pitrou Date: Fri Feb 20 20:58:22 2009 New Revision: 69813 Log: Add a test for StringIO properties Modified: python/branches/io-c/Lib/test/test_memoryio.py Modified: python/branches/io-c/Lib/test/test_memoryio.py ============================================================================== --- python/branches/io-c/Lib/test/test_memoryio.py (original) +++ python/branches/io-c/Lib/test/test_memoryio.py Fri Feb 20 20:58:22 2009 @@ -380,6 +380,15 @@ self.assertRaises(IOError, memio.seek, 1, 1) self.assertRaises(IOError, memio.seek, 1, 2) + def test_textio_properties(self): + memio = self.ioclass() + + # These are just dummy values but we nevertheless check them for fear + # of unexpected breakage. + self.assertEqual(memio.encoding, "utf-8") + self.assertEqual(memio.errors, "strict") + self.assertEqual(memio.line_buffering, False) + # XXX: For the Python version of io.StringIO, this is highly # dependent on the encoding used for the underlying buffer. # def test_widechar(self): From buildbot at python.org Fri Feb 20 21:00:10 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 20 Feb 2009 20:00:10 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090220200012.D85D11E4002@bag.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/1888 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: collin.winter BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 20 21:00:32 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 20 Feb 2009 20:00:32 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090220200032.452711E400C@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/665 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: collin.winter BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Feb 20 21:06:04 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 20 Feb 2009 21:06:04 +0100 (CET) Subject: [Python-checkins] r69814 - in python/branches/io-c: Lib/io.py Modules/_stringio.c Message-ID: <20090220200604.210121E4002@bag.python.org> Author: antoine.pitrou Date: Fri Feb 20 21:06:03 2009 New Revision: 69814 Log: Reimplement a few trivial StringIO functions and properties in C Modified: python/branches/io-c/Lib/io.py python/branches/io-c/Modules/_stringio.c Modified: python/branches/io-c/Lib/io.py ============================================================================== --- python/branches/io-c/Lib/io.py (original) +++ python/branches/io-c/Lib/io.py Fri Feb 20 21:06:03 2009 @@ -1915,22 +1915,6 @@ raise UnsupportedOperation("%s.buffer attribute is unsupported" % self.__class__.__name__) - # XXX Cruft to support the TextIOWrapper API. This would only - # be meaningful if StringIO supported the buffer attribute. - # Hopefully, a better solution, than adding these pseudo-attributes, - # will be found. - @property - def encoding(self): - return "utf-8" - - @property - def errors(self): - return "strict" - - @property - def line_buffering(self): - return False - def _decode_newlines(self, input, final=False): # decode input (with the eventual \r from a previous pass) if self._pending: @@ -1961,15 +1945,6 @@ return output - def writable(self): - return True - - def readable(self): - return True - - def seekable(self): - return True - _read = _io._StringIO.read _write = _io._StringIO.write _tell = _io._StringIO.tell Modified: python/branches/io-c/Modules/_stringio.c ============================================================================== --- python/branches/io-c/Modules/_stringio.c (original) +++ python/branches/io-c/Modules/_stringio.c Fri Feb 20 21:06:03 2009 @@ -301,6 +301,42 @@ return (PyObject *)self; } +static PyObject * +stringio_seekable(StringIOObject *self, PyObject *args) +{ + Py_RETURN_TRUE; +} + +static PyObject * +stringio_readable(StringIOObject *self, PyObject *args) +{ + Py_RETURN_TRUE; +} + +static PyObject * +stringio_writable(StringIOObject *self, PyObject *args) +{ + Py_RETURN_TRUE; +} + +static PyObject * +stringio_encoding(StringIOObject *self, void *context) +{ + return PyUnicode_FromString("utf-8"); +} + +static PyObject * +stringio_errors(StringIOObject *self, void *context) +{ + return PyUnicode_FromString("strict"); +} + +static PyObject * +stringio_line_buffering(StringIOObject *self, void *context) +{ + Py_RETURN_FALSE; +} + static struct PyMethodDef stringio_methods[] = { {"getvalue", (PyCFunction)stringio_getvalue, METH_VARARGS, NULL}, {"read", (PyCFunction)stringio_read, METH_VARARGS, NULL}, @@ -308,9 +344,26 @@ {"truncate", (PyCFunction)stringio_truncate, METH_VARARGS, NULL}, {"seek", (PyCFunction)stringio_seek, METH_VARARGS, NULL}, {"write", (PyCFunction)stringio_write, METH_O, NULL}, + + {"seekable", (PyCFunction)stringio_seekable, METH_NOARGS}, + {"readable", (PyCFunction)stringio_readable, METH_NOARGS}, + {"writable", (PyCFunction)stringio_writable, METH_NOARGS}, {NULL, NULL} /* sentinel */ }; +static PyGetSetDef stringio_getset[] = { + /* (following comments straight off of the original Python wrapper:) + XXX Cruft to support the TextIOWrapper API. This would only + be meaningful if StringIO supported the buffer attribute. + Hopefully, a better solution, than adding these pseudo-attributes, + will be found. + */ + {"encoding", (getter)stringio_encoding, NULL, NULL}, + {"errors", (getter)stringio_errors, NULL, NULL}, + {"line_buffering", (getter)stringio_line_buffering, NULL, NULL}, + {0} +}; + PyTypeObject PyStringIO_Type = { PyVarObject_HEAD_INIT(NULL, 0) "_StringIO", /*tp_name*/ @@ -341,7 +394,7 @@ 0, /*tp_iternext*/ stringio_methods, /*tp_methods*/ 0, /*tp_members*/ - 0, /*tp_getset*/ + stringio_getset, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ From python-checkins at python.org Fri Feb 20 21:13:12 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 20 Feb 2009 21:13:12 +0100 (CET) Subject: [Python-checkins] r69815 - in python/branches/io-c: Lib/test/test_io.py Modules/_textio.c Message-ID: <20090220201312.0D3221E4002@bag.python.org> Author: antoine.pitrou Date: Fri Feb 20 21:13:11 2009 New Revision: 69815 Log: Add the line_buffering property to TextIOWrapper, and test for it Modified: python/branches/io-c/Lib/test/test_io.py python/branches/io-c/Modules/_textio.c Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Fri Feb 20 21:13:11 2009 @@ -1255,7 +1255,11 @@ b = io.BufferedReader(r, 1000) t = io.TextIOWrapper(b) t.__init__(b, encoding="latin1", newline="\r\n") - t.__init__(b, encoding="utf8") + self.assertEquals(t.encoding, "latin1") + self.assertEquals(t.line_buffering, False) + t.__init__(b, encoding="utf8", line_buffering=True) + self.assertEquals(t.encoding, "utf8") + self.assertEquals(t.line_buffering, True) self.assertEquals("\xe9\n", t.readline()) self.assertRaises(TypeError, t.__init__, b, newline=42) self.assertRaises(ValueError, t.read) Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Fri Feb 20 21:13:11 2009 @@ -584,12 +584,12 @@ PyObject *readnl; PyObject *errors; const char *writenl; /* utf-8 encoded, NULL stands for \n */ - int line_buffering:1; - int readuniversal:1; - int readtranslate:1; - int writetranslate:1; - int seekable:1; - int telling:1; + char line_buffering; + char readuniversal; + char readtranslate; + char writetranslate; + char seekable; + char telling; /* Specialized encoding func (see below) */ encodefunc_t encodefunc; @@ -2312,6 +2312,7 @@ static PyMemberDef TextIOWrapper_members[] = { {"encoding", T_OBJECT, offsetof(PyTextIOWrapperObject, encoding), READONLY}, {"buffer", T_OBJECT, offsetof(PyTextIOWrapperObject, buffer), READONLY}, + {"line_buffering", T_BOOL, offsetof(PyTextIOWrapperObject, line_buffering), READONLY}, {NULL} }; From python-checkins at python.org Fri Feb 20 21:42:54 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 20 Feb 2009 21:42:54 +0100 (CET) Subject: [Python-checkins] r69816 - python/trunk/Lib/lib-tk/turtle.py Message-ID: <20090220204254.BDBA51E400C@bag.python.org> Author: mark.dickinson Date: Fri Feb 20 21:42:53 2009 New Revision: 69816 Log: Issue #5295: Typos in turtle.py Modified: python/trunk/Lib/lib-tk/turtle.py Modified: python/trunk/Lib/lib-tk/turtle.py ============================================================================== --- python/trunk/Lib/lib-tk/turtle.py (original) +++ python/trunk/Lib/lib-tk/turtle.py Fri Feb 20 21:42:53 2009 @@ -38,7 +38,7 @@ ----- turtle.py This module is an extended reimplementation of turtle.py from the -Python standard distribution up to Python 2.5. (See: http:\\www.python.org) +Python standard distribution up to Python 2.5. (See: http://www.python.org) It tries to keep the merits of turtle.py and to be (nearly) 100% compatible with it. This means in the first place to enable the @@ -54,8 +54,8 @@ - Different turtle shapes, gif-images as turtle shapes, user defined and user controllable turtle shapes, among them compound - (multicolored) shapes. Turtle shapes can be stgretched and tilted, which - makes turtles zu very versatile geometrical objects. + (multicolored) shapes. Turtle shapes can be stretched and tilted, which + makes turtles very versatile geometrical objects. - Fine control over turtle movement and screen updates via delay(), and enhanced tracer() and speed() methods. @@ -64,7 +64,7 @@ following the early Logo traditions. This reduces the boring work of typing long sequences of commands, which often occur in a natural way when kids try to program fancy pictures on their first encounter with - turtle graphcis. + turtle graphics. - Turtles now have an undo()-method with configurable undo-buffer. @@ -91,12 +91,12 @@ - If configured appropriately the module reads in docstrings from a docstring dictionary in some different language, supplied separately and replaces - the english ones by those read in. There is a utility function - write_docstringdict() to write a dictionary with the original (english) + the English ones by those read in. There is a utility function + write_docstringdict() to write a dictionary with the original (English) docstrings to disc, so it can serve as a template for translations. Behind the scenes there are some features included with possible -extensionsin in mind. These will be commented and documented elsewhere. +extensions in in mind. These will be commented and documented elsewhere. """ @@ -299,7 +299,7 @@ ############################################################################## ### From here up to line : Tkinter - Interface for turtle.py ### -### May be replaced by an interface to some different graphcis-toolkit ### +### May be replaced by an interface to some different graphics toolkit ### ############################################################################## ## helper functions for Scrolled Canvas, to forward Canvas-methods @@ -382,7 +382,7 @@ self._rootwindow.bind('', self.onResize) def reset(self, canvwidth=None, canvheight=None, bg = None): - """Ajust canvas and scrollbars according to given canvas size.""" + """Adjust canvas and scrollbars according to given canvas size.""" if canvwidth: self.canvwidth = canvwidth if canvheight: @@ -777,7 +777,7 @@ self.cv.coords(item, *newcoordlist) def _resize(self, canvwidth=None, canvheight=None, bg=None): - """Resize the canvas, the turtles are drawing on. Does + """Resize the canvas the turtles are drawing on. Does not alter the drawing window. """ # needs amendment @@ -952,7 +952,7 @@ def clear(self): """Delete all drawings and all turtles from the TurtleScreen. - Reset empty TurtleScreen to it's initial state: white background, + Reset empty TurtleScreen to its initial state: white background, no backgroundimage, no eventbindings and tracing on. No argument. @@ -1318,7 +1318,7 @@ fun -- a function with no arguments key -- a string: key (e.g. "a") or key-symbol (e.g. "space") - In order ro be able to register key-events, TurtleScreen + In order to be able to register key-events, TurtleScreen must have focus. (See method listen.) Example (for a TurtleScreen instance named screen @@ -1400,7 +1400,7 @@ self._bgpicname = picname def screensize(self, canvwidth=None, canvheight=None, bg=None): - """Resize the canvas, the turtles are drawing on. + """Resize the canvas the turtles are drawing on. Optional arguments: canvwidth -- positive integer, new width of canvas in pixels @@ -1693,8 +1693,8 @@ No arguments. - Move turtle to the origin - coordinates (0,0) and set it's - heading to it's start-orientation (which depends on mode). + Move turtle to the origin - coordinates (0,0) and set its + heading to its start-orientation (which depends on mode). Example (for a Turtle instance named turtle): >>> turtle.home() @@ -2266,7 +2266,7 @@ "outline" : positive number "tilt" : number - This dicionary can be used as argument for a subsequent + This dictionary can be used as argument for a subsequent pen()-call 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. @@ -2414,7 +2414,7 @@ class RawTurtle(TPen, TNavigator): """Animation part of the RawTurtle. Puts RawTurtle upon a TurtleScreen and provides tools for - it's animation. + its animation. """ screens = [] @@ -2459,7 +2459,7 @@ self._update() def reset(self): - """Delete the turtle's drawings and restore it's default values. + """Delete the turtle's drawings and restore its default values. No argument. , @@ -2749,7 +2749,7 @@ Return the current tilt-angle, i. e. the angle between the orientation of the turtleshape and the heading of the turtle - (it's direction of movement). + (its direction of movement). Examples (for a Turtle instance named turtle): >>> turtle.shape("circle") @@ -2794,7 +2794,7 @@ def _drawturtle(self): """Manages the correct rendering of the turtle with respect to - it's shape, resizemode, strech and tilt etc.""" + its shape, resizemode, strech and tilt etc.""" screen = self.screen shape = screen._shapes[self.turtle.shapeIndex] ttype = shape._type @@ -2848,7 +2848,7 @@ ############################## stamp stuff ############################### def stamp(self): - """Stamp a copy of the turtleshape onto the canvas and return it's id. + """Stamp a copy of the turtleshape onto the canvas and return its id. No argument. From python-checkins at python.org Fri Feb 20 21:45:50 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 20 Feb 2009 21:45:50 +0100 (CET) Subject: [Python-checkins] r69817 - in python/branches/io-c: Lib/test/test_io.py Modules/_textio.c Message-ID: <20090220204550.CCAB71E4041@bag.python.org> Author: antoine.pitrou Date: Fri Feb 20 21:45:50 2009 New Revision: 69817 Log: Allow IncrementalNewlineDecoder to take unicode objects as decoding input if the decoder parameter is None This will help rewriting StringIO to C Modified: python/branches/io-c/Lib/test/test_io.py python/branches/io-c/Modules/_textio.c Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Fri Feb 20 21:45:50 2009 @@ -1745,7 +1745,10 @@ self.assertEqual(buffer.seekable(), txt.seekable()) - def check_newline_decoder_utf8(self, decoder): + +class IncrementalNewlineDecoderTest(unittest.TestCase): + + def check_newline_decoding_utf8(self, decoder): # UTF-8 specific tests for a newline decoder def _check_decode(b, s, **kwargs): # We exercise getstate() / setstate() as well as decode() @@ -1787,12 +1790,20 @@ _check_decode(b'\xe8\xa2\x88\r', "\u8888") _check_decode(b'\n', "\n") - def check_newline_decoder(self, decoder, encoding): + def check_newline_decoding(self, decoder, encoding): result = [] - encoder = codecs.getincrementalencoder(encoding)() - def _decode_bytewise(s): - for b in encoder.encode(s): - result.append(decoder.decode(bytes([b]))) + if encoding is not None: + encoder = codecs.getincrementalencoder(encoding)() + def _decode_bytewise(s): + # Decode one byte at a time + for b in encoder.encode(s): + result.append(decoder.decode(bytes([b]))) + else: + encoder = None + def _decode_bytewise(s): + # Decode one char at a time + for c in s: + result.append(decoder.decode(c)) self.assertEquals(decoder.newlines, None) _decode_bytewise("abc\n\r") self.assertEquals(decoder.newlines, '\n') @@ -1805,22 +1816,28 @@ _decode_bytewise("abc\r") self.assertEquals("".join(result), "abc\n\nabcabc\nabcabc") decoder.reset() - self.assertEquals(decoder.decode("abc".encode(encoding)), "abc") + input = "abc" + if encoder is not None: + encoder.reset() + input = encoder.encode(input) + self.assertEquals(decoder.decode(input), "abc") self.assertEquals(decoder.newlines, None) def test_newline_decoder(self): encodings = ( - 'utf-8', 'latin-1', + # None meaning the IncrementalNewlineDecoder takes unicode input + # rather than bytes input + None, 'utf-8', 'latin-1', 'utf-16', 'utf-16-le', 'utf-16-be', 'utf-32', 'utf-32-le', 'utf-32-be', ) for enc in encodings: - decoder = codecs.getincrementaldecoder(enc)() + decoder = enc and codecs.getincrementaldecoder(enc)() decoder = io.IncrementalNewlineDecoder(decoder, translate=True) - self.check_newline_decoder(decoder, enc) + self.check_newline_decoding(decoder, enc) decoder = codecs.getincrementaldecoder("utf-8")() decoder = io.IncrementalNewlineDecoder(decoder, translate=True) - self.check_newline_decoder_utf8(decoder) + self.check_newline_decoding_utf8(decoder) # XXX Tests for open() @@ -1933,7 +1950,8 @@ BufferedReaderTest, BufferedWriterTest, BufferedRWPairTest, BufferedRandomTest, StatefulIncrementalDecoderTest, - TextIOWrapperTest, MiscIOTest + IncrementalNewlineDecoderTest, + TextIOWrapperTest, MiscIOTest, ) if __name__ == "__main__": Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Fri Feb 20 21:45:50 2009 @@ -154,7 +154,9 @@ "another incremental decoder, translating \\r\\n and \\r into \\n. It also\n" "records the types of newlines encountered. When used with\n" "translate=False, it ensures that the newline sequence is returned in\n" - "one piece.\n" + "one piece. When used with decoder=None, it expects unicode strings as\n" + "decode input and translates newlines without first invoking an external\n" + "decoder.\n" ); typedef struct { @@ -226,8 +228,15 @@ } /* decode input (with the eventual \r from a previous pass) */ - output = PyObject_CallMethodObjArgs(self->decoder, _PyIO_str_decode, - input, final ? Py_True : Py_False, NULL); + if (self->decoder != Py_None) { + output = PyObject_CallMethodObjArgs(self->decoder, + _PyIO_str_decode, input, final ? Py_True : Py_False, NULL); + } + else { + output = input; + Py_INCREF(output); + } + if (output == NULL) return NULL; @@ -421,20 +430,25 @@ static PyObject * IncrementalNewlineDecoder_getstate(PyNewLineDecoderObject *self, PyObject *args) { - PyObject *state = PyObject_CallMethodObjArgs(self->decoder, - _PyIO_str_getstate, NULL); PyObject *buffer; unsigned PY_LONG_LONG flag; - if (state == NULL) - return NULL; - - if (!PyArg_Parse(state, "(OK)", &buffer, &flag)) { + if (self->decoder != Py_None) { + PyObject *state = PyObject_CallMethodObjArgs(self->decoder, + _PyIO_str_getstate, NULL); + if (state == NULL) + return NULL; + if (!PyArg_Parse(state, "(OK)", &buffer, &flag)) { + Py_DECREF(state); + return NULL; + } + Py_INCREF(buffer); Py_DECREF(state); - return NULL; } - Py_INCREF(buffer); - Py_DECREF(state); + else { + buffer = PyBytes_FromString(""); + flag = 0; + } flag <<= 1; if (self->pendingcr) flag |= 1; @@ -453,7 +467,11 @@ self->pendingcr = (int) flag & 1; flag >>= 1; - return PyObject_CallMethod(self->decoder, "setstate", "((OK))", buffer, flag); + if (self->decoder != Py_None) + return PyObject_CallMethod(self->decoder, + "setstate", "((OK))", buffer, flag); + else + Py_RETURN_NONE; } static PyObject * @@ -461,7 +479,10 @@ { self->seennl = 0; self->pendingcr = 0; - return PyObject_CallMethodObjArgs(self->decoder, _PyIO_str_reset, NULL); + if (self->decoder != Py_None) + return PyObject_CallMethodObjArgs(self->decoder, _PyIO_str_reset, NULL); + else + Py_RETURN_NONE; } static PyObject * From python-checkins at python.org Fri Feb 20 21:46:31 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 20 Feb 2009 21:46:31 +0100 (CET) Subject: [Python-checkins] r69818 - in python/branches/release26-maint: Lib/lib-tk/turtle.py Message-ID: <20090220204631.0339F1E4032@bag.python.org> Author: mark.dickinson Date: Fri Feb 20 21:46:30 2009 New Revision: 69818 Log: Merged revisions 69816 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69816 | mark.dickinson | 2009-02-20 20:42:53 +0000 (Fri, 20 Feb 2009) | 2 lines Issue #5295: Typos in turtle.py ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/lib-tk/turtle.py Modified: python/branches/release26-maint/Lib/lib-tk/turtle.py ============================================================================== --- python/branches/release26-maint/Lib/lib-tk/turtle.py (original) +++ python/branches/release26-maint/Lib/lib-tk/turtle.py Fri Feb 20 21:46:30 2009 @@ -38,7 +38,7 @@ ----- turtle.py This module is an extended reimplementation of turtle.py from the -Python standard distribution up to Python 2.5. (See: http:\\www.python.org) +Python standard distribution up to Python 2.5. (See: http://www.python.org) It tries to keep the merits of turtle.py and to be (nearly) 100% compatible with it. This means in the first place to enable the @@ -54,8 +54,8 @@ - Different turtle shapes, gif-images as turtle shapes, user defined and user controllable turtle shapes, among them compound - (multicolored) shapes. Turtle shapes can be stgretched and tilted, which - makes turtles zu very versatile geometrical objects. + (multicolored) shapes. Turtle shapes can be stretched and tilted, which + makes turtles very versatile geometrical objects. - Fine control over turtle movement and screen updates via delay(), and enhanced tracer() and speed() methods. @@ -64,7 +64,7 @@ following the early Logo traditions. This reduces the boring work of typing long sequences of commands, which often occur in a natural way when kids try to program fancy pictures on their first encounter with - turtle graphcis. + turtle graphics. - Turtles now have an undo()-method with configurable undo-buffer. @@ -91,12 +91,12 @@ - If configured appropriately the module reads in docstrings from a docstring dictionary in some different language, supplied separately and replaces - the english ones by those read in. There is a utility function - write_docstringdict() to write a dictionary with the original (english) + the English ones by those read in. There is a utility function + write_docstringdict() to write a dictionary with the original (English) docstrings to disc, so it can serve as a template for translations. Behind the scenes there are some features included with possible -extensionsin in mind. These will be commented and documented elsewhere. +extensions in in mind. These will be commented and documented elsewhere. """ @@ -299,7 +299,7 @@ ############################################################################## ### From here up to line : Tkinter - Interface for turtle.py ### -### May be replaced by an interface to some different graphcis-toolkit ### +### May be replaced by an interface to some different graphics toolkit ### ############################################################################## ## helper functions for Scrolled Canvas, to forward Canvas-methods @@ -382,7 +382,7 @@ self._rootwindow.bind('', self.onResize) def reset(self, canvwidth=None, canvheight=None, bg = None): - """Ajust canvas and scrollbars according to given canvas size.""" + """Adjust canvas and scrollbars according to given canvas size.""" if canvwidth: self.canvwidth = canvwidth if canvheight: @@ -777,7 +777,7 @@ self.cv.coords(item, *newcoordlist) def _resize(self, canvwidth=None, canvheight=None, bg=None): - """Resize the canvas, the turtles are drawing on. Does + """Resize the canvas the turtles are drawing on. Does not alter the drawing window. """ # needs amendment @@ -952,7 +952,7 @@ def clear(self): """Delete all drawings and all turtles from the TurtleScreen. - Reset empty TurtleScreen to it's initial state: white background, + Reset empty TurtleScreen to its initial state: white background, no backgroundimage, no eventbindings and tracing on. No argument. @@ -1318,7 +1318,7 @@ fun -- a function with no arguments key -- a string: key (e.g. "a") or key-symbol (e.g. "space") - In order ro be able to register key-events, TurtleScreen + In order to be able to register key-events, TurtleScreen must have focus. (See method listen.) Example (for a TurtleScreen instance named screen @@ -1400,7 +1400,7 @@ self._bgpicname = picname def screensize(self, canvwidth=None, canvheight=None, bg=None): - """Resize the canvas, the turtles are drawing on. + """Resize the canvas the turtles are drawing on. Optional arguments: canvwidth -- positive integer, new width of canvas in pixels @@ -1693,8 +1693,8 @@ No arguments. - Move turtle to the origin - coordinates (0,0) and set it's - heading to it's start-orientation (which depends on mode). + Move turtle to the origin - coordinates (0,0) and set its + heading to its start-orientation (which depends on mode). Example (for a Turtle instance named turtle): >>> turtle.home() @@ -2266,7 +2266,7 @@ "outline" : positive number "tilt" : number - This dicionary can be used as argument for a subsequent + This dictionary can be used as argument for a subsequent pen()-call 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. @@ -2414,7 +2414,7 @@ class RawTurtle(TPen, TNavigator): """Animation part of the RawTurtle. Puts RawTurtle upon a TurtleScreen and provides tools for - it's animation. + its animation. """ screens = [] @@ -2459,7 +2459,7 @@ self._update() def reset(self): - """Delete the turtle's drawings and restore it's default values. + """Delete the turtle's drawings and restore its default values. No argument. , @@ -2749,7 +2749,7 @@ Return the current tilt-angle, i. e. the angle between the orientation of the turtleshape and the heading of the turtle - (it's direction of movement). + (its direction of movement). Examples (for a Turtle instance named turtle): >>> turtle.shape("circle") @@ -2794,7 +2794,7 @@ def _drawturtle(self): """Manages the correct rendering of the turtle with respect to - it's shape, resizemode, strech and tilt etc.""" + its shape, resizemode, strech and tilt etc.""" screen = self.screen shape = screen._shapes[self.turtle.shapeIndex] ttype = shape._type @@ -2848,7 +2848,7 @@ ############################## stamp stuff ############################### def stamp(self): - """Stamp a copy of the turtleshape onto the canvas and return it's id. + """Stamp a copy of the turtleshape onto the canvas and return its id. No argument. From python-checkins at python.org Fri Feb 20 21:50:22 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 20 Feb 2009 21:50:22 +0100 (CET) Subject: [Python-checkins] r69819 - in python/branches/py3k: Lib/turtle.py Message-ID: <20090220205022.257761E400C@bag.python.org> Author: mark.dickinson Date: Fri Feb 20 21:50:21 2009 New Revision: 69819 Log: Merged revisions 69816 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69816 | mark.dickinson | 2009-02-20 20:42:53 +0000 (Fri, 20 Feb 2009) | 2 lines Issue #5295: Typos in turtle.py ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/turtle.py Modified: python/branches/py3k/Lib/turtle.py ============================================================================== --- python/branches/py3k/Lib/turtle.py (original) +++ python/branches/py3k/Lib/turtle.py Fri Feb 20 21:50:21 2009 @@ -55,7 +55,7 @@ - Different turtle shapes, gif-images as turtle shapes, user defined and user controllable turtle shapes, among them compound (multicolored) shapes. Turtle shapes can be stgretched and tilted, which - makes turtles zu very versatile geometrical objects. + makes turtles very versatile geometrical objects. - Fine control over turtle movement and screen updates via delay(), and enhanced tracer() and speed() methods. From python-checkins at python.org Fri Feb 20 21:51:52 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 20 Feb 2009 21:51:52 +0100 (CET) Subject: [Python-checkins] r69820 - in python/branches/release30-maint: Lib/turtle.py Message-ID: <20090220205152.A8AF81E4002@bag.python.org> Author: mark.dickinson Date: Fri Feb 20 21:51:52 2009 New Revision: 69820 Log: Merged revisions 69819 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69819 | mark.dickinson | 2009-02-20 20:50:21 +0000 (Fri, 20 Feb 2009) | 9 lines Merged revisions 69816 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69816 | mark.dickinson | 2009-02-20 20:42:53 +0000 (Fri, 20 Feb 2009) | 2 lines Issue #5295: Typos in turtle.py ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/turtle.py Modified: python/branches/release30-maint/Lib/turtle.py ============================================================================== --- python/branches/release30-maint/Lib/turtle.py (original) +++ python/branches/release30-maint/Lib/turtle.py Fri Feb 20 21:51:52 2009 @@ -55,7 +55,7 @@ - Different turtle shapes, gif-images as turtle shapes, user defined and user controllable turtle shapes, among them compound (multicolored) shapes. Turtle shapes can be stgretched and tilted, which - makes turtles zu very versatile geometrical objects. + makes turtles very versatile geometrical objects. - Fine control over turtle movement and screen updates via delay(), and enhanced tracer() and speed() methods. From python-checkins at python.org Fri Feb 20 21:53:56 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 20 Feb 2009 21:53:56 +0100 (CET) Subject: [Python-checkins] r69821 - python/branches/py3k/Lib/turtle.py Message-ID: <20090220205356.50BD31E4059@bag.python.org> Author: mark.dickinson Date: Fri Feb 20 21:53:56 2009 New Revision: 69821 Log: More typos in Lib/turtle.py Modified: python/branches/py3k/Lib/turtle.py Modified: python/branches/py3k/Lib/turtle.py ============================================================================== --- python/branches/py3k/Lib/turtle.py (original) +++ python/branches/py3k/Lib/turtle.py Fri Feb 20 21:53:56 2009 @@ -38,7 +38,7 @@ ----- turtle.py This module is an extended reimplementation of turtle.py from the -Python standard distribution up to Python 2.5. (See: http:\\www.python.org) +Python standard distribution up to Python 2.5. (See: http://www.python.org) It tries to keep the merits of turtle.py and to be (nearly) 100% compatible with it. This means in the first place to enable the @@ -54,7 +54,7 @@ - Different turtle shapes, gif-images as turtle shapes, user defined and user controllable turtle shapes, among them compound - (multicolored) shapes. Turtle shapes can be stgretched and tilted, which + (multicolored) shapes. Turtle shapes can be stretched and tilted, which makes turtles very versatile geometrical objects. - Fine control over turtle movement and screen updates via delay(), @@ -64,7 +64,7 @@ following the early Logo traditions. This reduces the boring work of typing long sequences of commands, which often occur in a natural way when kids try to program fancy pictures on their first encounter with - turtle graphcis. + turtle graphics. - Turtles now have an undo()-method with configurable undo-buffer. @@ -91,12 +91,12 @@ - If configured appropriately the module reads in docstrings from a docstring dictionary in some different language, supplied separately and replaces - the english ones by those read in. There is a utility function - write_docstringdict() to write a dictionary with the original (english) + the English ones by those read in. There is a utility function + write_docstringdict() to write a dictionary with the original (English) docstrings to disc, so it can serve as a template for translations. Behind the scenes there are some features included with possible -extensionsin in mind. These will be commented and documented elsewhere. +extensions in in mind. These will be commented and documented elsewhere. """ @@ -301,7 +301,7 @@ ############################################################################## ### From here up to line : Tkinter - Interface for turtle.py ### -### May be replaced by an interface to some different graphcis-toolkit ### +### May be replaced by an interface to some different graphics toolkit ### ############################################################################## ## helper functions for Scrolled Canvas, to forward Canvas-methods @@ -380,7 +380,7 @@ self._rootwindow.bind('', self.onResize) def reset(self, canvwidth=None, canvheight=None, bg = None): - """Ajust canvas and scrollbars according to given canvas size.""" + """Adjust canvas and scrollbars according to given canvas size.""" if canvwidth: self.canvwidth = canvwidth if canvheight: @@ -776,7 +776,7 @@ self.cv.coords(item, *newcoordlist) def _resize(self, canvwidth=None, canvheight=None, bg=None): - """Resize the canvas, the turtles are drawing on. Does + """Resize the canvas the turtles are drawing on. Does not alter the drawing window. """ # needs amendment @@ -951,7 +951,7 @@ def clear(self): """Delete all drawings and all turtles from the TurtleScreen. - Reset empty TurtleScreen to it's initial state: white background, + Reset empty TurtleScreen to its initial state: white background, no backgroundimage, no eventbindings and tracing on. No argument. @@ -1317,7 +1317,7 @@ fun -- a function with no arguments key -- a string: key (e.g. "a") or key-symbol (e.g. "space") - In order ro be able to register key-events, TurtleScreen + In order to be able to register key-events, TurtleScreen must have focus. (See method listen.) Example (for a TurtleScreen instance named screen @@ -1399,7 +1399,7 @@ self._bgpicname = picname def screensize(self, canvwidth=None, canvheight=None, bg=None): - """Resize the canvas, the turtles are drawing on. + """Resize the canvas the turtles are drawing on. Optional arguments: canvwidth -- positive integer, new width of canvas in pixels @@ -1692,8 +1692,8 @@ No arguments. - Move turtle to the origin - coordinates (0,0) and set it's - heading to it's start-orientation (which depends on mode). + Move turtle to the origin - coordinates (0,0) and set its + heading to its start-orientation (which depends on mode). Example (for a Turtle instance named turtle): >>> turtle.home() @@ -2265,7 +2265,7 @@ "outline" : positive number "tilt" : number - This dicionary can be used as argument for a subsequent + This dictionary can be used as argument for a subsequent pen()-call 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. @@ -2413,7 +2413,7 @@ class RawTurtle(TPen, TNavigator): """Animation part of the RawTurtle. Puts RawTurtle upon a TurtleScreen and provides tools for - it's animation. + its animation. """ screens = [] @@ -2458,7 +2458,7 @@ self._update() def reset(self): - """Delete the turtle's drawings and restore it's default values. + """Delete the turtle's drawings and restore its default values. No argument. , @@ -2748,7 +2748,7 @@ Return the current tilt-angle, i. e. the angle between the orientation of the turtleshape and the heading of the turtle - (it's direction of movement). + (its direction of movement). Examples (for a Turtle instance named turtle): >>> turtle.shape("circle") @@ -2793,7 +2793,7 @@ def _drawturtle(self): """Manages the correct rendering of the turtle with respect to - it's shape, resizemode, strech and tilt etc.""" + its shape, resizemode, strech and tilt etc.""" screen = self.screen shape = screen._shapes[self.turtle.shapeIndex] ttype = shape._type @@ -2847,7 +2847,7 @@ ############################## stamp stuff ############################### def stamp(self): - """Stamp a copy of the turtleshape onto the canvas and return it's id. + """Stamp a copy of the turtleshape onto the canvas and return its id. No argument. From python-checkins at python.org Fri Feb 20 21:54:32 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 20 Feb 2009 21:54:32 +0100 (CET) Subject: [Python-checkins] r69822 - in python/branches/release30-maint: Lib/turtle.py Message-ID: <20090220205432.BAACC1E4002@bag.python.org> Author: mark.dickinson Date: Fri Feb 20 21:54:32 2009 New Revision: 69822 Log: Merged revisions 69821 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69821 | mark.dickinson | 2009-02-20 20:53:56 +0000 (Fri, 20 Feb 2009) | 2 lines More typos in Lib/turtle.py ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/turtle.py Modified: python/branches/release30-maint/Lib/turtle.py ============================================================================== --- python/branches/release30-maint/Lib/turtle.py (original) +++ python/branches/release30-maint/Lib/turtle.py Fri Feb 20 21:54:32 2009 @@ -38,7 +38,7 @@ ----- turtle.py This module is an extended reimplementation of turtle.py from the -Python standard distribution up to Python 2.5. (See: http:\\www.python.org) +Python standard distribution up to Python 2.5. (See: http://www.python.org) It tries to keep the merits of turtle.py and to be (nearly) 100% compatible with it. This means in the first place to enable the @@ -54,7 +54,7 @@ - Different turtle shapes, gif-images as turtle shapes, user defined and user controllable turtle shapes, among them compound - (multicolored) shapes. Turtle shapes can be stgretched and tilted, which + (multicolored) shapes. Turtle shapes can be stretched and tilted, which makes turtles very versatile geometrical objects. - Fine control over turtle movement and screen updates via delay(), @@ -64,7 +64,7 @@ following the early Logo traditions. This reduces the boring work of typing long sequences of commands, which often occur in a natural way when kids try to program fancy pictures on their first encounter with - turtle graphcis. + turtle graphics. - Turtles now have an undo()-method with configurable undo-buffer. @@ -91,12 +91,12 @@ - If configured appropriately the module reads in docstrings from a docstring dictionary in some different language, supplied separately and replaces - the english ones by those read in. There is a utility function - write_docstringdict() to write a dictionary with the original (english) + the English ones by those read in. There is a utility function + write_docstringdict() to write a dictionary with the original (English) docstrings to disc, so it can serve as a template for translations. Behind the scenes there are some features included with possible -extensionsin in mind. These will be commented and documented elsewhere. +extensions in in mind. These will be commented and documented elsewhere. """ @@ -301,7 +301,7 @@ ############################################################################## ### From here up to line : Tkinter - Interface for turtle.py ### -### May be replaced by an interface to some different graphcis-toolkit ### +### May be replaced by an interface to some different graphics toolkit ### ############################################################################## ## helper functions for Scrolled Canvas, to forward Canvas-methods @@ -380,7 +380,7 @@ self._rootwindow.bind('', self.onResize) def reset(self, canvwidth=None, canvheight=None, bg = None): - """Ajust canvas and scrollbars according to given canvas size.""" + """Adjust canvas and scrollbars according to given canvas size.""" if canvwidth: self.canvwidth = canvwidth if canvheight: @@ -776,7 +776,7 @@ self.cv.coords(item, *newcoordlist) def _resize(self, canvwidth=None, canvheight=None, bg=None): - """Resize the canvas, the turtles are drawing on. Does + """Resize the canvas the turtles are drawing on. Does not alter the drawing window. """ # needs amendment @@ -951,7 +951,7 @@ def clear(self): """Delete all drawings and all turtles from the TurtleScreen. - Reset empty TurtleScreen to it's initial state: white background, + Reset empty TurtleScreen to its initial state: white background, no backgroundimage, no eventbindings and tracing on. No argument. @@ -1317,7 +1317,7 @@ fun -- a function with no arguments key -- a string: key (e.g. "a") or key-symbol (e.g. "space") - In order ro be able to register key-events, TurtleScreen + In order to be able to register key-events, TurtleScreen must have focus. (See method listen.) Example (for a TurtleScreen instance named screen @@ -1399,7 +1399,7 @@ self._bgpicname = picname def screensize(self, canvwidth=None, canvheight=None, bg=None): - """Resize the canvas, the turtles are drawing on. + """Resize the canvas the turtles are drawing on. Optional arguments: canvwidth -- positive integer, new width of canvas in pixels @@ -1692,8 +1692,8 @@ No arguments. - Move turtle to the origin - coordinates (0,0) and set it's - heading to it's start-orientation (which depends on mode). + Move turtle to the origin - coordinates (0,0) and set its + heading to its start-orientation (which depends on mode). Example (for a Turtle instance named turtle): >>> turtle.home() @@ -2265,7 +2265,7 @@ "outline" : positive number "tilt" : number - This dicionary can be used as argument for a subsequent + This dictionary can be used as argument for a subsequent pen()-call 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. @@ -2413,7 +2413,7 @@ class RawTurtle(TPen, TNavigator): """Animation part of the RawTurtle. Puts RawTurtle upon a TurtleScreen and provides tools for - it's animation. + its animation. """ screens = [] @@ -2458,7 +2458,7 @@ self._update() def reset(self): - """Delete the turtle's drawings and restore it's default values. + """Delete the turtle's drawings and restore its default values. No argument. , @@ -2748,7 +2748,7 @@ Return the current tilt-angle, i. e. the angle between the orientation of the turtleshape and the heading of the turtle - (it's direction of movement). + (its direction of movement). Examples (for a Turtle instance named turtle): >>> turtle.shape("circle") @@ -2793,7 +2793,7 @@ def _drawturtle(self): """Manages the correct rendering of the turtle with respect to - it's shape, resizemode, strech and tilt etc.""" + its shape, resizemode, strech and tilt etc.""" screen = self.screen shape = screen._shapes[self.turtle.shapeIndex] ttype = shape._type @@ -2847,7 +2847,7 @@ ############################## stamp stuff ############################### def stamp(self): - """Stamp a copy of the turtleshape onto the canvas and return it's id. + """Stamp a copy of the turtleshape onto the canvas and return its id. No argument. From nnorwitz at gmail.com Fri Feb 20 22:16:13 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 20 Feb 2009 16:16:13 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090220211613.GA11517@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663882 refs] From nnorwitz at gmail.com Fri Feb 20 22:29:56 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 20 Feb 2009 16:29:56 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090220212956.GA18200@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 [17163 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17142 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663147 refs] From buildbot at python.org Fri Feb 20 22:36:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 20 Feb 2009 21:36:54 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090220213654.E43F51E4002@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/136 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 buildbot at python.org Fri Feb 20 22:39:49 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 20 Feb 2009 21:39:49 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian trunk Message-ID: <20090220213949.A664C1E4002@bag.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/120 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: benjamin.peterson,collin.winter,eric.smith,georg.brandl,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_modulefinder test_site test_smtplib ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 20 22:58:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 20 Feb 2009 21:58:28 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 2.6 Message-ID: <20090220215828.C36381E4002@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/139 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: Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-ubuntu-i386/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/home/pybot/buildarea/2.6.klose-ubuntu-i386/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/home/pybot/buildarea/2.6.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/2.6.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') sincerely, -The Buildbot From buildbot at python.org Fri Feb 20 23:47:21 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 20 Feb 2009 22:47:21 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090220224721.9DE5A1E4002@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/325 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: 3 tests failed: test_posix test_site test_subprocess ====================================================================== 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From buildbot at python.org Fri Feb 20 23:51:02 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 20 Feb 2009 22:51:02 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090220225102.380EB1E4002@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/130 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: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ppc/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/home/pybot/buildarea/2.6.klose-debian-ppc/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/home/pybot/buildarea/2.6.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/2.6.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_platform make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 21 00:25:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 20 Feb 2009 23:25:35 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090220232535.616ED1E4002@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/347 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: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 21 00:54:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 20 Feb 2009 23:54:20 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090220235420.78B7E1E4015@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/170 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_posix test_smtplib 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 Sat Feb 21 02:00:30 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 21 Feb 2009 02:00:30 +0100 (CET) Subject: [Python-checkins] r69827 - in python/branches/io-c: Lib/io.py Lib/test/test_memoryio.py Modules/_iobase.c Modules/_iomodule.h Modules/_stringio.c Modules/_textio.c Modules/io.c Message-ID: <20090221010030.7E9281E4002@bag.python.org> Author: antoine.pitrou Date: Sat Feb 21 02:00:30 2009 New Revision: 69827 Log: Rewrite most of StringIO in C. Some almost empty stubs remain to be converted. Modified: python/branches/io-c/Lib/io.py python/branches/io-c/Lib/test/test_memoryio.py python/branches/io-c/Modules/_iobase.c python/branches/io-c/Modules/_iomodule.h python/branches/io-c/Modules/_stringio.c python/branches/io-c/Modules/_textio.c python/branches/io-c/Modules/io.c Modified: python/branches/io-c/Lib/io.py ============================================================================== --- python/branches/io-c/Lib/io.py (original) +++ python/branches/io-c/Lib/io.py Sat Feb 21 02:00:30 2009 @@ -1872,15 +1872,6 @@ return self.buffer.getvalue().decode(self._encoding, self._errors) try: - # This subclass is a reimplementation of the TextIOWrapper - # interface without any of its text decoding facilities. All the - # stored data is manipulated with the efficient - # _io._StringIO extension type. Also, the newline decoding - # mechanism of IncrementalNewlineDecoder is reimplemented here for - # efficiency. Doing otherwise, would require us to implement a - # fake decoder which would add an additional and unnecessary layer - # on top of the _StringIO methods. - class StringIO(_io._StringIO, TextIOBase): """Text I/O implementation using an in-memory buffer. @@ -1888,64 +1879,8 @@ argument is like the one of TextIOWrapper's constructor. """ - _CHUNK_SIZE = 4096 - - def __init__(self, initial_value="", newline="\n"): - if newline not in (None, "", "\n", "\r", "\r\n"): - raise ValueError("illegal newline value: %r" % (newline,)) - - self._readuniversal = not newline - self._readtranslate = newline is None - self._readnl = newline - self._writetranslate = newline != "" - self._writenl = newline or os.linesep - self._pending = "" - self._seennl = 0 - - # Reset the buffer first, in case __init__ is called - # multiple times. - self.truncate(0) - if initial_value is None: - initial_value = "" - self.write(initial_value) - self.seek(0) - - @property - def buffer(self): - raise UnsupportedOperation("%s.buffer attribute is unsupported" % - self.__class__.__name__) - - def _decode_newlines(self, input, final=False): - # decode input (with the eventual \r from a previous pass) - if self._pending: - input = self._pending + input - - # retain last \r even when not translating data: - # then readline() is sure to get \r\n in one pass - if input.endswith("\r") and not final: - input = input[:-1] - self._pending = "\r" - else: - self._pending = "" - - # Record which newlines are read - crlf = input.count('\r\n') - cr = input.count('\r') - crlf - lf = input.count('\n') - crlf - self._seennl |= (lf and self._LF) | (cr and self._CR) \ - | (crlf and self._CRLF) - - if self._readtranslate: - if crlf: - output = input.replace("\r\n", "\n") - if cr: - output = input.replace("\r", "\n") - else: - output = input - - return output - _read = _io._StringIO.read + _readline = _io._StringIO.readline _write = _io._StringIO.write _tell = _io._StringIO.tell _seek = _io._StringIO.seek @@ -1965,15 +1900,7 @@ """ if self.closed: raise ValueError("write to closed file") - if not isinstance(s, str): - raise TypeError("can't write %s to text stream" % - s.__class__.__name__) - length = len(s) - if self._writetranslate and self._writenl != "\n": - s = s.replace("\n", self._writenl) - self._pending = "" - self._write(s) - return length + return self._write(s) def read(self, n: int = None) -> str: """Read at most n characters, returned as a string. @@ -1983,26 +1910,13 @@ """ if self.closed: raise ValueError("read to closed file") - if n is None: - n = -1 - res = self._pending - if n < 0: - res += self._decode_newlines(self._read(), True) - self._pending = "" - return res - else: - res = self._decode_newlines(self._read(n), True) - self._pending = res[n:] - return res[:n] + return self._read(n) def tell(self) -> int: """Tell the current file position.""" if self.closed: raise ValueError("tell from closed file") - if self._pending: - return self._tell() - len(self._pending) - else: - return self._tell() + return self._tell() def seek(self, pos: int = None, whence: int = 0) -> int: """Change stream position. @@ -2015,7 +1929,6 @@ """ if self.closed: raise ValueError("seek from closed file") - self._pending = "" return self._seek(pos, whence) def truncate(self, pos: int = None) -> int: @@ -2027,86 +1940,12 @@ """ if self.closed: raise ValueError("truncate from closed file") - self._pending = "" return self._truncate(pos) def readline(self, limit: int = None) -> str: if self.closed: raise ValueError("read from closed file") - if limit is None: - limit = -1 - if limit >= 0: - # XXX: Hack to support limit argument, for backwards - # XXX compatibility - line = self.readline() - if len(line) <= limit: - return line - line, self._pending = line[:limit], line[limit:] + self._pending - return line - - line = self._pending - self._pending = "" - - start = 0 - pos = endpos = None - while True: - if self._readtranslate: - # Newlines are already translated, only search for \n - pos = line.find('\n', start) - if pos >= 0: - endpos = pos + 1 - break - else: - start = len(line) - - elif self._readuniversal: - # Universal newline search. Find any of \r, \r\n, \n - # The decoder ensures that \r\n are not split in two pieces - - # In C we'd look for these in parallel of course. - nlpos = line.find("\n", start) - crpos = line.find("\r", start) - if crpos == -1: - if nlpos == -1: - # Nothing found - start = len(line) - else: - # Found \n - endpos = nlpos + 1 - break - elif nlpos == -1: - # Found lone \r - endpos = crpos + 1 - break - elif nlpos < crpos: - # Found \n - endpos = nlpos + 1 - break - elif nlpos == crpos + 1: - # Found \r\n - endpos = crpos + 2 - break - else: - # Found \r - endpos = crpos + 1 - break - else: - # non-universal - pos = line.find(self._readnl) - if pos >= 0: - endpos = pos + len(self._readnl) - break - - # No line ending seen yet - get more data - more_line = self.read(self._CHUNK_SIZE) - if more_line: - line += more_line - else: - # end of file - return line - - self._pending = line[endpos:] - return line[:endpos] + return self._readline(limit) _LF = 1 _CR = 2 Modified: python/branches/io-c/Lib/test/test_memoryio.py ============================================================================== --- python/branches/io-c/Lib/test/test_memoryio.py (original) +++ python/branches/io-c/Lib/test/test_memoryio.py Sat Feb 21 02:00:30 2009 @@ -370,6 +370,8 @@ ioclass = io.unused_StringIO EOF = "" + # TextIO-specific behaviour. + def test_relative_seek(self): memio = self.ioclass() @@ -389,19 +391,63 @@ self.assertEqual(memio.errors, "strict") self.assertEqual(memio.line_buffering, False) - # XXX: For the Python version of io.StringIO, this is highly - # dependent on the encoding used for the underlying buffer. - # def test_widechar(self): - # buf = self.buftype("\U0002030a\U00020347") - # memio = self.ioclass(buf) - # - # self.assertEqual(memio.getvalue(), buf) - # self.assertEqual(memio.write(buf), len(buf)) - # self.assertEqual(memio.tell(), len(buf)) - # self.assertEqual(memio.getvalue(), buf) - # self.assertEqual(memio.write(buf), len(buf)) - # self.assertEqual(memio.tell(), len(buf) * 2) - # self.assertEqual(memio.getvalue(), buf + buf) + def test_newlines_none(self): + # newline=None + memio = self.ioclass("a\nb\r\nc\rd", newline=None) + self.assertEqual(list(memio), ["a\n", "b\n", "c\n", "d"]) + memio.seek(0) + self.assertEqual(memio.read(1), "a") + self.assertEqual(memio.read(2), "\nb") + self.assertEqual(memio.read(2), "\nc") + self.assertEqual(memio.read(1), "\n") + memio = self.ioclass(newline=None) + self.assertEqual(2, memio.write("a\n")) + self.assertEqual(3, memio.write("b\r\n")) + self.assertEqual(3, memio.write("c\rd")) + memio.seek(0) + self.assertEqual(memio.read(), "a\nb\nc\nd") + + def test_newlines_empty(self): + # newline="" + memio = self.ioclass("a\nb\r\nc\rd", newline="") + self.assertEqual(list(memio), ["a\n", "b\r\n", "c\r", "d"]) + memio.seek(0) + self.assertEqual(memio.read(4), "a\nb\r") + self.assertEqual(memio.read(2), "\nc") + self.assertEqual(memio.read(1), "\r") + memio = self.ioclass(newline="") + self.assertEqual(2, memio.write("a\n")) + self.assertEqual(2, memio.write("b\r")) + self.assertEqual(4, memio.write("\nc\rd")) + memio.seek(0) + self.assertEqual(list(memio), ["a\n", "b\r\n", "c\r", "d"]) + + def test_newlines_lf(self): + # newline="\n" + memio = self.ioclass("a\nb\r\nc\rd") + self.assertEqual(list(memio), ["a\n", "b\r\n", "c\rd"]) + + def test_newlines_cr(self): + # newline="\r" + memio = self.ioclass("a\nb\r\nc\rd", newline="\r") + memio.seek(0) + self.assertEqual(memio.read(), "a\rb\r\rc\rd") + memio.seek(0) + self.assertEqual(list(memio), ["a\r", "b\r", "\r", "c\r", "d"]) + + def test_newlines_crlf(self): + # newline="\r\n" + memio = self.ioclass("a\nb\r\nc\rd", newline="\r\n") + memio.seek(0) + self.assertEqual(memio.read(), "a\r\nb\r\r\nc\rd") + memio.seek(0) + self.assertEqual(list(memio), ["a\r\n", "b\r\r\n", "c\rd"]) + + def test_issue5265(self): + # StringIO can duplicate newlines in universal newlines mode + memio = self.ioclass("a\r\nb\r\n", newline=None) + self.assertEqual(memio.read(5), "a\nb\n") + class CBytesIOTest(PyBytesIOTest): ioclass = io.BytesIO @@ -409,6 +455,20 @@ class CStringIOTest(PyStringIOTest): ioclass = io.StringIO + # XXX: For the Python version of io.StringIO, this is highly + # dependent on the encoding used for the underlying buffer. + def test_widechar(self): + buf = self.buftype("\U0002030a\U00020347") + memio = self.ioclass(buf) + + self.assertEqual(memio.getvalue(), buf) + self.assertEqual(memio.write(buf), len(buf)) + self.assertEqual(memio.tell(), len(buf)) + self.assertEqual(memio.getvalue(), buf) + self.assertEqual(memio.write(buf), len(buf)) + self.assertEqual(memio.tell(), len(buf) * 2) + self.assertEqual(memio.getvalue(), buf + buf) + def test_main(): tests = [PyBytesIOTest, PyStringIOTest, CBytesIOTest, CStringIOTest] Modified: python/branches/io-c/Modules/_iobase.c ============================================================================== --- python/branches/io-c/Modules/_iobase.c (original) +++ python/branches/io-c/Modules/_iobase.c Sat Feb 21 02:00:30 2009 @@ -566,8 +566,11 @@ return NULL; if (hint <= 0) { + /* XXX special-casing this made sense in the Python version in order + to remove the bytecode interpretation overhead, but it could + probably be removed here. */ PyObject *ret = PyObject_CallMethod(result, "extend", "O", self); - if( ret == NULL) { + if (ret == NULL) { Py_DECREF(result); return NULL; } @@ -583,7 +586,7 @@ return NULL; } else - break; /* SopIteration raised */ + break; /* StopIteration raised */ } if (PyList_Append(result, line) < 0) { Modified: python/branches/io-c/Modules/_iomodule.h ============================================================================== --- python/branches/io-c/Modules/_iomodule.h (original) +++ python/branches/io-c/Modules/_iomodule.h Sat Feb 21 02:00:30 2009 @@ -38,6 +38,22 @@ Doesn't check the argument type, so be careful! */ extern int _PyFileIO_closed(PyObject *self); +/* Shortcut to the core of the IncrementalNewlineDecoder.decode method */ +extern PyObject *_PyIncrementalNewlineDecoder_decode( + PyObject *self, PyObject *input, int final); + +/* Finds the first line ending between `start` and `end`. + If found, returns the index after the line ending and doesn't touch + `*consumed`. + If not found, returns -1 and sets `*consumed` to the number of characters + which can be safely put aside until another search. + + NOTE: for performance reasons, `end` must point to a NUL character ('\0'). + Otherwise, the function will scan further and return garbage. */ +extern Py_ssize_t _PyIO_find_line_ending( + int translated, int universal, PyObject *readnl, + Py_UNICODE *start, Py_UNICODE *end, Py_ssize_t *consumed); + #define DEFAULT_BUFFER_SIZE (8 * 1024) /* bytes */ @@ -104,7 +120,6 @@ PyObject *unsupported_operation; } _PyIO_State; - #define IO_MOD_STATE(mod) ((_PyIO_State *)PyModule_GetState(mod)) #define IO_STATE IO_MOD_STATE(PyState_FindModule(&_PyIO_Module)) @@ -117,11 +132,13 @@ extern PyObject *_PyIO_str_getstate; extern PyObject *_PyIO_str_isatty; extern PyObject *_PyIO_str_newlines; +extern PyObject *_PyIO_str_nl; extern PyObject *_PyIO_str_read; extern PyObject *_PyIO_str_read1; extern PyObject *_PyIO_str_readable; extern PyObject *_PyIO_str_readinto; extern PyObject *_PyIO_str_readline; +extern PyObject *_PyIO_str_replace; extern PyObject *_PyIO_str_reset; extern PyObject *_PyIO_str_seek; extern PyObject *_PyIO_str_seekable; Modified: python/branches/io-c/Modules/_stringio.c ============================================================================== --- python/branches/io-c/Modules/_stringio.c (original) +++ python/branches/io-c/Modules/_stringio.c Sat Feb 21 02:00:30 2009 @@ -2,14 +2,31 @@ #include "Python.h" #include "_iomodule.h" +/* Implementation note: the buffer is always at least one character longer + than the enclosed string, for proper functioning of _PyIO_find_line_ending. +*/ + typedef struct { PyObject_HEAD Py_UNICODE *buf; Py_ssize_t pos; Py_ssize_t string_size; size_t buf_size; + + int ok; /* initialized? */ + PyObject *decoder; + PyObject *readnl; + PyObject *writenl; + char readuniversal; + char readtranslate; } StringIOObject; +#define CHECK_INITIALIZED(self) \ + if (self->ok <= 0) { \ + PyErr_SetString(PyExc_ValueError, \ + "I/O operation on uninitialized object"); \ + return NULL; \ + } /* Internal routine for changing the size, in terms of characters, of the buffer of StringIO objects. The caller should ensure that the 'size' @@ -24,6 +41,8 @@ assert(self->buf != NULL); + /* Reserve one more char for line ending detection. */ + size = size + 1; /* For simplicity, stay in the range of the signed type. Anyway, Python doesn't allow strings to be longer than this. */ if (size > PY_SSIZE_T_MAX) @@ -65,26 +84,50 @@ return -1; } -/* Internal routine for writing a string of characters to the buffer of a - StringIO object. Returns the number of bytes wrote, or -1 on error. */ +/* Internal routine for writing a whole PyUnicode object to the buffer of a + StringIO object. Returns 0 on success, or -1 on error. */ static Py_ssize_t -write_str(StringIOObject *self, const Py_UNICODE *str, Py_ssize_t len) +write_str(StringIOObject *self, PyObject *obj) { + Py_UNICODE *str; + Py_ssize_t len; + PyObject *decoded = NULL; assert(self->buf != NULL); assert(self->pos >= 0); assert(len >= 0); + if (self->decoder != NULL) { + decoded = _PyIncrementalNewlineDecoder_decode( + self->decoder, obj, 1 /* always final */); + } + else { + decoded = obj; + Py_INCREF(decoded); + } + if (self->writenl) { + PyObject *translated = PyUnicode_Replace( + decoded, _PyIO_str_nl, self->writenl, -1); + Py_DECREF(decoded); + decoded = translated; + } + if (decoded == NULL) + return -1; + + assert(PyUnicode_Check(decoded)); + str = PyUnicode_AS_UNICODE(decoded); + len = PyUnicode_GET_SIZE(decoded); + /* This overflow check is not strictly necessary. However, it avoids us to deal with funky things like comparing an unsigned and a signed integer. */ if (self->pos > PY_SSIZE_T_MAX - len) { PyErr_SetString(PyExc_OverflowError, "new position too large"); - return -1; + goto fail; } if (self->pos + len > self->string_size) { if (resize_buffer(self, self->pos + len) < 0) - return -1; + goto fail; } if (self->pos > self->string_size) { @@ -106,23 +149,30 @@ memcpy(self->buf + self->pos, str, len * sizeof(Py_UNICODE)); self->pos += len; - /* Set the new length of the internal string if it has changed */ + /* Set the new length of the internal string if it has changed. */ if (self->string_size < self->pos) { self->string_size = self->pos; } - return len; + Py_DECREF(decoded); + return 0; + +fail: + Py_XDECREF(decoded); + return -1; } static PyObject * stringio_getvalue(StringIOObject *self) { + CHECK_INITIALIZED(self); return PyUnicode_FromUnicode(self->buf, self->string_size); } static PyObject * stringio_tell(StringIOObject *self) { + CHECK_INITIALIZED(self); return PyLong_FromSsize_t(self->pos); } @@ -133,11 +183,12 @@ Py_UNICODE *output; PyObject *arg = Py_None; + CHECK_INITIALIZED(self); if (!PyArg_ParseTuple(args, "|O:read", &arg)) return NULL; - if (PyLong_Check(arg)) { - size = PyLong_AsSsize_t(arg); + if (PyNumber_Check(arg)) { + size = PyNumber_AsSsize_t(arg, PyExc_OverflowError); if (size == -1 && PyErr_Occurred()) return NULL; } @@ -159,24 +210,69 @@ size = 0; } - assert(self->buf != NULL); output = self->buf + self->pos; self->pos += size; - return PyUnicode_FromUnicode(output, size); } static PyObject * +stringio_readline(StringIOObject *self, PyObject *args) +{ + PyObject *arg = Py_None; + Py_ssize_t limit = -1; + Py_UNICODE *start, *end, old_char; + Py_ssize_t len, consumed; + + CHECK_INITIALIZED(self); + if (!PyArg_ParseTuple(args, "|O:readline", &arg)) + return NULL; + + if (PyNumber_Check(arg)) { + limit = PyNumber_AsSsize_t(arg, PyExc_OverflowError); + if (limit == -1 && PyErr_Occurred()) + return NULL; + } + else if (arg != Py_None) { + PyErr_Format(PyExc_TypeError, "integer argument expected, got '%s'", + Py_TYPE(arg)->tp_name); + return NULL; + } + + /* In case of overseek, return the empty string */ + if (self->pos >= self->string_size) + return PyUnicode_FromString(""); + + start = self->buf + self->pos; + if (limit < 0 || limit > self->string_size - self->pos) + limit = self->string_size - self->pos; + + end = start + limit; + old_char = *end; + *end = '\0'; + len = _PyIO_find_line_ending( + self->readtranslate, self->readuniversal, self->readnl, + start, end, &consumed); + *end = old_char; + /* If we haven't found any line ending, we just return everything + (`consumed` is ignored). */ + if (len < 0) + len = limit; + self->pos += len; + return PyUnicode_FromUnicode(start, len); +} + +static PyObject * stringio_truncate(StringIOObject *self, PyObject *args) { Py_ssize_t size; PyObject *arg = Py_None; + CHECK_INITIALIZED(self); if (!PyArg_ParseTuple(args, "|O:truncate", &arg)) return NULL; - if (PyLong_Check(arg)) { - size = PyLong_AsSsize_t(arg); + if (PyNumber_Check(arg)) { + size = PyNumber_AsSsize_t(arg, PyExc_OverflowError); if (size == -1 && PyErr_Occurred()) return NULL; } @@ -197,9 +293,9 @@ } if (size < self->string_size) { - self->string_size = size; if (resize_buffer(self, size) < 0) return NULL; + self->string_size = size; } self->pos = size; @@ -212,6 +308,7 @@ Py_ssize_t pos; int mode = 0; + CHECK_INITIALIZED(self); if (!PyArg_ParseTuple(args, "n|i:seek", &pos, &mode)) return NULL; @@ -249,32 +346,29 @@ static PyObject * stringio_write(StringIOObject *self, PyObject *obj) { - const Py_UNICODE *str; Py_ssize_t size; - Py_ssize_t n = 0; - if (PyUnicode_Check(obj)) { - str = PyUnicode_AsUnicode(obj); - size = PyUnicode_GetSize(obj); - } - else { + CHECK_INITIALIZED(self); + if (!PyUnicode_Check(obj)) { PyErr_Format(PyExc_TypeError, "string argument expected, got '%s'", Py_TYPE(obj)->tp_name); return NULL; } + size = PyUnicode_GET_SIZE(obj); - if (size != 0) { - n = write_str(self, str, size); - if (n < 0) - return NULL; - } + if (size > 0 && write_str(self, obj) < 0) + return NULL; - return PyLong_FromSsize_t(n); + return PyLong_FromSsize_t(size); } static void stringio_dealloc(StringIOObject *self) { + self->writenl = NULL; + Py_CLEAR(self->readnl); + Py_CLEAR(self->writenl); + Py_CLEAR(self->decoder); PyMem_Free(self->buf); Py_TYPE(self)->tp_free(self); } @@ -301,45 +395,142 @@ return (PyObject *)self; } +static int +stringio_init(StringIOObject *self, PyObject *args, PyObject *kwds) +{ + char *kwlist[] = {"initial_value", "newline", NULL}; + PyObject *value = NULL; + char *newline = "\n"; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oz:__init__", kwlist, + &value, &newline)) + return -1; + + if (newline && newline[0] != '\0' + && !(newline[0] == '\n' && newline[1] == '\0') + && !(newline[0] == '\r' && newline[1] == '\0') + && !(newline[0] == '\r' && newline[1] == '\n' && newline[2] == '\0')) { + PyErr_Format(PyExc_ValueError, + "illegal newline value: %s", newline); + return -1; + } + if (value && value != Py_None && !PyUnicode_Check(value)) { + PyErr_Format(PyExc_ValueError, + "initial_value must be str or None, not %.200s", + Py_TYPE(value)->tp_name); + return -1; + } + + self->ok = 0; + + Py_CLEAR(self->readnl); + Py_CLEAR(self->writenl); + Py_CLEAR(self->decoder); + + if (newline) { + self->readnl = PyUnicode_FromString(newline); + if (self->readnl == NULL) + return -1; + } + self->readuniversal = (newline == NULL || newline[0] == '\0'); + self->readtranslate = (newline == NULL); + /* If newline == "", we don't translate anything. + If newline == "\n" or newline == None, we translate to "\n", which is + a no-op. + (for newline == None, TextIOWrapper translates to os.sepline, but it + is pointless for StringIO) + */ + if (newline != NULL && newline[0] == '\r') { + self->writenl = self->readnl; + Py_INCREF(self->writenl); + } + + if (self->readuniversal) { + self->decoder = PyObject_CallFunction( + (PyObject *)&PyIncrementalNewlineDecoder_Type, + "Oi", Py_None, (int) self->readtranslate); + if (self->decoder == NULL) + return -1; + } + + /* Now everything is set up, resize buffer to size of initial value, + and copy it */ + self->string_size = 0; + if (value && value != Py_None) { + Py_ssize_t len = PyUnicode_GetSize(value); + /* This is a heuristic, for newline translation might change + the string length. */ + if (resize_buffer(self, len) < 0) + return -1; + self->pos = 0; + if (write_str(self, value) < 0) + return -1; + } + else { + if (resize_buffer(self, 0) < 0) + return -1; + } + self->pos = 0; + + + self->ok = 1; + return 0; +} + static PyObject * stringio_seekable(StringIOObject *self, PyObject *args) { + CHECK_INITIALIZED(self); Py_RETURN_TRUE; } static PyObject * stringio_readable(StringIOObject *self, PyObject *args) { + CHECK_INITIALIZED(self); Py_RETURN_TRUE; } static PyObject * stringio_writable(StringIOObject *self, PyObject *args) { + CHECK_INITIALIZED(self); Py_RETURN_TRUE; } static PyObject * +stringio_buffer(StringIOObject *self, void *context) +{ + PyErr_SetString(IO_STATE->unsupported_operation, + "buffer attribute is unsupported on type StringIO"); + return NULL; +} + +static PyObject * stringio_encoding(StringIOObject *self, void *context) { + CHECK_INITIALIZED(self); return PyUnicode_FromString("utf-8"); } static PyObject * stringio_errors(StringIOObject *self, void *context) { + CHECK_INITIALIZED(self); return PyUnicode_FromString("strict"); } static PyObject * stringio_line_buffering(StringIOObject *self, void *context) { + CHECK_INITIALIZED(self); Py_RETURN_FALSE; } static struct PyMethodDef stringio_methods[] = { {"getvalue", (PyCFunction)stringio_getvalue, METH_VARARGS, NULL}, {"read", (PyCFunction)stringio_read, METH_VARARGS, NULL}, + {"readline", (PyCFunction)stringio_readline, METH_VARARGS, NULL}, {"tell", (PyCFunction)stringio_tell, METH_NOARGS, NULL}, {"truncate", (PyCFunction)stringio_truncate, METH_VARARGS, NULL}, {"seek", (PyCFunction)stringio_seek, METH_VARARGS, NULL}, @@ -358,6 +549,7 @@ Hopefully, a better solution, than adding these pseudo-attributes, will be found. */ + {"buffer", (getter)stringio_buffer, NULL, NULL}, {"encoding", (getter)stringio_encoding, NULL, NULL}, {"errors", (getter)stringio_errors, NULL, NULL}, {"line_buffering", (getter)stringio_line_buffering, NULL, NULL}, @@ -400,7 +592,7 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - 0, /*tp_init*/ + (initproc)stringio_init, /*tp_init*/ 0, /*tp_alloc*/ stringio_new, /*tp_new*/ }; Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Sat Feb 21 02:00:30 2009 @@ -214,12 +214,13 @@ #define SEEN_CRLF 4 #define SEEN_ALL (SEEN_CR | SEEN_LF | SEEN_CRLF) -static PyObject * -_IncrementalNewlineDecoder_decode(PyNewLineDecoderObject *self, - PyObject *input, int final) +PyObject * +_PyIncrementalNewlineDecoder_decode(PyObject *_self, + PyObject *input, int final) { PyObject *output; Py_ssize_t output_len; + PyNewLineDecoderObject *self = (PyNewLineDecoderObject *) _self; if (self->decoder == NULL) { PyErr_SetString(PyExc_ValueError, @@ -424,7 +425,7 @@ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|i:IncrementalNewlineDecoder", kwlist, &input, &final)) return NULL; - return _IncrementalNewlineDecoder_decode(self, input, final); + return _PyIncrementalNewlineDecoder_decode((PyObject *) self, input, final); } static PyObject * @@ -845,8 +846,11 @@ self->readuniversal = (newline == NULL || newline[0] == '\0'); self->line_buffering = line_buffering; self->readtranslate = (newline == NULL); - if (newline) + if (newline) { self->readnl = PyUnicode_FromString(newline); + if (self->readnl == NULL) + return -1; + } self->writetranslate = (newline == NULL || newline[0] != '\0'); if (!self->readuniversal && self->readnl) { self->writenl = _PyUnicode_AsString(self->readnl); @@ -1275,8 +1279,8 @@ eof = (PyBytes_Size(input_chunk) == 0); if (Py_TYPE(self->decoder) == &PyIncrementalNewlineDecoder_Type) { - decoded_chars = _IncrementalNewlineDecoder_decode( - (PyNewLineDecoderObject *) self->decoder, input_chunk, eof); + decoded_chars = _PyIncrementalNewlineDecoder_decode( + self->decoder, input_chunk, eof); } else { decoded_chars = PyObject_CallMethodObjArgs(self->decoder, @@ -1420,22 +1424,14 @@ } } -/* Finds the first line ending between start and end. - If not found, returns -1 and sets (*consumed) to the number of characters - which can be safely put aside before another search. - If found, returns the index after the line ending and doesn't touch - (*consumed). - - NOTE: `end` must point to the real end of the Py_UNICODE storage, - that is to the NUL character. Otherwise the function will produce - incorrect results. */ -static Py_ssize_t -find_line_ending(PyTextIOWrapperObject *self, - Py_UNICODE *start, Py_UNICODE *end, Py_ssize_t *consumed) +Py_ssize_t +_PyIO_find_line_ending( + int translated, int universal, PyObject *readnl, + Py_UNICODE *start, Py_UNICODE *end, Py_ssize_t *consumed) { Py_ssize_t len = end - start; - if (self->readtranslate) { + if (translated) { /* Newlines are already translated, only search for \n */ Py_UNICODE *pos = find_control_char(start, end, '\n'); if (pos != NULL) @@ -1445,7 +1441,7 @@ return -1; } } - else if (self->readuniversal) { + else if (universal) { /* Universal newline search. Find any of \r, \r\n, \n * The decoder ensures that \r\n are not split in two pieces */ @@ -1473,8 +1469,8 @@ } else { /* Non-universal mode. */ - Py_ssize_t readnl_len = PyUnicode_GET_SIZE(self->readnl); - Py_UNICODE *nl = PyUnicode_AS_UNICODE(self->readnl); + Py_ssize_t readnl_len = PyUnicode_GET_SIZE(readnl); + Py_UNICODE *nl = PyUnicode_AS_UNICODE(readnl); if (readnl_len == 1) { Py_UNICODE *pos = find_control_char(start, end, nl[0]); if (pos != NULL) @@ -1567,7 +1563,9 @@ ptr = PyUnicode_AS_UNICODE(line); line_len = PyUnicode_GET_SIZE(line); - endpos = find_line_ending(self, ptr + start, ptr + line_len, &consumed); + endpos = _PyIO_find_line_ending( + self->readtranslate, self->readuniversal, self->readnl, + ptr + start, ptr + line_len, &consumed); if (endpos >= 0) { endpos += start; if (limit >= 0 && (endpos - start) + chunked >= limit) Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Sat Feb 21 02:00:30 2009 @@ -32,11 +32,13 @@ PyObject *_PyIO_str_getstate; PyObject *_PyIO_str_isatty; PyObject *_PyIO_str_newlines; +PyObject *_PyIO_str_nl; PyObject *_PyIO_str_read; PyObject *_PyIO_str_read1; PyObject *_PyIO_str_readable; PyObject *_PyIO_str_readinto; PyObject *_PyIO_str_readline; +PyObject *_PyIO_str_replace; PyObject *_PyIO_str_reset; PyObject *_PyIO_str_seek; PyObject *_PyIO_str_seekable; @@ -614,7 +616,6 @@ { PyObject *m = PyModule_Create(&_PyIO_Module); _PyIO_State *state = NULL; - PyTypeObject *base; if (m == NULL) return NULL; state = IO_MOD_STATE(m); @@ -750,6 +751,8 @@ goto fail; if (!(_PyIO_str_newlines = PyUnicode_InternFromString("newlines"))) goto fail; + if (!(_PyIO_str_nl = PyUnicode_InternFromString("\n"))) + goto fail; if (!(_PyIO_str_read = PyUnicode_InternFromString("read"))) goto fail; if (!(_PyIO_str_read1 = PyUnicode_InternFromString("read1"))) @@ -760,6 +763,8 @@ goto fail; if (!(_PyIO_str_readline = PyUnicode_InternFromString("readline"))) goto fail; + if (!(_PyIO_str_replace = PyUnicode_InternFromString("replace"))) + goto fail; if (!(_PyIO_str_reset = PyUnicode_InternFromString("reset"))) goto fail; if (!(_PyIO_str_seek = PyUnicode_InternFromString("seek"))) From python-checkins at python.org Sat Feb 21 02:09:25 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 21 Feb 2009 02:09:25 +0100 (CET) Subject: [Python-checkins] r69828 - in python/branches/io-c/Modules: _iomodule.h _stringio.c io.c Message-ID: <20090221010925.9A5B01E4002@bag.python.org> Author: antoine.pitrou Date: Sat Feb 21 02:09:25 2009 New Revision: 69828 Log: Plug a leak, and remove an unused string Modified: python/branches/io-c/Modules/_iomodule.h python/branches/io-c/Modules/_stringio.c python/branches/io-c/Modules/io.c Modified: python/branches/io-c/Modules/_iomodule.h ============================================================================== --- python/branches/io-c/Modules/_iomodule.h (original) +++ python/branches/io-c/Modules/_iomodule.h Sat Feb 21 02:09:25 2009 @@ -138,7 +138,6 @@ extern PyObject *_PyIO_str_readable; extern PyObject *_PyIO_str_readinto; extern PyObject *_PyIO_str_readline; -extern PyObject *_PyIO_str_replace; extern PyObject *_PyIO_str_reset; extern PyObject *_PyIO_str_seek; extern PyObject *_PyIO_str_seekable; Modified: python/branches/io-c/Modules/_stringio.c ============================================================================== --- python/branches/io-c/Modules/_stringio.c (original) +++ python/branches/io-c/Modules/_stringio.c Sat Feb 21 02:09:25 2009 @@ -365,7 +365,6 @@ static void stringio_dealloc(StringIOObject *self) { - self->writenl = NULL; Py_CLEAR(self->readnl); Py_CLEAR(self->writenl); Py_CLEAR(self->decoder); Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Sat Feb 21 02:09:25 2009 @@ -38,7 +38,6 @@ PyObject *_PyIO_str_readable; PyObject *_PyIO_str_readinto; PyObject *_PyIO_str_readline; -PyObject *_PyIO_str_replace; PyObject *_PyIO_str_reset; PyObject *_PyIO_str_seek; PyObject *_PyIO_str_seekable; @@ -763,8 +762,6 @@ goto fail; if (!(_PyIO_str_readline = PyUnicode_InternFromString("readline"))) goto fail; - if (!(_PyIO_str_replace = PyUnicode_InternFromString("replace"))) - goto fail; if (!(_PyIO_str_reset = PyUnicode_InternFromString("reset"))) goto fail; if (!(_PyIO_str_seek = PyUnicode_InternFromString("seek"))) From python-checkins at python.org Sat Feb 21 03:02:28 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 21 Feb 2009 03:02:28 +0100 (CET) Subject: [Python-checkins] r69829 - python/branches/io-c/Modules/_stringio.c Message-ID: <20090221020228.4CBD51E400C@bag.python.org> Author: benjamin.peterson Date: Sat Feb 21 03:02:28 2009 New Revision: 69829 Log: this assertions makes more sense here Modified: python/branches/io-c/Modules/_stringio.c Modified: python/branches/io-c/Modules/_stringio.c ============================================================================== --- python/branches/io-c/Modules/_stringio.c (original) +++ python/branches/io-c/Modules/_stringio.c Sat Feb 21 03:02:28 2009 @@ -94,7 +94,6 @@ PyObject *decoded = NULL; assert(self->buf != NULL); assert(self->pos >= 0); - assert(len >= 0); if (self->decoder != NULL) { decoded = _PyIncrementalNewlineDecoder_decode( @@ -117,6 +116,8 @@ str = PyUnicode_AS_UNICODE(decoded); len = PyUnicode_GET_SIZE(decoded); + assert(len >= 0); + /* This overflow check is not strictly necessary. However, it avoids us to deal with funky things like comparing an unsigned and a signed integer. */ From python-checkins at python.org Sat Feb 21 03:03:04 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 21 Feb 2009 03:03:04 +0100 (CET) Subject: [Python-checkins] r69830 - python/branches/io-c/Modules/io.c Message-ID: <20090221020304.A41461E400C@bag.python.org> Author: benjamin.peterson Date: Sat Feb 21 03:03:04 2009 New Revision: 69830 Log: PyModule_AddObject can fail; simplify this code with a macro Modified: python/branches/io-c/Modules/io.c Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Sat Feb 21 03:03:04 2009 @@ -625,6 +625,16 @@ if (state->os_module == NULL) goto fail; +#define ADD_TYPE(type, name) \ + if (PyType_Ready(type) < 0) \ + goto fail; \ + Py_INCREF(type); \ + if (PyModule_AddObject(m, name, (PyObject *)type) < 0) { \ + Py_DECREF(type); \ + goto fail; \ + } + + /* UnsupportedOperation inherits from ValueError and IOError */ state->unsupported_operation = PyObject_CallFunction( (PyObject *)&PyType_Type, "s(OO){}", @@ -632,104 +642,60 @@ if (state->unsupported_operation == NULL) goto fail; Py_INCREF(state->unsupported_operation); - PyModule_AddObject(m, "UnsupportedOperation", - state->unsupported_operation); + if (PyModule_AddObject(m, "UnsupportedOperation", + state->unsupported_operation) < 0) + goto fail; /* BlockingIOError */ _PyExc_BlockingIOError.tp_base = (PyTypeObject *) PyExc_IOError; - if (PyType_Ready(&_PyExc_BlockingIOError) < 0) - goto fail; - Py_INCREF(&_PyExc_BlockingIOError); - PyModule_AddObject(m, "BlockingIOError", - (PyObject *)&_PyExc_BlockingIOError); + ADD_TYPE(&_PyExc_BlockingIOError, "BlockingIOError"); /* IOBase */ - if (PyType_Ready(&PyIOBase_Type) < 0) - goto fail; - Py_INCREF(&PyIOBase_Type); - PyModule_AddObject(m, "IOBase", - (PyObject *)&PyIOBase_Type); + ADD_TYPE(&PyIOBase_Type, "IOBase"); /* RawIOBase */ - if (PyType_Ready(&PyRawIOBase_Type) < 0) - goto fail; - Py_INCREF(&PyRawIOBase_Type); - PyModule_AddObject(m, "RawIOBase", - (PyObject *)&PyRawIOBase_Type); + ADD_TYPE(&PyRawIOBase_Type, "RawIOBase"); /* BufferedIOBase */ - if (PyType_Ready(&PyBufferedIOBase_Type) < 0) - goto fail; - Py_INCREF(&PyBufferedIOBase_Type); - PyModule_AddObject(m, "BufferedIOBase", (PyObject *) &PyBufferedIOBase_Type); + ADD_TYPE(&PyBufferedIOBase_Type, "BufferedIOBase"); /* TextIOBase */ - if (PyType_Ready(&PyTextIOBase_Type) < 0) - goto fail; - Py_INCREF(&PyTextIOBase_Type); - PyModule_AddObject(m, "TextIOBase", (PyObject *) &PyTextIOBase_Type); + ADD_TYPE(&PyTextIOBase_Type,"TextIOBase"); /* FileIO */ PyFileIO_Type.tp_base = &PyRawIOBase_Type; - if (PyType_Ready(&PyFileIO_Type) < 0) - goto fail; - Py_INCREF(&PyFileIO_Type); - PyModule_AddObject(m, "FileIO", (PyObject *) &PyFileIO_Type); + ADD_TYPE(&PyFileIO_Type, "FileIO"); /* BytesIO */ PyBytesIO_Type.tp_base = &PyBufferedIOBase_Type; - if (PyType_Ready(&PyBytesIO_Type) < 0) - goto fail; - Py_INCREF(&PyBytesIO_Type); - PyModule_AddObject(m, "BytesIO", (PyObject *) &PyBytesIO_Type); + ADD_TYPE(&PyBytesIO_Type, "BytesIO"); /* StringIO */ /* PyStringIO_Type.tp_base = &PyTextIOBase_Type; */ - if (PyType_Ready(&PyStringIO_Type) < 0) - goto fail; - Py_INCREF(&PyStringIO_Type); - PyModule_AddObject(m, "_StringIO", (PyObject *) &PyStringIO_Type); + ADD_TYPE(&PyStringIO_Type, "_StringIO"); /* BufferedReader */ PyBufferedReader_Type.tp_base = &PyBufferedIOBase_Type; - if (PyType_Ready(&PyBufferedReader_Type) < 0) - goto fail; - Py_INCREF(&PyBufferedReader_Type); - PyModule_AddObject(m, "BufferedReader", (PyObject *) &PyBufferedReader_Type); + ADD_TYPE(&PyBufferedReader_Type, "BufferedReader"); /* BufferedWriter */ PyBufferedWriter_Type.tp_base = &PyBufferedIOBase_Type; - if (PyType_Ready(&PyBufferedWriter_Type) < 0) - goto fail; - Py_INCREF(&PyBufferedWriter_Type); - PyModule_AddObject(m, "BufferedWriter", (PyObject *) &PyBufferedWriter_Type); + ADD_TYPE(&PyBufferedWriter_Type, "BufferedWriter"); /* BufferedRWPair */ PyBufferedRWPair_Type.tp_base = &PyBufferedIOBase_Type; - if (PyType_Ready(&PyBufferedRWPair_Type) < 0) - goto fail; - Py_INCREF(&PyBufferedRWPair_Type); - PyModule_AddObject(m, "BufferedRWPair", (PyObject *) &PyBufferedRWPair_Type); + ADD_TYPE(&PyBufferedRWPair_Type, "BufferedRWPair"); /* BufferedRandom */ PyBufferedRandom_Type.tp_base = &PyBufferedIOBase_Type; - if (PyType_Ready(&PyBufferedRandom_Type) < 0) - goto fail; - Py_INCREF(&PyBufferedRandom_Type); - PyModule_AddObject(m, "BufferedRandom", (PyObject *) &PyBufferedRandom_Type); + ADD_TYPE(&PyBufferedRandom_Type, "BufferedRandom"); /* TextIOWrapper */ PyTextIOWrapper_Type.tp_base = &PyTextIOBase_Type; - if (PyType_Ready(&PyTextIOWrapper_Type) < 0) - goto fail; - Py_INCREF(&PyTextIOWrapper_Type); - PyModule_AddObject(m, "TextIOWrapper", (PyObject *) &PyTextIOWrapper_Type); + ADD_TYPE(&PyTextIOWrapper_Type, "TextIOWrapper"); /* IncrementalNewlineDecoder */ - if (PyType_Ready(&PyIncrementalNewlineDecoder_Type) < 0) - goto fail; - Py_INCREF(&PyIncrementalNewlineDecoder_Type); - PyModule_AddObject(m, "IncrementalNewlineDecoder", (PyObject *) &PyIncrementalNewlineDecoder_Type); + ADD_TYPE(&PyIncrementalNewlineDecoder_Type, "IncrementalNewlineDecoder"); /* Interned strings */ if (!(_PyIO_str_close = PyUnicode_InternFromString("close"))) From python-checkins at python.org Sat Feb 21 03:51:13 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 21 Feb 2009 03:51:13 +0100 (CET) Subject: [Python-checkins] r69831 - python/branches/py3k/Lib/importlib/NOTES Message-ID: <20090221025113.1268C1E4002@bag.python.org> Author: brett.cannon Date: Sat Feb 21 03:51:12 2009 New Revision: 69831 Log: Minor NOTES changes for importlib. Modified: python/branches/py3k/Lib/importlib/NOTES Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sat Feb 21 03:51:12 2009 @@ -65,7 +65,6 @@ + machinery - - (?) Chained path hook/finder - Extensions importers * ExtensionFinder @@ -76,7 +75,7 @@ * SourceFinder * (?) Loader - + test + + test (Really want to worry about compatibility with future versions?) - abc From buildbot at python.org Sat Feb 21 04:08:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 03:08:23 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090221030823.F00191E4002@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/398 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: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Feb 21 04:12:18 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 21 Feb 2009 04:12:18 +0100 (CET) Subject: [Python-checkins] r69832 - python/branches/py3k/Lib/importlib/NOTES Message-ID: <20090221031218.2D2001E4002@bag.python.org> Author: brett.cannon Date: Sat Feb 21 04:12:17 2009 New Revision: 69832 Log: Add some notes about importlib and some API exposure cleanup. Modified: python/branches/py3k/Lib/importlib/NOTES Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sat Feb 21 04:12:17 2009 @@ -5,11 +5,6 @@ subclass of source support (makes it nicer for VMs that don't use CPython bytecode). - + chained_path_hook - + FileFinder - - - find_module - + ExtensionFileFinder + PyFileFinder + PyPycFileFinder @@ -82,6 +77,13 @@ * FinderTests [doc] * LoaderTests [doc] +* Remove ``import *`` from importlib.__init__. + +* Remove __all__ from importlib._bootstrap. + +* Add leading underscores to all objects in importlib._bootstrap that are not + publicly exposed. + * Make sure that there is documentation *somewhere* fully explaining the semantics of import that can be referenced from the package's documentation (even if it is in the package documentation itself, although it might be best From python-checkins at python.org Sat Feb 21 04:15:38 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 21 Feb 2009 04:15:38 +0100 (CET) Subject: [Python-checkins] r69833 - in python/branches/py3k/Lib/importlib: _bootstrap.py test/extension/test_case_sensitivity.py test/extension/test_finder.py test/extension/test_path_hook.py test/import_/test_path.py test/source/test_case_sensitivity.py test/source/test_finder.py test/source/test_path_hook.py Message-ID: <20090221031538.07DC31E402B@bag.python.org> Author: brett.cannon Date: Sat Feb 21 04:15:37 2009 New Revision: 69833 Log: Do some cleanup in importlib: + Ditch using arguments to super(). + Ditch subclassing from object directly. + Move directory check out of chaining path hook to file path hook/finder. + Rename some classes to better reflect they are finders, not importers. Modified: python/branches/py3k/Lib/importlib/_bootstrap.py python/branches/py3k/Lib/importlib/test/extension/test_case_sensitivity.py python/branches/py3k/Lib/importlib/test/extension/test_finder.py python/branches/py3k/Lib/importlib/test/extension/test_path_hook.py python/branches/py3k/Lib/importlib/test/import_/test_path.py python/branches/py3k/Lib/importlib/test/source/test_case_sensitivity.py python/branches/py3k/Lib/importlib/test/source/test_finder.py python/branches/py3k/Lib/importlib/test/source/test_path_hook.py Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Sat Feb 21 04:15:37 2009 @@ -174,51 +174,43 @@ raise -class ChainedImporter(object): +def chained_path_hook(*path_hooks): + """Create a closure which sequentially checks path hooks to see which ones + (if any) can work with a path.""" + def path_hook(entry): + """Check to see if 'entry' matches any of the enclosed path hooks.""" + finders = [] + for hook in path_hooks: + try: + finder = hook(entry) + except ImportError: + continue + else: + finders.append(finder) + if not finders: + raise ImportError("no finder found") + else: + return ChainedFinder(*finders) + + return path_hook + + +class ChainedFinder: """Finder that sequentially calls other finders.""" - def __init__(self, *importers): - self._importers = importers + def __init__(self, *finders): + self._finders = finders def find_module(self, fullname, path=None): - for importer in self._importers: - result = importer.find_module(fullname, path) + for finder in self._finders: + result = finder.find_module(fullname, path) if result: return result else: return None -# XXX Don't make filesystem-specific and instead make generic for any path -# hooks. -def chaining_fs_path_hook(*path_hooks): - """Create a closure which calls the path hooks sequentially looking for - which path hooks can handle a path entry. - - - Passed-in path hooks work as any other path hooks, raising ImportError if - they cannot handle the path, otherwise returning a finder. - - """ - def chained_fs_path_hook(path_entry): - """Closure which sees which of the captured path hooks can handle the - path entry.""" - absolute_path = _path_absolute(path_entry) - if not _path_isdir(absolute_path): - raise ImportError("only directories are supported") - accepted = [] - for path_hook in path_hooks: - try: - accepted.append(path_hook(absolute_path)) - except ImportError: - continue - if not accepted: - raise ImportError("no path hooks could handle %s" % path_entry) - return ChainedImporter(*accepted) - return chained_fs_path_hook - - def check_name(method): """Decorator to verify that the module being requested matches the one the loader can handle. @@ -235,11 +227,11 @@ return inner -class _ExtensionFileLoader(object): +class _ExtensionFileLoader: """Loader for extension modules. - The constructor is designed to work with FileImporter. + The constructor is designed to work with FileFinder. """ @@ -323,10 +315,10 @@ return decorated -class _PyFileLoader(object): +class _PyFileLoader: # XXX Still smart to have this as a separate class? Or would it work - # better to integrate with PyFileImporter? Could cache _is_pkg info. - # FileImporter can be changed to return self instead of a specific loader + # better to integrate with PyFileFinder? Could cache _is_pkg info. + # FileFinder can be changed to return self instead of a specific loader # call. Otherwise _base_path can be calculated on the fly without issue if # it is known whether a module should be treated as a path or package to # minimize stat calls. Could even go as far as to stat the directory the @@ -515,9 +507,9 @@ return self._is_pkg -class FileImporter(object): +class FileFinder: - """Base class for file importers. + """Base class for file finders. Subclasses are expected to define the following attributes: @@ -541,10 +533,13 @@ Can be used as an entry on sys.path_hook. """ - self._path_entry = path_entry + absolute_path = _path_absolute(path_entry) + if not _path_isdir(absolute_path): + raise ImportError("only directories are supported") + self._path_entry = absolute_path def find_module(self, fullname, path=None): - tail_module = fullname.rsplit('.', 1)[-1] + tail_module = fullname.rpartition('.')[2] package_directory = None if self._possible_package: for ext in self._suffixes: @@ -571,7 +566,7 @@ return None -class ExtensionFileImporter(FileImporter): +class ExtensionFileFinder(FileFinder): """Importer for extension files.""" @@ -582,10 +577,10 @@ # Assigning to _suffixes here instead of at the class level because # imp is not imported at the time of class creation. self._suffixes = suffix_list(imp.C_EXTENSION) - super(ExtensionFileImporter, self).__init__(path_entry) + super().__init__(path_entry) -class PyFileImporter(FileImporter): +class PyFileFinder(FileFinder): """Importer for source/bytecode files.""" @@ -598,7 +593,7 @@ # optimization by the loader. self._suffixes = suffix_list(imp.PY_SOURCE) self._suffixes += suffix_list(imp.PY_COMPILED) - super(PyFileImporter, self).__init__(path_entry) + super().__init__(path_entry) class PathFinder: @@ -664,31 +659,30 @@ return None +_DEFAULT_PATH_HOOK = chained_path_hook(ExtensionFileFinder, PyFileFinder) + class _DefaultPathFinder(PathFinder): """Subclass of PathFinder that implements implicit semantics for __import__.""" - _default_hook = staticmethod(chaining_fs_path_hook(ExtensionFileImporter, - PyFileImporter)) - @classmethod def _path_hooks(cls, path): """Search sys.path_hooks as well as implicit path hooks.""" try: return super()._path_hooks(path) except ImportError: - implicit_hooks = [cls._default_hook, imp.NullImporter] + implicit_hooks = [_DEFAULT_PATH_HOOK, imp.NullImporter] return super()._path_hooks(path, implicit_hooks) @classmethod def _path_importer_cache(cls, path): """Use the default path hook when None is stored in sys.path_importer_cache.""" - return super()._path_importer_cache(path, cls._default_hook) + return super()._path_importer_cache(path, _DEFAULT_PATH_HOOK) -class ImportLockContext(object): +class ImportLockContext: """Context manager for the import lock.""" 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 Sat Feb 21 04:15:37 2009 @@ -13,7 +13,7 @@ good_name = ext_util.NAME bad_name = good_name.upper() assert good_name != bad_name - finder = importlib.ExtensionFileImporter(ext_util.PATH) + finder = importlib.ExtensionFileFinder(ext_util.PATH) return finder.find_module(bad_name) def test_case_sensitive(self): Modified: python/branches/py3k/Lib/importlib/test/extension/test_finder.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/extension/test_finder.py (original) +++ python/branches/py3k/Lib/importlib/test/extension/test_finder.py Sat Feb 21 04:15:37 2009 @@ -9,7 +9,7 @@ """Test the finder for extension modules.""" def find_module(self, fullname): - importer = importlib.ExtensionFileImporter(util.PATH) + importer = importlib.ExtensionFileFinder(util.PATH) return importer.find_module(fullname) def test_module(self): Modified: python/branches/py3k/Lib/importlib/test/extension/test_path_hook.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/extension/test_path_hook.py (original) +++ python/branches/py3k/Lib/importlib/test/extension/test_path_hook.py Sat Feb 21 04:15:37 2009 @@ -14,7 +14,7 @@ # XXX Should it only work for directories containing an extension module? def hook(self, entry): - return importlib.ExtensionFileImporter(entry) + return importlib.ExtensionFileFinder(entry) def test_success(self): # Path hook should handle a directory where a known extension module Modified: python/branches/py3k/Lib/importlib/test/import_/test_path.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/import_/test_path.py (original) +++ python/branches/py3k/Lib/importlib/test/import_/test_path.py Sat Feb 21 04:15:37 2009 @@ -87,16 +87,16 @@ importer = util.mock_modules(module) path = '' # XXX Not blackbox. - original_hook = _bootstrap._DefaultPathFinder._default_hook + original_hook = _bootstrap._DEFAULT_PATH_HOOK mock_hook = import_util.mock_path_hook(path, importer=importer) - _bootstrap._DefaultPathFinder._default_hook = staticmethod(mock_hook) + _bootstrap._DEFAULT_PATH_HOOK = mock_hook try: with util.import_state(path_importer_cache={path: None}): loader = _bootstrap._DefaultPathFinder.find_module(module, path=[path]) self.assert_(loader is importer) finally: - _bootstrap._DefaultPathFinder._default_hook = original_hook + _bootstrap._DEFAULT_PATH_HOOK = original_hook def test_main(): 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 Sat Feb 21 04:15:37 2009 @@ -19,7 +19,7 @@ assert name != name.lower() def find(self, path): - finder = importlib.PyFileImporter(path) + finder = importlib.PyFileFinder(path) return finder.find_module(self.name) def sensitivity_test(self): Modified: python/branches/py3k/Lib/importlib/test/source/test_finder.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/test_finder.py (original) +++ python/branches/py3k/Lib/importlib/test/source/test_finder.py Sat Feb 21 04:15:37 2009 @@ -32,7 +32,7 @@ """ def import_(self, root, module): - finder = importlib.PyFileImporter(root) + finder = importlib.PyFileFinder(root) return finder.find_module(module) def run_test(self, test, create=None, *, compile_=None, unlink=None): Modified: python/branches/py3k/Lib/importlib/test/source/test_path_hook.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/test_path_hook.py (original) +++ python/branches/py3k/Lib/importlib/test/source/test_path_hook.py Sat Feb 21 04:15:37 2009 @@ -10,7 +10,7 @@ def test_success(self): # XXX Only work on existing directories? with source_util.create_modules('dummy') as mapping: - self.assert_(hasattr(importlib.FileImporter(mapping['.root']), + self.assert_(hasattr(importlib.FileFinder(mapping['.root']), 'find_module')) From python-checkins at python.org Sat Feb 21 04:31:35 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 21 Feb 2009 04:31:35 +0100 (CET) Subject: [Python-checkins] r69834 - in python/branches/py3k/Lib/importlib: NOTES _bootstrap.py test/source/test_case_sensitivity.py test/source/test_finder.py Message-ID: <20090221033135.BE7CD1E4002@bag.python.org> Author: brett.cannon Date: Sat Feb 21 04:31:35 2009 New Revision: 69834 Log: Separate out finder for source and source/bytecode. Modified: python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/_bootstrap.py python/branches/py3k/Lib/importlib/test/source/test_case_sensitivity.py python/branches/py3k/Lib/importlib/test/source/test_finder.py Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sat Feb 21 04:31:35 2009 @@ -5,19 +5,22 @@ subclass of source support (makes it nicer for VMs that don't use CPython bytecode). - + ExtensionFileFinder - + PyFileFinder - + PyPycFileFinder - + PyFileLoader + + PyLoader (for ABC) - get_code for source only + + + PyFileLoader(PyLoader) + - get_data - source_mtime - source_path - + PyPycFileLoader(PyFileLoader) + +PyPycLoader (PyLoader, for ABC) + + - get_code for source and bytecode + + + PyPycFileLoader(PyPycLoader, PyFileLoader) - - get_code - bytecode_path - write_bytecode Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Sat Feb 21 04:31:35 2009 @@ -592,10 +592,18 @@ # Make sure that Python source files are listed first! Needed for an # optimization by the loader. self._suffixes = suffix_list(imp.PY_SOURCE) - self._suffixes += suffix_list(imp.PY_COMPILED) super().__init__(path_entry) +class PyPycFileFinder(PyFileFinder): + + """Finder for source and bytecode files.""" + + def __init__(self, path_entry): + super().__init__(path_entry) + self._suffixes += suffix_list(imp.PY_COMPILED) + + class PathFinder: """Meta path finder for sys.(path|path_hooks|path_importer_cache).""" @@ -659,7 +667,7 @@ return None -_DEFAULT_PATH_HOOK = chained_path_hook(ExtensionFileFinder, PyFileFinder) +_DEFAULT_PATH_HOOK = chained_path_hook(ExtensionFileFinder, PyPycFileFinder) class _DefaultPathFinder(PathFinder): 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 Sat Feb 21 04:31:35 2009 @@ -19,7 +19,7 @@ assert name != name.lower() def find(self, path): - finder = importlib.PyFileFinder(path) + finder = importlib.PyPycFileFinder(path) return finder.find_module(self.name) def sensitivity_test(self): Modified: python/branches/py3k/Lib/importlib/test/source/test_finder.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/test_finder.py (original) +++ python/branches/py3k/Lib/importlib/test/source/test_finder.py Sat Feb 21 04:31:35 2009 @@ -32,7 +32,7 @@ """ def import_(self, root, module): - finder = importlib.PyFileFinder(root) + finder = importlib.PyPycFileFinder(root) return finder.find_module(module) def run_test(self, test, create=None, *, compile_=None, unlink=None): From buildbot at python.org Sat Feb 21 04:39:36 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 03:39:36 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090221033936.5A8C71E4011@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/312 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: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_bz2 test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Feb 21 04:53:06 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 21 Feb 2009 04:53:06 +0100 (CET) Subject: [Python-checkins] r69835 - in python/branches/py3k/Lib/importlib: NOTES _bootstrap.py Message-ID: <20090221035306.91CA51E4002@bag.python.org> Author: brett.cannon Date: Sat Feb 21 04:53:06 2009 New Revision: 69835 Log: Tweak the source/bytecode loader from importlib to use more of the PEP 302 protocol API. Modified: python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/_bootstrap.py Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sat Feb 21 04:53:06 2009 @@ -7,6 +7,7 @@ + PyLoader (for ABC) + - load_module for source only - get_code for source only + PyFileLoader(PyLoader) @@ -17,6 +18,7 @@ +PyPycLoader (PyLoader, for ABC) + - load_module for source and bytecode - get_code for source and bytecode + PyPycFileLoader(PyPycLoader, PyFileLoader) Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Sat Feb 21 04:53:06 2009 @@ -361,7 +361,6 @@ # Not a property for easy overriding. return self._find_path(imp.PY_COMPILED) - @check_name @module_for_loader def load_module(self, module): """Load a Python source or bytecode module.""" @@ -371,7 +370,7 @@ code_object = self.get_code(module.__name__) module.__file__ = source_path if source_path else bytecode_path module.__loader__ = self - if self._is_pkg: + if self.is_package(name): module.__path__ = [module.__file__.rsplit(path_sep, 1)[0]] module.__package__ = module.__name__ if not hasattr(module, '__path__'): @@ -429,7 +428,6 @@ else: raise - @check_name def get_code(self, name): """Return the code object for the module.""" # XXX Care enough to make sure this call does not happen if the magic From buildbot at python.org Sat Feb 21 05:02:59 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 04:02:59 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090221040259.7B2A41E4002@bag.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/305 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: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 21 05:10:58 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 04:10:58 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090221041059.1EA7A1E4002@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/401 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: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 21 05:33:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 04:33:28 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090221043328.A4DD61E4002@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/327 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 buildbot at python.org Sat Feb 21 05:33:46 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 04:33:46 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090221043346.1F4431E4002@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/350 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: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 21 06:02:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 05:02:25 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090221050225.5513E1E4002@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/314 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: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Feb 21 06:41:41 2009 From: python-checkins at python.org (brett.cannon) Date: Sat, 21 Feb 2009 06:41:41 +0100 (CET) Subject: [Python-checkins] r69836 - in python/branches/py3k/Lib/importlib: NOTES _bootstrap.py test/source/test_loader.py test/source/test_source_encoding.py Message-ID: <20090221054141.67F6E1E4002@bag.python.org> Author: brett.cannon Date: Sat Feb 21 06:41:15 2009 New Revision: 69836 Log: Refactor source and bytecode file loaders in importlib so that there are source-only and source/bytecode loaders. Modified: python/branches/py3k/Lib/importlib/NOTES python/branches/py3k/Lib/importlib/_bootstrap.py python/branches/py3k/Lib/importlib/test/source/test_loader.py python/branches/py3k/Lib/importlib/test/source/test_source_encoding.py Modified: python/branches/py3k/Lib/importlib/NOTES ============================================================================== --- python/branches/py3k/Lib/importlib/NOTES (original) +++ python/branches/py3k/Lib/importlib/NOTES Sat Feb 21 06:41:15 2009 @@ -1,31 +1,6 @@ to do ///// -* Refactor source/bytecode finder/loader code such that bytecode support is a - subclass of source support (makes it nicer for VMs that don't use CPython - bytecode). - - + PyLoader (for ABC) - - - load_module for source only - - get_code for source only - - + PyFileLoader(PyLoader) - - - get_data - - source_mtime - - source_path - - +PyPycLoader (PyLoader, for ABC) - - - load_module for source and bytecode - - get_code for source and bytecode - - + PyPycFileLoader(PyPycLoader, PyFileLoader) - - - bytecode_path - - write_bytecode - * Implement PEP 302 protocol for loaders (should just be a matter of testing). + Source/bytecode. @@ -42,7 +17,6 @@ * load_module - - (?) Importer(Finder, Loader) - ResourceLoader(Loader) * get_data @@ -89,6 +63,8 @@ * Add leading underscores to all objects in importlib._bootstrap that are not publicly exposed. +* Reorder importlib/_bootstrap.py so definitions are not in inverted order. + * Make sure that there is documentation *somewhere* fully explaining the semantics of import that can be referenced from the package's documentation (even if it is in the package documentation itself, although it might be best Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Sat Feb 21 06:41:15 2009 @@ -315,17 +315,124 @@ return decorated -class _PyFileLoader: - # XXX Still smart to have this as a separate class? Or would it work - # better to integrate with PyFileFinder? Could cache _is_pkg info. - # FileFinder can be changed to return self instead of a specific loader - # call. Otherwise _base_path can be calculated on the fly without issue if - # it is known whether a module should be treated as a path or package to - # minimize stat calls. Could even go as far as to stat the directory the - # importer is in to detect changes and then cache all the info about what - # files were found (if stating directories is platform-dependent). +class PyLoader: - """Load a Python source or bytecode file.""" + """Loader base class for Python source. + + Requires implementing the optional PEP 302 protocols as well as + source_mtime and source_path. + + """ + + @module_for_loader + def load_module(self, module): + """Load a source module.""" + return _load_module(module) + + def _load_module(self, module): + """Initialize a module from source.""" + name = module.__name__ + source_path = self.source_path(name) + code_object = self.get_code(module.__name__) + if not hasattr(module, '__file__'): + module.__file__ = source_path + if self.is_package(name): + module.__path__ = [module.__file__.rsplit(path_sep, 1)[0]] + module.__package__ = module.__name__ + if not hasattr(module, '__path__'): + module.__package__ = module.__package__.rpartition('.')[0] + exec(code_object, module.__dict__) + return module + + def get_code(self, fullname): + """Get a code object from source.""" + source_path = self.source_path(fullname) + source = self.get_data(source_path) + # Convert to universal newlines. + line_endings = b'\n' + for index, c in enumerate(source): + if c == ord(b'\n'): + break + elif c == ord(b'\r'): + line_endings = b'\r' + try: + if source[index+1] == ord(b'\n'): + line_endings += b'\n' + except IndexError: + pass + break + if line_endings != b'\n': + source = source.replace(line_endings, b'\n') + return compile(source, source_path, 'exec', dont_inherit=True) + + +class PyPycLoader(PyLoader): + + """Loader base class for Python source and bytecode. + + Requires implementing the methods needed for PyLoader as well as + bytecode_path and write_bytecode. + + """ + + @module_for_loader + def load_module(self, module): + """Load a module from source or bytecode.""" + name = module.__name__ + source_path = self.source_path(name) + bytecode_path = self.bytecode_path(name) + module.__file__ = source_path if source_path else bytecode_path + return self._load_module(module) + + def get_code(self, fullname): + """Get a code object from source or bytecode.""" + # XXX Care enough to make sure this call does not happen if the magic + # number is bad? + source_timestamp = self.source_mtime(fullname) + # Try to use bytecode if it is available. + bytecode_path = self.bytecode_path(fullname) + if bytecode_path: + data = self.get_data(bytecode_path) + magic = data[:4] + pyc_timestamp = marshal._r_long(data[4:8]) + bytecode = data[8:] + try: + # Verify that the magic number is valid. + if imp.get_magic() != magic: + raise ImportError("bad magic number") + # Verify that the bytecode is not stale (only matters when + # there is source to fall back on. + if source_timestamp: + if pyc_timestamp < source_timestamp: + raise ImportError("bytecode is stale") + except ImportError: + # If source is available give it a shot. + if source_timestamp is not None: + pass + else: + raise + else: + # Bytecode seems fine, so try to use it. + # XXX If the bytecode is ill-formed, would it be beneficial to + # try for using source if available and issue a warning? + return marshal.loads(bytecode) + elif source_timestamp is None: + raise ImportError("no source or bytecode available to create code " + "object for {0!r}".format(fullname)) + # Use the source. + code_object = super().get_code(fullname) + # Generate bytecode and write it out. + if not sys.dont_write_bytecode: + data = bytearray(imp.get_magic()) + data.extend(marshal._w_long(source_timestamp)) + data.extend(marshal.dumps(code_object)) + self.write_bytecode(fullname, data) + return code_object + + +class PyFileLoader(PyLoader): + + """Load a Python source file.""" def __init__(self, name, path, is_pkg): self._name = name @@ -354,29 +461,6 @@ # Not a property so that it is easy to override. return self._find_path(imp.PY_SOURCE) - @check_name - def bytecode_path(self, fullname): - """Return the path to a bytecode file, or None if one does not - exist.""" - # Not a property for easy overriding. - return self._find_path(imp.PY_COMPILED) - - @module_for_loader - def load_module(self, module): - """Load a Python source or bytecode module.""" - name = module.__name__ - source_path = self.source_path(name) - bytecode_path = self.bytecode_path(name) - code_object = self.get_code(module.__name__) - module.__file__ = source_path if source_path else bytecode_path - module.__loader__ = self - if self.is_package(name): - module.__path__ = [module.__file__.rsplit(path_sep, 1)[0]] - module.__package__ = module.__name__ - if not hasattr(module, '__path__'): - module.__package__ = module.__package__.rpartition('.')[0] - exec(code_object, module.__dict__) - return module @check_name def source_mtime(self, name): @@ -405,6 +489,34 @@ # anything other than UTF-8. return open(source_path, encoding=encoding).read() + + def get_data(self, path): + """Return the data from path as raw bytes.""" + return _fileio._FileIO(path, 'r').read() + + @check_name + def is_package(self, fullname): + """Return a boolean based on whether the module is a package. + + Raises ImportError (like get_source) if the loader cannot handle the + package. + + """ + return self._is_pkg + + +# XXX Rename _PyFileLoader throughout +class PyPycFileLoader(PyPycLoader, PyFileLoader): + + """Load a module from a source or bytecode file.""" + + @check_name + def bytecode_path(self, fullname): + """Return the path to a bytecode file, or None if one does not + exist.""" + # Not a property for easy overriding. + return self._find_path(imp.PY_COMPILED) + @check_name def write_bytecode(self, name, data): """Write out 'data' for the specified module, returning a boolean @@ -428,82 +540,6 @@ else: raise - def get_code(self, name): - """Return the code object for the module.""" - # XXX Care enough to make sure this call does not happen if the magic - # number is bad? - source_timestamp = self.source_mtime(name) - # Try to use bytecode if it is available. - bytecode_path = self.bytecode_path(name) - if bytecode_path: - data = self.get_data(bytecode_path) - magic = data[:4] - pyc_timestamp = marshal._r_long(data[4:8]) - bytecode = data[8:] - try: - # Verify that the magic number is valid. - if imp.get_magic() != magic: - raise ImportError("bad magic number") - # Verify that the bytecode is not stale (only matters when - # there is source to fall back on. - if source_timestamp: - if pyc_timestamp < source_timestamp: - raise ImportError("bytcode is stale") - except ImportError: - # If source is available give it a shot. - if source_timestamp is not None: - pass - else: - raise - else: - # Bytecode seems fine, so try to use it. - # XXX If the bytecode is ill-formed, would it be beneficial to - # try for using source if available and issue a warning? - return marshal.loads(bytecode) - elif source_timestamp is None: - raise ImportError("no source or bytecode available to create code " - "object for {0!r}".format(name)) - # Use the source. - source_path = self.source_path(name) - source = self.get_data(source_path) - # Convert to universal newlines. - line_endings = b'\n' - for index, c in enumerate(source): - if c == ord(b'\n'): - break - elif c == ord(b'\r'): - line_endings = b'\r' - try: - if source[index+1] == ord(b'\n'): - line_endings += b'\n' - except IndexError: - pass - break - if line_endings != b'\n': - source = source.replace(line_endings, b'\n') - code_object = compile(source, source_path, 'exec', dont_inherit=True) - # Generate bytecode and write it out. - if not sys.dont_write_bytecode: - data = bytearray(imp.get_magic()) - data.extend(marshal._w_long(source_timestamp)) - data.extend(marshal.dumps(code_object)) - self.write_bytecode(name, data) - return code_object - - def get_data(self, path): - """Return the data from path as raw bytes.""" - return _fileio._FileIO(path, 'r').read() - - @check_name - def is_package(self, fullname): - """Return a boolean based on whether the module is a package. - - Raises ImportError (like get_source) if the loader cannot handle the - package. - - """ - return self._is_pkg - class FileFinder: @@ -583,7 +619,7 @@ """Importer for source/bytecode files.""" _possible_package = True - _loader = _PyFileLoader + _loader = PyFileLoader def __init__(self, path_entry): # Lack of imp during class creation means _suffixes is set here. @@ -597,6 +633,8 @@ """Finder for source and bytecode files.""" + _loader = PyPycFileLoader + def __init__(self, path_entry): super().__init__(path_entry) self._suffixes += suffix_list(imp.PY_COMPILED) Modified: python/branches/py3k/Lib/importlib/test/source/test_loader.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/test_loader.py (original) +++ python/branches/py3k/Lib/importlib/test/source/test_loader.py Sat Feb 21 06:41:15 2009 @@ -19,7 +19,7 @@ # [basic] def test_module(self): with source_util.create_modules('_temp') as mapping: - loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + loader = importlib.PyPycFileLoader('_temp', mapping['_temp'], False) module = loader.load_module('_temp') self.assert_('_temp' in sys.modules) check = {'__name__': '_temp', '__file__': mapping['_temp'], @@ -29,7 +29,7 @@ def test_package(self): with source_util.create_modules('_pkg.__init__') as mapping: - loader = importlib._PyFileLoader('_pkg', mapping['_pkg.__init__'], + loader = importlib.PyPycFileLoader('_pkg', mapping['_pkg.__init__'], True) module = loader.load_module('_pkg') self.assert_('_pkg' in sys.modules) @@ -42,7 +42,7 @@ def test_lacking_parent(self): with source_util.create_modules('_pkg.__init__', '_pkg.mod')as mapping: - loader = importlib._PyFileLoader('_pkg.mod', mapping['_pkg.mod'], + loader = importlib.PyPycFileLoader('_pkg.mod', mapping['_pkg.mod'], False) module = loader.load_module('_pkg.mod') self.assert_('_pkg.mod' in sys.modules) @@ -57,7 +57,7 @@ def test_module_reuse(self): with source_util.create_modules('_temp') as mapping: - loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + loader = importlib.PyPycFileLoader('_temp', mapping['_temp'], False) module = loader.load_module('_temp') module_id = id(module) module_dict_id = id(module.__dict__) @@ -87,7 +87,7 @@ setattr(orig_module, attr, value) with open(mapping[name], 'w') as file: file.write('+++ bad syntax +++') - loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + loader = importlib.PyPycFileLoader('_temp', mapping['_temp'], False) self.assertRaises(SyntaxError, loader.load_module, name) for attr in attributes: self.assertEqual(getattr(orig_module, attr), value) @@ -97,7 +97,7 @@ with source_util.create_modules('_temp') as mapping: with open(mapping['_temp'], 'w') as file: file.write('=') - loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + loader = importlib.PyPycFileLoader('_temp', mapping['_temp'], False) self.assertRaises(SyntaxError, loader.load_module, '_temp') self.assert_('_temp' not in sys.modules) @@ -112,7 +112,7 @@ @source_util.writes_bytecode def run_test(self, assertion): with source_util.create_modules('_temp') as mapping: - loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + loader = importlib.PyPycFileLoader('_temp', mapping['_temp'], False) loader.load_module('_temp') bytecode_path = source_util.bytecode_path(mapping['_temp']) assertion(bytecode_path) @@ -144,7 +144,7 @@ with open(bytecode_path, 'r+b') as file: file.seek(0) file.write(b'\x00\x00\x00\x00') - loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + loader = importlib.PyPycFileLoader('_temp', mapping['_temp'], False) self.assertRaises(ImportError, loader.load_module, '_temp') self.assert_('_temp' not in sys.modules) @@ -159,7 +159,7 @@ """ def import_(self, file, module, *, pkg=False): - loader = importlib._PyFileLoader(module, file, pkg) + loader = importlib.PyPycFileLoader(module, file, pkg) return loader.load_module(module) def run_test(self, test, *create, pkg=False): @@ -171,7 +171,7 @@ import_name = test.rsplit('.', 1)[0] else: import_name = test - loader = importlib._PyFileLoader(import_name, mapping[test], pkg) + loader = importlib.PyPycFileLoader(import_name, mapping[test], pkg) # Because some platforms only have a granularity to the second for # atime you can't check the physical files. Instead just make it an # exception trigger if source was read. @@ -212,7 +212,7 @@ """ def import_(self, file, module_name): - loader = importlib._PyFileLoader(module_name, file, False) + loader = importlib.PyPycFileLoader(module_name, file, False) module = loader.load_module(module_name) self.assert_(module_name in sys.modules) Modified: python/branches/py3k/Lib/importlib/test/source/test_source_encoding.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/test_source_encoding.py (original) +++ python/branches/py3k/Lib/importlib/test/source/test_source_encoding.py Sat Feb 21 06:41:15 2009 @@ -35,7 +35,7 @@ with source_util.create_modules(self.module_name) as mapping: with open(mapping[self.module_name], 'wb')as file: file.write(source) - loader = importlib._PyFileLoader(self.module_name, + loader = importlib.PyPycFileLoader(self.module_name, mapping[self.module_name], False) return loader.load_module(self.module_name) @@ -96,7 +96,7 @@ with source_util.create_modules(module_name) as mapping: with open(mapping[module_name], 'wb') as file: file.write(source) - loader = importlib._PyFileLoader(module_name, mapping[module_name], + loader = importlib.PyPycFileLoader(module_name, mapping[module_name], False) return loader.load_module(module_name) From buildbot at python.org Sat Feb 21 07:33:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 06:33:25 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090221063325.ED4751E4002@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/329 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: 2 tests failed: test_posix test_site ====================================================================== 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 Sat Feb 21 08:17:22 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 21 Feb 2009 08:17:22 +0100 (CET) Subject: [Python-checkins] r69837 - in python/trunk: Lib/test/test_itertools.py Modules/itertoolsmodule.c Message-ID: <20090221071722.CC61F1E4002@bag.python.org> Author: raymond.hettinger Date: Sat Feb 21 08:17:22 2009 New Revision: 69837 Log: Fix keyword arguments for itertools.count(). Step arg without a start arg was ignored. Modified: python/trunk/Lib/test/test_itertools.py python/trunk/Modules/itertoolsmodule.c Modified: python/trunk/Lib/test/test_itertools.py ============================================================================== --- python/trunk/Lib/test/test_itertools.py (original) +++ python/trunk/Lib/test/test_itertools.py Sat Feb 21 08:17:22 2009 @@ -350,6 +350,8 @@ self.assertEqual(zip('abc',count(2,3)), [('a', 2), ('b', 5), ('c', 8)]) self.assertEqual(zip('abc',count(start=2,step=3)), [('a', 2), ('b', 5), ('c', 8)]) + self.assertEqual(zip('abc',count(step=-1)), + [('a', 0), ('b', -1), ('c', -2)]) self.assertEqual(zip('abc',count(2,0)), [('a', 2), ('b', 2), ('c', 2)]) self.assertEqual(zip('abc',count(2,1)), [('a', 2), ('b', 3), ('c', 4)]) self.assertEqual(take(20, count(maxsize-15, 3)), take(20, range(maxsize-15, maxsize+100, 3))) Modified: python/trunk/Modules/itertoolsmodule.c ============================================================================== --- python/trunk/Modules/itertoolsmodule.c (original) +++ python/trunk/Modules/itertoolsmodule.c Sat Feb 21 08:17:22 2009 @@ -3209,19 +3209,19 @@ /* Counting logic and invariants: -C_add_mode: when cnt an integer < PY_SSIZE_T_MAX and no step is specified. +fast_mode: when cnt an integer < PY_SSIZE_T_MAX and no step is specified. assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL && long_step==PyInt(1)); Advances with: cnt += 1 - When count hits Y_SSIZE_T_MAX, switch to Py_add_mode. + When count hits Y_SSIZE_T_MAX, switch to slow_mode. -Py_add_mode: when cnt == PY_SSIZE_T_MAX, step is not int(1), or cnt is a float. +slow_mode: when cnt == PY_SSIZE_T_MAX, step is not int(1), or cnt is a float. assert(cnt == PY_SSIZE_T_MAX && long_cnt != NULL && long_step != NULL); All counting is done with python objects (no overflows or underflows). Advances with: long_cnt += long_step Step may be zero -- effectively a slow version of repeat(cnt). - Either long_cnt or long_step may be a float. + Either long_cnt or long_step may be a float, Fraction, or Decimal. */ static PyTypeObject count_type; @@ -3230,6 +3230,7 @@ count_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { countobject *lz; + int slow_mode = 0; Py_ssize_t cnt = 0; PyObject *long_cnt = NULL; PyObject *long_step = NULL; @@ -3239,36 +3240,51 @@ kwlist, &long_cnt, &long_step)) return NULL; - if ((long_cnt != NULL && !PyNumber_Check(long_cnt)) || - (long_step != NULL && !PyNumber_Check(long_step))) { + if (long_cnt != NULL && !PyNumber_Check(long_cnt) || + long_step != NULL && !PyNumber_Check(long_step)) { PyErr_SetString(PyExc_TypeError, "a number is required"); return NULL; } + if (long_cnt != NULL) { + cnt = PyInt_AsSsize_t(long_cnt); + if (cnt == -1 && PyErr_Occurred() || !PyInt_Check(long_cnt)) { + PyErr_Clear(); + slow_mode = 1; + } + Py_INCREF(long_cnt); + } else { + cnt = 0; + long_cnt = PyInt_FromLong(0); + } + + /* If not specified, step defaults to 1 */ if (long_step == NULL) { - /* If not specified, step defaults to 1 */ long_step = PyInt_FromLong(1); - if (long_step == NULL) + if (long_step == NULL) { + Py_DECREF(long_cnt); return NULL; + } } else Py_INCREF(long_step); - assert(long_step != NULL); - if (long_cnt != NULL) { - cnt = PyInt_AsSsize_t(long_cnt); - if ((cnt == -1 && PyErr_Occurred()) || - !PyIndex_Check(long_cnt) || - !PyInt_Check(long_step) || - PyInt_AS_LONG(long_step) != 1) { - /* Switch to Py_add_mode */ - PyErr_Clear(); - Py_INCREF(long_cnt); - cnt = PY_SSIZE_T_MAX; - } else - long_cnt = NULL; + assert(long_cnt != NULL && long_step != NULL); + + /* Fast mode only works when the step is 1 */ + if (!PyInt_Check(long_step) || + PyInt_AS_LONG(long_step) != 1) { + slow_mode = 1; } - assert((cnt != PY_SSIZE_T_MAX && long_cnt == NULL) || - (cnt == PY_SSIZE_T_MAX && long_cnt != NULL)); + + if (slow_mode) + cnt = PY_SSIZE_T_MAX; + else + Py_CLEAR(long_cnt); + + assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL && !slow_mode || + cnt == PY_SSIZE_T_MAX && long_cnt != NULL && slow_mode); + assert(slow_mode || + PyInt_Check(long_step) && PyInt_AS_LONG(long_step) == 1); /* create countobject structure */ lz = (countobject *)type->tp_alloc(type, 0); @@ -3308,7 +3324,7 @@ long_cnt = lz->long_cnt; if (long_cnt == NULL) { - /* Switch to Py_add_mode */ + /* Switch to slow_mode */ long_cnt = PyInt_FromSsize_t(PY_SSIZE_T_MAX); if (long_cnt == NULL) return NULL; @@ -3360,11 +3376,10 @@ } PyDoc_STRVAR(count_doc, - "count([start[, step]]) --> count object\n\ + "count(start=0, step=1]) --> count object\n\ \n\ -Return a count object whose .next() method returns consecutive\n\ -integers starting from zero or, if specified, from start.\n\ -If step is specified, counts by that interval. Equivalent to:\n\n\ +Return a count object whose .next() method returns consecutive values.\n\ +Equivalent to:\n\n\ def count(firstval=0, step=1):\n\ x = firstval\n\ while 1:\n\ From buildbot at python.org Sat Feb 21 08:45:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 07:45:07 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090221074507.D36C21E4002@bag.python.org> The Buildbot has detected a new failure of OS X x86 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/169 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 21 08:46:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 07:46:41 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090221074642.7196C1E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/667 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Feb 21 09:58:42 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 21 Feb 2009 09:58:42 +0100 (CET) Subject: [Python-checkins] r69838 - python/trunk/Lib/heapq.py Message-ID: <20090221085842.9738F1E4002@bag.python.org> Author: raymond.hettinger Date: Sat Feb 21 09:58:42 2009 New Revision: 69838 Log: Speedup and simplify negative counter using count's new step argument. Modified: python/trunk/Lib/heapq.py Modified: python/trunk/Lib/heapq.py ============================================================================== --- python/trunk/Lib/heapq.py (original) +++ python/trunk/Lib/heapq.py Sat Feb 21 09:58:42 2009 @@ -130,7 +130,7 @@ 'nlargest', 'nsmallest', 'heappushpop'] from itertools import islice, repeat, count, imap, izip, tee, chain -from operator import itemgetter, neg +from operator import itemgetter import bisect def heappush(heap, item): @@ -413,13 +413,13 @@ # When key is none, use simpler decoration if key is None: - it = izip(iterable, imap(neg, count())) # decorate + it = izip(iterable, count(0,-1)) # decorate result = _nlargest(n, it) return map(itemgetter(0), result) # undecorate # General case, slowest method in1, in2 = tee(iterable) - it = izip(imap(key, in1), imap(neg, count()), in2) # decorate + it = izip(imap(key, in1), count(0,-1), in2) # decorate result = _nlargest(n, it) return map(itemgetter(2), result) # undecorate From nnorwitz at gmail.com Sat Feb 21 10:11:21 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 21 Feb 2009 04:11:21 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090221091121.GA17694@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663887 refs] From nnorwitz at gmail.com Sat Feb 21 10:23:53 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 21 Feb 2009 04:23:53 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090221092353.GA23631@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 [17163 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663157 refs] From buildbot at python.org Sat Feb 21 10:24:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 09:24:31 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090221092431.6F6301E4002@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/900 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: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 21 10:41:12 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 09:41:12 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090221094112.546F31E4022@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/4665 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Sat Feb 21 11:54:43 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 21 Feb 2009 05:54:43 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090221105443.GA20763@python.psfb.org> 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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-17129 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 test_slice test_smtplib test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [677587 refs] From python-checkins at python.org Sat Feb 21 19:54:01 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 21 Feb 2009 19:54:01 +0100 (CET) Subject: [Python-checkins] r69839 - in python/branches/io-c: Lib/io.py Lib/test/test_memoryio.py Modules/_stringio.c Modules/io.c Message-ID: <20090221185401.E0DFA1E4002@bag.python.org> Author: antoine.pitrou Date: Sat Feb 21 19:54:01 2009 New Revision: 69839 Log: StringIO is now written entirely in C (and blazingly fast) Modified: python/branches/io-c/Lib/io.py python/branches/io-c/Lib/test/test_memoryio.py python/branches/io-c/Modules/_stringio.c python/branches/io-c/Modules/io.c Modified: python/branches/io-c/Lib/io.py ============================================================================== --- python/branches/io-c/Lib/io.py (original) +++ python/branches/io-c/Lib/io.py Sat Feb 21 19:54:01 2009 @@ -1847,6 +1847,7 @@ def newlines(self): return self._decoder.newlines if self._decoder else None +StringIO = _io.StringIO class unused_StringIO(unused_TextIOWrapper): """Text I/O implementation using an in-memory buffer. @@ -1871,101 +1872,6 @@ self.flush() return self.buffer.getvalue().decode(self._encoding, self._errors) -try: - class StringIO(_io._StringIO, TextIOBase): - """Text I/O implementation using an in-memory buffer. - - The initial_value argument sets the value of object. The newline - argument is like the one of TextIOWrapper's constructor. - """ - - _read = _io._StringIO.read - _readline = _io._StringIO.readline - _write = _io._StringIO.write - _tell = _io._StringIO.tell - _seek = _io._StringIO.seek - _truncate = _io._StringIO.truncate - _getvalue = _io._StringIO.getvalue - - def getvalue(self) -> str: - """Retrieve the entire contents of the object.""" - if self.closed: - raise ValueError("read on closed file") - return self._getvalue() - - def write(self, s: str) -> int: - """Write string s to file. - - Returns the number of characters written. - """ - if self.closed: - raise ValueError("write to closed file") - return self._write(s) - - def read(self, n: int = None) -> str: - """Read at most n characters, returned as a string. - - If the argument is negative or omitted, read until EOF - is reached. Return an empty string at EOF. - """ - if self.closed: - raise ValueError("read to closed file") - return self._read(n) - - def tell(self) -> int: - """Tell the current file position.""" - if self.closed: - raise ValueError("tell from closed file") - return self._tell() - - def seek(self, pos: int = None, whence: int = 0) -> int: - """Change stream position. - - Seek to character offset pos relative to position indicated by whence: - 0 Start of stream (the default). pos should be >= 0; - 1 Current position - pos must be 0; - 2 End of stream - pos must be 0. - Returns the new absolute position. - """ - if self.closed: - raise ValueError("seek from closed file") - return self._seek(pos, whence) - - def truncate(self, pos: int = None) -> int: - """Truncate size to pos. - - The pos argument defaults to the current file position, as - returned by tell(). Imply an absolute seek to pos. - Returns the new absolute position. - """ - if self.closed: - raise ValueError("truncate from closed file") - return self._truncate(pos) - - def readline(self, limit: int = None) -> str: - if self.closed: - raise ValueError("read from closed file") - return self._readline(limit) - - _LF = 1 - _CR = 2 - _CRLF = 4 - - @property - def newlines(self): - return (None, - "\n", - "\r", - ("\r", "\n"), - "\r\n", - ("\n", "\r\n"), - ("\r", "\r\n"), - ("\r", "\n", "\r\n") - )[self._seennl] - - -except ImportError: - StringIO = _StringIO # make test_memoryio happy! _BytesIO = BytesIO Modified: python/branches/io-c/Lib/test/test_memoryio.py ============================================================================== --- python/branches/io-c/Lib/test/test_memoryio.py (original) +++ python/branches/io-c/Lib/test/test_memoryio.py Sat Feb 21 19:54:01 2009 @@ -391,7 +391,7 @@ self.assertEqual(memio.errors, "strict") self.assertEqual(memio.line_buffering, False) - def test_newlines_none(self): + def test_newline_none(self): # newline=None memio = self.ioclass("a\nb\r\nc\rd", newline=None) self.assertEqual(list(memio), ["a\n", "b\n", "c\n", "d"]) @@ -407,7 +407,7 @@ memio.seek(0) self.assertEqual(memio.read(), "a\nb\nc\nd") - def test_newlines_empty(self): + def test_newline_empty(self): # newline="" memio = self.ioclass("a\nb\r\nc\rd", newline="") self.assertEqual(list(memio), ["a\n", "b\r\n", "c\r", "d"]) @@ -418,16 +418,17 @@ memio = self.ioclass(newline="") self.assertEqual(2, memio.write("a\n")) self.assertEqual(2, memio.write("b\r")) - self.assertEqual(4, memio.write("\nc\rd")) + self.assertEqual(2, memio.write("\nc")) + self.assertEqual(2, memio.write("\rd")) memio.seek(0) self.assertEqual(list(memio), ["a\n", "b\r\n", "c\r", "d"]) - def test_newlines_lf(self): + def test_newline_lf(self): # newline="\n" memio = self.ioclass("a\nb\r\nc\rd") self.assertEqual(list(memio), ["a\n", "b\r\n", "c\rd"]) - def test_newlines_cr(self): + def test_newline_cr(self): # newline="\r" memio = self.ioclass("a\nb\r\nc\rd", newline="\r") memio.seek(0) @@ -435,7 +436,7 @@ memio.seek(0) self.assertEqual(list(memio), ["a\r", "b\r", "\r", "c\r", "d"]) - def test_newlines_crlf(self): + def test_newline_crlf(self): # newline="\r\n" memio = self.ioclass("a\nb\r\nc\rd", newline="\r\n") memio.seek(0) @@ -469,6 +470,17 @@ self.assertEqual(memio.tell(), len(buf) * 2) self.assertEqual(memio.getvalue(), buf + buf) + # XXX This test fails with the Python version of io.StringIO + def test_newlines_property(self): + memio = self.ioclass(newline=None) + self.assertEqual(memio.newlines, None) + memio.write("a\n") + self.assertEqual(memio.newlines, "\n") + memio.write("b\r\n") + self.assertEqual(memio.newlines, ("\n", "\r\n")) + memio.write("c\rd") + self.assertEqual(memio.newlines, ("\r", "\n", "\r\n")) + def test_main(): tests = [PyBytesIOTest, PyStringIOTest, CBytesIOTest, CStringIOTest] Modified: python/branches/io-c/Modules/_stringio.c ============================================================================== --- python/branches/io-c/Modules/_stringio.c (original) +++ python/branches/io-c/Modules/_stringio.c Sat Feb 21 19:54:01 2009 @@ -13,12 +13,13 @@ Py_ssize_t string_size; size_t buf_size; - int ok; /* initialized? */ + char ok; /* initialized? */ + char closed; + char readuniversal; + char readtranslate; PyObject *decoder; PyObject *readnl; PyObject *writenl; - char readuniversal; - char readtranslate; } StringIOObject; #define CHECK_INITIALIZED(self) \ @@ -28,6 +29,20 @@ return NULL; \ } +#define CHECK_CLOSED(self) \ + if (self->closed) { \ + PyErr_SetString(PyExc_ValueError, \ + "I/O operation on closed file"); \ + return NULL; \ + } + +PyDoc_STRVAR(stringio_doc, + "Text I/O implementation using an in-memory buffer.\n" + "\n" + "The initial_value argument sets the value of object. The newline\n" + "argument is like the one of TextIOWrapper's constructor."); + + /* Internal routine for changing the size, in terms of characters, of the buffer of StringIO objects. The caller should ensure that the 'size' argument is non-negative. Returns 0 on success, -1 otherwise. */ @@ -163,20 +178,34 @@ return -1; } +PyDoc_STRVAR(stringio_getvalue_doc, + "Retrieve the entire contents of the object."); + static PyObject * stringio_getvalue(StringIOObject *self) { CHECK_INITIALIZED(self); + CHECK_CLOSED(self); return PyUnicode_FromUnicode(self->buf, self->string_size); } +PyDoc_STRVAR(stringio_tell_doc, + "Tell the current file position."); + static PyObject * stringio_tell(StringIOObject *self) { CHECK_INITIALIZED(self); + CHECK_CLOSED(self); return PyLong_FromSsize_t(self->pos); } +PyDoc_STRVAR(stringio_read_doc, + "Read at most n characters, returned as a string.\n" + "\n" + "If the argument is negative or omitted, read until EOF\n" + "is reached. Return an empty string at EOF.\n"); + static PyObject * stringio_read(StringIOObject *self, PyObject *args) { @@ -187,6 +216,7 @@ CHECK_INITIALIZED(self); if (!PyArg_ParseTuple(args, "|O:read", &arg)) return NULL; + CHECK_CLOSED(self); if (PyNumber_Check(arg)) { size = PyNumber_AsSsize_t(arg, PyExc_OverflowError); @@ -216,29 +246,13 @@ return PyUnicode_FromUnicode(output, size); } +/* Internal helper, used by stringio_readline and stringio_iternext */ static PyObject * -stringio_readline(StringIOObject *self, PyObject *args) +_stringio_readline(StringIOObject *self, Py_ssize_t limit) { - PyObject *arg = Py_None; - Py_ssize_t limit = -1; Py_UNICODE *start, *end, old_char; Py_ssize_t len, consumed; - CHECK_INITIALIZED(self); - if (!PyArg_ParseTuple(args, "|O:readline", &arg)) - return NULL; - - if (PyNumber_Check(arg)) { - limit = PyNumber_AsSsize_t(arg, PyExc_OverflowError); - if (limit == -1 && PyErr_Occurred()) - return NULL; - } - else if (arg != Py_None) { - PyErr_Format(PyExc_TypeError, "integer argument expected, got '%s'", - Py_TYPE(arg)->tp_name); - return NULL; - } - /* In case of overseek, return the empty string */ if (self->pos >= self->string_size) return PyUnicode_FromString(""); @@ -262,6 +276,79 @@ return PyUnicode_FromUnicode(start, len); } +PyDoc_STRVAR(stringio_readline_doc, + "Read until newline or EOF.\n" + "\n" + "Returns an empty string if EOF is hit immediately.\n"); + +static PyObject * +stringio_readline(StringIOObject *self, PyObject *args) +{ + PyObject *arg = Py_None; + Py_ssize_t limit = -1; + + CHECK_INITIALIZED(self); + if (!PyArg_ParseTuple(args, "|O:readline", &arg)) + return NULL; + CHECK_CLOSED(self); + + if (PyNumber_Check(arg)) { + limit = PyNumber_AsSsize_t(arg, PyExc_OverflowError); + if (limit == -1 && PyErr_Occurred()) + return NULL; + } + else if (arg != Py_None) { + PyErr_Format(PyExc_TypeError, "integer argument expected, got '%s'", + Py_TYPE(arg)->tp_name); + return NULL; + } + return _stringio_readline(self, limit); +} + +static PyObject * +stringio_iternext(StringIOObject *self) +{ + PyObject *line; + + CHECK_INITIALIZED(self); + CHECK_CLOSED(self); + + if (Py_TYPE(self) == &PyStringIO_Type) { + /* Skip method call overhead for speed */ + line = _stringio_readline(self, -1); + } + else { + /* XXX is subclassing StringIO really supported? */ + line = PyObject_CallMethodObjArgs((PyObject *)self, + _PyIO_str_readline, NULL); + if (line && !PyUnicode_Check(line)) { + PyErr_Format(PyExc_IOError, + "readline() should have returned an str object, " + "not '%.200s'", Py_TYPE(line)->tp_name); + Py_DECREF(line); + return NULL; + } + } + + if (line == NULL) + return NULL; + + if (PyUnicode_GET_SIZE(line) == 0) { + /* Reached EOF */ + Py_DECREF(line); + return NULL; + } + + return line; +} + +PyDoc_STRVAR(stringio_truncate_doc, + "Truncate size to pos.\n" + "\n" + "The pos argument defaults to the current file position, as\n" + "returned by tell(). Imply an absolute seek to pos.\n" + "Returns the new absolute position.\n"); + static PyObject * stringio_truncate(StringIOObject *self, PyObject *args) { @@ -271,6 +358,7 @@ CHECK_INITIALIZED(self); if (!PyArg_ParseTuple(args, "|O:truncate", &arg)) return NULL; + CHECK_CLOSED(self); if (PyNumber_Check(arg)) { size = PyNumber_AsSsize_t(arg, PyExc_OverflowError); @@ -303,6 +391,15 @@ return PyLong_FromSsize_t(size); } +PyDoc_STRVAR(stringio_seek_doc, + "Change stream position.\n" + "\n" + "Seek to character offset pos relative to position indicated by whence:\n" + " 0 Start of stream (the default). pos should be >= 0;\n" + " 1 Current position - pos must be 0;\n" + " 2 End of stream - pos must be 0.\n" + "Returns the new absolute position.\n"); + static PyObject * stringio_seek(StringIOObject *self, PyObject *args) { @@ -312,6 +409,7 @@ CHECK_INITIALIZED(self); if (!PyArg_ParseTuple(args, "n|i:seek", &pos, &mode)) return NULL; + CHECK_CLOSED(self); if (mode != 0 && mode != 1 && mode != 2) { PyErr_Format(PyExc_ValueError, @@ -344,6 +442,12 @@ return PyLong_FromSsize_t(self->pos); } +PyDoc_STRVAR(stringio_write_doc, + "Write string to file.\n" + "\n" + "Returns the number of characters written, which is always equal to\n" + "the length of the string.\n"); + static PyObject * stringio_write(StringIOObject *self, PyObject *obj) { @@ -355,6 +459,7 @@ Py_TYPE(obj)->tp_name); return NULL; } + CHECK_CLOSED(self); size = PyUnicode_GET_SIZE(obj); if (size > 0 && write_str(self, obj) < 0) @@ -363,13 +468,33 @@ return PyLong_FromSsize_t(size); } +PyDoc_STRVAR(stringio_close_doc, + "Close the IO object. Attempting any further operation after the\n" + "object is closed will raise a ValueError.\n" + "\n" + "This method has no effect if the file is already closed.\n"); + +static PyObject * +stringio_close(StringIOObject *self) +{ + self->closed = 1; + /* Free up some memory */ + if (resize_buffer(self, 0) < 0) + return NULL; + Py_CLEAR(self->readnl); + Py_CLEAR(self->writenl); + Py_CLEAR(self->decoder); + Py_RETURN_NONE; +} + static void stringio_dealloc(StringIOObject *self) { Py_CLEAR(self->readnl); Py_CLEAR(self->writenl); Py_CLEAR(self->decoder); - PyMem_Free(self->buf); + if (self->buf) + PyMem_Free(self->buf); Py_TYPE(self)->tp_free(self); } @@ -472,11 +597,12 @@ } self->pos = 0; - + self->closed = 0; self->ok = 1; return 0; } +/* Properties and pseudo-properties */ static PyObject * stringio_seekable(StringIOObject *self, PyObject *args) { @@ -507,9 +633,17 @@ } static PyObject * +stringio_closed(StringIOObject *self, void *context) +{ + CHECK_INITIALIZED(self); + return PyBool_FromLong(self->closed); +} + +static PyObject * stringio_encoding(StringIOObject *self, void *context) { CHECK_INITIALIZED(self); + CHECK_CLOSED(self); return PyUnicode_FromString("utf-8"); } @@ -517,6 +651,7 @@ stringio_errors(StringIOObject *self, void *context) { CHECK_INITIALIZED(self); + CHECK_CLOSED(self); return PyUnicode_FromString("strict"); } @@ -524,25 +659,39 @@ stringio_line_buffering(StringIOObject *self, void *context) { CHECK_INITIALIZED(self); + CHECK_CLOSED(self); Py_RETURN_FALSE; } +static PyObject * +stringio_newlines(StringIOObject *self, void *context) +{ + CHECK_INITIALIZED(self); + CHECK_CLOSED(self); + if (self->decoder == NULL) + Py_RETURN_NONE; + return PyObject_GetAttr(self->decoder, _PyIO_str_newlines); +} + static struct PyMethodDef stringio_methods[] = { - {"getvalue", (PyCFunction)stringio_getvalue, METH_VARARGS, NULL}, - {"read", (PyCFunction)stringio_read, METH_VARARGS, NULL}, - {"readline", (PyCFunction)stringio_readline, METH_VARARGS, NULL}, - {"tell", (PyCFunction)stringio_tell, METH_NOARGS, NULL}, - {"truncate", (PyCFunction)stringio_truncate, METH_VARARGS, NULL}, - {"seek", (PyCFunction)stringio_seek, METH_VARARGS, NULL}, - {"write", (PyCFunction)stringio_write, METH_O, NULL}, + {"close", (PyCFunction)stringio_close, METH_NOARGS, stringio_close_doc}, + {"getvalue", (PyCFunction)stringio_getvalue, METH_VARARGS, stringio_getvalue_doc}, + {"read", (PyCFunction)stringio_read, METH_VARARGS, stringio_read_doc}, + {"readline", (PyCFunction)stringio_readline, METH_VARARGS, stringio_readline_doc}, + {"tell", (PyCFunction)stringio_tell, METH_NOARGS, stringio_tell_doc}, + {"truncate", (PyCFunction)stringio_truncate, METH_VARARGS, stringio_truncate_doc}, + {"seek", (PyCFunction)stringio_seek, METH_VARARGS, stringio_seek_doc}, + {"write", (PyCFunction)stringio_write, METH_O, stringio_write_doc}, - {"seekable", (PyCFunction)stringio_seekable, METH_NOARGS}, - {"readable", (PyCFunction)stringio_readable, METH_NOARGS}, - {"writable", (PyCFunction)stringio_writable, METH_NOARGS}, + {"seekable", (PyCFunction)stringio_seekable, METH_NOARGS}, + {"readable", (PyCFunction)stringio_readable, METH_NOARGS}, + {"writable", (PyCFunction)stringio_writable, METH_NOARGS}, {NULL, NULL} /* sentinel */ }; static PyGetSetDef stringio_getset[] = { + {"closed", (getter)stringio_closed, NULL, NULL}, + {"newlines", (getter)stringio_newlines, NULL, NULL}, /* (following comments straight off of the original Python wrapper:) XXX Cruft to support the TextIOWrapper API. This would only be meaningful if StringIO supported the buffer attribute. @@ -558,7 +707,7 @@ PyTypeObject PyStringIO_Type = { PyVarObject_HEAD_INIT(NULL, 0) - "_StringIO", /*tp_name*/ + "StringIO", /*tp_name*/ sizeof(StringIOObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ (destructor)stringio_dealloc, /*tp_dealloc*/ @@ -577,13 +726,13 @@ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ - 0, /*tp_doc*/ + stringio_doc, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ - 0, /*tp_iternext*/ + (iternextfunc)stringio_iternext, /*tp_iternext*/ stringio_methods, /*tp_methods*/ 0, /*tp_members*/ stringio_getset, /*tp_getset*/ Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Sat Feb 21 19:54:01 2009 @@ -671,8 +671,8 @@ ADD_TYPE(&PyBytesIO_Type, "BytesIO"); /* StringIO */ - /* PyStringIO_Type.tp_base = &PyTextIOBase_Type; */ - ADD_TYPE(&PyStringIO_Type, "_StringIO"); + PyStringIO_Type.tp_base = &PyTextIOBase_Type; + ADD_TYPE(&PyStringIO_Type, "StringIO"); /* BufferedReader */ PyBufferedReader_Type.tp_base = &PyBufferedIOBase_Type; From python-checkins at python.org Sat Feb 21 20:09:40 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 21 Feb 2009 20:09:40 +0100 (CET) Subject: [Python-checkins] r69840 - in python/trunk/Doc/c-api: intro.rst veryhigh.rst Message-ID: <20090221190940.704091E4002@bag.python.org> Author: georg.brandl Date: Sat Feb 21 20:09:40 2009 New Revision: 69840 Log: #5338, #5339: two types in the API manual. Modified: python/trunk/Doc/c-api/intro.rst python/trunk/Doc/c-api/veryhigh.rst Modified: python/trunk/Doc/c-api/intro.rst ============================================================================== --- python/trunk/Doc/c-api/intro.rst (original) +++ python/trunk/Doc/c-api/intro.rst Sat Feb 21 20:09:40 2009 @@ -187,7 +187,7 @@ the caller is said to *borrow* the reference. Nothing needs to be done for a borrowed reference. -Conversely, when a calling function passes it a reference to an object, there +Conversely, when a calling function passes in a reference to an object, there are two possibilities: the function *steals* a reference to the object, or it does not. *Stealing a reference* means that when you pass a reference to a function, that function assumes that it now owns that reference, and you are not Modified: python/trunk/Doc/c-api/veryhigh.rst ============================================================================== --- python/trunk/Doc/c-api/veryhigh.rst (original) +++ python/trunk/Doc/c-api/veryhigh.rst Sat Feb 21 20:09:40 2009 @@ -16,7 +16,7 @@ :const:`Py_file_input`, and :const:`Py_single_input`. These are described following the functions which accept them as parameters. -Note also that several of these functions take :ctype:`FILE\*` parameters. On +Note also that several of these functions take :ctype:`FILE\*` parameters. One particular issue which needs to be handled carefully is that the :ctype:`FILE` structure for different C libraries can be different and incompatible. Under Windows (at least), it is possible for dynamically linked extensions to actually From python-checkins at python.org Sat Feb 21 21:05:43 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 21 Feb 2009 21:05:43 +0100 (CET) Subject: [Python-checkins] r69841 - in python/branches/io-c/Lib: _pyio.py io.py test/test_io.py test/test_memoryio.py Message-ID: <20090221200543.5E5A71E4010@bag.python.org> Author: benjamin.peterson Date: Sat Feb 21 21:05:40 2009 New Revision: 69841 Log: split the Python implementation of io into another module and rewrite the tests to test both implementations Added: python/branches/io-c/Lib/_pyio.py (contents, props changed) Modified: python/branches/io-c/Lib/io.py python/branches/io-c/Lib/test/test_io.py python/branches/io-c/Lib/test/test_memoryio.py Added: python/branches/io-c/Lib/_pyio.py ============================================================================== --- (empty file) +++ python/branches/io-c/Lib/_pyio.py Sat Feb 21 21:05:40 2009 @@ -0,0 +1,1773 @@ +""" +Python implementation of the io module. +""" + +import os +import abc +import codecs +#import _fileio +# Import _thread instead of threading to reduce startup cost +try: + from _thread import allocate_lock as Lock +except ImportError: + from _dummy_thread import allocate_lock as Lock + +from io import __all__ + +# open() uses st_blksize whenever we can +DEFAULT_BUFFER_SIZE = 8 * 1024 # bytes + + +class BlockingIOError(IOError): + + """Exception raised when I/O would block on a non-blocking I/O stream.""" + + def __init__(self, errno, strerror, characters_written=0): + IOError.__init__(self, errno, strerror) + self.characters_written = characters_written + + +def open(file, mode="r", buffering=None, encoding=None, errors=None, + newline=None, closefd=True): + + r"""Open file and return a stream. Raise IOError upon failure. + + file is either a text or byte string giving the name (and the path + if the file isn't in the current working directory) of the file to + be opened or an integer file descriptor of the file to be + wrapped. (If a file descriptor is given, it is closed when the + returned I/O object is closed, unless closefd is set to False.) + + mode is an optional string that specifies the mode in which the file + is opened. It defaults to 'r' which means open for reading in text + mode. Other common values are 'w' for writing (truncating the file if + it already exists), and 'a' for appending (which on some Unix systems, + means that all writes append to the end of the file regardless of the + current seek position). In text mode, if encoding is not specified the + encoding used is platform dependent. (For reading and writing raw + bytes use binary mode and leave encoding unspecified.) The available + modes are: + + ========= =============================================================== + Character Meaning + --------- --------------------------------------------------------------- + 'r' open for reading (default) + 'w' open for writing, truncating the file first + 'a' open for writing, appending to the end of the file if it exists + 'b' binary mode + 't' text mode (default) + '+' open a disk file for updating (reading and writing) + 'U' universal newline mode (for backwards compatibility; unneeded + for new code) + ========= =============================================================== + + The default mode is 'rt' (open for reading text). For binary random + access, the mode 'w+b' opens and truncates the file to 0 bytes, while + 'r+b' opens the file without truncation. + + Python distinguishes between files opened in binary and text modes, + even when the underlying operating system doesn't. Files opened in + binary mode (appending 'b' to the mode argument) return contents as + bytes objects without any decoding. In text mode (the default, or when + 't' is appended to the mode argument), the contents of the file are + returned as strings, the bytes having been first decoded using a + platform-dependent encoding or using the specified encoding if given. + + buffering is an optional integer used to set the buffering policy. By + default full buffering is on. Pass 0 to switch buffering off (only + allowed in binary mode), 1 to set line buffering, and an integer > 1 + for full buffering. + + encoding is the name of the encoding used to decode or encode the + file. This should only be used in text mode. The default encoding is + platform dependent, but any encoding supported by Python can be + passed. See the codecs module for the list of supported encodings. + + errors is an optional string that specifies how encoding errors are to + be handled---this argument should not be used in binary mode. Pass + 'strict' to raise a ValueError exception if there is an encoding error + (the default of None has the same effect), or pass 'ignore' to ignore + errors. (Note that ignoring encoding errors can lead to data loss.) + See the documentation for codecs.register for a list of the permitted + encoding error strings. + + newline controls how universal newlines works (it only applies to text + mode). It can be None, '', '\n', '\r', and '\r\n'. It works as + follows: + + * On input, if newline is None, universal newlines mode is + enabled. Lines in the input can end in '\n', '\r', or '\r\n', and + these are translated into '\n' before being returned to the + caller. If it is '', universal newline mode is enabled, but line + endings are returned to the caller untranslated. If it has any of + the other legal values, input lines are only terminated by the given + string, and the line ending is returned to the caller untranslated. + + * On output, if newline is None, any '\n' characters written are + translated to the system default line separator, os.linesep. If + newline is '', no translation takes place. If newline is any of the + other legal values, any '\n' characters written are translated to + the given string. + + If closefd is False, the underlying file descriptor will be kept open + when the file is closed. This does not work when a file name is given + and must be True in that case. + + open() returns a file object whose type depends on the mode, and + through which the standard file operations such as reading and writing + are performed. When open() is used to open a file in a text mode ('w', + 'r', 'wt', 'rt', etc.), it returns a TextIOWrapper. When used to open + a file in a binary mode, the returned class varies: in read binary + mode, it returns a BufferedReader; in write binary and append binary + modes, it returns a BufferedWriter, and in read/write mode, it returns + a BufferedRandom. + + It is also possible to use a string or bytearray as a file for both + reading and writing. For strings StringIO can be used like a file + opened in a text mode, and for bytes a BytesIO can be used like a file + opened in a binary mode. + """ + if not isinstance(file, (str, bytes, int)): + raise TypeError("invalid file: %r" % file) + if not isinstance(mode, str): + raise TypeError("invalid mode: %r" % mode) + if buffering is not None and not isinstance(buffering, int): + raise TypeError("invalid buffering: %r" % buffering) + if encoding is not None and not isinstance(encoding, str): + raise TypeError("invalid encoding: %r" % encoding) + if errors is not None and not isinstance(errors, str): + raise TypeError("invalid errors: %r" % errors) + modes = set(mode) + if modes - set("arwb+tU") or len(mode) > len(modes): + raise ValueError("invalid mode: %r" % mode) + reading = "r" in modes + writing = "w" in modes + appending = "a" in modes + updating = "+" in modes + text = "t" in modes + binary = "b" in modes + if "U" in modes: + if writing or appending: + raise ValueError("can't use U and writing mode at once") + reading = True + if text and binary: + raise ValueError("can't have text and binary mode at once") + if reading + writing + appending > 1: + raise ValueError("can't have read/write/append mode at once") + if not (reading or writing or appending): + raise ValueError("must have exactly one of read/write/append mode") + if binary and encoding is not None: + raise ValueError("binary mode doesn't take an encoding argument") + if binary and errors is not None: + raise ValueError("binary mode doesn't take an errors argument") + if binary and newline is not None: + raise ValueError("binary mode doesn't take a newline argument") + raw = FileIO(file, + (reading and "r" or "") + + (writing and "w" or "") + + (appending and "a" or "") + + (updating and "+" or ""), + closefd) + if buffering is None: + buffering = -1 + line_buffering = False + if buffering == 1 or buffering < 0 and raw.isatty(): + buffering = -1 + line_buffering = True + if buffering < 0: + buffering = DEFAULT_BUFFER_SIZE + try: + bs = os.fstat(raw.fileno()).st_blksize + except (os.error, AttributeError): + pass + else: + if bs > 1: + buffering = bs + if buffering < 0: + raise ValueError("invalid buffering size") + if buffering == 0: + if binary: + return raw + raise ValueError("can't have unbuffered text I/O") + if updating: + buffer = BufferedRandom(raw, buffering) + elif writing or appending: + buffer = BufferedWriter(raw, buffering) + elif reading: + buffer = BufferedReader(raw, buffering) + else: + raise ValueError("unknown mode: %r" % mode) + if binary: + return buffer + text = TextIOWrapper(buffer, encoding, errors, newline, line_buffering) + text.mode = mode + return text + + +class DocDescriptor: + """Helper for builtins.open.__doc__ + """ + def __get__(self, obj, typ): + return ( + "open(file, mode='r', buffering=None, encoding=None, " + "errors=None, newline=None, closefd=True)\n\n" + + open.__doc__) + +class OpenWrapper: + """Wrapper for builtins.open + + Trick so that open won't become a bound method when stored + as a class variable (as dbm.dumb does). + + See initstdio() in Python/pythonrun.c. + """ + __doc__ = DocDescriptor() + + def __new__(cls, *args, **kwargs): + return open(*args, **kwargs) + + +class UnsupportedOperation(ValueError, IOError): + pass + + +class IOBase(metaclass=abc.ABCMeta): + + """The abstract base class for all I/O classes, acting on streams of + bytes. There is no public constructor. + + This class provides dummy implementations for many methods that + derived classes can override selectively; the default implementations + represent a file that cannot be read, written or seeked. + + Even though IOBase does not declare read, readinto, or write because + their signatures will vary, implementations and clients should + consider those methods part of the interface. Also, implementations + may raise a IOError when operations they do not support are called. + + The basic type used for binary data read from or written to a file is + bytes. bytearrays are accepted too, and in some cases (such as + readinto) needed. Text I/O classes work with str data. + + Note that calling any method (even inquiries) on a closed stream is + undefined. Implementations may raise IOError in this case. + + IOBase (and its subclasses) support the iterator protocol, meaning + that an IOBase object can be iterated over yielding the lines in a + stream. + + IOBase also supports the :keyword:`with` statement. In this example, + fp is closed after the suite of the with statment is complete: + + with open('spam.txt', 'r') as fp: + fp.write('Spam and eggs!') + """ + + ### Internal ### + + def _unsupported(self, name: str) -> IOError: + """Internal: raise an exception for unsupported operations.""" + raise UnsupportedOperation("%s.%s() not supported" % + (self.__class__.__name__, name)) + + ### Positioning ### + + def seek(self, pos: int, whence: int = 0) -> int: + """Change stream position. + + Change the stream position to byte offset offset. offset is + interpreted relative to the position indicated by whence. Values + for whence are: + + * 0 -- start of stream (the default); offset should be zero or positive + * 1 -- current stream position; offset may be negative + * 2 -- end of stream; offset is usually negative + + Return the new absolute position. + """ + self._unsupported("seek") + + def tell(self) -> int: + """Return current stream position.""" + return self.seek(0, 1) + + def truncate(self, pos: int = None) -> int: + """Truncate file to size bytes. + + Size defaults to the current IO position as reported by tell(). Return + the new size. + """ + self._unsupported("truncate") + + ### Flush and close ### + + def flush(self) -> None: + """Flush write buffers, if applicable. + + This is not implemented for read-only and non-blocking streams. + """ + # XXX Should this return the number of bytes written??? + + __closed = False + + def close(self) -> None: + """Flush and close the IO object. + + This method has no effect if the file is already closed. + """ + if not self.__closed: + try: + self.flush() + except IOError: + pass # If flush() fails, just give up + self.__closed = True + + def __del__(self) -> None: + """Destructor. Calls close().""" + # The try/except block is in case this is called at program + # exit time, when it's possible that globals have already been + # deleted, and then the close() call might fail. Since + # there's nothing we can do about such failures and they annoy + # the end users, we suppress the traceback. + try: + self.close() + except: + pass + + ### Inquiries ### + + def seekable(self) -> bool: + """Return whether object supports random access. + + If False, seek(), tell() and truncate() will raise IOError. + This method may need to do a test seek(). + """ + return False + + def _checkSeekable(self, msg=None): + """Internal: raise an IOError if file is not seekable + """ + if not self.seekable(): + raise IOError("File or stream is not seekable." + if msg is None else msg) + + + def readable(self) -> bool: + """Return whether object was opened for reading. + + If False, read() will raise IOError. + """ + return False + + def _checkReadable(self, msg=None): + """Internal: raise an IOError if file is not readable + """ + if not self.readable(): + raise IOError("File or stream is not readable." + if msg is None else msg) + + def writable(self) -> bool: + """Return whether object was opened for writing. + + If False, write() and truncate() will raise IOError. + """ + return False + + def _checkWritable(self, msg=None): + """Internal: raise an IOError if file is not writable + """ + if not self.writable(): + raise IOError("File or stream is not writable." + if msg is None else msg) + + @property + def closed(self): + """closed: bool. True iff the file has been closed. + + For backwards compatibility, this is a property, not a predicate. + """ + return self.__closed + + def _checkClosed(self, msg=None): + """Internal: raise an ValueError if file is closed + """ + if self.closed: + raise ValueError("I/O operation on closed file." + if msg is None else msg) + + ### Context manager ### + + def __enter__(self) -> "IOBase": # That's a forward reference + """Context management protocol. Returns self.""" + self._checkClosed() + return self + + def __exit__(self, *args) -> None: + """Context management protocol. Calls close()""" + self.close() + + ### Lower-level APIs ### + + # XXX Should these be present even if unimplemented? + + def fileno(self) -> int: + """Returns underlying file descriptor if one exists. + + An IOError is raised if the IO object does not use a file descriptor. + """ + self._unsupported("fileno") + + def isatty(self) -> bool: + """Return whether this is an 'interactive' stream. + + Return False if it can't be determined. + """ + self._checkClosed() + return False + + ### Readline[s] and writelines ### + + def readline(self, limit: int = -1) -> bytes: + r"""Read and return a line from the stream. + + If limit is specified, at most limit bytes will be read. + + The line terminator is always b'\n' for binary files; for text + files, the newlines argument to open can be used to select the line + terminator(s) recognized. + """ + # For backwards compatibility, a (slowish) readline(). + if hasattr(self, "peek"): + def nreadahead(): + readahead = self.peek(1) + if not readahead: + return 1 + n = (readahead.find(b"\n") + 1) or len(readahead) + if limit >= 0: + n = min(n, limit) + return n + else: + def nreadahead(): + return 1 + if limit is None: + limit = -1 + res = bytearray() + while limit < 0 or len(res) < limit: + b = self.read(nreadahead()) + if not b: + break + res += b + if res.endswith(b"\n"): + break + return bytes(res) + + def __iter__(self): + self._checkClosed() + return self + + def __next__(self): + line = self.readline() + if not line: + raise StopIteration + return line + + def readlines(self, hint=None): + """Return a list of lines from the stream. + + hint can be specified to control the number of lines read: no more + lines will be read if the total size (in bytes/characters) of all + lines so far exceeds hint. + """ + if hint is None or hint <= 0: + return list(self) + n = 0 + lines = [] + for line in self: + lines.append(line) + n += len(line) + if n >= hint: + break + return lines + + def writelines(self, lines): + self._checkClosed() + for line in lines: + self.write(line) + + +class RawIOBase(IOBase): + + """Base class for raw binary I/O.""" + + # The read() method is implemented by calling readinto(); derived + # classes that want to support read() only need to implement + # readinto() as a primitive operation. In general, readinto() can be + # more efficient than read(). + + # (It would be tempting to also provide an implementation of + # readinto() in terms of read(), in case the latter is a more suitable + # primitive operation, but that would lead to nasty recursion in case + # a subclass doesn't implement either.) + + def read(self, n: int = -1) -> bytes: + """Read and return up to n bytes. + + Returns an empty bytes object on EOF, or None if the object is + set not to block and has no data to read. + """ + if n is None: + n = -1 + if n < 0: + return self.readall() + b = bytearray(n.__index__()) + n = self.readinto(b) + del b[n:] + return bytes(b) + + def readall(self): + """Read until EOF, using multiple read() call.""" + res = bytearray() + while True: + data = self.read(DEFAULT_BUFFER_SIZE) + if not data: + break + res += data + return bytes(res) + + def readinto(self, b: bytearray) -> int: + """Read up to len(b) bytes into b. + + Returns number of bytes read (0 for EOF), or None if the object + is set not to block as has no data to read. + """ + self._unsupported("readinto") + + def write(self, b: bytes) -> int: + """Write the given buffer to the IO stream. + + Returns the number of bytes written, which may be less than len(b). + """ + self._unsupported("write") + + +from _io import FileIO + + +class BufferedIOBase(IOBase): + + """Base class for buffered IO objects. + + The main difference with RawIOBase is that the read() method + supports omitting the size argument, and does not have a default + implementation that defers to readinto(). + + In addition, read(), readinto() and write() may raise + BlockingIOError if the underlying raw stream is in non-blocking + mode and not ready; unlike their raw counterparts, they will never + return None. + + A typical implementation should not inherit from a RawIOBase + implementation, but wrap one. + """ + + def read(self, n: int = None) -> bytes: + """Read and return up to n bytes. + + If the argument is omitted, None, or negative, reads and + returns all data until EOF. + + If the argument is positive, and the underlying raw stream is + not 'interactive', multiple raw reads may be issued to satisfy + the byte count (unless EOF is reached first). But for + interactive raw streams (XXX and for pipes?), at most one raw + read will be issued, and a short result does not imply that + EOF is imminent. + + Returns an empty bytes array on EOF. + + Raises BlockingIOError if the underlying raw stream has no + data at the moment. + """ + self._unsupported("read") + + def readinto(self, b: bytearray) -> int: + """Read up to len(b) bytes into b. + + Like read(), this may issue multiple reads to the underlying raw + stream, unless the latter is 'interactive'. + + Returns the number of bytes read (0 for EOF). + + Raises BlockingIOError if the underlying raw stream has no + data at the moment. + """ + # XXX This ought to work with anything that supports the buffer API + data = self.read(len(b)) + n = len(data) + try: + b[:n] = data + except TypeError as err: + import array + if not isinstance(b, array.array): + raise err + b[:n] = array.array('b', data) + return n + + def write(self, b: bytes) -> int: + """Write the given buffer to the IO stream. + + Return the number of bytes written, which is never less than + len(b). + + Raises BlockingIOError if the buffer is full and the + underlying raw stream cannot accept more data at the moment. + """ + self._unsupported("write") + + +class _BufferedIOMixin(BufferedIOBase): + + """A mixin implementation of BufferedIOBase with an underlying raw stream. + + This passes most requests on to the underlying raw stream. It + does *not* provide implementations of read(), readinto() or + write(). + """ + + def __init__(self, raw): + self.raw = raw + + ### Positioning ### + + def seek(self, pos, whence=0): + return self.raw.seek(pos, whence) + + def tell(self): + return self.raw.tell() + + def truncate(self, pos=None): + # Flush the stream. We're mixing buffered I/O with lower-level I/O, + # and a flush may be necessary to synch both views of the current + # file state. + self.flush() + + if pos is None: + pos = self.tell() + # XXX: Should seek() be used, instead of passing the position + # XXX directly to truncate? + return self.raw.truncate(pos) + + ### Flush and close ### + + def flush(self): + self.raw.flush() + + def close(self): + if not self.closed: + try: + self.flush() + except IOError: + pass # If flush() fails, just give up + self.raw.close() + + ### Inquiries ### + + def seekable(self): + return self.raw.seekable() + + def readable(self): + return self.raw.readable() + + def writable(self): + return self.raw.writable() + + @property + def closed(self): + return self.raw.closed + + @property + def name(self): + return self.raw.name + + @property + def mode(self): + return self.raw.mode + + ### Lower-level APIs ### + + def fileno(self): + return self.raw.fileno() + + def isatty(self): + return self.raw.isatty() + + +class BytesIO(BufferedIOBase): + + """Buffered I/O implementation using an in-memory bytes buffer.""" + + def __init__(self, initial_bytes=None): + buf = bytearray() + if initial_bytes is not None: + buf += initial_bytes + self._buffer = buf + self._pos = 0 + + def getvalue(self): + """Return the bytes value (contents) of the buffer + """ + if self.closed: + raise ValueError("getvalue on closed file") + return bytes(self._buffer) + + def read(self, n=None): + if self.closed: + raise ValueError("read from closed file") + if n is None: + n = -1 + if n < 0: + n = len(self._buffer) + if len(self._buffer) <= self._pos: + return b"" + newpos = min(len(self._buffer), self._pos + n) + b = self._buffer[self._pos : newpos] + self._pos = newpos + return bytes(b) + + def read1(self, n): + """This is the same as read. + """ + return self.read(n) + + def write(self, b): + if self.closed: + raise ValueError("write to closed file") + if isinstance(b, str): + raise TypeError("can't write str to binary stream") + n = len(b) + if n == 0: + return 0 + pos = self._pos + if pos > len(self._buffer): + # Inserts null bytes between the current end of the file + # and the new write position. + padding = b'\x00' * (pos - len(self._buffer)) + self._buffer += padding + self._buffer[pos:pos + n] = b + self._pos += n + return n + + def seek(self, pos, whence=0): + if self.closed: + raise ValueError("seek on closed file") + try: + pos = pos.__index__() + except AttributeError as err: + raise TypeError("an integer is required") from err + if whence == 0: + if pos < 0: + raise ValueError("negative seek position %r" % (pos,)) + self._pos = pos + elif whence == 1: + self._pos = max(0, self._pos + pos) + elif whence == 2: + self._pos = max(0, len(self._buffer) + pos) + else: + raise ValueError("invalid whence value") + return self._pos + + def tell(self): + if self.closed: + raise ValueError("tell on closed file") + return self._pos + + def truncate(self, pos=None): + if self.closed: + raise ValueError("truncate on closed file") + if pos is None: + pos = self._pos + elif pos < 0: + raise ValueError("negative truncate position %r" % (pos,)) + del self._buffer[pos:] + return self.seek(pos) + + def readable(self): + return True + + def writable(self): + return True + + def seekable(self): + return True + + +class BufferedReader(_BufferedIOMixin): + + """BufferedReader(raw[, buffer_size]) + + A buffer for a readable, sequential BaseRawIO object. + + The constructor creates a BufferedReader for the given readable raw + stream and buffer_size. If buffer_size is omitted, DEFAULT_BUFFER_SIZE + is used. + """ + + def __init__(self, raw, buffer_size=DEFAULT_BUFFER_SIZE): + """Create a new buffered reader using the given readable raw IO object. + """ + raw._checkReadable() + _BufferedIOMixin.__init__(self, raw) + self.buffer_size = buffer_size + self._reset_read_buf() + self._read_lock = Lock() + + def _reset_read_buf(self): + self._read_buf = b"" + self._read_pos = 0 + + def read(self, n=None): + """Read n bytes. + + Returns exactly n bytes of data unless the underlying raw IO + stream reaches EOF or if the call would block in non-blocking + mode. If n is negative, read until EOF or until read() would + block. + """ + with self._read_lock: + return self._read_unlocked(n) + + def _read_unlocked(self, n=None): + nodata_val = b"" + empty_values = (b"", None) + buf = self._read_buf + pos = self._read_pos + + # Special case for when the number of bytes to read is unspecified. + if n is None or n == -1: + self._reset_read_buf() + chunks = [buf[pos:]] # Strip the consumed bytes. + current_size = 0 + while True: + # Read until EOF or until read() would block. + chunk = self.raw.read() + if chunk in empty_values: + nodata_val = chunk + break + current_size += len(chunk) + chunks.append(chunk) + return b"".join(chunks) or nodata_val + + # The number of bytes to read is specified, return at most n bytes. + avail = len(buf) - pos # Length of the available buffered data. + if n <= avail: + # Fast path: the data to read is fully buffered. + self._read_pos += n + return buf[pos:pos+n] + # Slow path: read from the stream until enough bytes are read, + # or until an EOF occurs or until read() would block. + chunks = [buf[pos:]] + wanted = max(self.buffer_size, n) + while avail < n: + chunk = self.raw.read(wanted) + if chunk in empty_values: + nodata_val = chunk + break + avail += len(chunk) + chunks.append(chunk) + # n is more then avail only when an EOF occurred or when + # read() would have blocked. + n = min(n, avail) + out = b"".join(chunks) + self._read_buf = out[n:] # Save the extra data in the buffer. + self._read_pos = 0 + return out[:n] if out else nodata_val + + def peek(self, n=0): + """Returns buffered bytes without advancing the position. + + The argument indicates a desired minimal number of bytes; we + do at most one raw read to satisfy it. We never return more + than self.buffer_size. + """ + with self._read_lock: + return self._peek_unlocked(n) + + def _peek_unlocked(self, n=0): + want = min(n, self.buffer_size) + have = len(self._read_buf) - self._read_pos + if have < want: + to_read = self.buffer_size - have + current = self.raw.read(to_read) + if current: + self._read_buf = self._read_buf[self._read_pos:] + current + self._read_pos = 0 + return self._read_buf[self._read_pos:] + + def read1(self, n): + """Reads up to n bytes, with at most one read() system call.""" + # Returns up to n bytes. If at least one byte is buffered, we + # only return buffered bytes. Otherwise, we do one raw read. + if n <= 0: + return b"" + with self._read_lock: + self._peek_unlocked(1) + return self._read_unlocked( + min(n, len(self._read_buf) - self._read_pos)) + + def tell(self): + return self.raw.tell() - len(self._read_buf) + self._read_pos + + def seek(self, pos, whence=0): + with self._read_lock: + if whence == 1: + pos -= len(self._read_buf) - self._read_pos + pos = self.raw.seek(pos, whence) + self._reset_read_buf() + return pos + +class BufferedWriter(_BufferedIOMixin): + + """A buffer for a writeable sequential RawIO object. + + The constructor creates a BufferedWriter for the given writeable raw + stream. If the buffer_size is not given, it defaults to + DEAFULT_BUFFER_SIZE. If max_buffer_size is omitted, it defaults to + twice the buffer size. + """ + + def __init__(self, raw, + buffer_size=DEFAULT_BUFFER_SIZE, max_buffer_size=None): + raw._checkWritable() + _BufferedIOMixin.__init__(self, raw) + self.buffer_size = buffer_size + self.max_buffer_size = (2*buffer_size + if max_buffer_size is None + else max_buffer_size) + self._write_buf = bytearray() + self._write_lock = Lock() + + def write(self, b): + if self.closed: + raise ValueError("write to closed file") + if isinstance(b, str): + raise TypeError("can't write str to binary stream") + with self._write_lock: + # XXX we can implement some more tricks to try and avoid + # partial writes + if len(self._write_buf) > self.buffer_size: + # We're full, so let's pre-flush the buffer + try: + self._flush_unlocked() + except BlockingIOError as e: + # We can't accept anything else. + # XXX Why not just let the exception pass through? + raise BlockingIOError(e.errno, e.strerror, 0) + before = len(self._write_buf) + self._write_buf.extend(b) + written = len(self._write_buf) - before + if len(self._write_buf) > self.buffer_size: + try: + self._flush_unlocked() + except BlockingIOError as e: + if len(self._write_buf) > self.max_buffer_size: + # We've hit max_buffer_size. We have to accept a + # partial write and cut back our buffer. + overage = len(self._write_buf) - self.max_buffer_size + self._write_buf = self._write_buf[:self.max_buffer_size] + raise BlockingIOError(e.errno, e.strerror, overage) + return written + + def truncate(self, pos=None): + with self._write_lock: + self._flush_unlocked() + if pos is None: + pos = self.raw.tell() + return self.raw.truncate(pos) + + def flush(self): + with self._write_lock: + self._flush_unlocked() + + def _flush_unlocked(self): + if self.closed: + raise ValueError("flush of closed file") + written = 0 + try: + while self._write_buf: + n = self.raw.write(self._write_buf) + del self._write_buf[:n] + written += n + except BlockingIOError as e: + n = e.characters_written + del self._write_buf[:n] + written += n + raise BlockingIOError(e.errno, e.strerror, written) + + def tell(self): + return self.raw.tell() + len(self._write_buf) + + def seek(self, pos, whence=0): + with self._write_lock: + self._flush_unlocked() + return self.raw.seek(pos, whence) + + +class BufferedRWPair(BufferedIOBase): + + """A buffered reader and writer object together. + + A buffered reader object and buffered writer object put together to + form a sequential IO object that can read and write. This is typically + used with a socket or two-way pipe. + + reader and writer are RawIOBase objects that are readable and + writeable respectively. If the buffer_size is omitted it defaults to + DEFAULT_BUFFER_SIZE. The max_buffer_size (for the buffered writer) + defaults to twice the buffer size. + """ + + # XXX The usefulness of this (compared to having two separate IO + # objects) is questionable. + + def __init__(self, reader, writer, + buffer_size=DEFAULT_BUFFER_SIZE, max_buffer_size=None): + """Constructor. + + The arguments are two RawIO instances. + """ + reader._checkReadable() + writer._checkWritable() + self.reader = BufferedReader(reader, buffer_size) + self.writer = BufferedWriter(writer, buffer_size, max_buffer_size) + + def read(self, n=None): + if n is None: + n = -1 + return self.reader.read(n) + + def readinto(self, b): + return self.reader.readinto(b) + + def write(self, b): + return self.writer.write(b) + + def peek(self, n=0): + return self.reader.peek(n) + + def read1(self, n): + return self.reader.read1(n) + + def readable(self): + return self.reader.readable() + + def writable(self): + return self.writer.writable() + + def flush(self): + return self.writer.flush() + + def close(self): + self.writer.close() + self.reader.close() + + def isatty(self): + return self.reader.isatty() or self.writer.isatty() + + @property + def closed(self): + return self.writer.closed() + + +class BufferedRandom(BufferedWriter, BufferedReader): + + """A buffered interface to random access streams. + + The constructor creates a reader and writer for a seekable stream, + raw, given in the first argument. If the buffer_size is omitted it + defaults to DEFAULT_BUFFER_SIZE. The max_buffer_size (for the buffered + writer) defaults to twice the buffer size. + """ + + def __init__(self, raw, + buffer_size=DEFAULT_BUFFER_SIZE, max_buffer_size=None): + raw._checkSeekable() + BufferedReader.__init__(self, raw, buffer_size) + BufferedWriter.__init__(self, raw, buffer_size, max_buffer_size) + + def seek(self, pos, whence=0): + self.flush() + # First do the raw seek, then empty the read buffer, so that + # if the raw seek fails, we don't lose buffered data forever. + pos = self.raw.seek(pos, whence) + with self._read_lock: + self._reset_read_buf() + return pos + + def tell(self): + if self._write_buf: + return self.raw.tell() + len(self._write_buf) + else: + return BufferedReader.tell(self) + + def truncate(self, pos=None): + if pos is None: + pos = self.tell() + # Use seek to flush the read buffer. + self.seek(pos) + return BufferedWriter.truncate(self) + + def read(self, n=None): + if n is None: + n = -1 + self.flush() + return BufferedReader.read(self, n) + + def readinto(self, b): + self.flush() + return BufferedReader.readinto(self, b) + + def peek(self, n=0): + self.flush() + return BufferedReader.peek(self, n) + + def read1(self, n): + self.flush() + return BufferedReader.read1(self, n) + + def write(self, b): + if self._read_buf: + # Undo readahead + with self._read_lock: + self.raw.seek(self._read_pos - len(self._read_buf), 1) + self._reset_read_buf() + return BufferedWriter.write(self, b) + + +class TextIOBase(IOBase): + + """Base class for text I/O. + + This class provides a character and line based interface to stream + I/O. There is no readinto method because Python's character strings + are immutable. There is no public constructor. + """ + + def read(self, n: int = -1) -> str: + """Read at most n characters from stream. + + Read from underlying buffer until we have n characters or we hit EOF. + If n is negative or omitted, read until EOF. + """ + self._unsupported("read") + + def write(self, s: str) -> int: + """Write string s to stream.""" + self._unsupported("write") + + def truncate(self, pos: int = None) -> int: + """Truncate size to pos.""" + self._unsupported("truncate") + + def readline(self) -> str: + """Read until newline or EOF. + + Returns an empty string if EOF is hit immediately. + """ + self._unsupported("readline") + + @property + def encoding(self): + """Subclasses should override.""" + return None + + @property + def newlines(self): + """Line endings translated so far. + + Only line endings translated during reading are considered. + + Subclasses should override. + """ + return None + + +class IncrementalNewlineDecoder(codecs.IncrementalDecoder): + r"""Codec used when reading a file in universal newlines mode. It wraps + another incremental decoder, translating \r\n and \r into \n. It also + records the types of newlines encountered. When used with + translate=False, it ensures that the newline sequence is returned in + one piece. + """ + def __init__(self, decoder, translate, errors='strict'): + codecs.IncrementalDecoder.__init__(self, errors=errors) + self.translate = translate + self.decoder = decoder + self.seennl = 0 + self.pendingcr = False + + def decode(self, input, final=False): + # decode input (with the eventual \r from a previous pass) + output = self.decoder.decode(input, final=final) + if self.pendingcr and (output or final): + output = "\r" + output + self.pendingcr = False + + # retain last \r even when not translating data: + # then readline() is sure to get \r\n in one pass + if output.endswith("\r") and not final: + output = output[:-1] + self.pendingcr = True + + # Record which newlines are read + crlf = output.count('\r\n') + cr = output.count('\r') - crlf + lf = output.count('\n') - crlf + self.seennl |= (lf and self._LF) | (cr and self._CR) \ + | (crlf and self._CRLF) + + if self.translate: + if crlf: + output = output.replace("\r\n", "\n") + if cr: + output = output.replace("\r", "\n") + + return output + + def getstate(self): + buf, flag = self.decoder.getstate() + flag <<= 1 + if self.pendingcr: + flag |= 1 + return buf, flag + + def setstate(self, state): + buf, flag = state + self.pendingcr = bool(flag & 1) + self.decoder.setstate((buf, flag >> 1)) + + def reset(self): + self.seennl = 0 + self.pendingcr = False + self.decoder.reset() + + _LF = 1 + _CR = 2 + _CRLF = 4 + + @property + def newlines(self): + return (None, + "\n", + "\r", + ("\r", "\n"), + "\r\n", + ("\n", "\r\n"), + ("\r", "\r\n"), + ("\r", "\n", "\r\n") + )[self.seennl] + + +class TextIOWrapper(TextIOBase): + + r"""Character and line based layer over a BufferedIOBase object, buffer. + + encoding gives the name of the encoding that the stream will be + decoded or encoded with. It defaults to locale.getpreferredencoding. + + errors determines the strictness of encoding and decoding (see the + codecs.register) and defaults to "strict". + + newline can be None, '', '\n', '\r', or '\r\n'. It controls the + handling of line endings. If it is None, universal newlines is + enabled. With this enabled, on input, the lines endings '\n', '\r', + or '\r\n' are translated to '\n' before being returned to the + caller. Conversely, on output, '\n' is translated to the system + default line seperator, os.linesep. If newline is any other of its + legal values, that newline becomes the newline when the file is read + and it is returned untranslated. On output, '\n' is converted to the + newline. + + If line_buffering is True, a call to flush is implied when a call to + write contains a newline character. + """ + + _CHUNK_SIZE = 128 + + def __init__(self, buffer, encoding=None, errors=None, newline=None, + line_buffering=False): + if newline not in (None, "", "\n", "\r", "\r\n"): + raise ValueError("illegal newline value: %r" % (newline,)) + if encoding is None: + try: + encoding = os.device_encoding(buffer.fileno()) + except (AttributeError, UnsupportedOperation): + pass + if encoding is None: + try: + import locale + except ImportError: + # Importing locale may fail if Python is being built + encoding = "ascii" + else: + encoding = locale.getpreferredencoding() + + if not isinstance(encoding, str): + raise ValueError("invalid encoding: %r" % encoding) + + if errors is None: + errors = "strict" + else: + if not isinstance(errors, str): + raise ValueError("invalid errors: %r" % errors) + + self.buffer = buffer + self._line_buffering = line_buffering + self._encoding = encoding + self._errors = errors + self._readuniversal = not newline + self._readtranslate = newline is None + self._readnl = newline + self._writetranslate = newline != '' + self._writenl = newline or os.linesep + self._encoder = None + self._decoder = None + self._decoded_chars = '' # buffer for text returned from decoder + self._decoded_chars_used = 0 # offset into _decoded_chars for read() + self._snapshot = None # info for reconstructing decoder state + self._seekable = self._telling = self.buffer.seekable() + + # 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 + # snapshot point. We use this to reconstruct decoder states in tell(). + + # Naming convention: + # - "bytes_..." for integer variables that count input bytes + # - "chars_..." for integer variables that count decoded characters + + @property + def encoding(self): + return self._encoding + + @property + def errors(self): + return self._errors + + @property + def line_buffering(self): + return self._line_buffering + + def seekable(self): + return self._seekable + + def readable(self): + return self.buffer.readable() + + def writable(self): + return self.buffer.writable() + + def flush(self): + self.buffer.flush() + self._telling = self._seekable + + def close(self): + try: + self.flush() + except: + pass # If flush() fails, just give up + self.buffer.close() + + @property + def closed(self): + return self.buffer.closed + + @property + def name(self): + return self.buffer.name + + def fileno(self): + return self.buffer.fileno() + + def isatty(self): + return self.buffer.isatty() + + def write(self, s: str): + if self.closed: + raise ValueError("write to closed file") + if not isinstance(s, str): + raise TypeError("can't write %s to text stream" % + s.__class__.__name__) + length = len(s) + haslf = (self._writetranslate or self._line_buffering) and "\n" in s + if haslf and self._writetranslate and self._writenl != "\n": + s = s.replace("\n", self._writenl) + encoder = self._encoder or self._get_encoder() + # XXX What if we were just reading? + b = encoder.encode(s) + self.buffer.write(b) + if self._line_buffering and (haslf or "\r" in s): + self.flush() + self._snapshot = None + if self._decoder: + self._decoder.reset() + return length + + def _get_encoder(self): + make_encoder = codecs.getincrementalencoder(self._encoding) + self._encoder = make_encoder(self._errors) + return self._encoder + + def _get_decoder(self): + make_decoder = codecs.getincrementaldecoder(self._encoding) + decoder = make_decoder(self._errors) + if self._readuniversal: + decoder = IncrementalNewlineDecoder(decoder, self._readtranslate) + self._decoder = decoder + return decoder + + # The following three methods implement an ADT for _decoded_chars. + # Text returned from the decoder is buffered here until the client + # requests it by calling our read() or readline() method. + def _set_decoded_chars(self, chars): + """Set the _decoded_chars buffer.""" + self._decoded_chars = chars + self._decoded_chars_used = 0 + + def _get_decoded_chars(self, n=None): + """Advance into the _decoded_chars buffer.""" + offset = self._decoded_chars_used + if n is None: + chars = self._decoded_chars[offset:] + else: + chars = self._decoded_chars[offset:offset + n] + self._decoded_chars_used += len(chars) + return chars + + def _rewind_decoded_chars(self, n): + """Rewind the _decoded_chars buffer.""" + if self._decoded_chars_used < n: + raise AssertionError("rewind decoded_chars out of bounds") + self._decoded_chars_used -= n + + def _read_chunk(self): + """ + Read and decode the next chunk of data from the BufferedReader. + """ + + # The return value is True unless EOF was reached. The decoded + # string is placed in self._decoded_chars (replacing its previous + # value). The entire input chunk is sent to the decoder, though + # some of it may remain buffered in the decoder, yet to be + # converted. + + if self._decoder is None: + raise ValueError("no decoder") + + if self._telling: + # To prepare for tell(), we need to snapshot a point in the + # file where the decoder's input buffer is empty. + + dec_buffer, dec_flags = self._decoder.getstate() + # Given this, we know there was a valid snapshot point + # len(dec_buffer) bytes ago with decoder state (b'', dec_flags). + + # Read a chunk, decode it, and put the result in self._decoded_chars. + input_chunk = self.buffer.read1(self._CHUNK_SIZE) + eof = not input_chunk + self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) + + if self._telling: + # At the snapshot point, len(dec_buffer) bytes before the read, + # the next input to be decoded is dec_buffer + input_chunk. + self._snapshot = (dec_flags, dec_buffer + input_chunk) + + return not eof + + def _pack_cookie(self, position, dec_flags=0, + bytes_to_feed=0, need_eof=0, chars_to_skip=0): + # The meaning of a tell() cookie is: seek to position, set the + # decoder flags to dec_flags, read bytes_to_feed bytes, feed them + # into the decoder with need_eof as the EOF flag, then skip + # chars_to_skip characters of the decoded result. For most simple + # decoders, tell() will often just give a byte offset in the file. + return (position | (dec_flags<<64) | (bytes_to_feed<<128) | + (chars_to_skip<<192) | bool(need_eof)<<256) + + def _unpack_cookie(self, bigint): + rest, position = divmod(bigint, 1<<64) + rest, dec_flags = divmod(rest, 1<<64) + rest, bytes_to_feed = divmod(rest, 1<<64) + need_eof, chars_to_skip = divmod(rest, 1<<64) + return position, dec_flags, bytes_to_feed, need_eof, chars_to_skip + + def tell(self): + if not self._seekable: + raise IOError("underlying stream is not seekable") + if not self._telling: + raise IOError("telling position disabled by next() call") + self.flush() + position = self.buffer.tell() + decoder = self._decoder + if decoder is None or self._snapshot is None: + if self._decoded_chars: + # This should never happen. + raise AssertionError("pending decoded text") + return position + + # Skip backward to the snapshot point (see _read_chunk). + dec_flags, next_input = self._snapshot + position -= len(next_input) + + # How many decoded characters have been used up since the snapshot? + chars_to_skip = self._decoded_chars_used + if chars_to_skip == 0: + # We haven't moved from the snapshot point. + return self._pack_cookie(position, dec_flags) + + # Starting from the snapshot position, we will walk the decoder + # forward until it gives us enough decoded characters. + saved_state = decoder.getstate() + try: + # Note our initial start point. + decoder.setstate((b'', dec_flags)) + start_pos = position + start_flags, bytes_fed, chars_decoded = dec_flags, 0, 0 + need_eof = 0 + + # Feed the decoder one byte at a time. As we go, note the + # nearest "safe start point" before the current location + # (a point where the decoder has nothing buffered, so seek() + # can safely start from there and advance to this location). + next_byte = bytearray(1) + for next_byte[0] in next_input: + bytes_fed += 1 + chars_decoded += len(decoder.decode(next_byte)) + dec_buffer, dec_flags = decoder.getstate() + if not dec_buffer and chars_decoded <= chars_to_skip: + # Decoder buffer is empty, so this is a safe start point. + start_pos += bytes_fed + chars_to_skip -= chars_decoded + start_flags, bytes_fed, chars_decoded = dec_flags, 0, 0 + if chars_decoded >= chars_to_skip: + break + else: + # We didn't get enough decoded data; signal EOF to get more. + chars_decoded += len(decoder.decode(b'', final=True)) + need_eof = 1 + if chars_decoded < chars_to_skip: + raise IOError("can't reconstruct logical file position") + + # The returned cookie corresponds to the last safe start point. + return self._pack_cookie( + start_pos, start_flags, bytes_fed, need_eof, chars_to_skip) + finally: + decoder.setstate(saved_state) + + def truncate(self, pos=None): + self.flush() + if pos is None: + pos = self.tell() + self.seek(pos) + return self.buffer.truncate() + + def seek(self, cookie, whence=0): + if self.closed: + raise ValueError("tell on closed file") + if not self._seekable: + raise IOError("underlying stream is not seekable") + if whence == 1: # seek relative to current position + if cookie != 0: + raise IOError("can't do nonzero cur-relative seeks") + # Seeking to the current position should attempt to + # sync the underlying buffer with the current position. + whence = 0 + cookie = self.tell() + if whence == 2: # seek relative to end of file + if cookie != 0: + raise IOError("can't do nonzero end-relative seeks") + self.flush() + position = self.buffer.seek(0, 2) + self._set_decoded_chars('') + self._snapshot = None + if self._decoder: + self._decoder.reset() + return position + if whence != 0: + raise ValueError("invalid whence (%r, should be 0, 1 or 2)" % + (whence,)) + if cookie < 0: + raise ValueError("negative seek position %r" % (cookie,)) + self.flush() + + # The strategy of seek() is to go back to the safe start point + # and replay the effect of read(chars_to_skip) from there. + start_pos, dec_flags, bytes_to_feed, need_eof, chars_to_skip = \ + self._unpack_cookie(cookie) + + # Seek back to the safe start point. + self.buffer.seek(start_pos) + self._set_decoded_chars('') + self._snapshot = None + + # Restore the decoder to its state from the safe start point. + if self._decoder or dec_flags or chars_to_skip: + self._decoder = self._decoder or self._get_decoder() + self._decoder.setstate((b'', dec_flags)) + self._snapshot = (dec_flags, b'') + + if chars_to_skip: + # Just like _read_chunk, feed the decoder and save a snapshot. + input_chunk = self.buffer.read(bytes_to_feed) + self._set_decoded_chars( + self._decoder.decode(input_chunk, need_eof)) + self._snapshot = (dec_flags, input_chunk) + + # Skip chars_to_skip of the decoded characters. + if len(self._decoded_chars) < chars_to_skip: + raise IOError("can't restore logical file position") + self._decoded_chars_used = chars_to_skip + + return cookie + + def read(self, n=None): + if n is None: + n = -1 + decoder = self._decoder or self._get_decoder() + if n < 0: + # Read everything. + result = (self._get_decoded_chars() + + decoder.decode(self.buffer.read(), final=True)) + self._set_decoded_chars('') + self._snapshot = None + return result + else: + # Keep reading chunks until we have n characters to return. + eof = False + result = self._get_decoded_chars(n) + while len(result) < n and not eof: + eof = not self._read_chunk() + result += self._get_decoded_chars(n - len(result)) + return result + + def __next__(self): + self._telling = False + line = self.readline() + if not line: + self._snapshot = None + self._telling = self._seekable + raise StopIteration + return line + + def readline(self, limit=None): + if self.closed: + raise ValueError("read from closed file") + if limit is None: + limit = -1 + + # Grab all the decoded text (we will rewind any extra bits later). + line = self._get_decoded_chars() + + start = 0 + decoder = self._decoder or self._get_decoder() + + pos = endpos = None + while True: + if self._readtranslate: + # Newlines are already translated, only search for \n + pos = line.find('\n', start) + if pos >= 0: + endpos = pos + 1 + break + else: + start = len(line) + + elif self._readuniversal: + # Universal newline search. Find any of \r, \r\n, \n + # The decoder ensures that \r\n are not split in two pieces + + # In C we'd look for these in parallel of course. + nlpos = line.find("\n", start) + crpos = line.find("\r", start) + if crpos == -1: + if nlpos == -1: + # Nothing found + start = len(line) + else: + # Found \n + endpos = nlpos + 1 + break + elif nlpos == -1: + # Found lone \r + endpos = crpos + 1 + break + elif nlpos < crpos: + # Found \n + endpos = nlpos + 1 + break + elif nlpos == crpos + 1: + # Found \r\n + endpos = crpos + 2 + break + else: + # Found \r + endpos = crpos + 1 + break + else: + # non-universal + pos = line.find(self._readnl) + if pos >= 0: + endpos = pos + len(self._readnl) + break + + if limit >= 0 and len(line) >= limit: + endpos = limit # reached length limit + break + + # No line ending seen yet - get more data + more_line = '' + while self._read_chunk(): + if self._decoded_chars: + break + if self._decoded_chars: + line += self._get_decoded_chars() + else: + # end of file + self._set_decoded_chars('') + self._snapshot = None + return line + + if limit >= 0 and endpos > limit: + endpos = limit # don't exceed limit + + # Rewind _decoded_chars to just after the line ending we found. + self._rewind_decoded_chars(len(line) - endpos) + return line[:endpos] + + @property + def newlines(self): + return self._decoder.newlines if self._decoder else None + + +class StringIO(TextIOWrapper): + """Text I/O implementation using an in-memory buffer. + + The initial_value argument sets the value of object. The newline + argument is like the one of TextIOWrapper's constructor. + """ + + # XXX This is really slow, but fully functional + + def __init__(self, initial_value="", newline="\n"): + super(StringIO, self).__init__(BytesIO(), + encoding="utf-8", + errors="strict", + newline=newline) + if initial_value: + if not isinstance(initial_value, str): + initial_value = str(initial_value) + self.write(initial_value) + self.seek(0) + + def getvalue(self): + self.flush() + return self.buffer.getvalue().decode(self._encoding, self._errors) Modified: python/branches/io-c/Lib/io.py ============================================================================== --- python/branches/io-c/Lib/io.py (original) +++ python/branches/io-c/Lib/io.py Sat Feb 21 21:05:40 2009 @@ -34,9 +34,6 @@ """ # New I/O library conforming to PEP 3116. -# This is a prototype; hopefully eventually some of this will be -# reimplemented in C. - # XXX edge cases when switching between reading/writing # XXX need to support 1 meaning line-buffered # XXX whenever an argument is None, use the default value @@ -55,1824 +52,23 @@ "BufferedReader", "BufferedWriter", "BufferedRWPair", "BufferedRandom", "TextIOBase", "TextIOWrapper"] -import os -import abc -import codecs -#import _fileio -# Import _thread instead of threading to reduce startup cost -try: - from _thread import allocate_lock as Lock -except ImportError: - from _dummy_thread import allocate_lock as Lock - - -# open() uses st_blksize whenever we can -DEFAULT_BUFFER_SIZE = 8 * 1024 # bytes - - -class unused_BlockingIOError(IOError): - - """Exception raised when I/O would block on a non-blocking I/O stream.""" - - def __init__(self, errno, strerror, characters_written=0): - IOError.__init__(self, errno, strerror) - self.characters_written = characters_written - - -def unused_open(file, mode="r", buffering=None, encoding=None, errors=None, - newline=None, closefd=True): - - r"""Open file and return a stream. Raise IOError upon failure. - - file is either a text or byte string giving the name (and the path - if the file isn't in the current working directory) of the file to - be opened or an integer file descriptor of the file to be - wrapped. (If a file descriptor is given, it is closed when the - returned I/O object is closed, unless closefd is set to False.) - - mode is an optional string that specifies the mode in which the file - is opened. It defaults to 'r' which means open for reading in text - mode. Other common values are 'w' for writing (truncating the file if - it already exists), and 'a' for appending (which on some Unix systems, - means that all writes append to the end of the file regardless of the - current seek position). In text mode, if encoding is not specified the - encoding used is platform dependent. (For reading and writing raw - bytes use binary mode and leave encoding unspecified.) The available - modes are: - - ========= =============================================================== - Character Meaning - --------- --------------------------------------------------------------- - 'r' open for reading (default) - 'w' open for writing, truncating the file first - 'a' open for writing, appending to the end of the file if it exists - 'b' binary mode - 't' text mode (default) - '+' open a disk file for updating (reading and writing) - 'U' universal newline mode (for backwards compatibility; unneeded - for new code) - ========= =============================================================== - - The default mode is 'rt' (open for reading text). For binary random - access, the mode 'w+b' opens and truncates the file to 0 bytes, while - 'r+b' opens the file without truncation. - - Python distinguishes between files opened in binary and text modes, - even when the underlying operating system doesn't. Files opened in - binary mode (appending 'b' to the mode argument) return contents as - bytes objects without any decoding. In text mode (the default, or when - 't' is appended to the mode argument), the contents of the file are - returned as strings, the bytes having been first decoded using a - platform-dependent encoding or using the specified encoding if given. - - buffering is an optional integer used to set the buffering policy. By - default full buffering is on. Pass 0 to switch buffering off (only - allowed in binary mode), 1 to set line buffering, and an integer > 1 - for full buffering. - - encoding is the name of the encoding used to decode or encode the - file. This should only be used in text mode. The default encoding is - platform dependent, but any encoding supported by Python can be - passed. See the codecs module for the list of supported encodings. - - errors is an optional string that specifies how encoding errors are to - be handled---this argument should not be used in binary mode. Pass - 'strict' to raise a ValueError exception if there is an encoding error - (the default of None has the same effect), or pass 'ignore' to ignore - errors. (Note that ignoring encoding errors can lead to data loss.) - See the documentation for codecs.register for a list of the permitted - encoding error strings. - - newline controls how universal newlines works (it only applies to text - mode). It can be None, '', '\n', '\r', and '\r\n'. It works as - follows: - - * On input, if newline is None, universal newlines mode is - enabled. Lines in the input can end in '\n', '\r', or '\r\n', and - these are translated into '\n' before being returned to the - caller. If it is '', universal newline mode is enabled, but line - endings are returned to the caller untranslated. If it has any of - the other legal values, input lines are only terminated by the given - string, and the line ending is returned to the caller untranslated. - - * On output, if newline is None, any '\n' characters written are - translated to the system default line separator, os.linesep. If - newline is '', no translation takes place. If newline is any of the - other legal values, any '\n' characters written are translated to - the given string. - If closefd is False, the underlying file descriptor will be kept open - when the file is closed. This does not work when a file name is given - and must be True in that case. - - open() returns a file object whose type depends on the mode, and - through which the standard file operations such as reading and writing - are performed. When open() is used to open a file in a text mode ('w', - 'r', 'wt', 'rt', etc.), it returns a TextIOWrapper. When used to open - a file in a binary mode, the returned class varies: in read binary - mode, it returns a BufferedReader; in write binary and append binary - modes, it returns a BufferedWriter, and in read/write mode, it returns - a BufferedRandom. - - It is also possible to use a string or bytearray as a file for both - reading and writing. For strings StringIO can be used like a file - opened in a text mode, and for bytes a BytesIO can be used like a file - opened in a binary mode. - """ - if not isinstance(file, (str, bytes, int)): - raise TypeError("invalid file: %r" % file) - if not isinstance(mode, str): - raise TypeError("invalid mode: %r" % mode) - if buffering is not None and not isinstance(buffering, int): - raise TypeError("invalid buffering: %r" % buffering) - if encoding is not None and not isinstance(encoding, str): - raise TypeError("invalid encoding: %r" % encoding) - if errors is not None and not isinstance(errors, str): - raise TypeError("invalid errors: %r" % errors) - modes = set(mode) - if modes - set("arwb+tU") or len(mode) > len(modes): - raise ValueError("invalid mode: %r" % mode) - reading = "r" in modes - writing = "w" in modes - appending = "a" in modes - updating = "+" in modes - text = "t" in modes - binary = "b" in modes - if "U" in modes: - if writing or appending: - raise ValueError("can't use U and writing mode at once") - reading = True - if text and binary: - raise ValueError("can't have text and binary mode at once") - if reading + writing + appending > 1: - raise ValueError("can't have read/write/append mode at once") - if not (reading or writing or appending): - raise ValueError("must have exactly one of read/write/append mode") - if binary and encoding is not None: - raise ValueError("binary mode doesn't take an encoding argument") - if binary and errors is not None: - raise ValueError("binary mode doesn't take an errors argument") - if binary and newline is not None: - raise ValueError("binary mode doesn't take a newline argument") - raw = FileIO(file, - (reading and "r" or "") + - (writing and "w" or "") + - (appending and "a" or "") + - (updating and "+" or ""), - closefd) - if buffering is None: - buffering = -1 - line_buffering = False - if buffering == 1 or buffering < 0 and raw.isatty(): - buffering = -1 - line_buffering = True - if buffering < 0: - buffering = DEFAULT_BUFFER_SIZE - try: - bs = os.fstat(raw.fileno()).st_blksize - except (os.error, AttributeError): - pass - else: - if bs > 1: - buffering = bs - if buffering < 0: - raise ValueError("invalid buffering size") - if buffering == 0: - if binary: - return raw - raise ValueError("can't have unbuffered text I/O") - if updating: - buffer = BufferedRandom(raw, buffering) - elif writing or appending: - buffer = BufferedWriter(raw, buffering) - elif reading: - buffer = BufferedReader(raw, buffering) - else: - raise ValueError("unknown mode: %r" % mode) - if binary: - return buffer - text = TextIOWrapper(buffer, encoding, errors, newline, line_buffering) - text.mode = mode - return text import _io + BlockingIOError = _io.BlockingIOError UnsupportedOperation = _io.UnsupportedOperation open = _io.open - -class unused_DocDescriptor: - """Helper for builtins.open.__doc__ - """ - def __get__(self, obj, typ): - return ( - "open(file, mode='r', buffering=None, encoding=None, " - "errors=None, newline=None, closefd=True)\n\n" + - open.__doc__) - -class unused_OpenWrapper: - """Wrapper for builtins.open - - Trick so that open won't become a bound method when stored - as a class variable (as dbm.dumb does). - - See initstdio() in Python/pythonrun.c. - """ - __doc__ = unused_DocDescriptor() - - def __new__(cls, *args, **kwargs): - return open(*args, **kwargs) OpenWrapper = _io.open - - -class unused_UnsupportedOperation(ValueError, IOError): - pass - - -class unused_IOBase(metaclass=abc.ABCMeta): - - """The abstract base class for all I/O classes, acting on streams of - bytes. There is no public constructor. - - This class provides dummy implementations for many methods that - derived classes can override selectively; the default implementations - represent a file that cannot be read, written or seeked. - - Even though IOBase does not declare read, readinto, or write because - their signatures will vary, implementations and clients should - consider those methods part of the interface. Also, implementations - may raise a IOError when operations they do not support are called. - - The basic type used for binary data read from or written to a file is - bytes. bytearrays are accepted too, and in some cases (such as - readinto) needed. Text I/O classes work with str data. - - Note that calling any method (even inquiries) on a closed stream is - undefined. Implementations may raise IOError in this case. - - IOBase (and its subclasses) support the iterator protocol, meaning - that an IOBase object can be iterated over yielding the lines in a - stream. - - IOBase also supports the :keyword:`with` statement. In this example, - fp is closed after the suite of the with statment is complete: - - with open('spam.txt', 'r') as fp: - fp.write('Spam and eggs!') - """ - - ### Internal ### - - def _unsupported(self, name: str) -> IOError: - """Internal: raise an exception for unsupported operations.""" - raise UnsupportedOperation("%s.%s() not supported" % - (self.__class__.__name__, name)) - - ### Positioning ### - - def seek(self, pos: int, whence: int = 0) -> int: - """Change stream position. - - Change the stream position to byte offset offset. offset is - interpreted relative to the position indicated by whence. Values - for whence are: - - * 0 -- start of stream (the default); offset should be zero or positive - * 1 -- current stream position; offset may be negative - * 2 -- end of stream; offset is usually negative - - Return the new absolute position. - """ - self._unsupported("seek") - - def tell(self) -> int: - """Return current stream position.""" - return self.seek(0, 1) - - def truncate(self, pos: int = None) -> int: - """Truncate file to size bytes. - - Size defaults to the current IO position as reported by tell(). Return - the new size. - """ - self._unsupported("truncate") - - ### Flush and close ### - - def flush(self) -> None: - """Flush write buffers, if applicable. - - This is not implemented for read-only and non-blocking streams. - """ - # XXX Should this return the number of bytes written??? - - __closed = False - - def close(self) -> None: - """Flush and close the IO object. - - This method has no effect if the file is already closed. - """ - if not self.__closed: - try: - self.flush() - except IOError: - pass # If flush() fails, just give up - self.__closed = True - - def __del__(self) -> None: - """Destructor. Calls close().""" - # The try/except block is in case this is called at program - # exit time, when it's possible that globals have already been - # deleted, and then the close() call might fail. Since - # there's nothing we can do about such failures and they annoy - # the end users, we suppress the traceback. - try: - self.close() - except: - pass - - ### Inquiries ### - - def seekable(self) -> bool: - """Return whether object supports random access. - - If False, seek(), tell() and truncate() will raise IOError. - This method may need to do a test seek(). - """ - return False - - def _checkSeekable(self, msg=None): - """Internal: raise an IOError if file is not seekable - """ - if not self.seekable(): - raise IOError("File or stream is not seekable." - if msg is None else msg) - - - def readable(self) -> bool: - """Return whether object was opened for reading. - - If False, read() will raise IOError. - """ - return False - - def _checkReadable(self, msg=None): - """Internal: raise an IOError if file is not readable - """ - if not self.readable(): - raise IOError("File or stream is not readable." - if msg is None else msg) - - def writable(self) -> bool: - """Return whether object was opened for writing. - - If False, write() and truncate() will raise IOError. - """ - return False - - def _checkWritable(self, msg=None): - """Internal: raise an IOError if file is not writable - """ - if not self.writable(): - raise IOError("File or stream is not writable." - if msg is None else msg) - - @property - def closed(self): - """closed: bool. True iff the file has been closed. - - For backwards compatibility, this is a property, not a predicate. - """ - return self.__closed - - def _checkClosed(self, msg=None): - """Internal: raise an ValueError if file is closed - """ - if self.closed: - raise ValueError("I/O operation on closed file." - if msg is None else msg) - - ### Context manager ### - - def __enter__(self) -> "IOBase": # That's a forward reference - """Context management protocol. Returns self.""" - self._checkClosed() - return self - - def __exit__(self, *args) -> None: - """Context management protocol. Calls close()""" - self.close() - - ### Lower-level APIs ### - - # XXX Should these be present even if unimplemented? - - def fileno(self) -> int: - """Returns underlying file descriptor if one exists. - - An IOError is raised if the IO object does not use a file descriptor. - """ - self._unsupported("fileno") - - def isatty(self) -> bool: - """Return whether this is an 'interactive' stream. - - Return False if it can't be determined. - """ - self._checkClosed() - return False - - ### Readline[s] and writelines ### - - def readline(self, limit: int = -1) -> bytes: - r"""Read and return a line from the stream. - - If limit is specified, at most limit bytes will be read. - - The line terminator is always b'\n' for binary files; for text - files, the newlines argument to open can be used to select the line - terminator(s) recognized. - """ - # For backwards compatibility, a (slowish) readline(). - if hasattr(self, "peek"): - def nreadahead(): - readahead = self.peek(1) - if not readahead: - return 1 - n = (readahead.find(b"\n") + 1) or len(readahead) - if limit >= 0: - n = min(n, limit) - return n - else: - def nreadahead(): - return 1 - if limit is None: - limit = -1 - res = bytearray() - while limit < 0 or len(res) < limit: - b = self.read(nreadahead()) - if not b: - break - res += b - if res.endswith(b"\n"): - break - return bytes(res) - - def __iter__(self): - self._checkClosed() - return self - - def __next__(self): - line = self.readline() - if not line: - raise StopIteration - return line - - def readlines(self, hint=None): - """Return a list of lines from the stream. - - hint can be specified to control the number of lines read: no more - lines will be read if the total size (in bytes/characters) of all - lines so far exceeds hint. - """ - if hint is None or hint <= 0: - return list(self) - n = 0 - lines = [] - for line in self: - lines.append(line) - n += len(line) - if n >= hint: - break - return lines - - def writelines(self, lines): - self._checkClosed() - for line in lines: - self.write(line) IOBase = _io.IOBase - - -class unused_RawIOBase(IOBase): - - """Base class for raw binary I/O.""" - - # The read() method is implemented by calling readinto(); derived - # classes that want to support read() only need to implement - # readinto() as a primitive operation. In general, readinto() can be - # more efficient than read(). - - # (It would be tempting to also provide an implementation of - # readinto() in terms of read(), in case the latter is a more suitable - # primitive operation, but that would lead to nasty recursion in case - # a subclass doesn't implement either.) - - def read(self, n: int = -1) -> bytes: - """Read and return up to n bytes. - - Returns an empty bytes object on EOF, or None if the object is - set not to block and has no data to read. - """ - if n is None: - n = -1 - if n < 0: - return self.readall() - b = bytearray(n.__index__()) - n = self.readinto(b) - del b[n:] - return bytes(b) - - def readall(self): - """Read until EOF, using multiple read() call.""" - res = bytearray() - while True: - data = self.read(DEFAULT_BUFFER_SIZE) - if not data: - break - res += data - return bytes(res) - - def readinto(self, b: bytearray) -> int: - """Read up to len(b) bytes into b. - - Returns number of bytes read (0 for EOF), or None if the object - is set not to block as has no data to read. - """ - self._unsupported("readinto") - - def write(self, b: bytes) -> int: - """Write the given buffer to the IO stream. - - Returns the number of bytes written, which may be less than len(b). - """ - self._unsupported("write") RawIOBase = _io.RawIOBase - - -if 0: - class unused_FileIO(_fileio._FileIO, RawIOBase): - - """Raw I/O implementation for OS files.""" - - # This multiply inherits from _FileIO and RawIOBase to make - # isinstance(io.FileIO(), io.RawIOBase) return True without requiring - # that _fileio._FileIO inherits from io.RawIOBase (which would be hard - # to do since _fileio.c is written in C). - - def __init__(self, name, mode="r", closefd=True): - _fileio._FileIO.__init__(self, name, mode, closefd) - self._name = name - - def close(self): - _fileio._FileIO.close(self) - RawIOBase.close(self) - - @property - def name(self): - return self._name - FileIO = _io.FileIO - - -class unused_BufferedIOBase(IOBase): - - """Base class for buffered IO objects. - - The main difference with RawIOBase is that the read() method - supports omitting the size argument, and does not have a default - implementation that defers to readinto(). - - In addition, read(), readinto() and write() may raise - BlockingIOError if the underlying raw stream is in non-blocking - mode and not ready; unlike their raw counterparts, they will never - return None. - - A typical implementation should not inherit from a RawIOBase - implementation, but wrap one. - """ - - def read(self, n: int = None) -> bytes: - """Read and return up to n bytes. - - If the argument is omitted, None, or negative, reads and - returns all data until EOF. - - If the argument is positive, and the underlying raw stream is - not 'interactive', multiple raw reads may be issued to satisfy - the byte count (unless EOF is reached first). But for - interactive raw streams (XXX and for pipes?), at most one raw - read will be issued, and a short result does not imply that - EOF is imminent. - - Returns an empty bytes array on EOF. - - Raises BlockingIOError if the underlying raw stream has no - data at the moment. - """ - self._unsupported("read") - - def readinto(self, b: bytearray) -> int: - """Read up to len(b) bytes into b. - - Like read(), this may issue multiple reads to the underlying raw - stream, unless the latter is 'interactive'. - - Returns the number of bytes read (0 for EOF). - - Raises BlockingIOError if the underlying raw stream has no - data at the moment. - """ - # XXX This ought to work with anything that supports the buffer API - data = self.read(len(b)) - n = len(data) - try: - b[:n] = data - except TypeError as err: - import array - if not isinstance(b, array.array): - raise err - b[:n] = array.array('b', data) - return n - - def write(self, b: bytes) -> int: - """Write the given buffer to the IO stream. - - Return the number of bytes written, which is never less than - len(b). - - Raises BlockingIOError if the buffer is full and the - underlying raw stream cannot accept more data at the moment. - """ - self._unsupported("write") BufferedIOBase = _io.BufferedIOBase - - -class unused_BufferedIOMixin(BufferedIOBase): - - """A mixin implementation of BufferedIOBase with an underlying raw stream. - - This passes most requests on to the underlying raw stream. It - does *not* provide implementations of read(), readinto() or - write(). - """ - - def __init__(self, raw): - self.raw = raw - - ### Positioning ### - - def seek(self, pos, whence=0): - return self.raw.seek(pos, whence) - - def tell(self): - return self.raw.tell() - - def truncate(self, pos=None): - # Flush the stream. We're mixing buffered I/O with lower-level I/O, - # and a flush may be necessary to synch both views of the current - # file state. - self.flush() - - if pos is None: - pos = self.tell() - # XXX: Should seek() be used, instead of passing the position - # XXX directly to truncate? - return self.raw.truncate(pos) - - ### Flush and close ### - - def flush(self): - self.raw.flush() - - def close(self): - if not self.closed: - try: - self.flush() - except IOError: - pass # If flush() fails, just give up - self.raw.close() - - ### Inquiries ### - - def seekable(self): - return self.raw.seekable() - - def readable(self): - return self.raw.readable() - - def writable(self): - return self.raw.writable() - - @property - def closed(self): - return self.raw.closed - - @property - def name(self): - return self.raw.name - - @property - def mode(self): - return self.raw.mode - - ### Lower-level APIs ### - - def fileno(self): - return self.raw.fileno() - - def isatty(self): - return self.raw.isatty() - - -class unused_BytesIO(BufferedIOBase): - - """Buffered I/O implementation using an in-memory bytes buffer.""" - - def __init__(self, initial_bytes=None): - buf = bytearray() - if initial_bytes is not None: - buf += initial_bytes - self._buffer = buf - self._pos = 0 - - def getvalue(self): - """Return the bytes value (contents) of the buffer - """ - if self.closed: - raise ValueError("getvalue on closed file") - return bytes(self._buffer) - - def read(self, n=None): - if self.closed: - raise ValueError("read from closed file") - if n is None: - n = -1 - if n < 0: - n = len(self._buffer) - if len(self._buffer) <= self._pos: - return b"" - newpos = min(len(self._buffer), self._pos + n) - b = self._buffer[self._pos : newpos] - self._pos = newpos - return bytes(b) - - def read1(self, n): - """This is the same as read. - """ - return self.read(n) - - def write(self, b): - if self.closed: - raise ValueError("write to closed file") - if isinstance(b, str): - raise TypeError("can't write str to binary stream") - n = len(b) - if n == 0: - return 0 - pos = self._pos - if pos > len(self._buffer): - # Inserts null bytes between the current end of the file - # and the new write position. - padding = b'\x00' * (pos - len(self._buffer)) - self._buffer += padding - self._buffer[pos:pos + n] = b - self._pos += n - return n - - def seek(self, pos, whence=0): - if self.closed: - raise ValueError("seek on closed file") - try: - pos = pos.__index__() - except AttributeError as err: - raise TypeError("an integer is required") from err - if whence == 0: - if pos < 0: - raise ValueError("negative seek position %r" % (pos,)) - self._pos = pos - elif whence == 1: - self._pos = max(0, self._pos + pos) - elif whence == 2: - self._pos = max(0, len(self._buffer) + pos) - else: - raise ValueError("invalid whence value") - return self._pos - - def tell(self): - if self.closed: - raise ValueError("tell on closed file") - return self._pos - - def truncate(self, pos=None): - if self.closed: - raise ValueError("truncate on closed file") - if pos is None: - pos = self._pos - elif pos < 0: - raise ValueError("negative truncate position %r" % (pos,)) - del self._buffer[pos:] - return self.seek(pos) - - def readable(self): - return True - - def writable(self): - return True - - def seekable(self): - return True - -# Use the faster implementation of BytesIO if available -if 0: - try: - import _bytesio - - class BytesIO(_bytesio._BytesIO, BufferedIOBase): - __doc__ = _bytesio._BytesIO.__doc__ - - except ImportError: - BytesIO = _BytesIO BytesIO = _io.BytesIO - - -class unused_BufferedReader(unused_BufferedIOMixin): - - """BufferedReader(raw[, buffer_size]) - - A buffer for a readable, sequential BaseRawIO object. - - The constructor creates a BufferedReader for the given readable raw - stream and buffer_size. If buffer_size is omitted, DEFAULT_BUFFER_SIZE - is used. - """ - - def __init__(self, raw, buffer_size=DEFAULT_BUFFER_SIZE): - """Create a new buffered reader using the given readable raw IO object. - """ - raw._checkReadable() - _BufferedIOMixin.__init__(self, raw) - self.buffer_size = buffer_size - self._reset_read_buf() - self._read_lock = Lock() - - def _reset_read_buf(self): - self._read_buf = b"" - self._read_pos = 0 - - def read(self, n=None): - """Read n bytes. - - Returns exactly n bytes of data unless the underlying raw IO - stream reaches EOF or if the call would block in non-blocking - mode. If n is negative, read until EOF or until read() would - block. - """ - with self._read_lock: - return self._read_unlocked(n) - - def _read_unlocked(self, n=None): - nodata_val = b"" - empty_values = (b"", None) - buf = self._read_buf - pos = self._read_pos - - # Special case for when the number of bytes to read is unspecified. - if n is None or n == -1: - self._reset_read_buf() - chunks = [buf[pos:]] # Strip the consumed bytes. - current_size = 0 - while True: - # Read until EOF or until read() would block. - chunk = self.raw.read() - if chunk in empty_values: - nodata_val = chunk - break - current_size += len(chunk) - chunks.append(chunk) - return b"".join(chunks) or nodata_val - - # The number of bytes to read is specified, return at most n bytes. - avail = len(buf) - pos # Length of the available buffered data. - if n <= avail: - # Fast path: the data to read is fully buffered. - self._read_pos += n - return buf[pos:pos+n] - # Slow path: read from the stream until enough bytes are read, - # or until an EOF occurs or until read() would block. - chunks = [buf[pos:]] - wanted = max(self.buffer_size, n) - while avail < n: - chunk = self.raw.read(wanted) - if chunk in empty_values: - nodata_val = chunk - break - avail += len(chunk) - chunks.append(chunk) - # n is more then avail only when an EOF occurred or when - # read() would have blocked. - n = min(n, avail) - out = b"".join(chunks) - self._read_buf = out[n:] # Save the extra data in the buffer. - self._read_pos = 0 - return out[:n] if out else nodata_val - - def peek(self, n=0): - """Returns buffered bytes without advancing the position. - - The argument indicates a desired minimal number of bytes; we - do at most one raw read to satisfy it. We never return more - than self.buffer_size. - """ - with self._read_lock: - return self._peek_unlocked(n) - - def _peek_unlocked(self, n=0): - want = min(n, self.buffer_size) - have = len(self._read_buf) - self._read_pos - if have < want: - to_read = self.buffer_size - have - current = self.raw.read(to_read) - if current: - self._read_buf = self._read_buf[self._read_pos:] + current - self._read_pos = 0 - return self._read_buf[self._read_pos:] - - def read1(self, n): - """Reads up to n bytes, with at most one read() system call.""" - # Returns up to n bytes. If at least one byte is buffered, we - # only return buffered bytes. Otherwise, we do one raw read. - if n <= 0: - return b"" - with self._read_lock: - self._peek_unlocked(1) - return self._read_unlocked( - min(n, len(self._read_buf) - self._read_pos)) - - def tell(self): - return self.raw.tell() - len(self._read_buf) + self._read_pos - - def seek(self, pos, whence=0): - with self._read_lock: - if whence == 1: - pos -= len(self._read_buf) - self._read_pos - pos = self.raw.seek(pos, whence) - self._reset_read_buf() - return pos +StringIO = _io.StringIO BufferedReader = _io.BufferedReader - - -class unused_BufferedWriter(unused_BufferedIOMixin): - - """A buffer for a writeable sequential RawIO object. - - The constructor creates a BufferedWriter for the given writeable raw - stream. If the buffer_size is not given, it defaults to - DEAFULT_BUFFER_SIZE. If max_buffer_size is omitted, it defaults to - twice the buffer size. - """ - - def __init__(self, raw, - buffer_size=DEFAULT_BUFFER_SIZE, max_buffer_size=None): - raw._checkWritable() - _BufferedIOMixin.__init__(self, raw) - self.buffer_size = buffer_size - self.max_buffer_size = (2*buffer_size - if max_buffer_size is None - else max_buffer_size) - self._write_buf = bytearray() - self._write_lock = Lock() - - def write(self, b): - if self.closed: - raise ValueError("write to closed file") - if isinstance(b, str): - raise TypeError("can't write str to binary stream") - with self._write_lock: - # XXX we can implement some more tricks to try and avoid - # partial writes - if len(self._write_buf) > self.buffer_size: - # We're full, so let's pre-flush the buffer - try: - self._flush_unlocked() - except BlockingIOError as e: - # We can't accept anything else. - # XXX Why not just let the exception pass through? - raise BlockingIOError(e.errno, e.strerror, 0) - before = len(self._write_buf) - self._write_buf.extend(b) - written = len(self._write_buf) - before - if len(self._write_buf) > self.buffer_size: - try: - self._flush_unlocked() - except BlockingIOError as e: - if len(self._write_buf) > self.max_buffer_size: - # We've hit max_buffer_size. We have to accept a - # partial write and cut back our buffer. - overage = len(self._write_buf) - self.max_buffer_size - self._write_buf = self._write_buf[:self.max_buffer_size] - raise BlockingIOError(e.errno, e.strerror, overage) - return written - - def truncate(self, pos=None): - with self._write_lock: - self._flush_unlocked() - if pos is None: - pos = self.raw.tell() - return self.raw.truncate(pos) - - def flush(self): - with self._write_lock: - self._flush_unlocked() - - def _flush_unlocked(self): - if self.closed: - raise ValueError("flush of closed file") - written = 0 - try: - while self._write_buf: - n = self.raw.write(self._write_buf) - del self._write_buf[:n] - written += n - except BlockingIOError as e: - n = e.characters_written - del self._write_buf[:n] - written += n - raise BlockingIOError(e.errno, e.strerror, written) - - def tell(self): - return self.raw.tell() + len(self._write_buf) - - def seek(self, pos, whence=0): - with self._write_lock: - self._flush_unlocked() - return self.raw.seek(pos, whence) BufferedWriter = _io.BufferedWriter - - -class unused_BufferedRWPair(BufferedIOBase): - - """A buffered reader and writer object together. - - A buffered reader object and buffered writer object put together to - form a sequential IO object that can read and write. This is typically - used with a socket or two-way pipe. - - reader and writer are RawIOBase objects that are readable and - writeable respectively. If the buffer_size is omitted it defaults to - DEFAULT_BUFFER_SIZE. The max_buffer_size (for the buffered writer) - defaults to twice the buffer size. - """ - - # XXX The usefulness of this (compared to having two separate IO - # objects) is questionable. - - def __init__(self, reader, writer, - buffer_size=DEFAULT_BUFFER_SIZE, max_buffer_size=None): - """Constructor. - - The arguments are two RawIO instances. - """ - reader._checkReadable() - writer._checkWritable() - self.reader = BufferedReader(reader, buffer_size) - self.writer = BufferedWriter(writer, buffer_size, max_buffer_size) - - def read(self, n=None): - if n is None: - n = -1 - return self.reader.read(n) - - def readinto(self, b): - return self.reader.readinto(b) - - def write(self, b): - return self.writer.write(b) - - def peek(self, n=0): - return self.reader.peek(n) - - def read1(self, n): - return self.reader.read1(n) - - def readable(self): - return self.reader.readable() - - def writable(self): - return self.writer.writable() - - def flush(self): - return self.writer.flush() - - def close(self): - self.writer.close() - self.reader.close() - - def isatty(self): - return self.reader.isatty() or self.writer.isatty() - - @property - def closed(self): - return self.writer.closed() BufferedRWPair = _io.BufferedRWPair - -class unused_BufferedRandom(unused_BufferedWriter, unused_BufferedReader): - - """A buffered interface to random access streams. - - The constructor creates a reader and writer for a seekable stream, - raw, given in the first argument. If the buffer_size is omitted it - defaults to DEFAULT_BUFFER_SIZE. The max_buffer_size (for the buffered - writer) defaults to twice the buffer size. - """ - - def __init__(self, raw, - buffer_size=DEFAULT_BUFFER_SIZE, max_buffer_size=None): - raw._checkSeekable() - BufferedReader.__init__(self, raw, buffer_size) - BufferedWriter.__init__(self, raw, buffer_size, max_buffer_size) - - def seek(self, pos, whence=0): - self.flush() - # First do the raw seek, then empty the read buffer, so that - # if the raw seek fails, we don't lose buffered data forever. - pos = self.raw.seek(pos, whence) - with self._read_lock: - self._reset_read_buf() - return pos - - def tell(self): - if self._write_buf: - return self.raw.tell() + len(self._write_buf) - else: - return BufferedReader.tell(self) - - def truncate(self, pos=None): - if pos is None: - pos = self.tell() - # Use seek to flush the read buffer. - self.seek(pos) - return BufferedWriter.truncate(self) - - def read(self, n=None): - if n is None: - n = -1 - self.flush() - return BufferedReader.read(self, n) - - def readinto(self, b): - self.flush() - return BufferedReader.readinto(self, b) - - def peek(self, n=0): - self.flush() - return BufferedReader.peek(self, n) - - def read1(self, n): - self.flush() - return BufferedReader.read1(self, n) - - def write(self, b): - if self._read_buf: - # Undo readahead - with self._read_lock: - self.raw.seek(self._read_pos - len(self._read_buf), 1) - self._reset_read_buf() - return BufferedWriter.write(self, b) BufferedRandom = _io.BufferedRandom - - -class unused_TextIOBase(IOBase): - - """Base class for text I/O. - - This class provides a character and line based interface to stream - I/O. There is no readinto method because Python's character strings - are immutable. There is no public constructor. - """ - - def read(self, n: int = -1) -> str: - """Read at most n characters from stream. - - Read from underlying buffer until we have n characters or we hit EOF. - If n is negative or omitted, read until EOF. - """ - self._unsupported("read") - - def write(self, s: str) -> int: - """Write string s to stream.""" - self._unsupported("write") - - def truncate(self, pos: int = None) -> int: - """Truncate size to pos.""" - self._unsupported("truncate") - - def readline(self) -> str: - """Read until newline or EOF. - - Returns an empty string if EOF is hit immediately. - """ - self._unsupported("readline") - - @property - def encoding(self): - """Subclasses should override.""" - return None - - @property - def newlines(self): - """Line endings translated so far. - - Only line endings translated during reading are considered. - - Subclasses should override. - """ - return None TextIOBase = _io.TextIOBase - - IncrementalNewlineDecoder = _io.IncrementalNewlineDecoder -class unused_IncrementalNewlineDecoder(codecs.IncrementalDecoder): - r"""Codec used when reading a file in universal newlines mode. It wraps - another incremental decoder, translating \r\n and \r into \n. It also - records the types of newlines encountered. When used with - translate=False, it ensures that the newline sequence is returned in - one piece. - """ - def __init__(self, decoder, translate, errors='strict'): - codecs.IncrementalDecoder.__init__(self, errors=errors) - self.translate = translate - self.decoder = decoder - self.seennl = 0 - self.pendingcr = False - - def decode(self, input, final=False): - # decode input (with the eventual \r from a previous pass) - output = self.decoder.decode(input, final=final) - if self.pendingcr and (output or final): - output = "\r" + output - self.pendingcr = False - - # retain last \r even when not translating data: - # then readline() is sure to get \r\n in one pass - if output.endswith("\r") and not final: - output = output[:-1] - self.pendingcr = True - - # Record which newlines are read - crlf = output.count('\r\n') - cr = output.count('\r') - crlf - lf = output.count('\n') - crlf - self.seennl |= (lf and self._LF) | (cr and self._CR) \ - | (crlf and self._CRLF) - - if self.translate: - if crlf: - output = output.replace("\r\n", "\n") - if cr: - output = output.replace("\r", "\n") - - return output - - def getstate(self): - buf, flag = self.decoder.getstate() - flag <<= 1 - if self.pendingcr: - flag |= 1 - return buf, flag - - def setstate(self, state): - buf, flag = state - self.pendingcr = bool(flag & 1) - self.decoder.setstate((buf, flag >> 1)) - - def reset(self): - self.seennl = 0 - self.pendingcr = False - self.decoder.reset() - - _LF = 1 - _CR = 2 - _CRLF = 4 - - @property - def newlines(self): - return (None, - "\n", - "\r", - ("\r", "\n"), - "\r\n", - ("\n", "\r\n"), - ("\r", "\r\n"), - ("\r", "\n", "\r\n") - )[self.seennl] - - TextIOWrapper = _io.TextIOWrapper -class unused_TextIOWrapper(TextIOBase): - - r"""Character and line based layer over a BufferedIOBase object, buffer. - - encoding gives the name of the encoding that the stream will be - decoded or encoded with. It defaults to locale.getpreferredencoding. - - errors determines the strictness of encoding and decoding (see the - codecs.register) and defaults to "strict". - - newline can be None, '', '\n', '\r', or '\r\n'. It controls the - handling of line endings. If it is None, universal newlines is - enabled. With this enabled, on input, the lines endings '\n', '\r', - or '\r\n' are translated to '\n' before being returned to the - caller. Conversely, on output, '\n' is translated to the system - default line seperator, os.linesep. If newline is any other of its - legal values, that newline becomes the newline when the file is read - and it is returned untranslated. On output, '\n' is converted to the - newline. - - If line_buffering is True, a call to flush is implied when a call to - write contains a newline character. - """ - - _CHUNK_SIZE = 128 - - def __init__(self, buffer, encoding=None, errors=None, newline=None, - line_buffering=False): - if newline not in (None, "", "\n", "\r", "\r\n"): - raise ValueError("illegal newline value: %r" % (newline,)) - if encoding is None: - try: - encoding = os.device_encoding(buffer.fileno()) - except (AttributeError, UnsupportedOperation): - pass - if encoding is None: - try: - import locale - except ImportError: - # Importing locale may fail if Python is being built - encoding = "ascii" - else: - encoding = locale.getpreferredencoding() - - if not isinstance(encoding, str): - raise ValueError("invalid encoding: %r" % encoding) - - if errors is None: - errors = "strict" - else: - if not isinstance(errors, str): - raise ValueError("invalid errors: %r" % errors) - - self.buffer = buffer - self._line_buffering = line_buffering - self._encoding = encoding - self._errors = errors - self._readuniversal = not newline - self._readtranslate = newline is None - self._readnl = newline - self._writetranslate = newline != '' - self._writenl = newline or os.linesep - self._encoder = None - self._decoder = None - self._decoded_chars = '' # buffer for text returned from decoder - self._decoded_chars_used = 0 # offset into _decoded_chars for read() - self._snapshot = None # info for reconstructing decoder state - self._seekable = self._telling = self.buffer.seekable() - - # 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 - # snapshot point. We use this to reconstruct decoder states in tell(). - - # Naming convention: - # - "bytes_..." for integer variables that count input bytes - # - "chars_..." for integer variables that count decoded characters - - @property - def encoding(self): - return self._encoding - - @property - def errors(self): - return self._errors - - @property - def line_buffering(self): - return self._line_buffering - - def seekable(self): - return self._seekable - - def readable(self): - return self.buffer.readable() - - def writable(self): - return self.buffer.writable() - - def flush(self): - self.buffer.flush() - self._telling = self._seekable - - def close(self): - try: - self.flush() - except: - pass # If flush() fails, just give up - self.buffer.close() - - @property - def closed(self): - return self.buffer.closed - - @property - def name(self): - return self.buffer.name - - def fileno(self): - return self.buffer.fileno() - - def isatty(self): - return self.buffer.isatty() - - def write(self, s: str): - if self.closed: - raise ValueError("write to closed file") - if not isinstance(s, str): - raise TypeError("can't write %s to text stream" % - s.__class__.__name__) - length = len(s) - haslf = (self._writetranslate or self._line_buffering) and "\n" in s - if haslf and self._writetranslate and self._writenl != "\n": - s = s.replace("\n", self._writenl) - encoder = self._encoder or self._get_encoder() - # XXX What if we were just reading? - b = encoder.encode(s) - self.buffer.write(b) - if self._line_buffering and (haslf or "\r" in s): - self.flush() - self._snapshot = None - if self._decoder: - self._decoder.reset() - return length - - def _get_encoder(self): - make_encoder = codecs.getincrementalencoder(self._encoding) - self._encoder = make_encoder(self._errors) - return self._encoder - - def _get_decoder(self): - make_decoder = codecs.getincrementaldecoder(self._encoding) - decoder = make_decoder(self._errors) - if self._readuniversal: - decoder = IncrementalNewlineDecoder(decoder, self._readtranslate) - self._decoder = decoder - return decoder - - # The following three methods implement an ADT for _decoded_chars. - # Text returned from the decoder is buffered here until the client - # requests it by calling our read() or readline() method. - def _set_decoded_chars(self, chars): - """Set the _decoded_chars buffer.""" - self._decoded_chars = chars - self._decoded_chars_used = 0 - - def _get_decoded_chars(self, n=None): - """Advance into the _decoded_chars buffer.""" - offset = self._decoded_chars_used - if n is None: - chars = self._decoded_chars[offset:] - else: - chars = self._decoded_chars[offset:offset + n] - self._decoded_chars_used += len(chars) - return chars - - def _rewind_decoded_chars(self, n): - """Rewind the _decoded_chars buffer.""" - if self._decoded_chars_used < n: - raise AssertionError("rewind decoded_chars out of bounds") - self._decoded_chars_used -= n - - def _read_chunk(self): - """ - Read and decode the next chunk of data from the BufferedReader. - """ - - # The return value is True unless EOF was reached. The decoded - # string is placed in self._decoded_chars (replacing its previous - # value). The entire input chunk is sent to the decoder, though - # some of it may remain buffered in the decoder, yet to be - # converted. - - if self._decoder is None: - raise ValueError("no decoder") - - if self._telling: - # To prepare for tell(), we need to snapshot a point in the - # file where the decoder's input buffer is empty. - - dec_buffer, dec_flags = self._decoder.getstate() - # Given this, we know there was a valid snapshot point - # len(dec_buffer) bytes ago with decoder state (b'', dec_flags). - - # Read a chunk, decode it, and put the result in self._decoded_chars. - input_chunk = self.buffer.read1(self._CHUNK_SIZE) - eof = not input_chunk - self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) - - if self._telling: - # At the snapshot point, len(dec_buffer) bytes before the read, - # the next input to be decoded is dec_buffer + input_chunk. - self._snapshot = (dec_flags, dec_buffer + input_chunk) - - return not eof - - def _pack_cookie(self, position, dec_flags=0, - bytes_to_feed=0, need_eof=0, chars_to_skip=0): - # The meaning of a tell() cookie is: seek to position, set the - # decoder flags to dec_flags, read bytes_to_feed bytes, feed them - # into the decoder with need_eof as the EOF flag, then skip - # chars_to_skip characters of the decoded result. For most simple - # decoders, tell() will often just give a byte offset in the file. - return (position | (dec_flags<<64) | (bytes_to_feed<<128) | - (chars_to_skip<<192) | bool(need_eof)<<256) - - def _unpack_cookie(self, bigint): - rest, position = divmod(bigint, 1<<64) - rest, dec_flags = divmod(rest, 1<<64) - rest, bytes_to_feed = divmod(rest, 1<<64) - need_eof, chars_to_skip = divmod(rest, 1<<64) - return position, dec_flags, bytes_to_feed, need_eof, chars_to_skip - - def tell(self): - if not self._seekable: - raise IOError("underlying stream is not seekable") - if not self._telling: - raise IOError("telling position disabled by next() call") - self.flush() - position = self.buffer.tell() - decoder = self._decoder - if decoder is None or self._snapshot is None: - if self._decoded_chars: - # This should never happen. - raise AssertionError("pending decoded text") - return position - - # Skip backward to the snapshot point (see _read_chunk). - dec_flags, next_input = self._snapshot - position -= len(next_input) - - # How many decoded characters have been used up since the snapshot? - chars_to_skip = self._decoded_chars_used - if chars_to_skip == 0: - # We haven't moved from the snapshot point. - return self._pack_cookie(position, dec_flags) - - # Starting from the snapshot position, we will walk the decoder - # forward until it gives us enough decoded characters. - saved_state = decoder.getstate() - try: - # Note our initial start point. - decoder.setstate((b'', dec_flags)) - start_pos = position - start_flags, bytes_fed, chars_decoded = dec_flags, 0, 0 - need_eof = 0 - - # Feed the decoder one byte at a time. As we go, note the - # nearest "safe start point" before the current location - # (a point where the decoder has nothing buffered, so seek() - # can safely start from there and advance to this location). - next_byte = bytearray(1) - for next_byte[0] in next_input: - bytes_fed += 1 - chars_decoded += len(decoder.decode(next_byte)) - dec_buffer, dec_flags = decoder.getstate() - if not dec_buffer and chars_decoded <= chars_to_skip: - # Decoder buffer is empty, so this is a safe start point. - start_pos += bytes_fed - chars_to_skip -= chars_decoded - start_flags, bytes_fed, chars_decoded = dec_flags, 0, 0 - if chars_decoded >= chars_to_skip: - break - else: - # We didn't get enough decoded data; signal EOF to get more. - chars_decoded += len(decoder.decode(b'', final=True)) - need_eof = 1 - if chars_decoded < chars_to_skip: - raise IOError("can't reconstruct logical file position") - - # The returned cookie corresponds to the last safe start point. - return self._pack_cookie( - start_pos, start_flags, bytes_fed, need_eof, chars_to_skip) - finally: - decoder.setstate(saved_state) - - def truncate(self, pos=None): - self.flush() - if pos is None: - pos = self.tell() - self.seek(pos) - return self.buffer.truncate() - - def seek(self, cookie, whence=0): - if self.closed: - raise ValueError("tell on closed file") - if not self._seekable: - raise IOError("underlying stream is not seekable") - if whence == 1: # seek relative to current position - if cookie != 0: - raise IOError("can't do nonzero cur-relative seeks") - # Seeking to the current position should attempt to - # sync the underlying buffer with the current position. - whence = 0 - cookie = self.tell() - if whence == 2: # seek relative to end of file - if cookie != 0: - raise IOError("can't do nonzero end-relative seeks") - self.flush() - position = self.buffer.seek(0, 2) - self._set_decoded_chars('') - self._snapshot = None - if self._decoder: - self._decoder.reset() - return position - if whence != 0: - raise ValueError("invalid whence (%r, should be 0, 1 or 2)" % - (whence,)) - if cookie < 0: - raise ValueError("negative seek position %r" % (cookie,)) - self.flush() - - # The strategy of seek() is to go back to the safe start point - # and replay the effect of read(chars_to_skip) from there. - start_pos, dec_flags, bytes_to_feed, need_eof, chars_to_skip = \ - self._unpack_cookie(cookie) - - # Seek back to the safe start point. - self.buffer.seek(start_pos) - self._set_decoded_chars('') - self._snapshot = None - - # Restore the decoder to its state from the safe start point. - if self._decoder or dec_flags or chars_to_skip: - self._decoder = self._decoder or self._get_decoder() - self._decoder.setstate((b'', dec_flags)) - self._snapshot = (dec_flags, b'') - - if chars_to_skip: - # Just like _read_chunk, feed the decoder and save a snapshot. - input_chunk = self.buffer.read(bytes_to_feed) - self._set_decoded_chars( - self._decoder.decode(input_chunk, need_eof)) - self._snapshot = (dec_flags, input_chunk) - - # Skip chars_to_skip of the decoded characters. - if len(self._decoded_chars) < chars_to_skip: - raise IOError("can't restore logical file position") - self._decoded_chars_used = chars_to_skip - - return cookie - - def read(self, n=None): - if n is None: - n = -1 - decoder = self._decoder or self._get_decoder() - if n < 0: - # Read everything. - result = (self._get_decoded_chars() + - decoder.decode(self.buffer.read(), final=True)) - self._set_decoded_chars('') - self._snapshot = None - return result - else: - # Keep reading chunks until we have n characters to return. - eof = False - result = self._get_decoded_chars(n) - while len(result) < n and not eof: - eof = not self._read_chunk() - result += self._get_decoded_chars(n - len(result)) - return result - - def __next__(self): - self._telling = False - line = self.readline() - if not line: - self._snapshot = None - self._telling = self._seekable - raise StopIteration - return line - - def readline(self, limit=None): - if self.closed: - raise ValueError("read from closed file") - if limit is None: - limit = -1 - - # Grab all the decoded text (we will rewind any extra bits later). - line = self._get_decoded_chars() - - start = 0 - decoder = self._decoder or self._get_decoder() - - pos = endpos = None - while True: - if self._readtranslate: - # Newlines are already translated, only search for \n - pos = line.find('\n', start) - if pos >= 0: - endpos = pos + 1 - break - else: - start = len(line) - - elif self._readuniversal: - # Universal newline search. Find any of \r, \r\n, \n - # The decoder ensures that \r\n are not split in two pieces - - # In C we'd look for these in parallel of course. - nlpos = line.find("\n", start) - crpos = line.find("\r", start) - if crpos == -1: - if nlpos == -1: - # Nothing found - start = len(line) - else: - # Found \n - endpos = nlpos + 1 - break - elif nlpos == -1: - # Found lone \r - endpos = crpos + 1 - break - elif nlpos < crpos: - # Found \n - endpos = nlpos + 1 - break - elif nlpos == crpos + 1: - # Found \r\n - endpos = crpos + 2 - break - else: - # Found \r - endpos = crpos + 1 - break - else: - # non-universal - pos = line.find(self._readnl) - if pos >= 0: - endpos = pos + len(self._readnl) - break - - if limit >= 0 and len(line) >= limit: - endpos = limit # reached length limit - break - - # No line ending seen yet - get more data - more_line = '' - while self._read_chunk(): - if self._decoded_chars: - break - if self._decoded_chars: - line += self._get_decoded_chars() - else: - # end of file - self._set_decoded_chars('') - self._snapshot = None - return line - - if limit >= 0 and endpos > limit: - endpos = limit # don't exceed limit - - # Rewind _decoded_chars to just after the line ending we found. - self._rewind_decoded_chars(len(line) - endpos) - return line[:endpos] - - @property - def newlines(self): - return self._decoder.newlines if self._decoder else None - -StringIO = _io.StringIO -class unused_StringIO(unused_TextIOWrapper): - """Text I/O implementation using an in-memory buffer. - - The initial_value argument sets the value of object. The newline - argument is like the one of TextIOWrapper's constructor. - """ - - # XXX This is really slow, but fully functional - - def __init__(self, initial_value="", newline="\n"): - super(unused_StringIO, self).__init__(BytesIO(), - encoding="utf-8", - errors="strict", - newline=newline) - if initial_value: - if not isinstance(initial_value, str): - initial_value = str(initial_value) - self.write(initial_value) - self.seek(0) - - def getvalue(self): - self.flush() - return self.buffer.getvalue().decode(self._encoding, self._errors) - - -# make test_memoryio happy! -_BytesIO = BytesIO -_StringIO = StringIO Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Sat Feb 21 21:05:40 2009 @@ -14,7 +14,8 @@ from test import support import codecs -import io # The module under test +import io # C implementation of io +import _pyio as pyio # Python implementation of io def _default_chunk_size(): @@ -23,7 +24,7 @@ return f._CHUNK_SIZE -class MockRawIO(io.RawIOBase): +class MockRawIO: def __init__(self, read_stack=()): self._read_stack = list(read_stack) @@ -82,13 +83,19 @@ def truncate(self, pos=None): return pos +class CMockRawIO(MockRawIO, io.RawIOBase): + pass + +class PyMockRawIO(MockRawIO, pyio.RawIOBase): + pass + class MisbehavedRawIO(MockRawIO): def write(self, b): - return MockRawIO.write(self, b) * 2 + return super().write(b) * 2 def read(self, n=None): - return MockRawIO.read(self, n) * 2 + return super().read(n) * 2 def seek(self, pos, whence): return -123 @@ -97,33 +104,52 @@ return -456 def readinto(self, buf): - MockRawIO.readinto(self, buf) + super().readinto(buf) return len(buf) * 5 +class CMisbehavedRawIO(MisbehavedRawIO, io.RawIOBase): + pass + +class PyMisbehavedRawIO(MisbehavedRawIO, pyio.RawIOBase): + pass + class CloseFailureIO(MockRawIO): def close(self): raise IOError +class CCloseFailureIO(CloseFailureIO, io.RawIOBase): + pass + +class PyCloseFailureIO(CloseFailureIO, pyio.RawIOBase): + pass -class MockFileIO(io.BytesIO): + +class MockFileIO: def __init__(self, data): self.read_history = [] - io.BytesIO.__init__(self, data) + super().__init__(data) def read(self, n=None): - res = io.BytesIO.read(self, n) + res = super().read(n) self.read_history.append(None if res is None else len(res)) return res def readinto(self, b): - res = io.BytesIO.readinto(self, b) + res = super().readinto(b) self.read_history.append(res) return res -class MockNonBlockWriterIO(io.RawIOBase): +class CMockFileIO(MockFileIO, io.BytesIO): + pass + +class PyMockFileIO(MockFileIO, pyio.BytesIO): + pass + + +class MockNonBlockWriterIO: def __init__(self): self._write_stack = [] @@ -158,10 +184,16 @@ else: self._blocker_char = None self._write_stack.append(b[:n]) - raise io.BlockingIOError(0, "test blocking", n) + raise self.BlockingIOError(0, "test blocking", n) self._write_stack.append(b) return len(b) +class CMockNonBlockWriterIO(MockNonBlockWriterIO, io.RawIOBase): + BlockingIOError = io.BlockingIOError + +class PyMockNonBlockWriterIO(MockNonBlockWriterIO, pyio.RawIOBase): + BlockingIOError = pyio.BlockingIOError + class IOTest(unittest.TestCase): @@ -235,13 +267,13 @@ self.assertEqual(f.read(2), b"x") def test_raw_file_io(self): - f = io.open(support.TESTFN, "wb", buffering=0) + f = self.open(support.TESTFN, "wb", buffering=0) self.assertEqual(f.readable(), False) self.assertEqual(f.writable(), True) self.assertEqual(f.seekable(), True) self.write_ops(f) f.close() - f = io.open(support.TESTFN, "rb", buffering=0) + f = self.open(support.TESTFN, "rb", buffering=0) self.assertEqual(f.readable(), True) self.assertEqual(f.writable(), False) self.assertEqual(f.seekable(), True) @@ -249,13 +281,13 @@ f.close() def test_buffered_file_io(self): - f = io.open(support.TESTFN, "wb") + f = self.open(support.TESTFN, "wb") self.assertEqual(f.readable(), False) self.assertEqual(f.writable(), True) self.assertEqual(f.seekable(), True) self.write_ops(f) f.close() - f = io.open(support.TESTFN, "rb") + f = self.open(support.TESTFN, "rb") self.assertEqual(f.readable(), True) self.assertEqual(f.writable(), False) self.assertEqual(f.seekable(), True) @@ -266,7 +298,7 @@ f = io.open(support.TESTFN, "wb") f.write(b"abc\ndef\nxyzzy\nfoo\x00bar\nanother line") f.close() - f = io.open(support.TESTFN, "rb") + f = self.open(support.TESTFN, "rb") self.assertEqual(f.readline(), b"abc\n") self.assertEqual(f.readline(10), b"def\n") self.assertEqual(f.readline(2), b"xy") @@ -276,11 +308,11 @@ f.close() def test_raw_bytes_io(self): - f = io.BytesIO() + f = self.BytesIO() self.write_ops(f) data = f.getvalue() self.assertEqual(data, b"hello world\n") - f = io.BytesIO(data) + f = self.BytesIO(data) self.read_ops(f, True) def test_large_file_ops(self): @@ -296,10 +328,10 @@ print("Use 'regrtest.py -u largefile test_io' to run it.", file=sys.stderr) return - f = io.open(support.TESTFN, "w+b", 0) + f = self.open(support.TESTFN, "w+b", 0) self.large_file_ops(f) f.close() - f = io.open(support.TESTFN, "w+b") + f = self.open(support.TESTFN, "w+b") self.large_file_ops(f) f.close() @@ -320,32 +352,32 @@ # issue 5008 def test_append_mode_tell(self): - with io.open(support.TESTFN, "wb") as f: + with self.open(support.TESTFN, "wb") as f: f.write(b"xxx") - with io.open(support.TESTFN, "ab", buffering=0) as f: + with self.open(support.TESTFN, "ab", buffering=0) as f: self.assertEqual(f.tell(), 3) - with io.open(support.TESTFN, "ab") as f: + with self.open(support.TESTFN, "ab") as f: self.assertEqual(f.tell(), 3) - with io.open(support.TESTFN, "a") as f: + with self.open(support.TESTFN, "a") as f: self.assert_(f.tell() > 0) def test_destructor(self): record = [] - class MyFileIO(io.FileIO): + class MyFileIO(self.FileIO): def __del__(self): record.append(1) try: - f = io.FileIO.__del__ + f = super().__del__ except AttributeError: pass else: - f(self) + f() def close(self): record.append(2) - io.FileIO.close(self) + super().close() def flush(self): record.append(3) - io.FileIO.flush(self) + super().flush() f = MyFileIO(support.TESTFN, "wb") f.write(b"xxx") del f @@ -353,54 +385,54 @@ def test_IOBase_destructor(self): record = [] - class MyIO(io.IOBase): + class MyIO(self.IOBase): def __init__(self): pass def __del__(self): record.append(1) try: - f = io.IOBase.__del__ + f = super().__del__ except AttributeError: pass else: - f(self) + f() def close(self): record.append(2) - io.IOBase.close(self) + super().close() def flush(self): record.append(3) - io.IOBase.flush(self) + super().flush() f = MyIO() del f self.assertEqual(record, [1, 2, 3]) def test_close_flushes(self): - f = io.open(support.TESTFN, "wb") + f = self.open(support.TESTFN, "wb") f.write(b"xxx") f.close() - f = io.open(support.TESTFN, "rb") + f = self.open(support.TESTFN, "rb") self.assertEqual(f.read(), b"xxx") f.close() def test_array_writes(self): a = array.array('i', range(10)) n = len(a.tostring()) - f = io.open(support.TESTFN, "wb", 0) + f = self.open(support.TESTFN, "wb", 0) self.assertEqual(f.write(a), n) f.close() - f = io.open(support.TESTFN, "wb") + f = self.open(support.TESTFN, "wb") self.assertEqual(f.write(a), n) f.close() def test_closefd(self): - self.assertRaises(ValueError, io.open, support.TESTFN, 'w', + self.assertRaises(ValueError, self.open, support.TESTFN, 'w', closefd=False) def testReadClosed(self): - with io.open(support.TESTFN, "w") as f: + with self.open(support.TESTFN, "w") as f: f.write("egg\n") - with io.open(support.TESTFN, "r") as f: - file = io.open(f.fileno(), "r", closefd=False) + with self.open(support.TESTFN, "r") as f: + file = self.open(f.fileno(), "r", closefd=False) self.assertEqual(file.read(), "egg\n") file.seek(0) file.close() @@ -408,20 +440,20 @@ def test_no_closefd_with_filename(self): # can't use closefd in combination with a file name - self.assertRaises(ValueError, io.open, support.TESTFN, "r", closefd=False) + self.assertRaises(ValueError, self.open, support.TESTFN, "r", closefd=False) def test_closefd_attr(self): - with io.open(support.TESTFN, "wb") as f: + with self.open(support.TESTFN, "wb") as f: f.write(b"egg\n") - with io.open(support.TESTFN, "r") as f: + with self.open(support.TESTFN, "r") as f: self.assertEqual(f.buffer.raw.closefd, True) - file = io.open(f.fileno(), "r", closefd=False) + file = self.open(f.fileno(), "r", closefd=False) self.assertEqual(file.buffer.raw.closefd, False) def test_garbage_collection(self): # FileIO objects are collected, and collecting them flushes # all data to disk. - f = io.FileIO(support.TESTFN, "wb") + f = self.FileIO(support.TESTFN, "wb") f.write(b"abcxxx") f.f = f wr = weakref.ref(f) @@ -431,71 +463,24 @@ with open(support.TESTFN, "rb") as f: self.assertEqual(f.read(), b"abcxxx") - -class MemorySeekTestMixin: - - def testInit(self): - buf = self.buftype("1234567890") - bytesIo = self.ioclass(buf) - - def testRead(self): - buf = self.buftype("1234567890") - bytesIo = self.ioclass(buf) - - self.assertEquals(buf[:1], bytesIo.read(1)) - self.assertEquals(buf[1:5], bytesIo.read(4)) - self.assertEquals(buf[5:], bytesIo.read(900)) - self.assertEquals(self.EOF, bytesIo.read()) - - def testReadNoArgs(self): - buf = self.buftype("1234567890") - bytesIo = self.ioclass(buf) - - self.assertEquals(buf, bytesIo.read()) - self.assertEquals(self.EOF, bytesIo.read()) - - def testSeek(self): - buf = self.buftype("1234567890") - bytesIo = self.ioclass(buf) - - bytesIo.read(5) - bytesIo.seek(0) - self.assertEquals(buf, bytesIo.read()) - - bytesIo.seek(3) - self.assertEquals(buf[3:], bytesIo.read()) - self.assertRaises(TypeError, bytesIo.seek, 0.0) - - def testTell(self): - buf = self.buftype("1234567890") - bytesIo = self.ioclass(buf) - - self.assertEquals(0, bytesIo.tell()) - bytesIo.seek(5) - self.assertEquals(5, bytesIo.tell()) - bytesIo.seek(10000) - self.assertEquals(10000, bytesIo.tell()) - - -class BytesIOTest(MemorySeekTestMixin, unittest.TestCase): - @staticmethod - def buftype(s): - return s.encode("utf-8") - ioclass = io.BytesIO - EOF = b"" - - -class StringIOTest(MemorySeekTestMixin, unittest.TestCase): - buftype = str - ioclass = io.StringIO - EOF = "" +class CIOTest(IOTest): + open = io.open + IOBase = io.IOBase + BytesIO = io.BytesIO + FileIO = io.FileIO + +class PyIOTest(IOTest): + open = staticmethod(pyio.open) + IOBase = pyio.IOBase + BytesIO = pyio.BytesIO + FileIO = pyio.FileIO class CommonBufferedTests: # Tests common to BufferedReader, BufferedWriter and BufferedRandom def testFileno(self): - rawio = MockRawIO() + rawio = self.MockRawIO() bufio = self.tp(rawio) self.assertEquals(42, bufio.fileno()) @@ -506,7 +491,7 @@ pass def testInvalidArgs(self): - rawio = MockRawIO() + rawio = self.MockRawIO() bufio = self.tp(rawio) # Invalid whence self.assertRaises(ValueError, bufio.seek, 0, -1) @@ -519,18 +504,18 @@ def __del__(self): record.append(1) try: - f = tp.__del__ + f = super().__del__ except AttributeError: pass else: - f(self) + f() def close(self): record.append(2) - tp.close(self) + super().close() def flush(self): record.append(3) - tp.flush(self) - rawio = MockRawIO() + super().flush() + rawio = self.MockRawIO() bufio = MyBufferedIO(rawio) writable = bufio.writable() del bufio @@ -541,7 +526,7 @@ def testContext(self): # Test usability as a context manager - rawio = MockRawIO() + rawio = self.MockRawIO() bufio = self.tp(rawio) def _with(): with bufio: @@ -561,11 +546,10 @@ class BufferedReaderTest(unittest.TestCase, CommonBufferedTests): - tp = io.BufferedReader read_mode = "rb" def testConstructor(self): - rawio = MockRawIO([b"abc"]) + rawio = self.MockRawIO([b"abc"]) bufio = self.tp(rawio) bufio.__init__(rawio) bufio.__init__(rawio, buffer_size=1024) @@ -582,19 +566,19 @@ # than 2GB RAM and a 64-bit kernel. self.assertRaises((OverflowError, MemoryError, ValueError), bufio.__init__, rawio, sys.maxsize) - rawio = MockRawIO([b"abc"]) + rawio = self.MockRawIO([b"abc"]) bufio.__init__(rawio) self.assertEquals(b"abc", bufio.read()) def testRead(self): - rawio = MockRawIO((b"abc", b"d", b"efg")) + rawio = self.MockRawIO((b"abc", b"d", b"efg")) bufio = self.tp(rawio) self.assertEquals(b"abcdef", bufio.read(6)) # Invalid args self.assertRaises(ValueError, bufio.read, -2) def testRead1(self): - rawio = MockRawIO((b"abc", b"d", b"efg")) + rawio = self.MockRawIO((b"abc", b"d", b"efg")) bufio = self.tp(rawio) self.assertEquals(b"a", bufio.read(1)) self.assertEquals(b"b", bufio.read1(1)) @@ -610,7 +594,7 @@ self.assertRaises(ValueError, bufio.read1, -1) def testReadinto(self): - rawio = MockRawIO((b"abc", b"d", b"efg")) + rawio = self.MockRawIO((b"abc", b"d", b"efg")) bufio = self.tp(rawio) b = bytearray(2) self.assertEquals(bufio.readinto(b), 2) @@ -635,7 +619,7 @@ ] for bufsize, buf_read_sizes, raw_read_sizes in tests: - rawio = MockFileIO(data) + rawio = self.MockFileIO(data) bufio = self.tp(rawio, buffer_size=bufsize) pos = 0 for nbytes in buf_read_sizes: @@ -646,7 +630,7 @@ def testReadNonBlocking(self): # Inject some None's in there to simulate EWOULDBLOCK - rawio = MockRawIO((b"abc", b"d", None, b"efg", None, None, None)) + rawio = self.MockRawIO((b"abc", b"d", None, b"efg", None, None, None)) bufio = self.tp(rawio) self.assertEquals(b"abcd", bufio.read(6)) @@ -657,13 +641,13 @@ self.assertEquals(b"", bufio.read()) def testReadToEof(self): - rawio = MockRawIO((b"abc", b"d", b"efg")) + rawio = self.MockRawIO((b"abc", b"d", b"efg")) bufio = self.tp(rawio) self.assertEquals(b"abcdefg", bufio.read(9000)) def testReadNoArgs(self): - rawio = MockRawIO((b"abc", b"d", b"efg")) + rawio = self.MockRawIO((b"abc", b"d", b"efg")) bufio = self.tp(rawio) self.assertEquals(b"abcdefg", bufio.read()) @@ -711,7 +695,7 @@ support.unlink(support.TESTFN) def testMisbehavedRawIO(self): - rawio = MisbehavedRawIO((b"abc", b"d", b"efg")) + rawio = self.MisbehavedRawIO((b"abc", b"d", b"efg")) bufio = self.tp(rawio) self.assertRaises(IOError, bufio.seek, 0) self.assertRaises(IOError, bufio.tell) @@ -719,7 +703,7 @@ def test_garbage_collection(self): # BufferedReader objects are collected - rawio = io.FileIO(support.TESTFN, "w+b") + rawio = self.FileIO(support.TESTFN, "w+b") f = self.tp(rawio) f.f = f wr = weakref.ref(f) @@ -727,13 +711,28 @@ gc.collect() self.assert_(wr() is None, wr) +class CBufferedReaderTest(BufferedReaderTest): + tp = io.BufferedReader + BlockingIOError = io.BlockingIOError + FileIO = io.FileIO + MisbehavedRawIO = CMisbehavedRawIO + MockRawIO = CMockRawIO + MockFileIO = CMockFileIO + +class PyBufferedReaderTest(BufferedReaderTest): + tp = pyio.BufferedReader + BlockingIOError = pyio.BlockingIOError + FileIO = pyio.FileIO + MisbehavedRawIO = PyMisbehavedRawIO + MockRawIO = PyMockRawIO + MockFileIO = PyMockFileIO + class BufferedWriterTest(unittest.TestCase, CommonBufferedTests): - tp = io.BufferedWriter write_mode = "wb" def testConstructor(self): - rawio = MockRawIO() + rawio = self.MockRawIO() bufio = self.tp(rawio) bufio.__init__(rawio) bufio.__init__(rawio, buffer_size=1024) @@ -758,13 +757,13 @@ def testWrite(self): # Write to the buffered IO but don't overflow the buffer. - writer = MockRawIO() + writer = self.MockRawIO() bufio = self.tp(writer, 8) bufio.write(b"abc") self.assertFalse(writer._write_stack) def testWriteOverflow(self): - writer = MockRawIO() + writer = self.MockRawIO() bufio = self.tp(writer, 8) contents = b"abcdefghijklmnop" for n in range(0, len(contents), 3): @@ -778,7 +777,7 @@ # Lots of writes, test the flushed output is as expected. contents = bytes(range(256)) * 1000 n = 0 - writer = MockRawIO() + writer = self.MockRawIO() bufio = self.tp(writer, 13) # Generator of write sizes: repeat each N 15 times then proceed to N+1 def gen_sizes(): @@ -818,7 +817,7 @@ self.check_writes(lambda bufio: bufio.truncate(bufio.tell())) def testWriteNonBlocking(self): - raw = MockNonBlockWriterIO() + raw = self.MockNonBlockWriterIO() bufio = self.tp(raw, 8, 8) self.assertEquals(bufio.write(b"abcd"), 4) @@ -831,7 +830,7 @@ raw.block_on(b"0") try: bufio.write(b"opqrwxyz0123456789") - except io.BlockingIOError as e: + except self.BlockingIOError as e: written = e.characters_written else: self.fail("BlockingIOError should have been raised") @@ -858,14 +857,14 @@ self.assertEqual(raw.getvalue(), b"XYcdef123456") def testFlush(self): - writer = MockRawIO() + writer = self.MockRawIO() bufio = self.tp(writer, 8) bufio.write(b"abc") bufio.flush() self.assertEquals(b"abc", writer._write_stack[0]) def testDestructor(self): - writer = MockRawIO() + writer = self.MockRawIO() bufio = self.tp(writer, 8) bufio.write(b"abc") del bufio @@ -931,7 +930,7 @@ support.unlink(support.TESTFN) def testMisbehavedRawIO(self): - rawio = MisbehavedRawIO() + rawio = self.MisbehavedRawIO() bufio = self.tp(rawio, 5) self.assertRaises(IOError, bufio.seek, 0) self.assertRaises(IOError, bufio.tell) @@ -940,7 +939,7 @@ def test_garbage_collection(self): # BufferedWriter objects are collected, and collecting them flushes # all data to disk. - rawio = io.FileIO(support.TESTFN, "w+b") + rawio = self.FileIO(support.TESTFN, "w+b") f = self.tp(rawio) f.write(b"123xxx") f.x = f @@ -951,20 +950,43 @@ with open(support.TESTFN, "rb") as f: self.assertEqual(f.read(), b"123xxx") +class CBufferedWriterTest(BufferedWriterTest): + tp = io.BufferedWriter + BlockingIOError = io.BlockingIOError + FileIO = io.FileIO + MockRawIO = CMockRawIO + MisbehavedRawIO = CMisbehavedRawIO + MockNonBlockWriterIO = CMockNonBlockWriterIO + +class PyBufferedWriterTest(BufferedWriterTest): + tp = pyio.BufferedWriter + BlockingIOError = pyio.BlockingIOError + FileIO = pyio.FileIO + MockRawIO = PyMockRawIO + MisbehavedRawIO = PyMisbehavedRawIO + MockNonBlockWriterIO = PyMockNonBlockWriterIO + class BufferedRWPairTest(unittest.TestCase): def testRWPair(self): - r = MockRawIO(()) - w = MockRawIO() - pair = io.BufferedRWPair(r, w) + r = self.MockRawIO(()) + w = self.MockRawIO() + pair = self.tp(r, w) self.assertFalse(pair.closed) # XXX More Tests +class CBufferedRWPairTest(BufferedRWPairTest): + tp = io.BufferedRWPair + MockRawIO = CMockRawIO + +class PyBufferedRWPairTest(BufferedRWPairTest): + tp = pyio.BufferedRWPair + MockRawIO = PyMockRawIO + class BufferedRandomTest(BufferedReaderTest, BufferedWriterTest): - tp = io.BufferedRandom read_mode = "rb+" write_mode = "wb+" @@ -973,7 +995,7 @@ BufferedWriterTest.testConstructor(self) def testReadAndWrite(self): - raw = MockRawIO((b"asdf", b"ghjk")) + raw = self.MockRawIO((b"asdf", b"ghjk")) rw = self.tp(raw, 8, 12) self.assertEqual(b"as", rw.read(2)) @@ -1095,6 +1117,24 @@ BufferedReaderTest.test_garbage_collection(self) BufferedWriterTest.test_garbage_collection(self) +class CBufferedRandomTest(BufferedRandomTest): + tp = io.BufferedRandom + BlockingIOError = io.BlockingIOError + FileIO = io.FileIO + MockRawIO = CMockRawIO + MockFileIO = CMockFileIO + MisbehavedRawIO = CMisbehavedRawIO + MockNonBlockWriterIO = CMockNonBlockWriterIO + +class PyBufferedRandomTest(BufferedRandomTest): + tp = pyio.BufferedRandom + BlockingIOError = pyio.BlockingIOError + FileIO = pyio.FileIO + MockRawIO = PyMockRawIO + MockFileIO = PyMockFileIO + MisbehavedRawIO = PyMisbehavedRawIO + MockNonBlockWriterIO = PyMockNonBlockWriterIO + # To fully exercise seek/tell, the StatefulIncrementalDecoder has these # properties: @@ -1251,9 +1291,9 @@ support.unlink(support.TESTFN) def testConstructor(self): - r = io.BytesIO(b"\xc3\xa9\n\n") - b = io.BufferedReader(r, 1000) - t = io.TextIOWrapper(b) + r = self.BytesIO(b"\xc3\xa9\n\n") + b = self.BufferedReader(r, 1000) + t = self.TextIOWrapper(b) t.__init__(b, encoding="latin1", newline="\r\n") self.assertEquals(t.encoding, "latin1") self.assertEquals(t.line_buffering, False) @@ -1267,9 +1307,9 @@ self.assertRaises(ValueError, t.read) def testLineBuffering(self): - r = io.BytesIO() - b = io.BufferedWriter(r, 1000) - t = io.TextIOWrapper(b, newline="\n", line_buffering=True) + r = self.BytesIO() + b = self.BufferedWriter(r, 1000) + t = self.TextIOWrapper(b, newline="\n", line_buffering=True) t.write("X") self.assertEquals(r.getvalue(), b"") # No flush happened t.write("Y\nZ") @@ -1279,50 +1319,50 @@ def testEncoding(self): # Check the encoding attribute is always set, and valid - b = io.BytesIO() - t = io.TextIOWrapper(b, encoding="utf8") + b = self.BytesIO() + t = self.TextIOWrapper(b, encoding="utf8") self.assertEqual(t.encoding, "utf8") - t = io.TextIOWrapper(b) + t = self.TextIOWrapper(b) self.assert_(t.encoding is not None) codecs.lookup(t.encoding) def testEncodingErrorsReading(self): # (1) default - b = io.BytesIO(b"abc\n\xff\n") - t = io.TextIOWrapper(b, encoding="ascii") + b = self.BytesIO(b"abc\n\xff\n") + t = self.TextIOWrapper(b, encoding="ascii") self.assertRaises(UnicodeError, t.read) # (2) explicit strict - b = io.BytesIO(b"abc\n\xff\n") - t = io.TextIOWrapper(b, encoding="ascii", errors="strict") + b = self.BytesIO(b"abc\n\xff\n") + t = self.TextIOWrapper(b, encoding="ascii", errors="strict") self.assertRaises(UnicodeError, t.read) # (3) ignore - b = io.BytesIO(b"abc\n\xff\n") - t = io.TextIOWrapper(b, encoding="ascii", errors="ignore") + b = self.BytesIO(b"abc\n\xff\n") + t = self.TextIOWrapper(b, encoding="ascii", errors="ignore") self.assertEquals(t.read(), "abc\n\n") # (4) replace - b = io.BytesIO(b"abc\n\xff\n") - t = io.TextIOWrapper(b, encoding="ascii", errors="replace") + b = self.BytesIO(b"abc\n\xff\n") + t = self.TextIOWrapper(b, encoding="ascii", errors="replace") self.assertEquals(t.read(), "abc\n\ufffd\n") def testEncodingErrorsWriting(self): # (1) default - b = io.BytesIO() - t = io.TextIOWrapper(b, encoding="ascii") + b = self.BytesIO() + t = self.TextIOWrapper(b, encoding="ascii") self.assertRaises(UnicodeError, t.write, "\xff") # (2) explicit strict - b = io.BytesIO() - t = io.TextIOWrapper(b, encoding="ascii", errors="strict") + b = self.BytesIO() + t = self.TextIOWrapper(b, encoding="ascii", errors="strict") self.assertRaises(UnicodeError, t.write, "\xff") # (3) ignore - b = io.BytesIO() - t = io.TextIOWrapper(b, encoding="ascii", errors="ignore", + b = self.BytesIO() + t = self.TextIOWrapper(b, encoding="ascii", errors="ignore", newline="\n") t.write("abc\xffdef\n") t.flush() self.assertEquals(b.getvalue(), b"abcdef\n") # (4) replace - b = io.BytesIO() - t = io.TextIOWrapper(b, encoding="ascii", errors="replace", + b = self.BytesIO() + t = self.TextIOWrapper(b, encoding="ascii", errors="replace", newline="\n") t.write("abc\xffdef\n") t.flush() @@ -1352,8 +1392,8 @@ for do_reads in (False, True): for bufsize in range(1, 10): for newline, exp_lines in tests: - bufio = io.BufferedReader(io.BytesIO(data), bufsize) - textio = io.TextIOWrapper(bufio, newline=newline, + bufio = self.BufferedReader(self.BytesIO(data), bufsize) + textio = self.TextIOWrapper(bufio, newline=newline, encoding=encoding) if do_reads: got_lines = [] @@ -1380,8 +1420,8 @@ ("\r\n", ["AAA\nBB\x00B\nCCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]), ("\r", ["AAA\nBB\x00B\nCCC\r", "DDD\r", "EEE\r", "\nFFF\r", "\nGGG"]), ]: - buf = io.BytesIO(testdata) - txt = io.TextIOWrapper(buf, encoding="ascii", newline=newline) + buf = self.BytesIO(testdata) + txt = self.TextIOWrapper(buf, encoding="ascii", newline=newline) self.assertEquals(txt.readlines(), expected) txt.seek(0) self.assertEquals(txt.read(), "".join(expected)) @@ -1395,8 +1435,8 @@ } tests = [(None, testdict[os.linesep])] + sorted(testdict.items()) for newline, expected in tests: - buf = io.BytesIO() - txt = io.TextIOWrapper(buf, encoding="ascii", newline=newline) + buf = self.BytesIO() + txt = self.TextIOWrapper(buf, encoding="ascii", newline=newline) txt.write("AAA\nB") txt.write("BB\nCCC\n") txt.write("X\rY\r\nZ") @@ -1406,34 +1446,34 @@ def testDestructor(self): l = [] - class MyBytesIO(io.BytesIO): + class MyBytesIO(self.BytesIO): def close(self): l.append(self.getvalue()) - io.BytesIO.close(self) + self.BytesIO.close(self) b = MyBytesIO() - t = io.TextIOWrapper(b, encoding="ascii") + t = self.TextIOWrapper(b, encoding="ascii") t.write("abc") del t self.assertEquals([b"abc"], l) def testOverrideDestructor(self): record = [] - class MyTextIO(io.TextIOWrapper): + class MyTextIO(self.TextIOWrapper): def __del__(self): record.append(1) try: - f = io.TextIOWrapper.__del__ + f = super().__del__ except AttributeError: pass else: - f(self) + f() def close(self): record.append(2) - io.TextIOWrapper.close(self) + super().close() def flush(self): record.append(3) - io.TextIOWrapper.flush(self) - b = io.BytesIO() + super().flush() + b = self.BytesIO() t = MyTextIO(b, encoding="ascii") del t self.assertEqual(record, [1, 2, 3]) @@ -1443,15 +1483,15 @@ # even if close() fails. rawio = CloseFailureIO() def f(): - io.TextIOWrapper(rawio).xyzzy + self.TextIOWrapper(rawio).xyzzy self.assertRaises(AttributeError, f) def test_garbage_collection(self): # TextIOWrapper objects are collected, and collecting them flushes # all data to disk. rawio = io.FileIO(support.TESTFN, "wb") - b = io.BufferedWriter(rawio) - t = io.TextIOWrapper(b, encoding="ascii") + b = self.BufferedWriter(rawio) + t = self.TextIOWrapper(b, encoding="ascii") t.write("456def") t.x = t wr = weakref.ref(t) @@ -1466,11 +1506,11 @@ def testBasicIO(self): for chunksize in (1, 2, 3, 4, 5, 15, 16, 17, 31, 32, 33, 63, 64, 65): for enc in "ascii", "latin1", "utf8" :# , "utf-16-be", "utf-16-le": - f = io.open(support.TESTFN, "w+", encoding=enc) + f = self.open(support.TESTFN, "w+", encoding=enc) f._CHUNK_SIZE = chunksize self.assertEquals(f.write("abc"), 3) f.close() - f = io.open(support.TESTFN, "r+", encoding=enc) + f = self.open(support.TESTFN, "r+", encoding=enc) f._CHUNK_SIZE = chunksize self.assertEquals(f.tell(), 0) self.assertEquals(f.read(), "abc") @@ -1513,7 +1553,7 @@ self.assertEquals(rlines, wlines) def testTelling(self): - f = io.open(support.TESTFN, "w+", encoding="utf8") + f = self.open(support.TESTFN, "w+", encoding="utf8") p0 = f.tell() f.write("\xff\n") p1 = f.tell() @@ -1541,10 +1581,10 @@ u_suffix = "\u8888\n" suffix = bytes(u_suffix.encode("utf-8")) line = prefix + suffix - f = io.open(support.TESTFN, "wb") + f = self.open(support.TESTFN, "wb") f.write(line*2) f.close() - f = io.open(support.TESTFN, "r", encoding="utf-8") + f = self.open(support.TESTFN, "r", encoding="utf-8") s = f.read(prefix_size) self.assertEquals(s, str(prefix, "ascii")) self.assertEquals(f.tell(), prefix_size) @@ -1553,34 +1593,34 @@ def testSeekingToo(self): # Regression test for a specific bug data = b'\xe0\xbf\xbf\n' - f = io.open(support.TESTFN, "wb") + f = self.open(support.TESTFN, "wb") f.write(data) f.close() - f = io.open(support.TESTFN, "r", encoding="utf-8") + f = self.open(support.TESTFN, "r", encoding="utf-8") f._CHUNK_SIZE # Just test that it exists f._CHUNK_SIZE = 2 f.readline() f.tell() def testSeekAndTell(self): - """Test seek/tell using the StatefulIncrementalDecoder.""" + #Test seek/tell using the StatefulIncrementalDecoder. # Make test faster by doing smaller seeks CHUNK_SIZE = 128 def testSeekAndTellWithData(data, min_pos=0): """Tell/seek to various points within a data stream and ensure that the decoded data returned by read() is consistent.""" - f = io.open(support.TESTFN, 'wb') + f = self.open(support.TESTFN, 'wb') f.write(data) f.close() - f = io.open(support.TESTFN, encoding='test_decoder') + f = self.open(support.TESTFN, encoding='test_decoder') f._CHUNK_SIZE = CHUNK_SIZE decoded = f.read() f.close() for i in range(min_pos, len(decoded) + 1): # seek positions for j in [1, 5, len(decoded) - i]: # read lengths - f = io.open(support.TESTFN, encoding='test_decoder') + f = self.open(support.TESTFN, encoding='test_decoder') self.assertEquals(f.read(i), decoded[:i]) cookie = f.tell() self.assertEquals(f.read(j), decoded[i:i + j]) @@ -1618,8 +1658,8 @@ "utf-32-le", "utf-32-be") for encoding in tests: - buf = io.BytesIO() - f = io.TextIOWrapper(buf, encoding=encoding) + buf = self.BytesIO() + f = self.TextIOWrapper(buf, encoding=encoding) # Check if the BOM is written only once (see issue1753). f.write(data) f.write(data) @@ -1635,7 +1675,7 @@ nchars = len(line) nbytes = len(line.encode(enc)) for chunk_size in (32, 64, 128, 256): - f = io.open(support.TESTFN, "w+", encoding=enc) + f = self.open(support.TESTFN, "w+", encoding=enc) f._CHUNK_SIZE = chunk_size t0 = timer() for i in range(nlines): @@ -1665,7 +1705,7 @@ print("Using readline()+tell(): %6.3f seconds" % (t4-t3)) def testReadOneByOne(self): - txt = io.TextIOWrapper(io.BytesIO(b"AA\r\nBB")) + txt = self.TextIOWrapper(self.BytesIO(b"AA\r\nBB")) reads = "" while True: c = txt.read(1) @@ -1677,7 +1717,7 @@ # read in amounts equal to TextIOWrapper._CHUNK_SIZE which is 128. def testReadByChunk(self): # make sure "\r\n" straddles 128 char boundary. - txt = io.TextIOWrapper(io.BytesIO(b"A" * 127 + b"\r\nB")) + txt = self.TextIOWrapper(self.BytesIO(b"A" * 127 + b"\r\nB")) reads = "" while True: c = txt.read(128) @@ -1687,7 +1727,7 @@ self.assertEquals(reads, "A"*127+"\nB") def test_issue1395_1(self): - txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ascii") + txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii") # read one char at a time reads = "" @@ -1699,7 +1739,7 @@ self.assertEquals(reads, self.normalized) def test_issue1395_2(self): - txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ascii") + txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii") txt._CHUNK_SIZE = 4 reads = "" @@ -1711,7 +1751,7 @@ self.assertEquals(reads, self.normalized) def test_issue1395_3(self): - txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ascii") + txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii") txt._CHUNK_SIZE = 4 reads = txt.read(4) @@ -1722,7 +1762,7 @@ self.assertEquals(reads, self.normalized) def test_issue1395_4(self): - txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ascii") + txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii") txt._CHUNK_SIZE = 4 reads = txt.read(4) @@ -1730,7 +1770,7 @@ self.assertEquals(reads, self.normalized) def test_issue1395_5(self): - txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ascii") + txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii") txt._CHUNK_SIZE = 4 reads = txt.read(4) @@ -1740,11 +1780,25 @@ self.assertEquals(txt.read(4), "BBB\n") def test_issue2282(self): - buffer = io.BytesIO(self.testdata) - txt = io.TextIOWrapper(buffer, encoding="ascii") + buffer = self.BytesIO(self.testdata) + txt = self.TextIOWrapper(buffer, encoding="ascii") self.assertEqual(buffer.seekable(), txt.seekable()) +class CTextIOWrapperTest(TextIOWrapperTest): + open = io.open + BufferedReader = io.BufferedReader + BufferedWriter = io.BufferedWriter + TextIOWrapper = io.TextIOWrapper + BytesIO = io.BytesIO + +class PyTextIOWrapperTest(TextIOWrapperTest): + open = staticmethod(pyio.open) + BufferedReader = pyio.BufferedReader + BufferedWriter = pyio.BufferedWriter + TextIOWrapper = pyio.TextIOWrapper + BytesIO = pyio.BytesIO + class IncrementalNewlineDecoderTest(unittest.TestCase): @@ -1833,12 +1887,18 @@ ) for enc in encodings: decoder = enc and codecs.getincrementaldecoder(enc)() - decoder = io.IncrementalNewlineDecoder(decoder, translate=True) + decoder = self.IncrementalNewlineDecoder(decoder, translate=True) self.check_newline_decoding(decoder, enc) decoder = codecs.getincrementaldecoder("utf-8")() - decoder = io.IncrementalNewlineDecoder(decoder, translate=True) + decoder = self.IncrementalNewlineDecoder(decoder, translate=True) self.check_newline_decoding_utf8(decoder) +class CIncrementalNewlineDecoderTest(IncrementalNewlineDecoderTest): + IncrementalNewlineDecoder = io.IncrementalNewlineDecoder + +class PyIncrementalNewlineDecoderTest(IncrementalNewlineDecoderTest): + IncrementalNewlineDecoder = pyio.IncrementalNewlineDecoder + # XXX Tests for open() @@ -1848,7 +1908,7 @@ support.unlink(support.TESTFN) def testImport__all__(self): - for name in io.__all__: + for name in self.io.__all__: obj = getattr(io, name, None) self.assert_(obj is not None, name) if name == "open": @@ -1856,14 +1916,14 @@ elif "error" in name.lower(): self.assert_(issubclass(obj, Exception), name) else: - self.assert_(issubclass(obj, io.IOBase)) + self.assert_(issubclass(obj, self.IOBase), name) def test_attributes(self): - f = io.open(support.TESTFN, "wb", buffering=0) + f = self.open(support.TESTFN, "wb", buffering=0) self.assertEquals(f.mode, "wb") f.close() - f = io.open(support.TESTFN, "U") + f = self.open(support.TESTFN, "U") self.assertEquals(f.name, support.TESTFN) self.assertEquals(f.buffer.name, support.TESTFN) self.assertEquals(f.buffer.raw.name, support.TESTFN) @@ -1872,12 +1932,12 @@ self.assertEquals(f.buffer.raw.mode, "rb") f.close() - f = io.open(support.TESTFN, "w+") + f = self.open(support.TESTFN, "w+") self.assertEquals(f.mode, "w+") self.assertEquals(f.buffer.mode, "rb+") # Does it really matter? self.assertEquals(f.buffer.raw.mode, "rb+") - g = io.open(f.fileno(), "wb", closefd=False) + g = self.open(f.fileno(), "wb", closefd=False) self.assertEquals(g.mode, "wb") self.assertEquals(g.raw.mode, "wb") self.assertEquals(g.name, f.fileno()) @@ -1903,7 +1963,7 @@ {"mode": "w+", "buffering": 2}, {"mode": "w+b", "buffering": 0}, ]: - f = io.open(support.TESTFN, **kwargs) + f = self.open(support.TESTFN, **kwargs) f.close() self.assertRaises(ValueError, f.flush) self.assertRaises(ValueError, f.fileno) @@ -1928,16 +1988,16 @@ def test_blockingioerror(self): # Various BlockingIOError issues - self.assertRaises(TypeError, io.BlockingIOError) - self.assertRaises(TypeError, io.BlockingIOError, 1) - self.assertRaises(TypeError, io.BlockingIOError, 1, 2, 3, 4) - self.assertRaises(TypeError, io.BlockingIOError, 1, "", None) - b = io.BlockingIOError(1, "") + self.assertRaises(TypeError, self.BlockingIOError) + self.assertRaises(TypeError, self.BlockingIOError, 1) + self.assertRaises(TypeError, self.BlockingIOError, 1, 2, 3, 4) + self.assertRaises(TypeError, self.BlockingIOError, 1, "", None) + b = self.BlockingIOError(1, "") self.assertEqual(b.characters_written, 0) class C(str): pass c = C("") - b = io.BlockingIOError(1, c) + b = self.BlockingIOError(1, c) c.b = b b.c = c wr = weakref.ref(c) @@ -1945,13 +2005,28 @@ gc.collect() self.assert_(wr() is None, wr) +class CMiscIOTest(MiscIOTest): + io = io + open = io.open + BlockingIOError = io.BlockingIOError + IOBase = io.IOBase + +class PyMiscIOTest(MiscIOTest): + io = pyio + open = staticmethod(pyio.open) + BlockingIOError = pyio.BlockingIOError + IOBase = pyio.IOBase + def test_main(): - support.run_unittest(IOTest, BytesIOTest, StringIOTest, - BufferedReaderTest, BufferedWriterTest, - BufferedRWPairTest, BufferedRandomTest, + support.run_unittest(CIOTest, PyIOTest, + CBufferedReaderTest, PyBufferedReaderTest, + CBufferedWriterTest, PyBufferedWriterTest, + CBufferedRWPairTest, PyBufferedRWPairTest, + CBufferedRandomTest, PyBufferedRandomTest, StatefulIncrementalDecoderTest, - IncrementalNewlineDecoderTest, - TextIOWrapperTest, MiscIOTest, + CIncrementalNewlineDecoderTest, PyIncrementalNewlineDecoderTest, + CTextIOWrapperTest, PyTextIOWrapperTest, + CMiscIOTest, PyMiscIOTest, ) if __name__ == "__main__": Modified: python/branches/io-c/Lib/test/test_memoryio.py ============================================================================== --- python/branches/io-c/Lib/test/test_memoryio.py (original) +++ python/branches/io-c/Lib/test/test_memoryio.py Sat Feb 21 21:05:40 2009 @@ -7,8 +7,53 @@ from test import support import io +import _pyio as pyio import sys +class MemorySeekTestMixin: + + def testInit(self): + buf = self.buftype("1234567890") + bytesIo = self.ioclass(buf) + + def testRead(self): + buf = self.buftype("1234567890") + bytesIo = self.ioclass(buf) + + self.assertEquals(buf[:1], bytesIo.read(1)) + self.assertEquals(buf[1:5], bytesIo.read(4)) + self.assertEquals(buf[5:], bytesIo.read(900)) + self.assertEquals(self.EOF, bytesIo.read()) + + def testReadNoArgs(self): + buf = self.buftype("1234567890") + bytesIo = self.ioclass(buf) + + self.assertEquals(buf, bytesIo.read()) + self.assertEquals(self.EOF, bytesIo.read()) + + def testSeek(self): + buf = self.buftype("1234567890") + bytesIo = self.ioclass(buf) + + bytesIo.read(5) + bytesIo.seek(0) + self.assertEquals(buf, bytesIo.read()) + + bytesIo.seek(3) + self.assertEquals(buf[3:], bytesIo.read()) + self.assertRaises(TypeError, bytesIo.seek, 0.0) + + def testTell(self): + buf = self.buftype("1234567890") + bytesIo = self.ioclass(buf) + + self.assertEquals(0, bytesIo.tell()) + bytesIo.seek(5) + self.assertEquals(5, bytesIo.tell()) + bytesIo.seek(10000) + self.assertEquals(10000, bytesIo.tell()) + class MemoryTestMixin: @@ -290,11 +335,11 @@ self.assertEqual(test2(), buf) -class PyBytesIOTest(MemoryTestMixin, unittest.TestCase): +class PyBytesIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase): @staticmethod def buftype(s): return s.encode("ascii") - ioclass = io.unused_BytesIO + ioclass = pyio.BytesIO EOF = b"" def test_read1(self): @@ -365,9 +410,9 @@ self.assertEqual(memio.getvalue(), buf) -class PyStringIOTest(MemoryTestMixin, unittest.TestCase): +class PyStringIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase): buftype = str - ioclass = io.unused_StringIO + ioclass = pyio.StringIO EOF = "" # TextIO-specific behaviour. From python-checkins at python.org Sat Feb 21 21:10:00 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 21 Feb 2009 21:10:00 +0100 (CET) Subject: [Python-checkins] r69842 - python/branches/io-c/Lib/_pyio.py Message-ID: <20090221201000.A56D41E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 21 21:10:00 2009 New Revision: 69842 Log: closed is not a function Modified: python/branches/io-c/Lib/_pyio.py Modified: python/branches/io-c/Lib/_pyio.py ============================================================================== --- python/branches/io-c/Lib/_pyio.py (original) +++ python/branches/io-c/Lib/_pyio.py Sat Feb 21 21:10:00 2009 @@ -1075,7 +1075,7 @@ @property def closed(self): - return self.writer.closed() + return self.writer.closed class BufferedRandom(BufferedWriter, BufferedReader): From python-checkins at python.org Sat Feb 21 21:13:05 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 21 Feb 2009 21:13:05 +0100 (CET) Subject: [Python-checkins] r69843 - python/branches/io-c/Lib/test/test_io.py Message-ID: <20090221201305.987441E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 21 21:13:04 2009 New Revision: 69843 Log: fix __all__ test Modified: python/branches/io-c/Lib/test/test_io.py Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Sat Feb 21 21:13:04 2009 @@ -1909,7 +1909,7 @@ def testImport__all__(self): for name in self.io.__all__: - obj = getattr(io, name, None) + obj = getattr(self.io, name, None) self.assert_(obj is not None, name) if name == "open": continue From python-checkins at python.org Sat Feb 21 21:21:24 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 21 Feb 2009 21:21:24 +0100 (CET) Subject: [Python-checkins] r69844 - in python/branches/io-c/Lib: _pyio.py test/test_io.py Message-ID: <20090221202124.AB1281E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 21 21:21:24 2009 New Revision: 69844 Log: fix the rest of the Misc tests Modified: python/branches/io-c/Lib/_pyio.py python/branches/io-c/Lib/test/test_io.py Modified: python/branches/io-c/Lib/_pyio.py ============================================================================== --- python/branches/io-c/Lib/_pyio.py (original) +++ python/branches/io-c/Lib/_pyio.py Sat Feb 21 21:21:24 2009 @@ -23,7 +23,9 @@ """Exception raised when I/O would block on a non-blocking I/O stream.""" def __init__(self, errno, strerror, characters_written=0): - IOError.__init__(self, errno, strerror) + super().__init__(errno, strerror) + if not isinstance(characters_written, int): + raise TypeError("characters_written must be a integer") self.characters_written = characters_written @@ -551,6 +553,7 @@ from _io import FileIO +IOBase.register(FileIO) class BufferedIOBase(IOBase): Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Sat Feb 21 21:21:24 2009 @@ -1969,7 +1969,6 @@ self.assertRaises(ValueError, f.fileno) self.assertRaises(ValueError, f.isatty) self.assertRaises(ValueError, f.__iter__) - self.assertRaises(ValueError, next, f) if hasattr(f, "peek"): self.assertRaises(ValueError, f.peek, 1) self.assertRaises(ValueError, f.read) @@ -1985,6 +1984,7 @@ self.assertRaises(ValueError, f.write, b"" if "b" in kwargs['mode'] else "") self.assertRaises(ValueError, f.writelines, []) + self.assertRaises(ValueError, next, f) def test_blockingioerror(self): # Various BlockingIOError issues From python-checkins at python.org Sat Feb 21 21:26:59 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 21 Feb 2009 21:26:59 +0100 (CET) Subject: [Python-checkins] r69845 - python/branches/io-c/Lib/_pyio.py Message-ID: <20090221202659.CD11E1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 21 21:26:59 2009 New Revision: 69845 Log: RawIOBase is better for FileIO Modified: python/branches/io-c/Lib/_pyio.py Modified: python/branches/io-c/Lib/_pyio.py ============================================================================== --- python/branches/io-c/Lib/_pyio.py (original) +++ python/branches/io-c/Lib/_pyio.py Sat Feb 21 21:26:59 2009 @@ -553,7 +553,7 @@ from _io import FileIO -IOBase.register(FileIO) +RawIOBase.register(FileIO) class BufferedIOBase(IOBase): From python-checkins at python.org Sat Feb 21 21:27:02 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 21 Feb 2009 21:27:02 +0100 (CET) Subject: [Python-checkins] r69846 - in python/trunk: Demo/tkinter/matt/menu-all-types-of-entries.py Demo/tkinter/matt/menu-simple.py Doc/howto/webservers.rst Doc/library/io.rst Doc/library/pty.rst Doc/library/subprocess.rst Doc/tutorial/classes.rst Doc/tutorial/datastructures.rst Doc/tutorial/floatingpoint.rst Doc/tutorial/inputoutput.rst Doc/tutorial/stdlib.rst Lib/bsddb/test/test_basics.py Lib/bsddb/test/test_compat.py Lib/bsddb/test/test_recno.py Lib/difflib.py Lib/distutils/tests/test_core.py Lib/email/message.py Lib/idlelib/AutoComplete.py Lib/idlelib/CallTips.py Lib/idlelib/NEWS.txt Lib/io.py Lib/lib-tk/Tkinter.py Lib/lib-tk/test/test_ttk/test_style.py Lib/lib-tk/test/test_ttk/test_widgets.py Lib/lib-tk/turtle.py Lib/optparse.py Lib/plat-mac/bundlebuilder.py Lib/smtpd.py Lib/subprocess.py Lib/tarfile.py Lib/test/test_calendar.py Lib/test/test_cfgparser.py Lib/test/test_codeccallbacks.py Lib/test/test_cookielib.py Lib/test/test_descrtut.py Lib/test/test_funcattrs.py Lib/test/test_urllib2net.py Lib/wsgiref/headers.py Misc/AIX-NOTES Misc/HISTORY Misc/NEWS Misc/cheatsheet Modules/_ctypes/libffi/aclocal.m4 Modules/_ctypes/libffi/configure Modules/_ctypes/libffi/src/x86/ffi64.c Modules/_ctypes/libffi_osx/x86/x86-ffi64.c Modules/_sqlite/connection.c Modules/arraymodule.c Modules/posixmodule.c Objects/abstract.c Objects/listsort.txt Objects/object.c Objects/unicodeobject.c PC/_winreg.c PC/os2vacpp/makefile.omk Tools/scripts/texi2html.py Message-ID: <20090221202702.CC5481E4034@bag.python.org> Author: mark.dickinson Date: Sat Feb 21 21:27:01 2009 New Revision: 69846 Log: Issue #5341: Fix a variety of spelling errors. Modified: python/trunk/Demo/tkinter/matt/menu-all-types-of-entries.py python/trunk/Demo/tkinter/matt/menu-simple.py python/trunk/Doc/howto/webservers.rst python/trunk/Doc/library/io.rst python/trunk/Doc/library/pty.rst python/trunk/Doc/library/subprocess.rst python/trunk/Doc/tutorial/classes.rst python/trunk/Doc/tutorial/datastructures.rst python/trunk/Doc/tutorial/floatingpoint.rst python/trunk/Doc/tutorial/inputoutput.rst python/trunk/Doc/tutorial/stdlib.rst python/trunk/Lib/bsddb/test/test_basics.py python/trunk/Lib/bsddb/test/test_compat.py python/trunk/Lib/bsddb/test/test_recno.py python/trunk/Lib/difflib.py python/trunk/Lib/distutils/tests/test_core.py python/trunk/Lib/email/message.py python/trunk/Lib/idlelib/AutoComplete.py python/trunk/Lib/idlelib/CallTips.py python/trunk/Lib/idlelib/NEWS.txt python/trunk/Lib/io.py python/trunk/Lib/lib-tk/Tkinter.py python/trunk/Lib/lib-tk/test/test_ttk/test_style.py python/trunk/Lib/lib-tk/test/test_ttk/test_widgets.py python/trunk/Lib/lib-tk/turtle.py python/trunk/Lib/optparse.py python/trunk/Lib/plat-mac/bundlebuilder.py python/trunk/Lib/smtpd.py python/trunk/Lib/subprocess.py python/trunk/Lib/tarfile.py python/trunk/Lib/test/test_calendar.py python/trunk/Lib/test/test_cfgparser.py python/trunk/Lib/test/test_codeccallbacks.py python/trunk/Lib/test/test_cookielib.py python/trunk/Lib/test/test_descrtut.py python/trunk/Lib/test/test_funcattrs.py python/trunk/Lib/test/test_urllib2net.py python/trunk/Lib/wsgiref/headers.py python/trunk/Misc/AIX-NOTES python/trunk/Misc/HISTORY python/trunk/Misc/NEWS python/trunk/Misc/cheatsheet python/trunk/Modules/_ctypes/libffi/aclocal.m4 python/trunk/Modules/_ctypes/libffi/configure python/trunk/Modules/_ctypes/libffi/src/x86/ffi64.c python/trunk/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c python/trunk/Modules/_sqlite/connection.c python/trunk/Modules/arraymodule.c python/trunk/Modules/posixmodule.c python/trunk/Objects/abstract.c python/trunk/Objects/listsort.txt python/trunk/Objects/object.c python/trunk/Objects/unicodeobject.c python/trunk/PC/_winreg.c python/trunk/PC/os2vacpp/makefile.omk python/trunk/Tools/scripts/texi2html.py Modified: python/trunk/Demo/tkinter/matt/menu-all-types-of-entries.py ============================================================================== --- python/trunk/Demo/tkinter/matt/menu-all-types-of-entries.py (original) +++ python/trunk/Demo/tkinter/matt/menu-all-types-of-entries.py Sat Feb 21 21:27:01 2009 @@ -110,12 +110,12 @@ Cascade_button.menu.choices = Menu(Cascade_button.menu) # ...and this is a menu that cascades from that. - Cascade_button.menu.choices.wierdones = Menu(Cascade_button.menu.choices) + Cascade_button.menu.choices.weirdones = Menu(Cascade_button.menu.choices) # then you define the menus from the deepest level on up. - Cascade_button.menu.choices.wierdones.add_command(label='avacado') - Cascade_button.menu.choices.wierdones.add_command(label='belgian endive') - Cascade_button.menu.choices.wierdones.add_command(label='beefaroni') + Cascade_button.menu.choices.weirdones.add_command(label='avacado') + Cascade_button.menu.choices.weirdones.add_command(label='belgian endive') + Cascade_button.menu.choices.weirdones.add_command(label='beefaroni') # definition of the menu one level up... Cascade_button.menu.choices.add_command(label='Chocolate') @@ -125,8 +125,8 @@ Cascade_button.menu.choices.add_command(label='Rocky Road') Cascade_button.menu.choices.add_command(label='BubbleGum') Cascade_button.menu.choices.add_cascade( - label='Wierd Flavors', - menu=Cascade_button.menu.choices.wierdones) + label='Weird Flavors', + menu=Cascade_button.menu.choices.weirdones) # and finally, the definition for the top level Cascade_button.menu.add_cascade(label='more choices', Modified: python/trunk/Demo/tkinter/matt/menu-simple.py ============================================================================== --- python/trunk/Demo/tkinter/matt/menu-simple.py (original) +++ python/trunk/Demo/tkinter/matt/menu-simple.py Sat Feb 21 21:27:01 2009 @@ -48,7 +48,7 @@ File_button.menu = Menu(File_button) # add an item. The first param is a menu entry type, - # must be one of: "cascade", "checkbutton", "command", "radiobutton", "seperator" + # must be one of: "cascade", "checkbutton", "command", "radiobutton", "separator" # see menu-demo-2.py for examples of use File_button.menu.add_command(label='New...', underline=0, command=new_file) Modified: python/trunk/Doc/howto/webservers.rst ============================================================================== --- python/trunk/Doc/howto/webservers.rst (original) +++ python/trunk/Doc/howto/webservers.rst Sat Feb 21 21:27:01 2009 @@ -426,7 +426,7 @@ user. Typically this component is represented by the templates. * The *controller*. This is the layer between the user and the model. The controller reacts on user actions (like opening some specific URL) and tells - the model to modify the data if neccessary. + the model to modify the data if necessary. While one might think that MVC is a complex design pattern, in fact it is not. It is used in Python because it has turned out to be useful for creating clean, @@ -435,9 +435,9 @@ .. note:: While not all Python frameworks explicitly support MVC, it is often trivial - to create a web site which uses the MVC pattern by seperating the data logic + to create a web site which uses the MVC pattern by separating the data logic (the model) from the user interaction logic (the controller) and the - templates (the view). That's why it is important not to write unneccessary + templates (the view). That's why it is important not to write unnecessary Python code in the templates -- it is against MVC and creates more chaos. .. seealso:: @@ -607,7 +607,7 @@ ----------------------- There is an incredible number of frameworks, so there is no way to describe them -all. It is not even neccessary, as most of these frameworks are nothing special +all. It is not even necessary, as most of these frameworks are nothing special and everything that can be done with these can also be done with one of the popular ones. @@ -679,7 +679,7 @@ Another framework that's already been mentioned is `Pylons`_. Pylons is much like TurboGears with ab even stronger emphasis on flexibility, which is bought at the cost of being more difficult to use. Nearly every component can be -exchanged, which makes it neccessary to use the documentation of every single +exchanged, which makes it necessary to use the documentation of every single component, because there are so many Pylons combinations possible that can satisfy every requirement. Pylons builds upon `Paste `_, an extensive set of tools which are handy for WSGI. Modified: python/trunk/Doc/library/io.rst ============================================================================== --- python/trunk/Doc/library/io.rst (original) +++ python/trunk/Doc/library/io.rst Sat Feb 21 21:27:01 2009 @@ -14,7 +14,7 @@ At the top of the I/O hierarchy is the abstract base class :class:`IOBase`. It defines the basic interface to a stream. Note, however, that there is no -seperation between reading and writing to streams; implementations are allowed +separation between reading and writing to streams; implementations are allowed to throw an :exc:`IOError` if they do not support a given operation. Extending :class:`IOBase` is :class:`RawIOBase` which deals simply with the @@ -612,7 +612,7 @@ is enabled. With this enabled, on input, the lines endings ``'\n'``, ``'\r'``, or ``'\r\n'`` are translated to ``'\n'`` before being returned to the caller. Conversely, on output, ``'\n'`` is translated to the system - default line seperator, :data:`os.linesep`. If *newline* is any other of its + default line separator, :data:`os.linesep`. If *newline* is any other of its legal values, that newline becomes the newline when the file is read and it is returned untranslated. On output, ``'\n'`` is converted to the *newline*. Modified: python/trunk/Doc/library/pty.rst ============================================================================== --- python/trunk/Doc/library/pty.rst (original) +++ python/trunk/Doc/library/pty.rst Sat Feb 21 21:27:01 2009 @@ -13,7 +13,7 @@ concept: starting another process and being able to write to and read from its controlling terminal programmatically. -Because pseudo-terminal handling is highly platform dependant, there is code to +Because pseudo-terminal handling is highly platform dependent, there is code to do it only for SGI and Linux. (The Linux code is supposed to work on other platforms, but hasn't been tested yet.) Modified: python/trunk/Doc/library/subprocess.rst ============================================================================== --- python/trunk/Doc/library/subprocess.rst (original) +++ python/trunk/Doc/library/subprocess.rst Sat Feb 21 21:27:01 2009 @@ -181,9 +181,9 @@ To capture standard error in the result, use stderr=subprocess.STDOUT. >>> subprocess.check_output( - ["/bin/sh", "-c", "ls non_existant_file ; exit 0"], + ["/bin/sh", "-c", "ls non_existent_file ; exit 0"], stderr=subprocess.STDOUT) - 'ls: non_existant_file: No such file or directory\n' + 'ls: non_existent_file: No such file or directory\n' .. versionadded:: 2.7 Modified: python/trunk/Doc/tutorial/classes.rst ============================================================================== --- python/trunk/Doc/tutorial/classes.rst (original) +++ python/trunk/Doc/tutorial/classes.rst Sat Feb 21 21:27:01 2009 @@ -470,7 +470,7 @@ only works if the base class is defined or imported directly in the global scope.) -Python has two builtin functions that work with inheritance: +Python has two built-in functions that work with inheritance: * Use :func:`isinstance` to check an object's type: ``isinstance(obj, int)`` will be ``True`` only if ``obj.__class__`` is :class:`int` or some class Modified: python/trunk/Doc/tutorial/datastructures.rst ============================================================================== --- python/trunk/Doc/tutorial/datastructures.rst (original) +++ python/trunk/Doc/tutorial/datastructures.rst Sat Feb 21 21:27:01 2009 @@ -308,7 +308,7 @@ print row[i], print -In real world, you should prefer builtin functions to complex flow statements. +In real world, you should prefer built-in functions to complex flow statements. The :func:`zip` function would do a great job for this use case:: >>> zip(*mat) Modified: python/trunk/Doc/tutorial/floatingpoint.rst ============================================================================== --- python/trunk/Doc/tutorial/floatingpoint.rst (original) +++ python/trunk/Doc/tutorial/floatingpoint.rst Sat Feb 21 21:27:01 2009 @@ -65,7 +65,7 @@ >>> 0.1 0.1000000000000000055511151231257827021181583404541015625 -instead! The Python prompt uses the builtin :func:`repr` function to obtain a +instead! The Python prompt uses the built-in :func:`repr` function to obtain a string version of everything it displays. For floats, ``repr(float)`` rounds the true decimal value to 17 significant digits, giving :: @@ -81,7 +81,7 @@ (although some languages may not *display* the difference by default, or in all output modes). -Python's builtin :func:`str` function produces only 12 significant digits, and +Python's built-in :func:`str` function produces only 12 significant digits, and you may wish to use that instead. It's unusual for ``eval(str(x))`` to reproduce *x*, but the output may be more pleasant to look at:: Modified: python/trunk/Doc/tutorial/inputoutput.rst ============================================================================== --- python/trunk/Doc/tutorial/inputoutput.rst (original) +++ python/trunk/Doc/tutorial/inputoutput.rst Sat Feb 21 21:27:01 2009 @@ -187,7 +187,7 @@ This is particularly useful in combination with the new built-in :func:`vars` function, which returns a dictionary containing all local variables. -For a complete overview of string formating with :meth:`str.format`, see +For a complete overview of string formatting with :meth:`str.format`, see :ref:`formatstrings`. Modified: python/trunk/Doc/tutorial/stdlib.rst ============================================================================== --- python/trunk/Doc/tutorial/stdlib.rst (original) +++ python/trunk/Doc/tutorial/stdlib.rst Sat Feb 21 21:27:01 2009 @@ -21,12 +21,12 @@ >>> os.chdir('/server/accesslogs') Be sure to use the ``import os`` style instead of ``from os import *``. This -will keep :func:`os.open` from shadowing the builtin :func:`open` function which +will keep :func:`os.open` from shadowing the built-in :func:`open` function which operates much differently. .. index:: builtin: help -The builtin :func:`dir` and :func:`help` functions are useful as interactive +The built-in :func:`dir` and :func:`help` functions are useful as interactive aids for working with large modules like :mod:`os`:: >>> import os Modified: python/trunk/Lib/bsddb/test/test_basics.py ============================================================================== --- python/trunk/Lib/bsddb/test/test_basics.py (original) +++ python/trunk/Lib/bsddb/test/test_basics.py Sat Feb 21 21:27:01 2009 @@ -131,7 +131,7 @@ self.assertEqual(d.get('0321'), '0321-0321-0321-0321-0321') - # By default non-existant keys return None... + # By default non-existent keys return None... self.assertEqual(d.get('abcd'), None) # ...but they raise exceptions in other situations. Call Modified: python/trunk/Lib/bsddb/test/test_compat.py ============================================================================== --- python/trunk/Lib/bsddb/test/test_compat.py (original) +++ python/trunk/Lib/bsddb/test/test_compat.py Sat Feb 21 21:27:01 2009 @@ -133,7 +133,7 @@ except KeyError: pass else: - self.fail("set_location on non-existant key did not raise KeyError") + self.fail("set_location on non-existent key did not raise KeyError") f.sync() f.close() Modified: python/trunk/Lib/bsddb/test/test_recno.py ============================================================================== --- python/trunk/Lib/bsddb/test/test_recno.py (original) +++ python/trunk/Lib/bsddb/test/test_recno.py Sat Feb 21 21:27:01 2009 @@ -150,7 +150,7 @@ if verbose: print rec - # test that non-existant key lookups work (and that + # test that non-existent key lookups work (and that # DBC_set_range doesn't have a memleak under valgrind) rec = c.set_range(999999) self.assertEqual(rec, None) Modified: python/trunk/Lib/difflib.py ============================================================================== --- python/trunk/Lib/difflib.py (original) +++ python/trunk/Lib/difflib.py Sat Feb 21 21:27:01 2009 @@ -1329,7 +1329,7 @@ (from line tuple, to line tuple, boolean flag) from/to line tuple -- (line num, line text) - line num -- integer or None (to indicate a context seperation) + line num -- integer or None (to indicate a context separation) line text -- original line text with following markers inserted: '\0+' -- marks start of added text '\0-' -- marks start of deleted text Modified: python/trunk/Lib/distutils/tests/test_core.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_core.py (original) +++ python/trunk/Lib/distutils/tests/test_core.py Sat Feb 21 21:27:01 2009 @@ -57,7 +57,7 @@ def test_run_setup_uses_current_dir(self): # This tests that the setup script is run with the current directory - # as it's own current directory; this was temporarily broken by a + # as its own current directory; this was temporarily broken by a # previous patch when TESTFN did not use the current directory. sys.stdout = StringIO.StringIO() cwd = os.getcwd() Modified: python/trunk/Lib/email/message.py ============================================================================== --- python/trunk/Lib/email/message.py (original) +++ python/trunk/Lib/email/message.py Sat Feb 21 21:27:01 2009 @@ -20,7 +20,7 @@ SEMISPACE = '; ' # Regular expression that matches `special' characters in parameters, the -# existance of which force quoting of the parameter value. +# existence of which force quoting of the parameter value. tspecials = re.compile(r'[ \(\)<>@,;:\\"/\[\]\?=]') Modified: python/trunk/Lib/idlelib/AutoComplete.py ============================================================================== --- python/trunk/Lib/idlelib/AutoComplete.py (original) +++ python/trunk/Lib/idlelib/AutoComplete.py Sat Feb 21 21:27:01 2009 @@ -67,7 +67,7 @@ def try_open_completions_event(self, event): """Happens when it would be nice to open a completion list, but not - really neccesary, for example after an dot, so function + really necessary, for example after an dot, so function calls won't be made. """ lastchar = self.text.get("insert-1c") @@ -79,7 +79,7 @@ COMPLETE_FILES) def autocomplete_event(self, event): - """Happens when the user wants to complete his word, and if neccesary, + """Happens when the user wants to complete his word, and if necessary, open a completion list after that (if there is more than one completion) """ Modified: python/trunk/Lib/idlelib/CallTips.py ============================================================================== --- python/trunk/Lib/idlelib/CallTips.py (original) +++ python/trunk/Lib/idlelib/CallTips.py Sat Feb 21 21:27:01 2009 @@ -51,7 +51,7 @@ def try_open_calltip_event(self, event): """Happens when it would be nice to open a CallTip, but not really - neccesary, for example after an opening bracket, so function calls + necessary, for example after an opening bracket, so function calls won't be made. """ self.open_calltip(False) Modified: python/trunk/Lib/idlelib/NEWS.txt ============================================================================== --- python/trunk/Lib/idlelib/NEWS.txt (original) +++ python/trunk/Lib/idlelib/NEWS.txt Sat Feb 21 21:27:01 2009 @@ -300,7 +300,7 @@ window raising, especially in the Windows menu and in the debugger. IDLEfork 763524. -- If user passes a non-existant filename on the commandline, just +- If user passes a non-existent filename on the commandline, just open a new file, don't raise a dialog. IDLEfork 854928. Modified: python/trunk/Lib/io.py ============================================================================== --- python/trunk/Lib/io.py (original) +++ python/trunk/Lib/io.py Sat Feb 21 21:27:01 2009 @@ -4,7 +4,7 @@ At the top of the I/O hierarchy is the abstract base class IOBase. It defines the basic interface to a stream. Note, however, that there is no -seperation between reading and writing to streams; implementations are +separation between reading and writing to streams; implementations are allowed to throw an IOError if they do not support a given operation. Extending IOBase is RawIOBase which deals simply with the reading and @@ -1374,7 +1374,7 @@ enabled. With this enabled, on input, the lines endings '\n', '\r', or '\r\n' are translated to '\n' before being returned to the caller. Conversely, on output, '\n' is translated to the system - default line seperator, os.linesep. If newline is any other of its + default line separator, os.linesep. If newline is any other of its legal values, that newline becomes the newline when the file is read and it is returned untranslated. On output, '\n' is converted to the newline. Modified: python/trunk/Lib/lib-tk/Tkinter.py ============================================================================== --- python/trunk/Lib/lib-tk/Tkinter.py (original) +++ python/trunk/Lib/lib-tk/Tkinter.py Sat Feb 21 21:27:01 2009 @@ -3316,7 +3316,7 @@ """Return the color (red, green, blue) of the pixel at X,Y.""" return self.tk.call(self.name, 'get', x, y) def put(self, data, to=None): - """Put row formated colors to image starting from + """Put row formatted colors to image starting from position TO, e.g. image.put("{red green} {blue yellow}", to=(4,6))""" args = (self.name, 'put', data) if to: Modified: python/trunk/Lib/lib-tk/test/test_ttk/test_style.py ============================================================================== --- python/trunk/Lib/lib-tk/test/test_ttk/test_style.py (original) +++ python/trunk/Lib/lib-tk/test/test_ttk/test_style.py Sat Feb 21 21:27:01 2009 @@ -61,7 +61,7 @@ # correct layout, but "option" doesn't exist as option self.failUnlessRaises(Tkinter.TclError, style.layout, 'Treeview', - [('name', {'option': 'inexistant'})]) + [('name', {'option': 'inexistent'})]) def test_theme_use(self): Modified: python/trunk/Lib/lib-tk/test/test_ttk/test_widgets.py ============================================================================== --- python/trunk/Lib/lib-tk/test/test_ttk/test_widgets.py (original) +++ python/trunk/Lib/lib-tk/test/test_ttk/test_widgets.py Sat Feb 21 21:27:01 2009 @@ -861,9 +861,9 @@ # bad values self.failUnlessRaises(Tkinter.TclError, - self.tv.reattach, 'nonexistant', '', 'end') + self.tv.reattach, 'nonexistent', '', 'end') self.failUnlessRaises(Tkinter.TclError, - self.tv.detach, 'nonexistant') + self.tv.detach, 'nonexistent') self.failUnlessRaises(Tkinter.TclError, self.tv.reattach, item2, 'otherparent', 'end') self.failUnlessRaises(Tkinter.TclError, @@ -897,7 +897,7 @@ self.tv.delete(item1) self.failUnlessEqual(self.tv.focus(), '') - # try focusing inexistant item + # try focusing inexistent item self.failUnlessRaises(Tkinter.TclError, self.tv.focus, 'hi') @@ -1064,11 +1064,11 @@ self.failUnlessEqual(self.tv.item(item, values=None), (123, 'a')) self.failUnlessEqual(self.tv.set(item), {'B': 123}) - # inexistant column + # inexistent column self.failUnlessRaises(Tkinter.TclError, self.tv.set, item, 'A') self.failUnlessRaises(Tkinter.TclError, self.tv.set, item, 'A', 'b') - # inexistant item + # inexistent item self.failUnlessRaises(Tkinter.TclError, self.tv.set, 'notme') Modified: python/trunk/Lib/lib-tk/turtle.py ============================================================================== --- python/trunk/Lib/lib-tk/turtle.py (original) +++ python/trunk/Lib/lib-tk/turtle.py Sat Feb 21 21:27:01 2009 @@ -2794,7 +2794,7 @@ def _drawturtle(self): """Manages the correct rendering of the turtle with respect to - its shape, resizemode, strech and tilt etc.""" + its shape, resizemode, stretch and tilt etc.""" screen = self.screen shape = screen._shapes[self.turtle.shapeIndex] ttype = shape._type Modified: python/trunk/Lib/optparse.py ============================================================================== --- python/trunk/Lib/optparse.py (original) +++ python/trunk/Lib/optparse.py Sat Feb 21 21:27:01 2009 @@ -1574,7 +1574,7 @@ """print_usage(file : file = stdout) Print the usage message for the current program (self.usage) to - 'file' (default stdout). Any occurence of the string "%prog" in + 'file' (default stdout). Any occurrence of the string "%prog" in self.usage is replaced with the name of the current program (basename of sys.argv[0]). Does nothing if self.usage is empty or not defined. @@ -1592,7 +1592,7 @@ """print_version(file : file = stdout) Print the version message for this program (self.version) to - 'file' (default stdout). As with print_usage(), any occurence + 'file' (default stdout). As with print_usage(), any occurrence of "%prog" in self.version is replaced by the current program's name. Does nothing if self.version is empty or undefined. """ Modified: python/trunk/Lib/plat-mac/bundlebuilder.py ============================================================================== --- python/trunk/Lib/plat-mac/bundlebuilder.py (original) +++ python/trunk/Lib/plat-mac/bundlebuilder.py Sat Feb 21 21:27:01 2009 @@ -669,7 +669,7 @@ if self.use_zipimport: if name != "zlib": # neatly pack all extension modules in a subdirectory, - # except zlib, since it's neccesary for bootstrapping. + # except zlib, since it's necessary for bootstrapping. dstpath = pathjoin("ExtensionModules", dstpath) # Python modules are stored in a Zip archive, but put # extensions in Contents/Resources/. Add a tiny "loader" Modified: python/trunk/Lib/smtpd.py ============================================================================== --- python/trunk/Lib/smtpd.py (original) +++ python/trunk/Lib/smtpd.py Sat Feb 21 21:27:01 2009 @@ -420,7 +420,7 @@ s = StringIO(data) msg = Message.Message(s) # These headers are required for the proper execution of Mailman. All - # MTAs in existance seem to add these if the original message doesn't + # MTAs in existence seem to add these if the original message doesn't # have them. if not msg.getheader('from'): msg['From'] = mailfrom Modified: python/trunk/Lib/subprocess.py ============================================================================== --- python/trunk/Lib/subprocess.py (original) +++ python/trunk/Lib/subprocess.py Sat Feb 21 21:27:01 2009 @@ -494,9 +494,9 @@ To capture standard error in the result, use stderr=subprocess.STDOUT. >>> check_output(["/bin/sh", "-c", - "ls -l non_existant_file ; exit 0"], + "ls -l non_existent_file ; exit 0"], stderr=subprocess.STDOUT) - 'ls: non_existant_file: No such file or directory\n' + 'ls: non_existent_file: No such file or directory\n' """ if 'stdout' in kwargs: raise ValueError('stdout argument not allowed, it will be overridden.') Modified: python/trunk/Lib/tarfile.py ============================================================================== --- python/trunk/Lib/tarfile.py (original) +++ python/trunk/Lib/tarfile.py Sat Feb 21 21:27:01 2009 @@ -1772,7 +1772,7 @@ def getmember(self, name): """Return a TarInfo object for member `name'. If `name' can not be found in the archive, KeyError is raised. If a member occurs more - than once in the archive, its last occurence is assumed to be the + than once in the archive, its last occurrence is assumed to be the most up-to-date version. """ tarinfo = self._getmember(name) Modified: python/trunk/Lib/test/test_calendar.py ============================================================================== --- python/trunk/Lib/test/test_calendar.py (original) +++ python/trunk/Lib/test/test_calendar.py Sat Feb 21 21:27:01 2009 @@ -170,7 +170,7 @@ class OutputTestCase(unittest.TestCase): def normalize_calendar(self, s): - # Filters out locale dependant strings + # Filters out locale dependent strings def neitherspacenordigit(c): return not c.isspace() and not c.isdigit() Modified: python/trunk/Lib/test/test_cfgparser.py ============================================================================== --- python/trunk/Lib/test/test_cfgparser.py (original) +++ python/trunk/Lib/test/test_cfgparser.py Sat Feb 21 21:27:01 2009 @@ -87,11 +87,11 @@ # Make sure the right things happen for remove_option(); # added to include check for SourceForge bug #123324: self.failUnless(cf.remove_option('Foo Bar', 'foo'), - "remove_option() failed to report existance of option") + "remove_option() failed to report existence of option") self.failIf(cf.has_option('Foo Bar', 'foo'), "remove_option() failed to remove option") self.failIf(cf.remove_option('Foo Bar', 'foo'), - "remove_option() failed to report non-existance of option" + "remove_option() failed to report non-existence of option" " that was removed") self.assertRaises(ConfigParser.NoSectionError, @@ -264,7 +264,7 @@ file1 = test_support.findfile("cfgparser.1") # check when we pass a mix of readable and non-readable files: cf = self.newconfig() - parsed_files = cf.read([file1, "nonexistant-file"]) + parsed_files = cf.read([file1, "nonexistent-file"]) self.assertEqual(parsed_files, [file1]) self.assertEqual(cf.get("Foo Bar", "foo"), "newbar") # check when we pass only a filename: @@ -274,7 +274,7 @@ self.assertEqual(cf.get("Foo Bar", "foo"), "newbar") # check when we pass only missing files: cf = self.newconfig() - parsed_files = cf.read(["nonexistant-file"]) + parsed_files = cf.read(["nonexistent-file"]) self.assertEqual(parsed_files, []) # check when we pass no files: cf = self.newconfig() Modified: python/trunk/Lib/test/test_codeccallbacks.py ============================================================================== --- python/trunk/Lib/test/test_codeccallbacks.py (original) +++ python/trunk/Lib/test/test_codeccallbacks.py Sat Feb 21 21:27:01 2009 @@ -109,7 +109,7 @@ # useful that the error handler is not called for every single # unencodable character, but for a complete sequence of # unencodable characters, otherwise we would output many - # unneccessary escape sequences. + # unnecessary escape sequences. def uninamereplace(exc): if not isinstance(exc, UnicodeEncodeError): Modified: python/trunk/Lib/test/test_cookielib.py ============================================================================== --- python/trunk/Lib/test/test_cookielib.py (original) +++ python/trunk/Lib/test/test_cookielib.py Sat Feb 21 21:27:01 2009 @@ -1714,7 +1714,7 @@ counter[key] = counter[key] + 1 self.assert_(not ( - # a permanent cookie got lost accidently + # a permanent cookie got lost accidentally counter["perm_after"] != counter["perm_before"] or # a session cookie hasn't been cleared counter["session_after"] != 0 or Modified: python/trunk/Lib/test/test_descrtut.py ============================================================================== --- python/trunk/Lib/test/test_descrtut.py (original) +++ python/trunk/Lib/test/test_descrtut.py Sat Feb 21 21:27:01 2009 @@ -54,7 +54,7 @@ {1: 3.25} >>> print a[1] # show the new item 3.25 - >>> print a[0] # a non-existant item + >>> print a[0] # a non-existent item 0.0 >>> a.merge({1:100, 2:200}) # use a dict method >>> print sortdict(a) # show the result Modified: python/trunk/Lib/test/test_funcattrs.py ============================================================================== --- python/trunk/Lib/test/test_funcattrs.py (original) +++ python/trunk/Lib/test/test_funcattrs.py Sat Feb 21 21:27:01 2009 @@ -196,7 +196,7 @@ def test_unset_attr(self): for func in [self.b, self.f.a, self.fi.a]: - try: func.non_existant_attr + try: func.non_existent_attr except AttributeError: pass else: self.fail("using unknown attributes should raise " "AttributeError") Modified: python/trunk/Lib/test/test_urllib2net.py ============================================================================== --- python/trunk/Lib/test/test_urllib2net.py (original) +++ python/trunk/Lib/test/test_urllib2net.py Sat Feb 21 21:27:01 2009 @@ -104,7 +104,7 @@ def test_ftp(self): urls = [ 'ftp://ftp.kernel.org/pub/linux/kernel/README', - 'ftp://ftp.kernel.org/pub/linux/kernel/non-existant-file', + 'ftp://ftp.kernel.org/pub/linux/kernel/non-existent-file', #'ftp://ftp.kernel.org/pub/leenox/kernel/test', 'ftp://gatekeeper.research.compaq.com/pub/DEC/SRC' '/research-reports/00README-Legal-Rules-Regs', Modified: python/trunk/Lib/wsgiref/headers.py ============================================================================== --- python/trunk/Lib/wsgiref/headers.py (original) +++ python/trunk/Lib/wsgiref/headers.py Sat Feb 21 21:27:01 2009 @@ -8,7 +8,7 @@ from types import ListType, TupleType # Regular expression that matches `special' characters in parameters, the -# existance of which force quoting of the parameter value. +# existence of which force quoting of the parameter value. import re tspecials = re.compile(r'[ \(\)<>@,;:\\"/\[\]\?=]') Modified: python/trunk/Misc/AIX-NOTES ============================================================================== --- python/trunk/Misc/AIX-NOTES (original) +++ python/trunk/Misc/AIX-NOTES Sat Feb 21 21:27:01 2009 @@ -22,7 +22,7 @@ (2) Stefan Esser (se at MI.Uni-Koeln.DE), in work done to compile Python 1.0.0 on AIX 3.2.4, reports that AIX compilers don't like the LANG environment varaiable set to European locales. This makes the compiler - generate floating point constants using "," as the decimal seperator, + generate floating point constants using "," as the decimal separator, which the assembler doesn't understand (or perhaps it is the other way around, with the assembler expecting, but not getting "," in float numbers). "LANG=C; export LANG" solves the problem, as does Modified: python/trunk/Misc/HISTORY ============================================================================== --- python/trunk/Misc/HISTORY (original) +++ python/trunk/Misc/HISTORY Sat Feb 21 21:27:01 2009 @@ -9862,7 +9862,7 @@ Also (quite separately, but strangely related to the philosophical issue above) fix abspath() so that if win32api exists, it doesn't fail when the path doesn't actually exist -- if GetFullPathName() fails, - fall back on the old strategy (join with getcwd() if neccessary, and + fall back on the old strategy (join with getcwd() if necessary, and then use normpath()). * configure.in, configure, config.h.in, acconfig.h: Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Feb 21 21:27:01 2009 @@ -911,7 +911,7 @@ - Issue #3575: Incremental decoder's decode function now takes bytearray by using 's*' instead of 't#'. -- Issue #2222: Fixed reference leak when occured os.rename() +- Issue #2222: Fixed reference leak when occurred os.rename() fails unicode conversion on 2nd parameter. (windows only) - Issue 2464. urllib2 now supports a malformation in the URL received Modified: python/trunk/Misc/cheatsheet ============================================================================== --- python/trunk/Misc/cheatsheet (original) +++ python/trunk/Misc/cheatsheet Sat Feb 21 21:27:01 2009 @@ -481,7 +481,7 @@ s.isupper() return True if all characters in s are uppercase, False (6) otherwise. s.join(seq) return a concatenation of the strings in the sequence - seq, seperated by 's's. + seq, separated by 's's. s.ljust(width) return s left justified in a string of length width. (1), (8) s.lower() return a copy of s converted to lowercase. @@ -1556,10 +1556,10 @@ asctime( timeTuple), strftime( -format, return a formated string representing time. +format, return a formatted string representing time. timeTuple) mktime(tuple) inverse of localtime(). Return a float. -strptime( parse a formated string representing time, return tuple as in +strptime( parse a formatted string representing time, return tuple as in string[, gmtime(). format]) sleep(secs) Suspend execution for seconds. can be a float. Modified: python/trunk/Modules/_ctypes/libffi/aclocal.m4 ============================================================================== --- python/trunk/Modules/_ctypes/libffi/aclocal.m4 (original) +++ python/trunk/Modules/_ctypes/libffi/aclocal.m4 Sat Feb 21 21:27:01 2009 @@ -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 Modified: python/trunk/Modules/_ctypes/libffi/configure ============================================================================== --- python/trunk/Modules/_ctypes/libffi/configure (original) +++ python/trunk/Modules/_ctypes/libffi/configure Sat Feb 21 21:27:01 2009 @@ -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 Modified: python/trunk/Modules/_ctypes/libffi/src/x86/ffi64.c ============================================================================== --- python/trunk/Modules/_ctypes/libffi/src/x86/ffi64.c (original) +++ python/trunk/Modules/_ctypes/libffi/src/x86/ffi64.c Sat Feb 21 21:27:01 2009 @@ -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). */ Modified: python/trunk/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c ============================================================================== --- python/trunk/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c (original) +++ python/trunk/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c Sat Feb 21 21:27:01 2009 @@ -55,7 +55,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). */ Modified: python/trunk/Modules/_sqlite/connection.c ============================================================================== --- python/trunk/Modules/_sqlite/connection.c (original) +++ python/trunk/Modules/_sqlite/connection.c Sat Feb 21 21:27:01 2009 @@ -845,7 +845,7 @@ PyErr_Clear(); } - /* abort query if error occured */ + /* abort query if error occurred */ rc = 1; } else { rc = (int)PyObject_IsTrue(ret); Modified: python/trunk/Modules/arraymodule.c ============================================================================== --- python/trunk/Modules/arraymodule.c (original) +++ python/trunk/Modules/arraymodule.c Sat Feb 21 21:27:01 2009 @@ -935,7 +935,7 @@ PyDoc_STRVAR(count_doc, "count(x)\n\ \n\ -Return number of occurences of x in the array."); +Return number of occurrences of x in the array."); static PyObject * array_index(arrayobject *self, PyObject *v) @@ -959,7 +959,7 @@ PyDoc_STRVAR(index_doc, "index(x)\n\ \n\ -Return index of first occurence of x in the array."); +Return index of first occurrence of x in the array."); static int array_contains(arrayobject *self, PyObject *v) @@ -1001,7 +1001,7 @@ PyDoc_STRVAR(remove_doc, "remove(x)\n\ \n\ -Remove the first occurence of x in the array."); +Remove the first occurrence of x in the array."); static PyObject * array_pop(arrayobject *self, PyObject *args) @@ -2055,16 +2055,16 @@ append() -- append a new item to the end of the array\n\ buffer_info() -- return information giving the current memory info\n\ byteswap() -- byteswap all the items of the array\n\ -count() -- return number of occurences of an object\n\ +count() -- return number of occurrences of an object\n\ extend() -- extend array by appending multiple elements from an iterable\n\ fromfile() -- read items from a file object\n\ fromlist() -- append items from the list\n\ fromstring() -- append items from the string\n\ -index() -- return index of first occurence of an object\n\ +index() -- return index of first occurrence of an object\n\ insert() -- insert a new item into the array at a provided position\n\ pop() -- remove and return item (default last)\n\ read() -- DEPRECATED, use fromfile()\n\ -remove() -- remove first occurence of an object\n\ +remove() -- remove first occurrence of an object\n\ reverse() -- reverse the order of the items in the array\n\ tofile() -- write all items to a file object\n\ tolist() -- return the array converted to an ordinary list\n\ Modified: python/trunk/Modules/posixmodule.c ============================================================================== --- python/trunk/Modules/posixmodule.c (original) +++ python/trunk/Modules/posixmodule.c Sat Feb 21 21:27:01 2009 @@ -2484,7 +2484,7 @@ static PyObject * posix__getfullpathname(PyObject *self, PyObject *args) { - /* assume encoded strings wont more than double no of chars */ + /* 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); @@ -5113,7 +5113,7 @@ "Your program accessed mem currently in use at xxx" and a hopeful warning about the stability of your system. - Cost is Ctrl+C wont kill children, but anyone + Cost is Ctrl+C won't kill children, but anyone who cares can have a go! */ dwProcessFlags |= CREATE_NEW_CONSOLE; Modified: python/trunk/Objects/abstract.c ============================================================================== --- python/trunk/Objects/abstract.c (original) +++ python/trunk/Objects/abstract.c Sat Feb 21 21:27:01 2009 @@ -2258,7 +2258,7 @@ /* Iterate over seq. Result depends on the operation: PY_ITERSEARCH_COUNT: -1 if error, else # of times obj appears in seq. - PY_ITERSEARCH_INDEX: 0-based index of first occurence of obj in seq; + PY_ITERSEARCH_INDEX: 0-based index of first occurrence of obj in seq; set ValueError and return -1 if none found; also return -1 on error. Py_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on error. */ Modified: python/trunk/Objects/listsort.txt ============================================================================== --- python/trunk/Objects/listsort.txt (original) +++ python/trunk/Objects/listsort.txt Sat Feb 21 21:27:01 2009 @@ -309,7 +309,7 @@ A:10000 B:20000 C:10000 we dare not merge A with C first, because if A, B and C happen to contain -a common element, it would get out of order wrt its occurence(s) in B. The +a common element, it would get out of order wrt its occurrence(s) in B. The merging must be done as (A+B)+C or A+(B+C) instead. So merging is always done on two consecutive runs at a time, and in-place, Modified: python/trunk/Objects/object.c ============================================================================== --- python/trunk/Objects/object.c (original) +++ python/trunk/Objects/object.c Sat Feb 21 21:27:01 2009 @@ -1964,7 +1964,7 @@ none_dealloc(PyObject* ignore) { /* This should never get called, but we also don't want to SEGV if - * we accidently decref None out of existance. + * we accidentally decref None out of existence. */ Py_FatalError("deallocating None"); } Modified: python/trunk/Objects/unicodeobject.c ============================================================================== --- python/trunk/Objects/unicodeobject.c (original) +++ python/trunk/Objects/unicodeobject.c Sat Feb 21 21:27:01 2009 @@ -1704,7 +1704,7 @@ charsleft = (charsleft << 16) | ch; /* out, charsleft, bitsleft = */ ENCODE(out, charsleft, bitsleft); - /* If the next character is special then we dont' need to terminate + /* 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 '-'. */ Modified: python/trunk/PC/_winreg.c ============================================================================== --- python/trunk/PC/_winreg.c (original) +++ python/trunk/PC/_winreg.c Sat Feb 21 21:27:01 2009 @@ -25,7 +25,7 @@ /* The win32api module reports the function name that failed, but this concept is not in the Python core. - Hopefully it will one day, and in the meantime I dont + Hopefully it will one day, and in the meantime I don't want to lose this info... */ #define PyErr_SetFromWindowsErrWithFunction(rc, fnname) \ @@ -690,9 +690,9 @@ ** Note that fixupMultiSZ and countString have both had changes ** made to support "incorrect strings". The registry specification ** calls for strings to be terminated with 2 null bytes. It seems -** some commercial packages install strings which dont conform, +** some commercial packages install strings which don't conform, ** causing this code to fail - however, "regedit" etc still work -** with these strings (ie only we dont!). +** with these strings (ie only we don't!). */ static void fixupMultiSZ(char **str, char *data, int len) Modified: python/trunk/PC/os2vacpp/makefile.omk ============================================================================== --- python/trunk/PC/os2vacpp/makefile.omk (original) +++ python/trunk/PC/os2vacpp/makefile.omk Sat Feb 21 21:27:01 2009 @@ -219,7 +219,7 @@ # zlibmodule.c -- Wrapper of ZLib Compression API (GZip Format) # puremodule.c -- Wrapper of Purify Debugging API (Probably Non-OS/2) - # dlmodule.c -- Some Wierd Form of Data Processing Module + # dlmodule.c -- Some Weird Form of Data Processing Module # xxmodule.c -- Template to Create Your Own Module # Modified: python/trunk/Tools/scripts/texi2html.py ============================================================================== --- python/trunk/Tools/scripts/texi2html.py (original) +++ python/trunk/Tools/scripts/texi2html.py Sat Feb 21 21:27:01 2009 @@ -38,7 +38,7 @@ # rpyron 2002-05-07 # Robert Pyron # 1. BUGFIX: In function makefile(), strip blanks from the nodename. -# This is necesary to match the behavior of parser.makeref() and +# This is necessary to match the behavior of parser.makeref() and # parser.do_node(). # 2. BUGFIX fixed KeyError in end_ifset (well, I may have just made # it go away, rather than fix it) From buildbot at python.org Sat Feb 21 21:56:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 20:56:39 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090221205639.96EEC1E4002@bag.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/1892 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 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_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Feb 21 21:59:34 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 21 Feb 2009 21:59:34 +0100 (CET) Subject: [Python-checkins] r69847 - in python/branches/py3k: Demo/tkinter/matt/menu-all-types-of-entries.py Demo/tkinter/matt/menu-simple.py Doc/howto/webservers.rst Doc/library/io.rst Doc/library/pty.rst Doc/library/subprocess.rst Doc/tutorial/classes.rst Doc/tutorial/datastructures.rst Doc/tutorial/floatingpoint.rst Doc/tutorial/inputoutput.rst Doc/tutorial/stdlib.rst Lib/difflib.py Lib/distutils/tests/test_core.py Lib/email/message.py Lib/idlelib/AutoComplete.py Lib/idlelib/NEWS.txt Lib/io.py Lib/optparse.py Lib/smtpd.py Lib/subprocess.py Lib/tarfile.py Lib/test/test_calendar.py Lib/test/test_cfgparser.py Lib/test/test_codeccallbacks.py Lib/test/test_descrtut.py Lib/test/test_funcattrs.py Lib/test/test_urllib2net.py Lib/tkinter/__init__.py Lib/tkinter/test/test_ttk/test_style.py Lib/tkinter/test/test_ttk/test_widgets.py Lib/turtle.py Lib/wsgiref/headers.py Mac/Tools/bundlebuilder.py Misc/AIX-NOTES Misc/HISTORY Misc/cheatsheet Modules/_ctypes/libffi/aclocal.m4 Modules/_ctypes/libffi/configure Modules/_ctypes/libffi/src/x86/ffi64.c Modules/_ctypes/libffi_osx/x86/x86-ffi64.c Modules/_sqlite/connection.c Modules/arraymodule.c Modules/posixmodule.c Objects/abstract.c Objects/listsort.txt Objects/object.c Objects/unicodeobject.c Tools/scripts/texi2html.py Message-ID: <20090221205934.786F21E4002@bag.python.org> Author: mark.dickinson Date: Sat Feb 21 21:59:32 2009 New Revision: 69847 Log: Merged revisions 69846 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69846 | mark.dickinson | 2009-02-21 20:27:01 +0000 (Sat, 21 Feb 2009) | 2 lines Issue #5341: Fix a variety of spelling errors. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Demo/tkinter/matt/menu-all-types-of-entries.py python/branches/py3k/Demo/tkinter/matt/menu-simple.py python/branches/py3k/Doc/howto/webservers.rst python/branches/py3k/Doc/library/io.rst python/branches/py3k/Doc/library/pty.rst python/branches/py3k/Doc/library/subprocess.rst python/branches/py3k/Doc/tutorial/classes.rst python/branches/py3k/Doc/tutorial/datastructures.rst python/branches/py3k/Doc/tutorial/floatingpoint.rst python/branches/py3k/Doc/tutorial/inputoutput.rst python/branches/py3k/Doc/tutorial/stdlib.rst python/branches/py3k/Lib/difflib.py python/branches/py3k/Lib/distutils/tests/test_core.py python/branches/py3k/Lib/email/message.py python/branches/py3k/Lib/idlelib/AutoComplete.py python/branches/py3k/Lib/idlelib/NEWS.txt python/branches/py3k/Lib/io.py python/branches/py3k/Lib/optparse.py python/branches/py3k/Lib/smtpd.py python/branches/py3k/Lib/subprocess.py python/branches/py3k/Lib/tarfile.py python/branches/py3k/Lib/test/test_calendar.py python/branches/py3k/Lib/test/test_cfgparser.py python/branches/py3k/Lib/test/test_codeccallbacks.py python/branches/py3k/Lib/test/test_descrtut.py python/branches/py3k/Lib/test/test_funcattrs.py python/branches/py3k/Lib/test/test_urllib2net.py python/branches/py3k/Lib/tkinter/__init__.py python/branches/py3k/Lib/tkinter/test/test_ttk/test_style.py python/branches/py3k/Lib/tkinter/test/test_ttk/test_widgets.py python/branches/py3k/Lib/turtle.py python/branches/py3k/Lib/wsgiref/headers.py python/branches/py3k/Mac/Tools/bundlebuilder.py python/branches/py3k/Misc/AIX-NOTES python/branches/py3k/Misc/HISTORY python/branches/py3k/Misc/cheatsheet python/branches/py3k/Modules/_ctypes/libffi/aclocal.m4 python/branches/py3k/Modules/_ctypes/libffi/configure python/branches/py3k/Modules/_ctypes/libffi/src/x86/ffi64.c python/branches/py3k/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c python/branches/py3k/Modules/_sqlite/connection.c python/branches/py3k/Modules/arraymodule.c python/branches/py3k/Modules/posixmodule.c python/branches/py3k/Objects/abstract.c python/branches/py3k/Objects/listsort.txt python/branches/py3k/Objects/object.c python/branches/py3k/Objects/unicodeobject.c python/branches/py3k/Tools/scripts/texi2html.py Modified: python/branches/py3k/Demo/tkinter/matt/menu-all-types-of-entries.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/menu-all-types-of-entries.py (original) +++ python/branches/py3k/Demo/tkinter/matt/menu-all-types-of-entries.py Sat Feb 21 21:59:32 2009 @@ -110,12 +110,12 @@ Cascade_button.menu.choices = Menu(Cascade_button.menu) # ...and this is a menu that cascades from that. - Cascade_button.menu.choices.wierdones = Menu(Cascade_button.menu.choices) + Cascade_button.menu.choices.weirdones = Menu(Cascade_button.menu.choices) # then you define the menus from the deepest level on up. - Cascade_button.menu.choices.wierdones.add_command(label='avacado') - Cascade_button.menu.choices.wierdones.add_command(label='belgian endive') - Cascade_button.menu.choices.wierdones.add_command(label='beefaroni') + Cascade_button.menu.choices.weirdones.add_command(label='avacado') + Cascade_button.menu.choices.weirdones.add_command(label='belgian endive') + Cascade_button.menu.choices.weirdones.add_command(label='beefaroni') # definition of the menu one level up... Cascade_button.menu.choices.add_command(label='Chocolate') @@ -125,8 +125,8 @@ Cascade_button.menu.choices.add_command(label='Rocky Road') Cascade_button.menu.choices.add_command(label='BubbleGum') Cascade_button.menu.choices.add_cascade( - label='Wierd Flavors', - menu=Cascade_button.menu.choices.wierdones) + label='Weird Flavors', + menu=Cascade_button.menu.choices.weirdones) # and finally, the definition for the top level Cascade_button.menu.add_cascade(label='more choices', Modified: python/branches/py3k/Demo/tkinter/matt/menu-simple.py ============================================================================== --- python/branches/py3k/Demo/tkinter/matt/menu-simple.py (original) +++ python/branches/py3k/Demo/tkinter/matt/menu-simple.py Sat Feb 21 21:59:32 2009 @@ -48,7 +48,7 @@ File_button.menu = Menu(File_button) # add an item. The first param is a menu entry type, - # must be one of: "cascade", "checkbutton", "command", "radiobutton", "seperator" + # must be one of: "cascade", "checkbutton", "command", "radiobutton", "separator" # see menu-demo-2.py for examples of use File_button.menu.add_command(label='New...', underline=0, command=new_file) Modified: python/branches/py3k/Doc/howto/webservers.rst ============================================================================== --- python/branches/py3k/Doc/howto/webservers.rst (original) +++ python/branches/py3k/Doc/howto/webservers.rst Sat Feb 21 21:59:32 2009 @@ -426,7 +426,7 @@ user. Typically this component is represented by the templates. * The *controller*. This is the layer between the user and the model. The controller reacts on user actions (like opening some specific URL) and tells - the model to modify the data if neccessary. + the model to modify the data if necessary. While one might think that MVC is a complex design pattern, in fact it is not. It is used in Python because it has turned out to be useful for creating clean, @@ -435,9 +435,9 @@ .. note:: While not all Python frameworks explicitly support MVC, it is often trivial - to create a web site which uses the MVC pattern by seperating the data logic + to create a web site which uses the MVC pattern by separating the data logic (the model) from the user interaction logic (the controller) and the - templates (the view). That's why it is important not to write unneccessary + templates (the view). That's why it is important not to write unnecessary Python code in the templates -- it is against MVC and creates more chaos. .. seealso:: @@ -607,7 +607,7 @@ ----------------------- There is an incredible number of frameworks, so there is no way to describe them -all. It is not even neccessary, as most of these frameworks are nothing special +all. It is not even necessary, as most of these frameworks are nothing special and everything that can be done with these can also be done with one of the popular ones. @@ -679,7 +679,7 @@ Another framework that's already been mentioned is `Pylons`_. Pylons is much like TurboGears with ab even stronger emphasis on flexibility, which is bought at the cost of being more difficult to use. Nearly every component can be -exchanged, which makes it neccessary to use the documentation of every single +exchanged, which makes it necessary to use the documentation of every single component, because there are so many Pylons combinations possible that can satisfy every requirement. Pylons builds upon `Paste `_, an extensive set of tools which are handy for WSGI. Modified: python/branches/py3k/Doc/library/io.rst ============================================================================== --- python/branches/py3k/Doc/library/io.rst (original) +++ python/branches/py3k/Doc/library/io.rst Sat Feb 21 21:59:32 2009 @@ -13,7 +13,7 @@ At the top of the I/O hierarchy is the abstract base class :class:`IOBase`. It defines the basic interface to a stream. Note, however, that there is no -seperation between reading and writing to streams; implementations are allowed +separation between reading and writing to streams; implementations are allowed to throw an :exc:`IOError` if they do not support a given operation. Extending :class:`IOBase` is :class:`RawIOBase` which deals simply with the @@ -611,7 +611,7 @@ is enabled. With this enabled, on input, the lines endings ``'\n'``, ``'\r'``, or ``'\r\n'`` are translated to ``'\n'`` before being returned to the caller. Conversely, on output, ``'\n'`` is translated to the system - default line seperator, :data:`os.linesep`. If *newline* is any other of its + default line separator, :data:`os.linesep`. If *newline* is any other of its legal values, that newline becomes the newline when the file is read and it is returned untranslated. On output, ``'\n'`` is converted to the *newline*. Modified: python/branches/py3k/Doc/library/pty.rst ============================================================================== --- python/branches/py3k/Doc/library/pty.rst (original) +++ python/branches/py3k/Doc/library/pty.rst Sat Feb 21 21:59:32 2009 @@ -13,7 +13,7 @@ concept: starting another process and being able to write to and read from its controlling terminal programmatically. -Because pseudo-terminal handling is highly platform dependant, there is code to +Because pseudo-terminal handling is highly platform dependent, there is code to do it only for SGI and Linux. (The Linux code is supposed to work on other platforms, but hasn't been tested yet.) Modified: python/branches/py3k/Doc/library/subprocess.rst ============================================================================== --- python/branches/py3k/Doc/library/subprocess.rst (original) +++ python/branches/py3k/Doc/library/subprocess.rst Sat Feb 21 21:59:32 2009 @@ -174,9 +174,9 @@ To capture standard error in the result, use stderr=subprocess.STDOUT. >>> subprocess.check_output( - ["/bin/sh", "-c", "ls non_existant_file ; exit 0"], + ["/bin/sh", "-c", "ls non_existent_file ; exit 0"], stderr=subprocess.STDOUT) - 'ls: non_existant_file: No such file or directory\n' + 'ls: non_existent_file: No such file or directory\n' .. versionadded:: 3.1 Modified: python/branches/py3k/Doc/tutorial/classes.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/classes.rst (original) +++ python/branches/py3k/Doc/tutorial/classes.rst Sat Feb 21 21:59:32 2009 @@ -522,7 +522,7 @@ only works if the base class is defined or imported directly in the global scope.) -Python has two builtin functions that work with inheritance: +Python has two built-in functions that work with inheritance: * Use :func:`isinstance` to check an object's type: ``isinstance(obj, int)`` will be ``True`` only if ``obj.__class__`` is :class:`int` or some class Modified: python/branches/py3k/Doc/tutorial/datastructures.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/datastructures.rst (original) +++ python/branches/py3k/Doc/tutorial/datastructures.rst Sat Feb 21 21:59:32 2009 @@ -254,7 +254,7 @@ print(row[i], end="") print() -In real world, you should prefer builtin functions to complex flow statements. +In real world, you should prefer built-in functions to complex flow statements. The :func:`zip` function would do a great job for this use case:: >>> list(zip(*mat)) Modified: python/branches/py3k/Doc/tutorial/floatingpoint.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/floatingpoint.rst (original) +++ python/branches/py3k/Doc/tutorial/floatingpoint.rst Sat Feb 21 21:59:32 2009 @@ -65,7 +65,7 @@ >>> 0.1 0.1000000000000000055511151231257827021181583404541015625 -instead! The Python prompt uses the builtin :func:`repr` function to obtain a +instead! The Python prompt uses the built-in :func:`repr` function to obtain a string version of everything it displays. For floats, ``repr(float)`` rounds the true decimal value to 17 significant digits, giving :: @@ -81,7 +81,7 @@ (although some languages may not *display* the difference by default, or in all output modes). -Python's builtin :func:`str` function produces only 12 significant digits, and +Python's built-in :func:`str` function produces only 12 significant digits, and you may wish to use that instead. It's unusual for ``eval(str(x))`` to reproduce *x*, but the output may be more pleasant to look at:: Modified: python/branches/py3k/Doc/tutorial/inputoutput.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/inputoutput.rst (original) +++ python/branches/py3k/Doc/tutorial/inputoutput.rst Sat Feb 21 21:59:32 2009 @@ -190,7 +190,7 @@ This is particularly useful in combination with the new built-in :func:`vars` function, which returns a dictionary containing all local variables. -For a complete overview of string formating with :meth:`str.format`, see +For a complete overview of string formatting with :meth:`str.format`, see :ref:`formatstrings`. Modified: python/branches/py3k/Doc/tutorial/stdlib.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/stdlib.rst (original) +++ python/branches/py3k/Doc/tutorial/stdlib.rst Sat Feb 21 21:59:32 2009 @@ -21,12 +21,12 @@ >>> os.chdir('/server/accesslogs') Be sure to use the ``import os`` style instead of ``from os import *``. This -will keep :func:`os.open` from shadowing the builtin :func:`open` function which +will keep :func:`os.open` from shadowing the built-in :func:`open` function which operates much differently. .. index:: builtin: help -The builtin :func:`dir` and :func:`help` functions are useful as interactive +The built-in :func:`dir` and :func:`help` functions are useful as interactive aids for working with large modules like :mod:`os`:: >>> import os Modified: python/branches/py3k/Lib/difflib.py ============================================================================== --- python/branches/py3k/Lib/difflib.py (original) +++ python/branches/py3k/Lib/difflib.py Sat Feb 21 21:59:32 2009 @@ -1329,7 +1329,7 @@ (from line tuple, to line tuple, boolean flag) from/to line tuple -- (line num, line text) - line num -- integer or None (to indicate a context seperation) + line num -- integer or None (to indicate a context separation) line text -- original line text with following markers inserted: '\0+' -- marks start of added text '\0-' -- marks start of deleted text Modified: python/branches/py3k/Lib/distutils/tests/test_core.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_core.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_core.py Sat Feb 21 21:59:32 2009 @@ -57,7 +57,7 @@ def test_run_setup_uses_current_dir(self): # This tests that the setup script is run with the current directory - # as it's own current directory; this was temporarily broken by a + # as its own current directory; this was temporarily broken by a # previous patch when TESTFN did not use the current directory. sys.stdout = io.StringIO() cwd = os.getcwd() Modified: python/branches/py3k/Lib/email/message.py ============================================================================== --- python/branches/py3k/Lib/email/message.py (original) +++ python/branches/py3k/Lib/email/message.py Sat Feb 21 21:59:32 2009 @@ -21,7 +21,7 @@ SEMISPACE = '; ' # Regular expression that matches `special' characters in parameters, the -# existance of which force quoting of the parameter value. +# existence of which force quoting of the parameter value. tspecials = re.compile(r'[ \(\)<>@,;:\\"/\[\]\?=]') Modified: python/branches/py3k/Lib/idlelib/AutoComplete.py ============================================================================== --- python/branches/py3k/Lib/idlelib/AutoComplete.py (original) +++ python/branches/py3k/Lib/idlelib/AutoComplete.py Sat Feb 21 21:59:32 2009 @@ -67,7 +67,7 @@ def try_open_completions_event(self, event): """Happens when it would be nice to open a completion list, but not - really neccesary, for example after an dot, so function + really necessary, for example after an dot, so function calls won't be made. """ lastchar = self.text.get("insert-1c") @@ -79,7 +79,7 @@ COMPLETE_FILES) def autocomplete_event(self, event): - """Happens when the user wants to complete his word, and if neccesary, + """Happens when the user wants to complete his word, and if necessary, open a completion list after that (if there is more than one completion) """ Modified: python/branches/py3k/Lib/idlelib/NEWS.txt ============================================================================== --- python/branches/py3k/Lib/idlelib/NEWS.txt (original) +++ python/branches/py3k/Lib/idlelib/NEWS.txt Sat Feb 21 21:59:32 2009 @@ -339,7 +339,7 @@ window raising, especially in the Windows menu and in the debugger. IDLEfork 763524. -- If user passes a non-existant filename on the commandline, just +- If user passes a non-existent filename on the commandline, just open a new file, don't raise a dialog. IDLEfork 854928. Modified: python/branches/py3k/Lib/io.py ============================================================================== --- python/branches/py3k/Lib/io.py (original) +++ python/branches/py3k/Lib/io.py Sat Feb 21 21:59:32 2009 @@ -3,7 +3,7 @@ At the top of the I/O hierarchy is the abstract base class IOBase. It defines the basic interface to a stream. Note, however, that there is no -seperation between reading and writing to streams; implementations are +separation between reading and writing to streams; implementations are allowed to throw an IOError if they do not support a given operation. Extending IOBase is RawIOBase which deals simply with the reading and @@ -1371,7 +1371,7 @@ enabled. With this enabled, on input, the lines endings '\n', '\r', or '\r\n' are translated to '\n' before being returned to the caller. Conversely, on output, '\n' is translated to the system - default line seperator, os.linesep. If newline is any other of its + default line separator, os.linesep. If newline is any other of its legal values, that newline becomes the newline when the file is read and it is returned untranslated. On output, '\n' is converted to the newline. Modified: python/branches/py3k/Lib/optparse.py ============================================================================== --- python/branches/py3k/Lib/optparse.py (original) +++ python/branches/py3k/Lib/optparse.py Sat Feb 21 21:59:32 2009 @@ -1563,7 +1563,7 @@ """print_usage(file : file = stdout) Print the usage message for the current program (self.usage) to - 'file' (default stdout). Any occurence of the string "%prog" in + 'file' (default stdout). Any occurrence of the string "%prog" in self.usage is replaced with the name of the current program (basename of sys.argv[0]). Does nothing if self.usage is empty or not defined. @@ -1581,7 +1581,7 @@ """print_version(file : file = stdout) Print the version message for this program (self.version) to - 'file' (default stdout). As with print_usage(), any occurence + 'file' (default stdout). As with print_usage(), any occurrence of "%prog" in self.version is replaced by the current program's name. Does nothing if self.version is empty or undefined. """ Modified: python/branches/py3k/Lib/smtpd.py ============================================================================== --- python/branches/py3k/Lib/smtpd.py (original) +++ python/branches/py3k/Lib/smtpd.py Sat Feb 21 21:59:32 2009 @@ -419,7 +419,7 @@ s = StringIO(data) msg = Message.Message(s) # These headers are required for the proper execution of Mailman. All - # MTAs in existance seem to add these if the original message doesn't + # MTAs in existence seem to add these if the original message doesn't # have them. if not msg.get('from'): msg['From'] = mailfrom Modified: python/branches/py3k/Lib/subprocess.py ============================================================================== --- python/branches/py3k/Lib/subprocess.py (original) +++ python/branches/py3k/Lib/subprocess.py Sat Feb 21 21:59:32 2009 @@ -446,9 +446,9 @@ To capture standard error in the result, use stderr=subprocess.STDOUT. >>> check_output(["/bin/sh", "-c", - "ls -l non_existant_file ; exit 0"], + "ls -l non_existent_file ; exit 0"], stderr=subprocess.STDOUT) - 'ls: non_existant_file: No such file or directory\n' + 'ls: non_existent_file: No such file or directory\n' """ if 'stdout' in kwargs: raise ValueError('stdout argument not allowed, it will be overridden.') @@ -850,7 +850,7 @@ # cause random failures on win9x. Specifically a # dialog: "Your program accessed mem currently in # use at xxx" and a hopeful warning about the - # stability of your system. Cost is Ctrl+C wont + # stability of your system. Cost is Ctrl+C won't # kill children. creationflags |= CREATE_NEW_CONSOLE Modified: python/branches/py3k/Lib/tarfile.py ============================================================================== --- python/branches/py3k/Lib/tarfile.py (original) +++ python/branches/py3k/Lib/tarfile.py Sat Feb 21 21:59:32 2009 @@ -1753,7 +1753,7 @@ def getmember(self, name): """Return a TarInfo object for member `name'. If `name' can not be found in the archive, KeyError is raised. If a member occurs more - than once in the archive, its last occurence is assumed to be the + than once in the archive, its last occurrence is assumed to be the most up-to-date version. """ tarinfo = self._getmember(name) Modified: python/branches/py3k/Lib/test/test_calendar.py ============================================================================== --- python/branches/py3k/Lib/test/test_calendar.py (original) +++ python/branches/py3k/Lib/test/test_calendar.py Sat Feb 21 21:59:32 2009 @@ -170,7 +170,7 @@ class OutputTestCase(unittest.TestCase): def normalize_calendar(self, s): - # Filters out locale dependant strings + # Filters out locale dependent strings def neitherspacenordigit(c): return not c.isspace() and not c.isdigit() Modified: python/branches/py3k/Lib/test/test_cfgparser.py ============================================================================== --- python/branches/py3k/Lib/test/test_cfgparser.py (original) +++ python/branches/py3k/Lib/test/test_cfgparser.py Sat Feb 21 21:59:32 2009 @@ -82,11 +82,11 @@ # Make sure the right things happen for remove_option(); # added to include check for SourceForge bug #123324: self.failUnless(cf.remove_option('Foo Bar', 'foo'), - "remove_option() failed to report existance of option") + "remove_option() failed to report existence of option") self.failIf(cf.has_option('Foo Bar', 'foo'), "remove_option() failed to remove option") self.failIf(cf.remove_option('Foo Bar', 'foo'), - "remove_option() failed to report non-existance of option" + "remove_option() failed to report non-existence of option" " that was removed") self.assertRaises(configparser.NoSectionError, @@ -254,7 +254,7 @@ file1 = support.findfile("cfgparser.1") # check when we pass a mix of readable and non-readable files: cf = self.newconfig() - parsed_files = cf.read([file1, "nonexistant-file"]) + parsed_files = cf.read([file1, "nonexistent-file"]) self.assertEqual(parsed_files, [file1]) self.assertEqual(cf.get("Foo Bar", "foo"), "newbar") # check when we pass only a filename: @@ -264,7 +264,7 @@ self.assertEqual(cf.get("Foo Bar", "foo"), "newbar") # check when we pass only missing files: cf = self.newconfig() - parsed_files = cf.read(["nonexistant-file"]) + parsed_files = cf.read(["nonexistent-file"]) self.assertEqual(parsed_files, []) # check when we pass no files: cf = self.newconfig() Modified: python/branches/py3k/Lib/test/test_codeccallbacks.py ============================================================================== --- python/branches/py3k/Lib/test/test_codeccallbacks.py (original) +++ python/branches/py3k/Lib/test/test_codeccallbacks.py Sat Feb 21 21:59:32 2009 @@ -109,7 +109,7 @@ # useful that the error handler is not called for every single # unencodable character, but for a complete sequence of # unencodable characters, otherwise we would output many - # unneccessary escape sequences. + # unnecessary escape sequences. def uninamereplace(exc): if not isinstance(exc, UnicodeEncodeError): Modified: python/branches/py3k/Lib/test/test_descrtut.py ============================================================================== --- python/branches/py3k/Lib/test/test_descrtut.py (original) +++ python/branches/py3k/Lib/test/test_descrtut.py Sat Feb 21 21:59:32 2009 @@ -54,7 +54,7 @@ {1: 3.25} >>> print(a[1]) # show the new item 3.25 - >>> print(a[0]) # a non-existant item + >>> print(a[0]) # a non-existent item 0.0 >>> a.merge({1:100, 2:200}) # use a dict method >>> print(sortdict(a)) # show the result 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 Sat Feb 21 21:59:32 2009 @@ -167,7 +167,7 @@ def test_unset_attr(self): for func in [self.b, self.fi.a]: - try: func.non_existant_attr + try: func.non_existent_attr except AttributeError: pass else: self.fail("using unknown attributes should raise " "AttributeError") Modified: python/branches/py3k/Lib/test/test_urllib2net.py ============================================================================== --- python/branches/py3k/Lib/test/test_urllib2net.py (original) +++ python/branches/py3k/Lib/test/test_urllib2net.py Sat Feb 21 21:59:32 2009 @@ -99,7 +99,7 @@ def test_ftp(self): urls = [ 'ftp://ftp.kernel.org/pub/linux/kernel/README', - 'ftp://ftp.kernel.org/pub/linux/kernel/non-existant-file', + 'ftp://ftp.kernel.org/pub/linux/kernel/non-existent-file', #'ftp://ftp.kernel.org/pub/leenox/kernel/test', 'ftp://gatekeeper.research.compaq.com/pub/DEC/SRC' '/research-reports/00README-Legal-Rules-Regs', Modified: python/branches/py3k/Lib/tkinter/__init__.py ============================================================================== --- python/branches/py3k/Lib/tkinter/__init__.py (original) +++ python/branches/py3k/Lib/tkinter/__init__.py Sat Feb 21 21:59:32 2009 @@ -3300,7 +3300,7 @@ """Return the color (red, green, blue) of the pixel at X,Y.""" return self.tk.call(self.name, 'get', x, y) def put(self, data, to=None): - """Put row formated colors to image starting from + """Put row formatted colors to image starting from position TO, e.g. image.put("{red green} {blue yellow}", to=(4,6))""" args = (self.name, 'put', data) if to: Modified: python/branches/py3k/Lib/tkinter/test/test_ttk/test_style.py ============================================================================== --- python/branches/py3k/Lib/tkinter/test/test_ttk/test_style.py (original) +++ python/branches/py3k/Lib/tkinter/test/test_ttk/test_style.py Sat Feb 21 21:59:32 2009 @@ -61,7 +61,7 @@ # correct layout, but "option" doesn't exist as option self.failUnlessRaises(tkinter.TclError, style.layout, 'Treeview', - [('name', {'option': 'inexistant'})]) + [('name', {'option': 'inexistent'})]) def test_theme_use(self): Modified: python/branches/py3k/Lib/tkinter/test/test_ttk/test_widgets.py ============================================================================== --- python/branches/py3k/Lib/tkinter/test/test_ttk/test_widgets.py (original) +++ python/branches/py3k/Lib/tkinter/test/test_ttk/test_widgets.py Sat Feb 21 21:59:32 2009 @@ -861,9 +861,9 @@ # bad values self.failUnlessRaises(tkinter.TclError, - self.tv.reattach, 'nonexistant', '', 'end') + self.tv.reattach, 'nonexistent', '', 'end') self.failUnlessRaises(tkinter.TclError, - self.tv.detach, 'nonexistant') + self.tv.detach, 'nonexistent') self.failUnlessRaises(tkinter.TclError, self.tv.reattach, item2, 'otherparent', 'end') self.failUnlessRaises(tkinter.TclError, @@ -897,7 +897,7 @@ self.tv.delete(item1) self.failUnlessEqual(self.tv.focus(), '') - # try focusing inexistant item + # try focusing inexistent item self.failUnlessRaises(tkinter.TclError, self.tv.focus, 'hi') @@ -1064,11 +1064,11 @@ self.failUnlessEqual(self.tv.item(item, values=None), (123, 'a')) self.failUnlessEqual(self.tv.set(item), {'B': 123}) - # inexistant column + # inexistent column self.failUnlessRaises(tkinter.TclError, self.tv.set, item, 'A') self.failUnlessRaises(tkinter.TclError, self.tv.set, item, 'A', 'b') - # inexistant item + # inexistent item self.failUnlessRaises(tkinter.TclError, self.tv.set, 'notme') Modified: python/branches/py3k/Lib/turtle.py ============================================================================== --- python/branches/py3k/Lib/turtle.py (original) +++ python/branches/py3k/Lib/turtle.py Sat Feb 21 21:59:32 2009 @@ -2793,7 +2793,7 @@ def _drawturtle(self): """Manages the correct rendering of the turtle with respect to - its shape, resizemode, strech and tilt etc.""" + its shape, resizemode, stretch and tilt etc.""" screen = self.screen shape = screen._shapes[self.turtle.shapeIndex] ttype = shape._type Modified: python/branches/py3k/Lib/wsgiref/headers.py ============================================================================== --- python/branches/py3k/Lib/wsgiref/headers.py (original) +++ python/branches/py3k/Lib/wsgiref/headers.py Sat Feb 21 21:59:32 2009 @@ -6,7 +6,7 @@ """ # Regular expression that matches `special' characters in parameters, the -# existance of which force quoting of the parameter value. +# existence of which force quoting of the parameter value. import re tspecials = re.compile(r'[ \(\)<>@,;:\\"/\[\]\?=]') Modified: python/branches/py3k/Mac/Tools/bundlebuilder.py ============================================================================== --- python/branches/py3k/Mac/Tools/bundlebuilder.py (original) +++ python/branches/py3k/Mac/Tools/bundlebuilder.py Sat Feb 21 21:59:32 2009 @@ -658,7 +658,7 @@ if USE_ZIPIMPORT: if name != "zlib": # neatly pack all extension modules in a subdirectory, - # except zlib, since it's neccesary for bootstrapping. + # except zlib, since it's necessary for bootstrapping. dstpath = pathjoin("ExtensionModules", dstpath) # Python modules are stored in a Zip archive, but put # extensions in Contents/Resources/. Add a tiny "loader" Modified: python/branches/py3k/Misc/AIX-NOTES ============================================================================== --- python/branches/py3k/Misc/AIX-NOTES (original) +++ python/branches/py3k/Misc/AIX-NOTES Sat Feb 21 21:59:32 2009 @@ -22,7 +22,7 @@ (2) Stefan Esser (se at MI.Uni-Koeln.DE), in work done to compile Python 1.0.0 on AIX 3.2.4, reports that AIX compilers don't like the LANG environment varaiable set to European locales. This makes the compiler - generate floating point constants using "," as the decimal seperator, + generate floating point constants using "," as the decimal separator, which the assembler doesn't understand (or perhaps it is the other way around, with the assembler expecting, but not getting "," in float numbers). "LANG=C; export LANG" solves the problem, as does Modified: python/branches/py3k/Misc/HISTORY ============================================================================== --- python/branches/py3k/Misc/HISTORY (original) +++ python/branches/py3k/Misc/HISTORY Sat Feb 21 21:59:32 2009 @@ -11247,7 +11247,7 @@ Also (quite separately, but strangely related to the philosophical issue above) fix abspath() so that if win32api exists, it doesn't fail when the path doesn't actually exist -- if GetFullPathName() fails, - fall back on the old strategy (join with getcwd() if neccessary, and + fall back on the old strategy (join with getcwd() if necessary, and then use normpath()). * configure.in, configure, config.h.in, acconfig.h: Modified: python/branches/py3k/Misc/cheatsheet ============================================================================== --- python/branches/py3k/Misc/cheatsheet (original) +++ python/branches/py3k/Misc/cheatsheet Sat Feb 21 21:59:32 2009 @@ -476,7 +476,7 @@ s.isupper() return True if all characters in s are uppercase, False (6) otherwise. s.join(seq) return a concatenation of the strings in the sequence - seq, seperated by 's's. + seq, separated by 's's. s.ljust(width) return s left justified in a string of length width. (1), (8) s.lower() return a copy of s converted to lowercase. @@ -1509,10 +1509,10 @@ asctime( timeTuple), strftime( -format, return a formated string representing time. +format, return a formatted string representing time. timeTuple) mktime(tuple) inverse of localtime(). Return a float. -strptime( parse a formated string representing time, return tuple as in +strptime( parse a formatted string representing time, return tuple as in string[, gmtime(). format]) sleep(secs) Suspend execution for seconds. can be a float. Modified: python/branches/py3k/Modules/_ctypes/libffi/aclocal.m4 ============================================================================== --- python/branches/py3k/Modules/_ctypes/libffi/aclocal.m4 (original) +++ python/branches/py3k/Modules/_ctypes/libffi/aclocal.m4 Sat Feb 21 21:59:32 2009 @@ -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 Modified: python/branches/py3k/Modules/_ctypes/libffi/configure ============================================================================== --- python/branches/py3k/Modules/_ctypes/libffi/configure (original) +++ python/branches/py3k/Modules/_ctypes/libffi/configure Sat Feb 21 21:59:32 2009 @@ -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 Modified: python/branches/py3k/Modules/_ctypes/libffi/src/x86/ffi64.c ============================================================================== --- python/branches/py3k/Modules/_ctypes/libffi/src/x86/ffi64.c (original) +++ python/branches/py3k/Modules/_ctypes/libffi/src/x86/ffi64.c Sat Feb 21 21:59:32 2009 @@ -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). */ Modified: python/branches/py3k/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c ============================================================================== --- python/branches/py3k/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c (original) +++ python/branches/py3k/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c Sat Feb 21 21:59:32 2009 @@ -55,7 +55,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). */ Modified: python/branches/py3k/Modules/_sqlite/connection.c ============================================================================== --- python/branches/py3k/Modules/_sqlite/connection.c (original) +++ python/branches/py3k/Modules/_sqlite/connection.c Sat Feb 21 21:59:32 2009 @@ -770,7 +770,7 @@ PyErr_Clear(); } - /* abort query if error occured */ + /* abort query if error occurred */ rc = 1; } else { rc = (int)PyObject_IsTrue(ret); Modified: python/branches/py3k/Modules/arraymodule.c ============================================================================== --- python/branches/py3k/Modules/arraymodule.c (original) +++ python/branches/py3k/Modules/arraymodule.c Sat Feb 21 21:59:32 2009 @@ -904,7 +904,7 @@ PyDoc_STRVAR(count_doc, "count(x)\n\ \n\ -Return number of occurences of x in the array."); +Return number of occurrences of x in the array."); static PyObject * array_index(arrayobject *self, PyObject *v) @@ -928,7 +928,7 @@ PyDoc_STRVAR(index_doc, "index(x)\n\ \n\ -Return index of first occurence of x in the array."); +Return index of first occurrence of x in the array."); static int array_contains(arrayobject *self, PyObject *v) @@ -970,7 +970,7 @@ PyDoc_STRVAR(remove_doc, "remove(x)\n\ \n\ -Remove the first occurence of x in the array."); +Remove the first occurrence of x in the array."); static PyObject * array_pop(arrayobject *self, PyObject *args) @@ -1982,15 +1982,15 @@ append() -- append a new item to the end of the array\n\ buffer_info() -- return information giving the current memory info\n\ byteswap() -- byteswap all the items of the array\n\ -count() -- return number of occurences of an object\n\ +count() -- return number of occurrences of an object\n\ extend() -- extend array by appending multiple elements from an iterable\n\ fromfile() -- read items from a file object\n\ fromlist() -- append items from the list\n\ fromstring() -- append items from the string\n\ -index() -- return index of first occurence of an object\n\ +index() -- return index of first occurrence of an object\n\ insert() -- insert a new item into the array at a provided position\n\ pop() -- remove and return item (default last)\n\ -remove() -- remove first occurence of an object\n\ +remove() -- remove first occurrence of an object\n\ reverse() -- reverse the order of the items in the array\n\ tofile() -- write all items to a file object\n\ tolist() -- return the array converted to an ordinary list\n\ Modified: python/branches/py3k/Modules/posixmodule.c ============================================================================== --- python/branches/py3k/Modules/posixmodule.c (original) +++ python/branches/py3k/Modules/posixmodule.c Sat Feb 21 21:59:32 2009 @@ -2490,7 +2490,7 @@ static PyObject * posix__getfullpathname(PyObject *self, PyObject *args) { - /* assume encoded strings wont more than double no of chars */ + /* 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); Modified: python/branches/py3k/Objects/abstract.c ============================================================================== --- python/branches/py3k/Objects/abstract.c (original) +++ python/branches/py3k/Objects/abstract.c Sat Feb 21 21:59:32 2009 @@ -1872,7 +1872,7 @@ /* Iterate over seq. Result depends on the operation: PY_ITERSEARCH_COUNT: -1 if error, else # of times obj appears in seq. - PY_ITERSEARCH_INDEX: 0-based index of first occurence of obj in seq; + PY_ITERSEARCH_INDEX: 0-based index of first occurrence of obj in seq; set ValueError and return -1 if none found; also return -1 on error. Py_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on error. */ Modified: python/branches/py3k/Objects/listsort.txt ============================================================================== --- python/branches/py3k/Objects/listsort.txt (original) +++ python/branches/py3k/Objects/listsort.txt Sat Feb 21 21:59:32 2009 @@ -309,7 +309,7 @@ A:10000 B:20000 C:10000 we dare not merge A with C first, because if A, B and C happen to contain -a common element, it would get out of order wrt its occurence(s) in B. The +a common element, it would get out of order wrt its occurrence(s) in B. The merging must be done as (A+B)+C or A+(B+C) instead. So merging is always done on two consecutive runs at a time, and in-place, Modified: python/branches/py3k/Objects/object.c ============================================================================== --- python/branches/py3k/Objects/object.c (original) +++ python/branches/py3k/Objects/object.c Sat Feb 21 21:59:32 2009 @@ -1410,7 +1410,7 @@ none_dealloc(PyObject* ignore) { /* This should never get called, but we also don't want to SEGV if - * we accidently decref None out of existance. + * we accidentally decref None out of existence. */ Py_FatalError("deallocating None"); } Modified: python/branches/py3k/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k/Objects/unicodeobject.c (original) +++ python/branches/py3k/Objects/unicodeobject.c Sat Feb 21 21:59:32 2009 @@ -1927,7 +1927,7 @@ charsleft = (charsleft << 16) | ch; /* out, charsleft, bitsleft = */ ENCODE(out, charsleft, bitsleft); - /* If the next character is special then we dont' need to terminate + /* 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 '-'. */ Modified: python/branches/py3k/Tools/scripts/texi2html.py ============================================================================== --- python/branches/py3k/Tools/scripts/texi2html.py (original) +++ python/branches/py3k/Tools/scripts/texi2html.py Sat Feb 21 21:59:32 2009 @@ -38,7 +38,7 @@ # rpyron 2002-05-07 # Robert Pyron # 1. BUGFIX: In function makefile(), strip blanks from the nodename. -# This is necesary to match the behavior of parser.makeref() and +# This is necessary to match the behavior of parser.makeref() and # parser.do_node(). # 2. BUGFIX fixed KeyError in end_ifset (well, I may have just made # it go away, rather than fix it) From buildbot at python.org Sat Feb 21 22:10:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 21:10:18 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090221211025.2723E1E4039@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/178 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,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Sat Feb 21 22:10:36 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 21 Feb 2009 16:10:36 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090221211036.GA32220@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663885 refs] From buildbot at python.org Sat Feb 21 22:17:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 21:17:31 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090221211731.85B3F1E4002@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/403 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: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Sat Feb 21 22:17:51 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 21 Feb 2009 16:17:51 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090221211751.GA2150@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 [17163 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663157 refs] From buildbot at python.org Sat Feb 21 22:23:33 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 21:23:33 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090221212333.B020A1E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/669 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sat Feb 21 22:26:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 21:26:31 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090221212631.B2CFD1E4002@bag.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/308 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 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 Sat Feb 21 22:33:54 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 21 Feb 2009 22:33:54 +0100 (CET) Subject: [Python-checkins] r69848 - in python/branches/io-c/Lib: _pyio.py test/test_io.py Message-ID: <20090221213354.366831E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 21 22:33:53 2009 New Revision: 69848 Log: fix some more tests broken by bag argument validation Modified: python/branches/io-c/Lib/_pyio.py python/branches/io-c/Lib/test/test_io.py Modified: python/branches/io-c/Lib/_pyio.py ============================================================================== --- python/branches/io-c/Lib/_pyio.py (original) +++ python/branches/io-c/Lib/_pyio.py Sat Feb 21 22:33:53 2009 @@ -820,6 +820,8 @@ """ raw._checkReadable() _BufferedIOMixin.__init__(self, raw) + if buffer_size <= 0: + raise ValueError("invalid buffer size") self.buffer_size = buffer_size self._reset_read_buf() self._read_lock = Lock() @@ -836,6 +838,8 @@ mode. If n is negative, read until EOF or until read() would block. """ + if n is not None and n < -1: + raise ValueError("invalid number of bytes to read") with self._read_lock: return self._read_unlocked(n) @@ -910,7 +914,9 @@ """Reads up to n bytes, with at most one read() system call.""" # Returns up to n bytes. If at least one byte is buffered, we # only return buffered bytes. Otherwise, we do one raw read. - if n <= 0: + if n < 0: + raise ValueError("number of bytes ot read must be positive") + if n == 0: return b"" with self._read_lock: self._peek_unlocked(1) @@ -921,6 +927,8 @@ return self.raw.tell() - len(self._read_buf) + self._read_pos def seek(self, pos, whence=0): + if not (0 <= whence <= 2): + raise ValueError("invalid whence value") with self._read_lock: if whence == 1: pos -= len(self._read_buf) - self._read_pos @@ -942,6 +950,8 @@ buffer_size=DEFAULT_BUFFER_SIZE, max_buffer_size=None): raw._checkWritable() _BufferedIOMixin.__init__(self, raw) + if buffer_size <= 0: + raise ValueError("invalid buffer size") self.buffer_size = buffer_size self.max_buffer_size = (2*buffer_size if max_buffer_size is None @@ -1010,6 +1020,8 @@ return self.raw.tell() + len(self._write_buf) def seek(self, pos, whence=0): + if not (0 <= whence <= 2): + raise ValueError("invalid whence") with self._write_lock: self._flush_unlocked() return self.raw.seek(pos, whence) @@ -1298,6 +1310,8 @@ def __init__(self, buffer, encoding=None, errors=None, newline=None, line_buffering=False): + if newline is not None and not isinstance(newline, str): + raise TypeError("illegal newline type: %r" % (type(newline),)) if newline not in (None, "", "\n", "\r", "\r\n"): raise ValueError("illegal newline value: %r" % (newline,)) if encoding is None: Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Sat Feb 21 22:33:53 2009 @@ -556,11 +556,8 @@ bufio.__init__(rawio, buffer_size=16) self.assertEquals(b"abc", bufio.read()) self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=0) - self.assertRaises(ValueError, bufio.read) self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-16) - self.assertRaises(ValueError, bufio.read) self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1) - self.assertRaises(ValueError, bufio.read) if sys.maxsize > 0x7FFFFFFF: # The allocation can succeed on 32-bit builds, e.g. with more # than 2GB RAM and a 64-bit kernel. @@ -719,6 +716,16 @@ MockRawIO = CMockRawIO MockFileIO = CMockFileIO + def test_initialization(self): + rawio = self.MockRawIO([b"abc"]) + bufio = self.tp(rawio) + self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=0) + self.assertRaises(ValueError, bufio.read) + self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-16) + self.assertRaises(ValueError, bufio.read) + self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1) + self.assertRaises(ValueError, bufio.read) + class PyBufferedReaderTest(BufferedReaderTest): tp = pyio.BufferedReader BlockingIOError = pyio.BlockingIOError @@ -740,11 +747,8 @@ self.assertEquals(3, bufio.write(b"abc")) bufio.flush() self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=0) - self.assertRaises(ValueError, bufio.write, b"def") self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-16) - self.assertRaises(ValueError, bufio.write, b"def") self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1) - self.assertRaises(ValueError, bufio.write, b"def") if sys.maxsize > 0x7FFFFFFF: # The allocation can succeed on 32-bit builds, e.g. with more # than 2GB RAM and a 64-bit kernel. @@ -958,6 +962,17 @@ MisbehavedRawIO = CMisbehavedRawIO MockNonBlockWriterIO = CMockNonBlockWriterIO + def test_initialization(self): + rawio = self.MockRawIO() + bufio = self.tp(rawio) + self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=0) + self.assertRaises(ValueError, bufio.write, b"def") + self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-16) + self.assertRaises(ValueError, bufio.write, b"def") + self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1) + self.assertRaises(ValueError, bufio.write, b"def") + + class PyBufferedWriterTest(BufferedWriterTest): tp = pyio.BufferedWriter BlockingIOError = pyio.BlockingIOError @@ -1302,9 +1317,7 @@ self.assertEquals(t.line_buffering, True) self.assertEquals("\xe9\n", t.readline()) self.assertRaises(TypeError, t.__init__, b, newline=42) - self.assertRaises(ValueError, t.read) self.assertRaises(ValueError, t.__init__, b, newline='xyzzy') - self.assertRaises(ValueError, t.read) def testLineBuffering(self): r = self.BytesIO() @@ -1792,6 +1805,15 @@ TextIOWrapper = io.TextIOWrapper BytesIO = io.BytesIO + def test_initialization(self): + r = self.BytesIO(b"\xc3\xa9\n\n") + b = self.BufferedReader(r, 1000) + t = self.TextIOWrapper(b) + self.assertRaises(TypeError, t.__init__, b, newline=42) + self.assertRaises(ValueError, t.read) + self.assertRaises(ValueError, t.__init__, b, newline='xyzzy') + self.assertRaises(ValueError, t.read) + class PyTextIOWrapperTest(TextIOWrapperTest): open = staticmethod(pyio.open) BufferedReader = pyio.BufferedReader From python-checkins at python.org Sat Feb 21 23:10:21 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 21 Feb 2009 23:10:21 +0100 (CET) Subject: [Python-checkins] r69849 - python/branches/py3k/Lib/heapq.py Message-ID: <20090221221021.41BF21E4002@bag.python.org> Author: raymond.hettinger Date: Sat Feb 21 23:10:18 2009 New Revision: 69849 Log: Port r69838: Speedup and simplify negative counter using count's new step argument. Modified: python/branches/py3k/Lib/heapq.py Modified: python/branches/py3k/Lib/heapq.py ============================================================================== --- python/branches/py3k/Lib/heapq.py (original) +++ python/branches/py3k/Lib/heapq.py Sat Feb 21 23:10:18 2009 @@ -130,7 +130,7 @@ 'nlargest', 'nsmallest', 'heappushpop'] from itertools import islice, repeat, count, tee, chain -from operator import itemgetter, neg +from operator import itemgetter import bisect def heappush(heap, item): @@ -413,13 +413,13 @@ # When key is none, use simpler decoration if key is None: - it = zip(iterable, map(neg, count())) # decorate + it = zip(iterable, count(0,-1)) # decorate result = _nlargest(n, it) return list(map(itemgetter(0), result)) # undecorate # General case, slowest method in1, in2 = tee(iterable) - it = zip(map(key, in1), map(neg, count()), in2) # decorate + it = zip(map(key, in1), count(0,-1), in2) # decorate result = _nlargest(n, it) return list(map(itemgetter(2), result)) # undecorate From python-checkins at python.org Sat Feb 21 23:16:42 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 21 Feb 2009 23:16:42 +0100 (CET) Subject: [Python-checkins] r69850 - python/branches/io-c/Lib/_pyio.py Message-ID: <20090221221642.79E3E1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 21 23:16:42 2009 New Revision: 69850 Log: make the python IncrementalNewineDecoder support a None decoder Modified: python/branches/io-c/Lib/_pyio.py Modified: python/branches/io-c/Lib/_pyio.py ============================================================================== --- python/branches/io-c/Lib/_pyio.py (original) +++ python/branches/io-c/Lib/_pyio.py Sat Feb 21 23:16:42 2009 @@ -1222,7 +1222,10 @@ def decode(self, input, final=False): # decode input (with the eventual \r from a previous pass) - output = self.decoder.decode(input, final=final) + if self.decoder is None: + output = input + else: + output = self.decoder.decode(input, final=final) if self.pendingcr and (output or final): output = "\r" + output self.pendingcr = False @@ -1249,7 +1252,11 @@ return output def getstate(self): - buf, flag = self.decoder.getstate() + if self.decoder is None: + buf = b"" + flag = 0 + else: + buf, flag = self.decoder.getstate() flag <<= 1 if self.pendingcr: flag |= 1 @@ -1258,12 +1265,14 @@ def setstate(self, state): buf, flag = state self.pendingcr = bool(flag & 1) - self.decoder.setstate((buf, flag >> 1)) + if self.decoder is not None: + self.decoder.setstate((buf, flag >> 1)) def reset(self): self.seennl = 0 self.pendingcr = False - self.decoder.reset() + if self.decoder is not None: + self.decoder.reset() _LF = 1 _CR = 2 From python-checkins at python.org Sat Feb 21 23:30:13 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 21 Feb 2009 23:30:13 +0100 (CET) Subject: [Python-checkins] r69851 - in python/branches/py3k: Lib/test/test_itertools.py Modules/itertoolsmodule.c Message-ID: <20090221223013.19B031E4002@bag.python.org> Author: raymond.hettinger Date: Sat Feb 21 23:30:12 2009 New Revision: 69851 Log: Port r69837: Fix keyword arguments for itertools.count(). Step arg without a start arg was ignored. Modified: python/branches/py3k/Lib/test/test_itertools.py python/branches/py3k/Modules/itertoolsmodule.c Modified: python/branches/py3k/Lib/test/test_itertools.py ============================================================================== --- python/branches/py3k/Lib/test/test_itertools.py (original) +++ python/branches/py3k/Lib/test/test_itertools.py Sat Feb 21 23:30:12 2009 @@ -354,6 +354,10 @@ def test_count_with_stride(self): self.assertEqual(lzip('abc',count(2,3)), [('a', 2), ('b', 5), ('c', 8)]) + self.assertEqual(lzip('abc',count(start=2,step=3)), + [('a', 2), ('b', 5), ('c', 8)]) + self.assertEqual(lzip('abc',count(step=-1)), + [('a', 0), ('b', -1), ('c', -2)]) self.assertEqual(lzip('abc',count(2,0)), [('a', 2), ('b', 2), ('c', 2)]) self.assertEqual(lzip('abc',count(2,1)), [('a', 2), ('b', 3), ('c', 4)]) self.assertEqual(lzip('abc',count(2,3)), [('a', 2), ('b', 5), ('c', 8)]) Modified: python/branches/py3k/Modules/itertoolsmodule.c ============================================================================== --- python/branches/py3k/Modules/itertoolsmodule.c (original) +++ python/branches/py3k/Modules/itertoolsmodule.c Sat Feb 21 23:30:12 2009 @@ -2892,19 +2892,19 @@ /* Counting logic and invariants: -C_add_mode: when cnt an integer < PY_SSIZE_T_MAX and no step is specified. +fast_mode: when cnt an integer < PY_SSIZE_T_MAX and no step is specified. assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL && long_step==PyInt(1)); Advances with: cnt += 1 - When count hits Y_SSIZE_T_MAX, switch to Py_add_mode. + When count hits Y_SSIZE_T_MAX, switch to slow_mode. -Py_add_mode: when cnt == PY_SSIZE_T_MAX, step is not int(1), or cnt is a float. +slow_mode: when cnt == PY_SSIZE_T_MAX, step is not int(1), or cnt is a float. assert(cnt == PY_SSIZE_T_MAX && long_cnt != NULL && long_step != NULL); All counting is done with python objects (no overflows or underflows). Advances with: long_cnt += long_step Step may be zero -- effectively a slow version of repeat(cnt). - Either long_cnt or long_step may be a float. + Either long_cnt or long_step may be a float, Fraction, or Decimal. */ static PyTypeObject count_type; @@ -2913,6 +2913,7 @@ count_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { countobject *lz; + int slow_mode = 0; Py_ssize_t cnt = 0; PyObject *long_cnt = NULL; PyObject *long_step = NULL; @@ -2922,36 +2923,51 @@ kwlist, &long_cnt, &long_step)) return NULL; - if ((long_cnt != NULL && !PyNumber_Check(long_cnt)) || - (long_step != NULL && !PyNumber_Check(long_step))) { + if (long_cnt != NULL && !PyNumber_Check(long_cnt) || + long_step != NULL && !PyNumber_Check(long_step)) { PyErr_SetString(PyExc_TypeError, "a number is required"); return NULL; } + if (long_cnt != NULL) { + cnt = PyLong_AsSsize_t(long_cnt); + if (cnt == -1 && PyErr_Occurred() || !PyLong_Check(long_cnt)) { + PyErr_Clear(); + slow_mode = 1; + } + Py_INCREF(long_cnt); + } else { + cnt = 0; + long_cnt = PyLong_FromLong(0); + } + + /* If not specified, step defaults to 1 */ if (long_step == NULL) { - /* If not specified, step defaults to 1 */ long_step = PyLong_FromLong(1); - if (long_step == NULL) + if (long_step == NULL) { + Py_DECREF(long_cnt); return NULL; + } } else Py_INCREF(long_step); - assert(long_step != NULL); - if (long_cnt != NULL) { - cnt = PyLong_AsSsize_t(long_cnt); - if ((cnt == -1 && PyErr_Occurred()) || - !PyIndex_Check(long_cnt) || - !PyLong_Check(long_step) || - PyLong_AS_LONG(long_step) != 1) { - /* Switch to Py_add_mode */ - PyErr_Clear(); - Py_INCREF(long_cnt); - cnt = PY_SSIZE_T_MAX; - } else - long_cnt = NULL; + assert(long_cnt != NULL && long_step != NULL); + + /* Fast mode only works when the step is 1 */ + if (!PyLong_Check(long_step) || + PyLong_AS_LONG(long_step) != 1) { + slow_mode = 1; } - assert((cnt != PY_SSIZE_T_MAX && long_cnt == NULL) || - (cnt == PY_SSIZE_T_MAX && long_cnt != NULL)); + + if (slow_mode) + cnt = PY_SSIZE_T_MAX; + else + Py_CLEAR(long_cnt); + + assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL && !slow_mode || + cnt == PY_SSIZE_T_MAX && long_cnt != NULL && slow_mode); + assert(slow_mode || + PyLong_Check(long_step) && PyLong_AS_LONG(long_step) == 1); /* create countobject structure */ lz = (countobject *)type->tp_alloc(type, 0); @@ -2991,7 +3007,7 @@ long_cnt = lz->long_cnt; if (long_cnt == NULL) { - /* Switch to Py_add_mode */ + /* Switch to slow_mode */ long_cnt = PyLong_FromSsize_t(PY_SSIZE_T_MAX); if (long_cnt == NULL) return NULL; @@ -3034,11 +3050,10 @@ } PyDoc_STRVAR(count_doc, - "count([start[, step]]) --> count object\n\ + "count(start=0, step=1]) --> count object\n\ \n\ -Return a count object whose .__next__() method returns consecutive\n\ -integers starting from zero or, if specified, from start.\n\ -If step is specified, counts by that interval. Equivalent to:\n\n\ +Return a count object whose .__next__() method returns consecutive values.\n\ +Equivalent to:\n\n\ def count(firstval=0, step=1):\n\ x = firstval\n\ while 1:\n\ From python-checkins at python.org Sat Feb 21 23:36:09 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 21 Feb 2009 23:36:09 +0100 (CET) Subject: [Python-checkins] r69852 - python/branches/io-c/Lib/_pyio.py Message-ID: <20090221223609.DB7EA1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 21 23:36:09 2009 New Revision: 69852 Log: fix a BlockingIOError.characters_written bug Modified: python/branches/io-c/Lib/_pyio.py Modified: python/branches/io-c/Lib/_pyio.py ============================================================================== --- python/branches/io-c/Lib/_pyio.py (original) +++ python/branches/io-c/Lib/_pyio.py Sat Feb 21 23:36:09 2009 @@ -986,8 +986,9 @@ # We've hit max_buffer_size. We have to accept a # partial write and cut back our buffer. overage = len(self._write_buf) - self.max_buffer_size + written -= overage self._write_buf = self._write_buf[:self.max_buffer_size] - raise BlockingIOError(e.errno, e.strerror, overage) + raise BlockingIOError(e.errno, e.strerror, written) return written def truncate(self, pos=None): From python-checkins at python.org Sat Feb 21 23:39:38 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 21 Feb 2009 23:39:38 +0100 (CET) Subject: [Python-checkins] r69853 - python/branches/py3k Message-ID: <20090221223938.BA76A1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 21 23:39:38 2009 New Revision: 69853 Log: Blocked revisions 69837-69838 via svnmerge ........ r69837 | raymond.hettinger | 2009-02-21 01:17:22 -0600 (Sat, 21 Feb 2009) | 4 lines Fix keyword arguments for itertools.count(). Step arg without a start arg was ignored. ........ r69838 | raymond.hettinger | 2009-02-21 02:58:42 -0600 (Sat, 21 Feb 2009) | 1 line Speedup and simplify negative counter using count's new step argument. ........ Modified: python/branches/py3k/ (props changed) From nnorwitz at gmail.com Sat Feb 21 23:42:09 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 21 Feb 2009 17:42:09 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090221224209.GA14268@python.psfb.org> 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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-32243 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 test_slice test_smtplib test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [677587 refs] From python-checkins at python.org Sat Feb 21 23:49:04 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 21 Feb 2009 23:49:04 +0100 (CET) Subject: [Python-checkins] r69854 - python/branches/io-c/Lib/_pyio.py Message-ID: <20090221224904.165A41E400C@bag.python.org> Author: benjamin.peterson Date: Sat Feb 21 23:49:02 2009 New Revision: 69854 Log: check whence Modified: python/branches/io-c/Lib/_pyio.py Modified: python/branches/io-c/Lib/_pyio.py ============================================================================== --- python/branches/io-c/Lib/_pyio.py (original) +++ python/branches/io-c/Lib/_pyio.py Sat Feb 21 23:49:02 2009 @@ -1111,6 +1111,8 @@ BufferedWriter.__init__(self, raw, buffer_size, max_buffer_size) def seek(self, pos, whence=0): + if not (0 <= whence <= 2): + raise ValueError("invalid whence") self.flush() # First do the raw seek, then empty the read buffer, so that # if the raw seek fails, we don't lose buffered data forever. From buildbot at python.org Sat Feb 21 23:49:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 22:49:29 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090221224929.317CE1E400C@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/353 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_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Feb 22 00:09:35 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 22 Feb 2009 00:09:35 +0100 (CET) Subject: [Python-checkins] r69855 - python/trunk/Modules/itertoolsmodule.c Message-ID: <20090221230935.290DC1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 22 00:09:33 2009 New Revision: 69855 Log: fix compiler warnings Modified: python/trunk/Modules/itertoolsmodule.c Modified: python/trunk/Modules/itertoolsmodule.c ============================================================================== --- python/trunk/Modules/itertoolsmodule.c (original) +++ python/trunk/Modules/itertoolsmodule.c Sun Feb 22 00:09:33 2009 @@ -3240,15 +3240,15 @@ kwlist, &long_cnt, &long_step)) return NULL; - if (long_cnt != NULL && !PyNumber_Check(long_cnt) || - long_step != NULL && !PyNumber_Check(long_step)) { + if ((long_cnt != NULL && !PyNumber_Check(long_cnt)) || + (long_step != NULL && !PyNumber_Check(long_step))) { PyErr_SetString(PyExc_TypeError, "a number is required"); return NULL; } if (long_cnt != NULL) { cnt = PyInt_AsSsize_t(long_cnt); - if (cnt == -1 && PyErr_Occurred() || !PyInt_Check(long_cnt)) { + if ((cnt == -1 && PyErr_Occurred()) || !PyInt_Check(long_cnt)) { PyErr_Clear(); slow_mode = 1; } @@ -3281,10 +3281,10 @@ else Py_CLEAR(long_cnt); - assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL && !slow_mode || - cnt == PY_SSIZE_T_MAX && long_cnt != NULL && slow_mode); + assert((cnt != PY_SSIZE_T_MAX && long_cnt == NULL && !slow_mode) || + (cnt == PY_SSIZE_T_MAX && long_cnt != NULL && slow_mode)); assert(slow_mode || - PyInt_Check(long_step) && PyInt_AS_LONG(long_step) == 1); + (PyInt_Check(long_step) && PyInt_AS_LONG(long_step) == 1)); /* create countobject structure */ lz = (countobject *)type->tp_alloc(type, 0); From python-checkins at python.org Sun Feb 22 00:12:26 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 22 Feb 2009 00:12:26 +0100 (CET) Subject: [Python-checkins] r69856 - python/branches/py3k/Lib/importlib/_bootstrap.py Message-ID: <20090221231226.9C2991E4002@bag.python.org> Author: brett.cannon Date: Sun Feb 22 00:12:24 2009 New Revision: 69856 Log: Relocate source_mtime in importlib to PyPycLoader. Modified: python/branches/py3k/Lib/importlib/_bootstrap.py Modified: python/branches/py3k/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/py3k/Lib/importlib/_bootstrap.py (original) +++ python/branches/py3k/Lib/importlib/_bootstrap.py Sun Feb 22 00:12:24 2009 @@ -320,7 +320,7 @@ """Loader base class for Python source. Requires implementing the optional PEP 302 protocols as well as - source_mtime and source_path. + source_path. """ @@ -371,7 +371,7 @@ """Loader base class for Python source and bytecode. Requires implementing the methods needed for PyLoader as well as - bytecode_path and write_bytecode. + source_mtime, bytecode_path, and write_bytecode. """ @@ -461,16 +461,6 @@ # Not a property so that it is easy to override. return self._find_path(imp.PY_SOURCE) - - @check_name - def source_mtime(self, name): - """Return the modification time of the source for the specified - module.""" - source_path = self.source_path(name) - if not source_path: - return None - return int(_os.stat(source_path).st_mtime) - @check_name def get_source(self, fullname): """Return the source for the module as a string. @@ -505,12 +495,20 @@ return self._is_pkg -# XXX Rename _PyFileLoader throughout class PyPycFileLoader(PyPycLoader, PyFileLoader): """Load a module from a source or bytecode file.""" @check_name + def source_mtime(self, name): + """Return the modification time of the source for the specified + module.""" + source_path = self.source_path(name) + if not source_path: + return None + return int(_os.stat(source_path).st_mtime) + + @check_name def bytecode_path(self, fullname): """Return the path to a bytecode file, or None if one does not exist.""" From python-checkins at python.org Sun Feb 22 00:14:56 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 22 Feb 2009 00:14:56 +0100 (CET) Subject: [Python-checkins] r69857 - in python/branches/py3k: Modules/itertoolsmodule.c Message-ID: <20090221231456.ADBA31E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 22 00:14:55 2009 New Revision: 69857 Log: Merged revisions 69855 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69855 | benjamin.peterson | 2009-02-21 17:09:33 -0600 (Sat, 21 Feb 2009) | 1 line fix compiler warnings ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Modules/itertoolsmodule.c Modified: python/branches/py3k/Modules/itertoolsmodule.c ============================================================================== --- python/branches/py3k/Modules/itertoolsmodule.c (original) +++ python/branches/py3k/Modules/itertoolsmodule.c Sun Feb 22 00:14:55 2009 @@ -2923,15 +2923,15 @@ kwlist, &long_cnt, &long_step)) return NULL; - if (long_cnt != NULL && !PyNumber_Check(long_cnt) || - long_step != NULL && !PyNumber_Check(long_step)) { + if ((long_cnt != NULL && !PyNumber_Check(long_cnt)) || + (long_step != NULL && !PyNumber_Check(long_step))) { PyErr_SetString(PyExc_TypeError, "a number is required"); return NULL; } if (long_cnt != NULL) { cnt = PyLong_AsSsize_t(long_cnt); - if (cnt == -1 && PyErr_Occurred() || !PyLong_Check(long_cnt)) { + if ((cnt == -1 && PyErr_Occurred()) || !PyLong_Check(long_cnt)) { PyErr_Clear(); slow_mode = 1; } @@ -2964,10 +2964,10 @@ else Py_CLEAR(long_cnt); - assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL && !slow_mode || - cnt == PY_SSIZE_T_MAX && long_cnt != NULL && slow_mode); + assert((cnt != PY_SSIZE_T_MAX && long_cnt == NULL && !slow_mode) || + (cnt == PY_SSIZE_T_MAX && long_cnt != NULL && slow_mode)); assert(slow_mode || - PyLong_Check(long_step) && PyLong_AS_LONG(long_step) == 1); + (PyLong_Check(long_step) && PyLong_AS_LONG(long_step) == 1)); /* create countobject structure */ lz = (countobject *)type->tp_alloc(type, 0); From python-checkins at python.org Sun Feb 22 00:20:57 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sun, 22 Feb 2009 00:20:57 +0100 (CET) Subject: [Python-checkins] r69858 - python/branches/py3k/Lib/heapq.py Message-ID: <20090221232057.E97181E4027@bag.python.org> Author: raymond.hettinger Date: Sun Feb 22 00:20:57 2009 New Revision: 69858 Log: In Py3.x, a list comprehension is now faster than list(map(itemgetter(0), iterable)). Modified: python/branches/py3k/Lib/heapq.py Modified: python/branches/py3k/Lib/heapq.py ============================================================================== --- python/branches/py3k/Lib/heapq.py (original) +++ python/branches/py3k/Lib/heapq.py Sun Feb 22 00:20:57 2009 @@ -130,7 +130,6 @@ 'nlargest', 'nsmallest', 'heappushpop'] from itertools import islice, repeat, count, tee, chain -from operator import itemgetter import bisect def heappush(heap, item): @@ -377,13 +376,13 @@ if key is None: it = zip(iterable, count()) # decorate result = _nsmallest(n, it) - return list(map(itemgetter(0), result)) # undecorate + return [r[0] for r in result] # undecorate # General case, slowest method in1, in2 = tee(iterable) it = zip(map(key, in1), count(), in2) # decorate result = _nsmallest(n, it) - return list(map(itemgetter(2), result)) # undecorate + return [r[2] for r in result] # undecorate _nlargest = nlargest def nlargest(n, iterable, key=None): @@ -415,13 +414,13 @@ if key is None: it = zip(iterable, count(0,-1)) # decorate result = _nlargest(n, it) - return list(map(itemgetter(0), result)) # undecorate + return [r[0] for r in result] # undecorate # General case, slowest method in1, in2 = tee(iterable) it = zip(map(key, in1), count(0,-1), in2) # decorate result = _nlargest(n, it) - return list(map(itemgetter(2), result)) # undecorate + return [r[2] for r in result] # undecorate if __name__ == "__main__": # Simple sanity test From python-checkins at python.org Sun Feb 22 00:27:02 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sun, 22 Feb 2009 00:27:02 +0100 (CET) Subject: [Python-checkins] r69859 - python/branches/release30-maint/Lib/heapq.py Message-ID: <20090221232702.AA5E21E4002@bag.python.org> Author: raymond.hettinger Date: Sun Feb 22 00:27:02 2009 New Revision: 69859 Log: Backport 69858: In Py3.x, a list comprehension is now faster than list(map(itemgetter(0), iterable)). Modified: python/branches/release30-maint/Lib/heapq.py Modified: python/branches/release30-maint/Lib/heapq.py ============================================================================== --- python/branches/release30-maint/Lib/heapq.py (original) +++ python/branches/release30-maint/Lib/heapq.py Sun Feb 22 00:27:02 2009 @@ -130,7 +130,7 @@ 'nlargest', 'nsmallest', 'heappushpop'] from itertools import islice, repeat, count, tee -from operator import itemgetter, neg +from operator import neg import bisect def heappush(heap, item): @@ -357,11 +357,11 @@ if key is None: it = zip(iterable, count()) # decorate result = _nsmallest(n, it) - return list(map(itemgetter(0), result)) # undecorate + return [r[0] for r in result] # undecorate in1, in2 = tee(iterable) it = zip(map(key, in1), count(), in2) # decorate result = _nsmallest(n, it) - return list(map(itemgetter(2), result)) # undecorate + return [r[2] for r in result] # undecorate _nlargest = nlargest def nlargest(n, iterable, key=None): @@ -372,11 +372,11 @@ if key is None: it = zip(iterable, map(neg, count())) # decorate result = _nlargest(n, it) - return list(map(itemgetter(0), result)) # undecorate + return [r[0] for r in result] # undecorate in1, in2 = tee(iterable) it = zip(map(key, in1), map(neg, count()), in2) # decorate result = _nlargest(n, it) - return list(map(itemgetter(2), result)) # undecorate + return [r[2] for r in result] # undecorate if __name__ == "__main__": # Simple sanity test From buildbot at python.org Sun Feb 22 00:35:46 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 23:35:46 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090221233546.B3A761E400C@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/902 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/threading.py", line 522, 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_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Feb 22 00:42:51 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 22 Feb 2009 00:42:51 +0100 (CET) Subject: [Python-checkins] r69860 - in python/branches/io-c/Lib: _pyio.py test/test_io.py Message-ID: <20090221234251.16E891E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 22 00:42:50 2009 New Revision: 69860 Log: fix some of these Misbehaving io tests Modified: python/branches/io-c/Lib/_pyio.py python/branches/io-c/Lib/test/test_io.py Modified: python/branches/io-c/Lib/_pyio.py ============================================================================== --- python/branches/io-c/Lib/_pyio.py (original) +++ python/branches/io-c/Lib/_pyio.py Sun Feb 22 00:42:50 2009 @@ -643,10 +643,16 @@ ### Positioning ### def seek(self, pos, whence=0): - return self.raw.seek(pos, whence) + new_position = self.raw.seek(pos, whence) + if new_position < 0: + raise IOError("seek() returned an invalid position") + return new_position def tell(self): - return self.raw.tell() + pos = self.raw.tell() + if pos < 0: + raise IOError("tell() returned an invalid position") + return pos def truncate(self, pos=None): # Flush the stream. We're mixing buffered I/O with lower-level I/O, @@ -924,7 +930,7 @@ min(n, len(self._read_buf) - self._read_pos)) def tell(self): - return self.raw.tell() - len(self._read_buf) + self._read_pos + return super().tell() - len(self._read_buf) + self._read_pos def seek(self, pos, whence=0): if not (0 <= whence <= 2): @@ -932,7 +938,7 @@ with self._read_lock: if whence == 1: pos -= len(self._read_buf) - self._read_pos - pos = self.raw.seek(pos, whence) + pos = super().seek(pos, whence) self._reset_read_buf() return pos @@ -1009,6 +1015,8 @@ try: while self._write_buf: n = self.raw.write(self._write_buf) + if n > len(self._write_buf) or n < 0: + raise IOError("write() returned incorrect number of bytes") del self._write_buf[:n] written += n except BlockingIOError as e: @@ -1018,14 +1026,14 @@ raise BlockingIOError(e.errno, e.strerror, written) def tell(self): - return self.raw.tell() + len(self._write_buf) + return super().tell() + len(self._write_buf) def seek(self, pos, whence=0): if not (0 <= whence <= 2): raise ValueError("invalid whence") with self._write_lock: self._flush_unlocked() - return self.raw.seek(pos, whence) + return super().seek(pos, whence) class BufferedRWPair(BufferedIOBase): @@ -1116,14 +1124,14 @@ self.flush() # First do the raw seek, then empty the read buffer, so that # if the raw seek fails, we don't lose buffered data forever. - pos = self.raw.seek(pos, whence) + pos = super().seek(pos, whence) with self._read_lock: self._reset_read_buf() return pos def tell(self): if self._write_buf: - return self.raw.tell() + len(self._write_buf) + return super().tell() + len(self._write_buf) else: return BufferedReader.tell(self) Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Sun Feb 22 00:42:50 2009 @@ -696,7 +696,6 @@ bufio = self.tp(rawio) self.assertRaises(IOError, bufio.seek, 0) self.assertRaises(IOError, bufio.tell) - self.assertRaises(IOError, bufio.read, 10) def test_garbage_collection(self): # BufferedReader objects are collected @@ -726,6 +725,13 @@ self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1) self.assertRaises(ValueError, bufio.read) + def testMisbehavedRawIORead(self): + rawio = self.MisbehavedRawIO((b"abc", b"d", b"efg")) + bufio = self.tp(rawio) + # _pyio.BufferedReader seems to implement reading different, so that + # checking this is not so easy. + self.assertRaises(IOError, bufio.read, 10) + class PyBufferedReaderTest(BufferedReaderTest): tp = pyio.BufferedReader BlockingIOError = pyio.BlockingIOError From buildbot at python.org Sun Feb 22 00:45:33 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 21 Feb 2009 23:45:33 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090221234533.F29221E4002@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/318 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,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Feb 22 01:07:45 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 22 Feb 2009 01:07:45 +0100 (CET) Subject: [Python-checkins] r69861 - in python/trunk/Doc/distutils: setupscript.rst sourcedist.rst Message-ID: <20090222000745.E04241E4002@bag.python.org> Author: tarek.ziade Date: Sun Feb 22 01:07:45 2009 New Revision: 69861 Log: using versionchanged instead of versionadded for distutils doc on sdist default files Modified: python/trunk/Doc/distutils/setupscript.rst python/trunk/Doc/distutils/sourcedist.rst Modified: python/trunk/Doc/distutils/setupscript.rst ============================================================================== --- python/trunk/Doc/distutils/setupscript.rst (original) +++ python/trunk/Doc/distutils/setupscript.rst Sun Feb 22 01:07:45 2009 @@ -450,10 +450,9 @@ scripts=['scripts/xmlproc_parse', 'scripts/xmlproc_val'] ) -All the scripts will also be added to the ``MANIFEST`` -file if no template is provided. See :ref:`manifest`. - -.. versionadded:: 2.7 +.. versionchanged:: 2.7 + All the scripts will also be added to the ``MANIFEST`` + file if no template is provided. See :ref:`manifest`. .. _distutils-installing-package-data: @@ -499,10 +498,10 @@ .. versionadded:: 2.4 -All the files that match ``package_data`` will be added to the ``MANIFEST`` -file if no template is provided. See :ref:`manifest`. +.. versionchanged:: 2.7 + All the files that match ``package_data`` will be added to the ``MANIFEST`` + file if no template is provided. See :ref:`manifest`. -.. versionadded:: 2.7 .. _distutils-additional-files: @@ -540,10 +539,10 @@ files directly in the target directory, an empty string should be given as the directory. -All the files that match ``data_files`` will be added to the ``MANIFEST`` -file if no template is provided. See :ref:`manifest`. +.. versionchanged:: 2.7 + All the files that match ``data_files`` will be added to the ``MANIFEST`` + file if no template is provided. See :ref:`manifest`. -.. versionadded:: 2.7 .. _meta-data: Modified: python/trunk/Doc/distutils/sourcedist.rst ============================================================================== --- python/trunk/Doc/distutils/sourcedist.rst (original) +++ python/trunk/Doc/distutils/sourcedist.rst Sun Feb 22 01:07:45 2009 @@ -87,14 +87,9 @@ * all files that matches the ``package_data`` metadata. See :ref:`distutils-installing-package-data`. - .. versionadded:: 2.7 - * all files that matches the ``data_files`` metadata. See :ref:`distutils-additional-files`. - .. versionadded:: 2.7 - - Sometimes this is enough, but usually you will want to specify additional files to distribute. The typical way to do this is to write a *manifest template*, called :file:`MANIFEST.in` by default. The manifest template is just a list of From python-checkins at python.org Sun Feb 22 01:09:09 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 22 Feb 2009 01:09:09 +0100 (CET) Subject: [Python-checkins] r69862 - python/branches/release26-maint Message-ID: <20090222000909.14E581E4002@bag.python.org> Author: tarek.ziade Date: Sun Feb 22 01:09:08 2009 New Revision: 69862 Log: Blocked revisions 69861 via svnmerge ........ r69861 | tarek.ziade | 2009-02-22 01:07:45 +0100 (Sun, 22 Feb 2009) | 1 line using versionchanged instead of versionadded for distutils doc on sdist default files ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun Feb 22 01:10:58 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 22 Feb 2009 01:10:58 +0100 (CET) Subject: [Python-checkins] r69863 - in python/branches/py3k: Doc/distutils/setupscript.rst Doc/distutils/sourcedist.rst Message-ID: <20090222001058.9F04D1E4002@bag.python.org> Author: tarek.ziade Date: Sun Feb 22 01:10:58 2009 New Revision: 69863 Log: Merged revisions 69861 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69861 | tarek.ziade | 2009-02-22 01:07:45 +0100 (Sun, 22 Feb 2009) | 1 line using versionchanged instead of versionadded for distutils doc on sdist default files ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/distutils/setupscript.rst python/branches/py3k/Doc/distutils/sourcedist.rst Modified: python/branches/py3k/Doc/distutils/setupscript.rst ============================================================================== --- python/branches/py3k/Doc/distutils/setupscript.rst (original) +++ python/branches/py3k/Doc/distutils/setupscript.rst Sun Feb 22 01:10:58 2009 @@ -450,10 +450,9 @@ scripts=['scripts/xmlproc_parse', 'scripts/xmlproc_val'] ) -All the scripts will also be added to the ``MANIFEST`` -file if no template is provided. See :ref:`manifest`. - -.. versionadded:: 2.7 +.. versionchanged:: 2.7 + All the scripts will also be added to the ``MANIFEST`` + file if no template is provided. See :ref:`manifest`. .. _distutils-installing-package-data: @@ -498,10 +497,10 @@ ) -All the files that match ``package_data`` will be added to the ``MANIFEST`` -file if no template is provided. See :ref:`manifest`. +.. versionchanged:: 2.7 + All the files that match ``package_data`` will be added to the ``MANIFEST`` + file if no template is provided. See :ref:`manifest`. -.. versionadded:: 2.7 .. _distutils-additional-files: @@ -539,10 +538,10 @@ files directly in the target directory, an empty string should be given as the directory. -All the files that match ``data_files`` will be added to the ``MANIFEST`` -file if no template is provided. See :ref:`manifest`. +.. versionchanged:: 2.7 + All the files that match ``data_files`` will be added to the ``MANIFEST`` + file if no template is provided. See :ref:`manifest`. -.. versionadded:: 2.7 .. _meta-data: Modified: python/branches/py3k/Doc/distutils/sourcedist.rst ============================================================================== --- python/branches/py3k/Doc/distutils/sourcedist.rst (original) +++ python/branches/py3k/Doc/distutils/sourcedist.rst Sun Feb 22 01:10:58 2009 @@ -87,14 +87,9 @@ * all files that matches the ``package_data`` metadata. See :ref:`distutils-installing-package-data`. - .. versionadded:: 2.7 - * all files that matches the ``data_files`` metadata. See :ref:`distutils-additional-files`. - .. versionadded:: 2.7 - - Sometimes this is enough, but usually you will want to specify additional files to distribute. The typical way to do this is to write a *manifest template*, called :file:`MANIFEST.in` by default. The manifest template is just a list of From python-checkins at python.org Sun Feb 22 01:11:47 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 22 Feb 2009 01:11:47 +0100 (CET) Subject: [Python-checkins] r69864 - python/branches/release30-maint Message-ID: <20090222001147.CFE821E4002@bag.python.org> Author: tarek.ziade Date: Sun Feb 22 01:11:47 2009 New Revision: 69864 Log: Blocked revisions 69863 via svnmerge ................ r69863 | tarek.ziade | 2009-02-22 01:10:58 +0100 (Sun, 22 Feb 2009) | 9 lines Merged revisions 69861 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69861 | tarek.ziade | 2009-02-22 01:07:45 +0100 (Sun, 22 Feb 2009) | 1 line using versionchanged instead of versionadded for distutils doc on sdist default files ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Sun Feb 22 01:27:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 22 Feb 2009 00:27:19 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090222002719.EADF71E4002@bag.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/143 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_threading_local make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Feb 22 01:59:53 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 22 Feb 2009 01:59:53 +0100 (CET) Subject: [Python-checkins] r69865 - python/branches/io-c/Lib/_pyio.py Message-ID: <20090222005953.258181E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 22 01:59:52 2009 New Revision: 69865 Log: don't use super here() Modified: python/branches/io-c/Lib/_pyio.py Modified: python/branches/io-c/Lib/_pyio.py ============================================================================== --- python/branches/io-c/Lib/_pyio.py (original) +++ python/branches/io-c/Lib/_pyio.py Sun Feb 22 01:59:52 2009 @@ -1124,7 +1124,9 @@ self.flush() # First do the raw seek, then empty the read buffer, so that # if the raw seek fails, we don't lose buffered data forever. - pos = super().seek(pos, whence) + pos = self.raw.seek(pos, whence) + if pos < 0: + raise IOError("seek() returned invalid position") with self._read_lock: self._reset_read_buf() return pos From python-checkins at python.org Sun Feb 22 02:05:28 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 22 Feb 2009 02:05:28 +0100 (CET) Subject: [Python-checkins] r69866 - python/branches/io-c/Lib/test/test_io.py Message-ID: <20090222010528.CE18E1E4002@bag.python.org> Author: benjamin.peterson Date: Sun Feb 22 02:05:28 2009 New Revision: 69866 Log: use implementation specific classes Modified: python/branches/io-c/Lib/test/test_io.py Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Sun Feb 22 02:05:28 2009 @@ -1027,7 +1027,7 @@ self.assertEquals(b"dddeee", raw._write_stack[0]) def testSeekAndTell(self): - raw = io.BytesIO(b"asdfghjkl") + raw = self.BytesIO(b"asdfghjkl") rw = self.tp(raw) self.assertEquals(b"as", rw.read(2)) @@ -1047,7 +1047,7 @@ self.assertRaises(TypeError, rw.seek, 0.0) def check_flush_and_read(self, read_func): - raw = io.BytesIO(b"abcdefghi") + raw = self.BytesIO(b"abcdefghi") bufio = self.tp(raw) self.assertEquals(b"ab", read_func(bufio, 2)) @@ -1086,7 +1086,7 @@ self.check_flush_and_read(_peek) def testFlushAndWrite(self): - raw = io.BytesIO(b"abcdefghi") + raw = self.BytesIO(b"abcdefghi") bufio = self.tp(raw) bufio.write(b"123") @@ -1142,6 +1142,7 @@ tp = io.BufferedRandom BlockingIOError = io.BlockingIOError FileIO = io.FileIO + BytesIO = io.BytesIO MockRawIO = CMockRawIO MockFileIO = CMockFileIO MisbehavedRawIO = CMisbehavedRawIO @@ -1151,6 +1152,7 @@ tp = pyio.BufferedRandom BlockingIOError = pyio.BlockingIOError FileIO = pyio.FileIO + BytesIO = pyio.BytesIO MockRawIO = PyMockRawIO MockFileIO = PyMockFileIO MisbehavedRawIO = PyMisbehavedRawIO From buildbot at python.org Sun Feb 22 03:05:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 22 Feb 2009 02:05:15 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.6 Message-ID: <20090222020516.184931E4010@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/102 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: 2 tests failed: test_bsddb3 test_subprocess Traceback (most recent call last): File "../lib/test/regrtest.py", line 1197, in File "../lib/test/regrtest.py", line 419, in main File "../lib/test/regrtest.py", line 1108, in __init__ ImportError: cannot import name test_timeout sincerely, -The Buildbot From python-checkins at python.org Sun Feb 22 03:33:52 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 22 Feb 2009 03:33:52 +0100 (CET) Subject: [Python-checkins] r69867 - peps/trunk/pep-0376.txt Message-ID: <20090222023352.E33A41E4002@bag.python.org> Author: tarek.ziade Date: Sun Feb 22 03:33:52 2009 New Revision: 69867 Log: started the work on PEP 376 for Distutils Added: peps/trunk/pep-0376.txt (contents, props changed) Added: peps/trunk/pep-0376.txt ============================================================================== --- (empty file) +++ peps/trunk/pep-0376.txt Sun Feb 22 03:33:52 2009 @@ -0,0 +1,248 @@ +PEP: 376 +Title: Changing the .egg-info structure +Version: $Revision:$ +Last-Modified: $Date:$ +Author: Tarek Ziad? +Status: Draft +Type: Standards Track +Content-Type: text/x-rst +Created: 22-Feb-2009 +Python-Version: 2.7, 3.1 +Post-History: + +.. contents:: + +Abstract +======== + +This PEP proposes various enhancements for Distutils: + +- a new format for the .egg-info structure. +- an install script to install package in Python. +- an uninstall script to uninstall a package in Python. + +Rationale +========= + +There are three problems right now in the way packages +are installed in Python: + +- There are too many different ways to install a package in + Python nowadays + +- There is no way to uninstall a package. + +- There is no API to get the metadata of installed + packages. + +How packages are installed +-------------------------- + +Right now, when a package is installed in Python, using the +Distutils `install` command, the `install_egg_info` subcommand is +called in order to create an `.egg-info` file in the site-packages directory, +right beside the package itself. + +For example, if the `zlib` package is installed, two elements +will be installed in `site-packages`:: + + - zlib + - zlib-2.5.2-py2.6.egg-info + +Where `zlib` is the package itself, and `zlib-2.5.2-py2.6.egg-info` is +a file containing the package metadata as described in PEP 314. + +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 tool does not install +the packages the same way Distutils does. + +- `easy_install` creates an `EGG-INFO` directory inside an `.egg` directory, + and adds a `PKG-INFO` file inside this directory, amongst other files. + +- `pip` creates an `.egg-info` directory inside the site-packages directory + besides the package, and adds an `PKG-INFO` file inside it. + +They both add other files in the `EGG-INFO` or `.egg-info` directory, and +create or modify `.pth` files. `pip` also creates one `.pth` file +per installed package, which may lead to slow initialisation of Python. + +The uninstall command +--------------------- + +Python doesn't provide any `uninstall` command. If you want to uninstall +a package, you have to be a power user and remove the package directory +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 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 (distutils or setuptools). + +But there's a common behavior : files are copied in your installation. +And there's a way to keep track of theses file, so to remove them. + +Installing a package +-------------------- + +There are too many different ways to install a package in Python: + +- by hand, by getting a distribution and running the install command +- using `easy_install`, the script provided by setuptools +- using `pip` + +The problem is: they do no install the package the same way, +and Python should provide one and only one way to do it. + +What this PEP proposes +---------------------- + +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; +- some new functions in `pkgutil` +- adding an install and an uninstall script + +.egg-info becomes a directory +============================= + +The first change would be to make `.egg-info` become a directory and +hold the `PKG-INFO` file built by the `write_pkg_file` method. + +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. + +Although, it will impact the `setuptools` and `pip` project, but given +the fact that they already works with a directory that contains a +`PKG-INFO` file, the change will be small. + +For example, if the `zlib` package is installed, two elements +will be installed in `site-packages`:: + + - zlib + - zlib-2.5.2-py2.6.egg-info/ + PKG-INFO + +To be able to implement this change, the impacted code in Distutils +is the `install_egg_info` command. + +Adding MANIFEST and RECORD in the .egg-info directory +===================================================== + +Some files can be added inside the `.egg-info` directory at installation +time. They will all be UPPERCASE files. + +- the `MANIFEST` file built by the `sdist` command. Notice that + some fixes were made lately on the default files added in `MANIFEST` + when `MANIFEST.in` is not provided (see #2279 for instance). + +- 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, like + explained later in this PEP. + +The `install` command will record by default installed files in the +RECORD file. + +The `sdist` 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('MANIFEST', 'RECORD', 'PKG-INFO') + +Back to our `zlib` example, we will have:: + + - zlib + - zlib-2.5.2-py2.6.egg-info/ + PKG-INFO + MANIFEST + RECORD + +New functions in pkgutil +======================== + +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 : + +- get_egg_info(pkg_name) -> directory or None + + Scans all site-packages directories and look for all `pkg_name*.egg-info` + directory. If founded, returns the path. If the directory is not found, + returns None. + +- get_metadata(pkg_name) -> DistributionMetadata or None + + 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(pkg_name, filename) -> file object or None + + Uses `get_egg_info` and gets any file inside the directory, + pointed by filename. + + filename is any value founded in `distutils.sdist.EGG_INFO_FILES` + +Let's use it over our `zlib` example:: + + >>> from pkgutil import get_egg_info, get_metadata, get_egg_info_file + >>> get_egg_info('zlib') + '/opt/local/lib/python2.6/site-packages/zlib-2.5.2-py2.6.egg-info' + >>> metadata = get_metadata('zlib') + >>> metadata.version + '2.5.2' + >>> from distutils.dist import EGG_INFO_FILES + >>> get_metadata('zlib', EGG_INFO_FILES.manifest).read() + some + ... + files + +Adding an install and an uninstall script +========================================= + +`easy_install` and `pip` does basically the same work, besides other features +that are not discussed here. + +- they look for the package at PyPI +- they download it and build it +- they install it inside the site-packages directory +- they add an entry in a .pth file + +A new script called `install.py` is added in a new directory called `scripts` +in Distutils, and let people run an installation using:: + + $ python -m 'distutils.scripts.install' zlib + +An uninstall command is added as well, that removes the files recorded +in the RECORD file. This removal will warn on file that no longer exists +and will not take care of side effects, like the removal of a file +used by another element of the system. + +XXX work to be done here : specification of the two commands +(probably a mix of easy_install and pip) + +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 buildbot at python.org Sun Feb 22 03:50:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 22 Feb 2009 02:50:19 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090222025019.DD9201E4002@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/333 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,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_posix test_site ====================================================================== 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 sincerely, -The Buildbot From buildbot at python.org Sun Feb 22 03:58:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 22 Feb 2009 02:58:54 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090222025854.F266F1E4002@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/131 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 buildbot at python.org Sun Feb 22 04:57:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 22 Feb 2009 03:57:14 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090222035714.A0C971E4002@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/172 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 Sun Feb 22 05:12:05 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 22 Feb 2009 05:12:05 +0100 (CET) Subject: [Python-checkins] r69868 - python/branches/io-c/Lib/test/test_io.py Message-ID: <20090222041205.F2DDE1E400C@bag.python.org> Author: benjamin.peterson Date: Sun Feb 22 05:12:05 2009 New Revision: 69868 Log: use a more DRY friendly approach to injecting module contents into test classes Modified: python/branches/io-c/Lib/test/test_io.py Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Sun Feb 22 05:12:05 2009 @@ -464,16 +464,10 @@ self.assertEqual(f.read(), b"abcxxx") class CIOTest(IOTest): - open = io.open - IOBase = io.IOBase - BytesIO = io.BytesIO - FileIO = io.FileIO + pass class PyIOTest(IOTest): - open = staticmethod(pyio.open) - IOBase = pyio.IOBase - BytesIO = pyio.BytesIO - FileIO = pyio.FileIO + pass class CommonBufferedTests: @@ -539,7 +533,7 @@ def testErrorThroughDestructor(self): # Test that the exception state is not modified by a destructor, # even if close() fails. - rawio = CloseFailureIO() + rawio = self.CloseFailureIO() def f(): self.tp(rawio).xyzzy self.assertRaises(AttributeError, f) @@ -709,11 +703,6 @@ class CBufferedReaderTest(BufferedReaderTest): tp = io.BufferedReader - BlockingIOError = io.BlockingIOError - FileIO = io.FileIO - MisbehavedRawIO = CMisbehavedRawIO - MockRawIO = CMockRawIO - MockFileIO = CMockFileIO def test_initialization(self): rawio = self.MockRawIO([b"abc"]) @@ -734,11 +723,6 @@ class PyBufferedReaderTest(BufferedReaderTest): tp = pyio.BufferedReader - BlockingIOError = pyio.BlockingIOError - FileIO = pyio.FileIO - MisbehavedRawIO = PyMisbehavedRawIO - MockRawIO = PyMockRawIO - MockFileIO = PyMockFileIO class BufferedWriterTest(unittest.TestCase, CommonBufferedTests): @@ -962,11 +946,6 @@ class CBufferedWriterTest(BufferedWriterTest): tp = io.BufferedWriter - BlockingIOError = io.BlockingIOError - FileIO = io.FileIO - MockRawIO = CMockRawIO - MisbehavedRawIO = CMisbehavedRawIO - MockNonBlockWriterIO = CMockNonBlockWriterIO def test_initialization(self): rawio = self.MockRawIO() @@ -981,12 +960,6 @@ class PyBufferedWriterTest(BufferedWriterTest): tp = pyio.BufferedWriter - BlockingIOError = pyio.BlockingIOError - FileIO = pyio.FileIO - MockRawIO = PyMockRawIO - MisbehavedRawIO = PyMisbehavedRawIO - MockNonBlockWriterIO = PyMockNonBlockWriterIO - class BufferedRWPairTest(unittest.TestCase): @@ -1000,11 +973,9 @@ class CBufferedRWPairTest(BufferedRWPairTest): tp = io.BufferedRWPair - MockRawIO = CMockRawIO class PyBufferedRWPairTest(BufferedRWPairTest): tp = pyio.BufferedRWPair - MockRawIO = PyMockRawIO class BufferedRandomTest(BufferedReaderTest, BufferedWriterTest): @@ -1140,23 +1111,9 @@ class CBufferedRandomTest(BufferedRandomTest): tp = io.BufferedRandom - BlockingIOError = io.BlockingIOError - FileIO = io.FileIO - BytesIO = io.BytesIO - MockRawIO = CMockRawIO - MockFileIO = CMockFileIO - MisbehavedRawIO = CMisbehavedRawIO - MockNonBlockWriterIO = CMockNonBlockWriterIO class PyBufferedRandomTest(BufferedRandomTest): tp = pyio.BufferedRandom - BlockingIOError = pyio.BlockingIOError - FileIO = pyio.FileIO - BytesIO = pyio.BytesIO - MockRawIO = PyMockRawIO - MockFileIO = PyMockFileIO - MisbehavedRawIO = PyMisbehavedRawIO - MockNonBlockWriterIO = PyMockNonBlockWriterIO # To fully exercise seek/tell, the StatefulIncrementalDecoder has these @@ -1502,7 +1459,7 @@ def testErrorThroughDestructor(self): # Test that the exception state is not modified by a destructor, # even if close() fails. - rawio = CloseFailureIO() + rawio = self.CloseFailureIO() def f(): self.TextIOWrapper(rawio).xyzzy self.assertRaises(AttributeError, f) @@ -1807,11 +1764,6 @@ self.assertEqual(buffer.seekable(), txt.seekable()) class CTextIOWrapperTest(TextIOWrapperTest): - open = io.open - BufferedReader = io.BufferedReader - BufferedWriter = io.BufferedWriter - TextIOWrapper = io.TextIOWrapper - BytesIO = io.BytesIO def test_initialization(self): r = self.BytesIO(b"\xc3\xa9\n\n") @@ -1823,11 +1775,7 @@ self.assertRaises(ValueError, t.read) class PyTextIOWrapperTest(TextIOWrapperTest): - open = staticmethod(pyio.open) - BufferedReader = pyio.BufferedReader - BufferedWriter = pyio.BufferedWriter - TextIOWrapper = pyio.TextIOWrapper - BytesIO = pyio.BytesIO + pass class IncrementalNewlineDecoderTest(unittest.TestCase): @@ -1924,10 +1872,10 @@ self.check_newline_decoding_utf8(decoder) class CIncrementalNewlineDecoderTest(IncrementalNewlineDecoderTest): - IncrementalNewlineDecoder = io.IncrementalNewlineDecoder + pass class PyIncrementalNewlineDecoderTest(IncrementalNewlineDecoderTest): - IncrementalNewlineDecoder = pyio.IncrementalNewlineDecoder + pass # XXX Tests for open() @@ -2037,27 +1985,42 @@ class CMiscIOTest(MiscIOTest): io = io - open = io.open - BlockingIOError = io.BlockingIOError - IOBase = io.IOBase class PyMiscIOTest(MiscIOTest): io = pyio - open = staticmethod(pyio.open) - BlockingIOError = pyio.BlockingIOError - IOBase = pyio.IOBase def test_main(): - support.run_unittest(CIOTest, PyIOTest, - CBufferedReaderTest, PyBufferedReaderTest, - CBufferedWriterTest, PyBufferedWriterTest, - CBufferedRWPairTest, PyBufferedRWPairTest, - CBufferedRandomTest, PyBufferedRandomTest, - StatefulIncrementalDecoderTest, - CIncrementalNewlineDecoderTest, PyIncrementalNewlineDecoderTest, - CTextIOWrapperTest, PyTextIOWrapperTest, - CMiscIOTest, PyMiscIOTest, - ) + tests = (CIOTest, PyIOTest, + CBufferedReaderTest, PyBufferedReaderTest, + CBufferedWriterTest, PyBufferedWriterTest, + CBufferedRWPairTest, PyBufferedRWPairTest, + CBufferedRandomTest, PyBufferedRandomTest, + StatefulIncrementalDecoderTest, + CIncrementalNewlineDecoderTest, PyIncrementalNewlineDecoderTest, + CTextIOWrapperTest, PyTextIOWrapperTest, + CMiscIOTest, PyMiscIOTest,) + + # Put the namespaces of the IO module we are testing and some useful mock + # classes in the __dict__ of each test. + mocks = (MockRawIO, MisbehavedRawIO, MockFileIO, CloseFailureIO, + MockNonBlockWriterIO) + all_members = io.__all__ + ["IncrementalNewlineDecoder"] + c_io_ns = {name : getattr(io, name) for name in all_members} + py_io_ns = {name : getattr(pyio, name) for name in all_members} + globs = globals() + c_io_ns.update((x.__name__, globs["C" + x.__name__]) for x in mocks) + py_io_ns.update((x.__name__, globs["Py" + x.__name__]) for x in mocks) + # Avoid turning open into a bound method. + py_io_ns["open"] = pyio.OpenWrapper + for test in tests: + if test.__name__.startswith("C"): + for name, obj in c_io_ns.items(): + setattr(test, name, obj) + elif test.__name__.startswith("Py"): + for name, obj in py_io_ns.items(): + setattr(test, name, obj) + + support.run_unittest(*tests) if __name__ == "__main__": test_main() From nnorwitz at gmail.com Sun Feb 22 10:09:02 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 22 Feb 2009 04:09:02 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090222090902.GA14579@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17142 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663887 refs] From nnorwitz at gmail.com Sun Feb 22 10:16:17 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 22 Feb 2009 04:16:17 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090222091617.GA16972@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 [17163 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17142 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663157 refs] From nnorwitz at gmail.com Sun Feb 22 11:37:40 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 22 Feb 2009 05:37:40 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090222103740.GA6699@python.psfb.org> 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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-3047 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 test_slice test_smtplib test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [677587 refs] From python-checkins at python.org Sun Feb 22 13:57:58 2009 From: python-checkins at python.org (matthias.klose) Date: Sun, 22 Feb 2009 13:57:58 +0100 (CET) Subject: [Python-checkins] r69869 - python/branches/py3k/Modules/Setup.dist Message-ID: <20090222125758.52E8E1E4002@bag.python.org> Author: matthias.klose Date: Sun Feb 22 13:57:58 2009 New Revision: 69869 Log: - Modules/Setup.dist: Mention _heapq 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 Sun Feb 22 13:57:58 2009 @@ -169,6 +169,7 @@ #_pickle _pickle.c # pickle accelerator #datetime datetimemodule.c # date/time type #_bisect _bisectmodule.c # Bisection algorithms +#_heapq _heapqmodule.c # Heap queue algorithm #unicodedata unicodedata.c # static Unicode character database From buildbot at python.org Sun Feb 22 14:23:59 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 22 Feb 2009 13:23:59 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090222132359.A155A1E4002@bag.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/315 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: matthias.klose BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_codecs test_site ====================================================================== 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 1344, 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 1429, 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 Sun Feb 22 14:43:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 22 Feb 2009 13:43:35 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090222134336.235821E403A@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/321 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: matthias.klose BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Feb 22 18:25:53 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 22 Feb 2009 18:25:53 +0100 (CET) Subject: [Python-checkins] r69870 - python/trunk/Lib/test/test_site.py Message-ID: <20090222172553.0E46E1E4002@bag.python.org> Author: antoine.pitrou Date: Sun Feb 22 18:25:52 2009 New Revision: 69870 Log: Try to make sense of the test_site buildbot failures Modified: python/trunk/Lib/test/test_site.py Modified: python/trunk/Lib/test/test_site.py ============================================================================== --- python/trunk/Lib/test/test_site.py (original) +++ python/trunk/Lib/test/test_site.py Sun Feb 22 18:25:52 2009 @@ -99,9 +99,10 @@ def test_s_option(self): usersite = site.USER_SITE self.assert_(usersite in sys.path) + print usersite, sys.path rc = subprocess.call([sys.executable, '-c', - 'import sys; sys.exit(%r in sys.path)' % usersite]) + 'import sys; print sys.path; sys.exit(%r in sys.path)' % usersite]) self.assertEqual(rc, 1) rc = subprocess.call([sys.executable, '-s', '-c', From buildbot at python.org Sun Feb 22 18:54:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 22 Feb 2009 17:54:54 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090222175455.008F41E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/671 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: antoine.pitrou,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_site.py", line 106, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun Feb 22 18:55:27 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 22 Feb 2009 17:55:27 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090222175527.F09251E4025@bag.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/1894 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,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_site.py", line 106, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Feb 22 19:20:46 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 22 Feb 2009 19:20:46 +0100 (CET) Subject: [Python-checkins] r69871 - python/trunk/Lib/test/test_site.py Message-ID: <20090222182046.45B2F1E401A@bag.python.org> Author: antoine.pitrou Date: Sun Feb 22 19:20:46 2009 New Revision: 69871 Log: Revert debugging statements, culprit is possibly test_distutils (see #5316) Modified: python/trunk/Lib/test/test_site.py Modified: python/trunk/Lib/test/test_site.py ============================================================================== --- python/trunk/Lib/test/test_site.py (original) +++ python/trunk/Lib/test/test_site.py Sun Feb 22 19:20:46 2009 @@ -99,10 +99,9 @@ def test_s_option(self): usersite = site.USER_SITE self.assert_(usersite in sys.path) - print usersite, sys.path rc = subprocess.call([sys.executable, '-c', - 'import sys; print sys.path; sys.exit(%r in sys.path)' % usersite]) + 'import sys; sys.exit(%r in sys.path)' % usersite]) self.assertEqual(rc, 1) rc = subprocess.call([sys.executable, '-s', '-c', From buildbot at python.org Sun Feb 22 20:13:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 22 Feb 2009 19:13:50 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian 3.x Message-ID: <20090222191350.9282D1E4002@bag.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/64 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,brett.cannon,mark.dickinson,matthias.klose,raymond.hettinger,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 4 tests failed: test___all__ test_cprofile test_profile test_site ====================================================================== ERROR: test_all (test.test___all__.AllTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test___all__.py", line 104, in test_all self.check_all("profile") File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test___all__.py", line 15, in check_all exec("import %s" % modname, names) File "", line 1, in File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/profile.py", line 125, in class Profile: File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/profile.py", line 231, in Profile self.t = t[0] + t[1] NameError: name 'trace_dispatch_call' is not defined Traceback (most recent call last): File "./Lib/test/regrtest.py", line 598, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_cprofile.py", line 8, in from test.test_profile import ProfileTest, regenerate_expected_output File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_profile.py", line 11, in import profile File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/profile.py", line 125, in class Profile: File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/profile.py", line 231, in Profile self.t = t[0] + t[1] NameError: name 'trace_dispatch_call' is not defined Traceback (most recent call last): File "./Lib/test/regrtest.py", line 598, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_profile.py", line 11, in import profile File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/profile.py", line 125, in class Profile: File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/profile.py", line 231, in Profile self.t = t[0] + t[1] NameError: name 'trace_dispatch_call' is not defined make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Feb 22 20:39:45 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 22 Feb 2009 20:39:45 +0100 (CET) Subject: [Python-checkins] r69872 - in python/branches/io-c: Lib/test/test_io.py Modules/_bufferedio.c Modules/_iobase.c Modules/_stringio.c Message-ID: <20090222193945.DCDF41E4002@bag.python.org> Author: antoine.pitrou Date: Sun Feb 22 20:39:45 2009 New Revision: 69872 Log: Sanitize destructor behaviour of IOBase. Now Python-defined attributes can be accessed from close(). Modified: python/branches/io-c/Lib/test/test_io.py python/branches/io-c/Modules/_bufferedio.c python/branches/io-c/Modules/_iobase.c python/branches/io-c/Modules/_stringio.c Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Sun Feb 22 20:39:45 2009 @@ -115,9 +115,12 @@ class CloseFailureIO(MockRawIO): + closed = 0 def close(self): - raise IOError + if not self.closed: + self.closed = 1 + raise IOError class CCloseFailureIO(CloseFailureIO, io.RawIOBase): pass @@ -382,14 +385,22 @@ f.write(b"xxx") del f self.assertEqual(record, [1, 2, 3]) + f = open(support.TESTFN, "rb") + self.assertEqual(f.read(), b"xxx") - def test_IOBase_destructor(self): + def _check_base_destructor(self, base): record = [] - class MyIO(self.IOBase): + class MyIO(base): def __init__(self): - pass + # This exercises the availability of attributes on object + # destruction. + # (in the C version, close() is called by the tp_dealloc + # function, not by __del__) + self.on_del = 1 + self.on_close = 2 + self.on_flush = 3 def __del__(self): - record.append(1) + record.append(self.on_del) try: f = super().__del__ except AttributeError: @@ -397,15 +408,27 @@ else: f() def close(self): - record.append(2) + record.append(self.on_close) super().close() def flush(self): - record.append(3) + record.append(self.on_flush) super().flush() f = MyIO() del f self.assertEqual(record, [1, 2, 3]) + def test_IOBase_destructor(self): + self._check_base_destructor(self.IOBase) + + def test_RawIOBase_destructor(self): + self._check_base_destructor(self.RawIOBase) + + def test_BufferedIOBase_destructor(self): + self._check_base_destructor(self.BufferedIOBase) + + def test_TextIOBase_destructor(self): + self._check_base_destructor(self.TextIOBase) + def test_close_flushes(self): f = self.open(support.TESTFN, "wb") f.write(b"xxx") @@ -536,7 +559,14 @@ rawio = self.CloseFailureIO() def f(): self.tp(rawio).xyzzy - self.assertRaises(AttributeError, f) + with support.captured_output("stderr") as s: + self.assertRaises(AttributeError, f) + s = s.getvalue().strip() + if s: + # The destructor *may* have printed an unraisable error, check it + self.assertEqual(len(s.splitlines()), 1) + self.assert_(s.startswith("Exception IOError: "), s) + self.assert_(s.endswith(" ignored"), s) class BufferedReaderTest(unittest.TestCase, CommonBufferedTests): @@ -1424,10 +1454,11 @@ def testDestructor(self): l = [] - class MyBytesIO(self.BytesIO): + base = self.BytesIO + class MyBytesIO(base): def close(self): l.append(self.getvalue()) - self.BytesIO.close(self) + base.close(self) b = MyBytesIO() t = self.TextIOWrapper(b, encoding="ascii") t.write("abc") @@ -1462,7 +1493,14 @@ rawio = self.CloseFailureIO() def f(): self.TextIOWrapper(rawio).xyzzy - self.assertRaises(AttributeError, f) + with support.captured_output("stderr") as s: + self.assertRaises(AttributeError, f) + s = s.getvalue().strip() + if s: + # The destructor *may* have printed an unraisable error, check it + self.assertEqual(len(s.splitlines()), 1) + self.assert_(s.startswith("Exception IOError: "), s) + self.assert_(s.endswith(" ignored"), s) def test_garbage_collection(self): # TextIOWrapper objects are collected, and collecting them flushes Modified: python/branches/io-c/Modules/_bufferedio.c ============================================================================== --- python/branches/io-c/Modules/_bufferedio.c (original) +++ python/branches/io-c/Modules/_bufferedio.c Sun Feb 22 20:39:45 2009 @@ -1780,6 +1780,7 @@ BufferedObject *reader; BufferedObject *writer; PyObject *dict; + PyObject *weakreflist; } BufferedRWPairObject; static int @@ -1826,11 +1827,30 @@ return 0; } +static int +BufferedRWPair_traverse(BufferedRWPairObject *self, visitproc visit, void *arg) +{ + Py_VISIT(self->dict); + return 0; +} + +static int +BufferedRWPair_clear(BufferedRWPairObject *self) +{ + Py_CLEAR(self->reader); + Py_CLEAR(self->writer); + Py_CLEAR(self->dict); + return 0; +} + static void BufferedRWPair_dealloc(BufferedRWPairObject *self) { + _PyObject_GC_UNTRACK(self); Py_CLEAR(self->reader); Py_CLEAR(self->writer); + Py_CLEAR(self->dict); + Py_TYPE(self)->tp_free((PyObject *) self); } static PyObject * @@ -1955,17 +1975,18 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE + | Py_TPFLAGS_HAVE_GC, /* tp_flags */ BufferedRWPair_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ + (traverseproc)BufferedRWPair_traverse, /* tp_traverse */ + (inquiry)BufferedRWPair_clear, /* tp_clear */ 0, /* tp_richcompare */ - offsetof(BufferedObject, weakreflist), /*tp_weaklistoffset*/ + offsetof(BufferedRWPairObject, weakreflist), /*tp_weaklistoffset*/ 0, /* tp_iter */ 0, /* tp_iternext */ BufferedRWPair_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ + 0, /* tp_members */ + 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ Modified: python/branches/io-c/Modules/_iobase.c ============================================================================== --- python/branches/io-c/Modules/_iobase.c (original) +++ python/branches/io-c/Modules/_iobase.c Sun Feb 22 20:39:45 2009 @@ -17,6 +17,13 @@ * IOBase class, an abstract class */ +typedef struct { + PyObject_HEAD + + PyObject *dict; + PyObject *weakreflist; +} IOBaseObject; + PyDoc_STRVAR(IOBase_doc, "The abstract base class for all I/O classes, acting on streams of\n" "bytes. There is no public constructor.\n" @@ -186,6 +193,8 @@ Py_RETURN_NONE; } +/* Finalization and garbage collection support */ + int _PyIOBase_finalize(PyObject *self) { @@ -194,19 +203,15 @@ int closed = 1; int is_zombie; - PyErr_Fetch(&tp, &v, &tb); /* If _PyIOBase_finalize() is called from a destructor, we need to resurrect the object as calling close() can invoke arbitrary code. */ is_zombie = (Py_REFCNT(self) == 0); if (is_zombie) { ++Py_REFCNT(self); } - /* The object could already be in an unusable state, so we'll take any - error as meaning "stop, nothing to see here". */ - /* XXX any Python method or property called from here may rely on - attributes being set in the instance __dict__, but the __dict__ has - already been cleared by subtype_dealloc(). - Worse, since exceptions are silenced, the user will be unaware of it. */ + PyErr_Fetch(&tp, &v, &tb); + /* If `closed` doesn't exist or can't be evaluated as bool, then the + object is probably in an unusable state, so ignore. */ res = PyObject_GetAttr(self, _PyIO_str_closed); if (res == NULL) PyErr_Clear(); @@ -214,13 +219,14 @@ closed = PyObject_IsTrue(res); Py_DECREF(res); if (closed == -1) - PyErr_Clear(); + PyErr_WriteUnraisable(self); } if (closed == 0) { res = PyObject_CallMethodObjArgs((PyObject *) self, _PyIO_str_close, NULL); + /* Silencing I/O errors is bad, so we print them out on the console. */ if (res == NULL) - PyErr_Clear(); + PyErr_WriteUnraisable(self); else Py_DECREF(res); } @@ -247,29 +253,48 @@ #endif return -1; } - else { - /* The code above might have re-added a dict, DECREF it */ - PyObject **dictptr = _PyObject_GetDictPtr(self); - if (dictptr != NULL) - Py_CLEAR(*dictptr); - } } return 0; } +static int +IOBase_traverse(IOBaseObject *self, visitproc visit, void *arg) +{ + Py_VISIT(self->dict); + return 0; +} + +static int +IOBase_clear(IOBaseObject *self) +{ + if (_PyIOBase_finalize((PyObject *) self) < 0) + return -1; + Py_CLEAR(self->dict); + return 0; +} + /* Destructor */ static void -IOBase_dealloc(PyObject *self) +IOBase_dealloc(IOBaseObject *self) { - if (_PyIOBase_finalize((PyObject *)self) < 0) { + /* NOTE: since IOBaseObject has its own dict, Python-defined attributes + are still available here for close() to use. + However, if the derived class declares a __slots__, those slots are + already gone. + */ + if (_PyIOBase_finalize((PyObject *) self) < 0) { /* When called from a heap type's dealloc, the type will be decref'ed on return (see e.g. subtype_dealloc in typeobject.c). */ if (PyType_HasFeature(Py_TYPE(self), Py_TPFLAGS_HEAPTYPE)) Py_INCREF(Py_TYPE(self)); return; } - Py_TYPE(self)->tp_free(self); + _PyObject_GC_UNTRACK(self); + if (self->weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) self); + Py_CLEAR(self->dict); + Py_TYPE(self)->tp_free((PyObject *) self); } /* Inquiry methods */ @@ -680,9 +705,9 @@ PyTypeObject PyIOBase_Type = { PyVarObject_HEAD_INIT(NULL, 0) "IOBase", /*tp_name*/ - 0, /*tp_basicsize*/ + sizeof(IOBaseObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ - IOBase_dealloc, /*tp_dealloc*/ + (destructor)IOBase_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -697,12 +722,13 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE + | Py_TPFLAGS_HAVE_GC, /*tp_flags*/ IOBase_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ + (traverseproc)IOBase_traverse, /* tp_traverse */ + (inquiry)IOBase_clear, /* tp_clear */ 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ + offsetof(IOBaseObject, weakreflist), /* tp_weaklistoffset */ IOBase_iter, /* tp_iter */ IOBase_iternext, /* tp_iternext */ IOBase_methods, /* tp_methods */ @@ -712,7 +738,7 @@ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ + offsetof(IOBaseObject, dict), /* tp_dictoffset */ 0, /* tp_init */ 0, /* tp_alloc */ PyType_GenericNew, /* tp_new */ Modified: python/branches/io-c/Modules/_stringio.c ============================================================================== --- python/branches/io-c/Modules/_stringio.c (original) +++ python/branches/io-c/Modules/_stringio.c Sun Feb 22 20:39:45 2009 @@ -1,5 +1,6 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "structmember.h" #include "_iomodule.h" /* Implementation note: the buffer is always at least one character longer @@ -20,6 +21,9 @@ PyObject *decoder; PyObject *readnl; PyObject *writenl; + + PyObject *dict; + PyObject *weakreflist; } StringIOObject; #define CHECK_INITIALIZED(self) \ @@ -487,14 +491,31 @@ Py_RETURN_NONE; } +static int +stringio_traverse(StringIOObject *self, visitproc visit, void *arg) +{ + Py_VISIT(self->dict); + return 0; +} + +static int +stringio_clear(StringIOObject *self) +{ + Py_CLEAR(self->dict); + return 0; +} + static void stringio_dealloc(StringIOObject *self) { + _PyObject_GC_UNTRACK(self); Py_CLEAR(self->readnl); Py_CLEAR(self->writenl); Py_CLEAR(self->decoder); if (self->buf) PyMem_Free(self->buf); + if (self->weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) self); Py_TYPE(self)->tp_free(self); } @@ -725,12 +746,13 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE + | Py_TPFLAGS_HAVE_GC, /*tp_flags*/ stringio_doc, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + (traverseproc)stringio_traverse, /*tp_traverse*/ + (inquiry)stringio_clear, /*tp_clear*/ 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ + offsetof(StringIOObject, weakreflist), /*tp_weaklistoffset*/ 0, /*tp_iter*/ (iternextfunc)stringio_iternext, /*tp_iternext*/ stringio_methods, /*tp_methods*/ @@ -740,7 +762,7 @@ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ + offsetof(StringIOObject, dict), /*tp_dictoffset*/ (initproc)stringio_init, /*tp_init*/ 0, /*tp_alloc*/ stringio_new, /*tp_new*/ From python-checkins at python.org Sun Feb 22 20:50:15 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 22 Feb 2009 20:50:15 +0100 (CET) Subject: [Python-checkins] r69873 - python/branches/io-c/Modules/_fileio.c Message-ID: <20090222195015.5CD961E4002@bag.python.org> Author: antoine.pitrou Date: Sun Feb 22 20:50:14 2009 New Revision: 69873 Log: Only set the internal fd after it has been checked to be valid (otherwise, the destructor will attempt to close it) Modified: python/branches/io-c/Modules/_fileio.c Modified: python/branches/io-c/Modules/_fileio.c ============================================================================== --- python/branches/io-c/Modules/_fileio.c (original) +++ python/branches/io-c/Modules/_fileio.c Sun Feb 22 20:50:14 2009 @@ -315,10 +315,10 @@ #endif if (fd >= 0) { - self->fd = fd; - self->closefd = closefd; if (check_fd(fd)) goto error; + self->fd = fd; + self->closefd = closefd; } else { self->closefd = 1; From python-checkins at python.org Sun Feb 22 20:58:13 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 22 Feb 2009 20:58:13 +0100 (CET) Subject: [Python-checkins] r69874 - in python/trunk/Lib/distutils: tests/test_text_file.py text_file.py Message-ID: <20090222195813.317A41E4002@bag.python.org> Author: tarek.ziade Date: Sun Feb 22 20:58:12 2009 New Revision: 69874 Log: moved distutils.text_file tests into a real unittest class Added: python/trunk/Lib/distutils/tests/test_text_file.py (contents, props changed) Modified: python/trunk/Lib/distutils/text_file.py Added: python/trunk/Lib/distutils/tests/test_text_file.py ============================================================================== --- (empty file) +++ python/trunk/Lib/distutils/tests/test_text_file.py Sun Feb 22 20:58:12 2009 @@ -0,0 +1,87 @@ +"""Tests for distutils.text_file.""" +import os +import unittest +from distutils.text_file import TextFile +from distutils.tests import support + +TEST_DATA = """# test file + +line 3 \\ +# intervening comment + continues on next line +""" + +class TextFileTestCase(support.TempdirManager, unittest.TestCase): + + def test_class(self): + # old tests moved from text_file.__main__ + # so they are really called by the buildbots + + # result 1: no fancy options + result1 = map(lambda x: x + "\n", + TEST_DATA.split("\n")[0:-1]) + + # result 2: just strip comments + result2 = ["\n", + "line 3 \\\n", + " continues on next line\n"] + + # result 3: just strip blank lines + result3 = ["# test file\n", + "line 3 \\\n", + "# intervening comment\n", + " continues on next line\n"] + + # result 4: default, strip comments, blank lines, + # and trailing whitespace + result4 = ["line 3 \\", + " continues on next line"] + + # result 5: strip comments and blanks, plus join lines (but don't + # "collapse" joined lines + result5 = ["line 3 continues on next line"] + + # result 6: strip comments and blanks, plus join lines (and + # "collapse" joined lines + result6 = ["line 3 continues on next line"] + + def test_input(count, description, file, expected_result): + result = file.readlines() + self.assertEquals(result, expected_result) + + tmpdir = self.mkdtemp() + filename = os.path.join(tmpdir, "test.txt") + out_file = open(filename, "w") + try: + out_file.write(TEST_DATA) + finally: + out_file.close() + + in_file = TextFile (filename, strip_comments=0, skip_blanks=0, + lstrip_ws=0, rstrip_ws=0) + test_input (1, "no processing", in_file, result1) + + in_file = TextFile (filename, strip_comments=1, skip_blanks=0, + lstrip_ws=0, rstrip_ws=0) + test_input (2, "strip comments", in_file, result2) + + in_file = TextFile (filename, strip_comments=0, skip_blanks=1, + lstrip_ws=0, rstrip_ws=0) + test_input (3, "strip blanks", in_file, result3) + + in_file = TextFile (filename) + test_input (4, "default processing", in_file, result4) + + in_file = TextFile (filename, strip_comments=1, skip_blanks=1, + join_lines=1, rstrip_ws=1) + test_input (5, "join lines without collapsing", in_file, result5) + + in_file = TextFile (filename, strip_comments=1, skip_blanks=1, + join_lines=1, rstrip_ws=1, collapse_join=1) + test_input (6, "join lines with collapsing", in_file, result6) + +def test_suite(): + return unittest.makeSuite(TextFileTestCase) + +if __name__ == "__main__": + unittest.main(defaultTest="test_suite") Modified: python/trunk/Lib/distutils/text_file.py ============================================================================== --- python/trunk/Lib/distutils/text_file.py (original) +++ python/trunk/Lib/distutils/text_file.py Sun Feb 22 20:58:12 2009 @@ -303,80 +303,3 @@ a parser with line-at-a-time lookahead.""" self.linebuf.append (line) - - -if __name__ == "__main__": - test_data = """# test file - -line 3 \\ -# intervening comment - continues on next line -""" - # result 1: no fancy options - result1 = map (lambda x: x + "\n", string.split (test_data, "\n")[0:-1]) - - # result 2: just strip comments - result2 = ["\n", - "line 3 \\\n", - " continues on next line\n"] - - # result 3: just strip blank lines - result3 = ["# test file\n", - "line 3 \\\n", - "# intervening comment\n", - " continues on next line\n"] - - # result 4: default, strip comments, blank lines, and trailing whitespace - result4 = ["line 3 \\", - " continues on next line"] - - # result 5: strip comments and blanks, plus join lines (but don't - # "collapse" joined lines - result5 = ["line 3 continues on next line"] - - # result 6: strip comments and blanks, plus join lines (and - # "collapse" joined lines - result6 = ["line 3 continues on next line"] - - def test_input (count, description, file, expected_result): - result = file.readlines () - # result = string.join (result, '') - if result == expected_result: - print "ok %d (%s)" % (count, description) - else: - print "not ok %d (%s):" % (count, description) - print "** expected:" - print expected_result - print "** received:" - print result - - - filename = "test.txt" - out_file = open (filename, "w") - out_file.write (test_data) - out_file.close () - - in_file = TextFile (filename, strip_comments=0, skip_blanks=0, - lstrip_ws=0, rstrip_ws=0) - test_input (1, "no processing", in_file, result1) - - in_file = TextFile (filename, strip_comments=1, skip_blanks=0, - lstrip_ws=0, rstrip_ws=0) - test_input (2, "strip comments", in_file, result2) - - in_file = TextFile (filename, strip_comments=0, skip_blanks=1, - lstrip_ws=0, rstrip_ws=0) - test_input (3, "strip blanks", in_file, result3) - - in_file = TextFile (filename) - test_input (4, "default processing", in_file, result4) - - in_file = TextFile (filename, strip_comments=1, skip_blanks=1, - join_lines=1, rstrip_ws=1) - test_input (5, "join lines without collapsing", in_file, result5) - - in_file = TextFile (filename, strip_comments=1, skip_blanks=1, - join_lines=1, rstrip_ws=1, collapse_join=1) - test_input (6, "join lines with collapsing", in_file, result6) - - os.remove (filename) From python-checkins at python.org Sun Feb 22 20:59:07 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 22 Feb 2009 20:59:07 +0100 (CET) Subject: [Python-checkins] r69875 - python/branches/release26-maint Message-ID: <20090222195907.C61241E4002@bag.python.org> Author: tarek.ziade Date: Sun Feb 22 20:59:07 2009 New Revision: 69875 Log: Blocked revisions 69874 via svnmerge ........ r69874 | tarek.ziade | 2009-02-22 20:58:12 +0100 (Sun, 22 Feb 2009) | 1 line moved distutils.text_file tests into a real unittest class ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun Feb 22 21:05:23 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 22 Feb 2009 21:05:23 +0100 (CET) Subject: [Python-checkins] r69876 - in python/branches/py3k: Lib/distutils/tests/test_text_file.py Lib/distutils/text_file.py Message-ID: <20090222200523.E28E11E4002@bag.python.org> Author: tarek.ziade Date: Sun Feb 22 21:05:16 2009 New Revision: 69876 Log: Merged revisions 69874 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69874 | tarek.ziade | 2009-02-22 20:58:12 +0100 (Sun, 22 Feb 2009) | 1 line moved distutils.text_file tests into a real unittest class ........ Added: python/branches/py3k/Lib/distutils/tests/test_text_file.py - copied, changed from r69874, /python/trunk/Lib/distutils/tests/test_text_file.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/text_file.py Copied: python/branches/py3k/Lib/distutils/tests/test_text_file.py (from r69874, /python/trunk/Lib/distutils/tests/test_text_file.py) ============================================================================== --- /python/trunk/Lib/distutils/tests/test_text_file.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_text_file.py Sun Feb 22 21:05:16 2009 @@ -18,8 +18,9 @@ # so they are really called by the buildbots # result 1: no fancy options - result1 = map(lambda x: x + "\n", - TEST_DATA.split("\n")[0:-1]) + result1 = ['# test file\n', '\n', 'line 3 \\\n', + '# intervening comment\n', + ' continues on next line\n'] # result 2: just strip comments result2 = ["\n", Modified: python/branches/py3k/Lib/distutils/text_file.py ============================================================================== --- python/branches/py3k/Lib/distutils/text_file.py (original) +++ python/branches/py3k/Lib/distutils/text_file.py Sun Feb 22 21:05:16 2009 @@ -282,80 +282,3 @@ checked by future 'readline()' calls. Handy for implementing a parser with line-at-a-time lookahead.""" self.linebuf.append(line) - - -if __name__ == "__main__": - test_data = """# test file - -line 3 \\ -# intervening comment - continues on next line -""" - # result 1: no fancy options - result1 = [x + "\n" for x in test_data.split("\n")[:-1]] - - # result 2: just strip comments - result2 = ["\n", - "line 3 \\\n", - " continues on next line\n"] - - # result 3: just strip blank lines - result3 = ["# test file\n", - "line 3 \\\n", - "# intervening comment\n", - " continues on next line\n"] - - # result 4: default, strip comments, blank lines, and trailing whitespace - result4 = ["line 3 \\", - " continues on next line"] - - # result 5: strip comments and blanks, plus join lines (but don't - # "collapse" joined lines - result5 = ["line 3 continues on next line"] - - # result 6: strip comments and blanks, plus join lines (and - # "collapse" joined lines - result6 = ["line 3 continues on next line"] - - def test_input(count, description, file, expected_result): - result = file.readlines() - if result == expected_result: - print("ok %d (%s)" % (count, description)) - else: - print("not ok %d (%s):" % (count, description)) - print("** expected:") - print(expected_result) - print("** received:") - print(result) - - - filename = "test.txt" - out_file = open(filename, "w") - out_file.write(test_data) - out_file.close() - - in_file = TextFile(filename, strip_comments=0, skip_blanks=0, - lstrip_ws=0, rstrip_ws=0) - test_input(1, "no processing", in_file, result1) - - in_file = TextFile(filename, strip_comments=1, skip_blanks=0, - lstrip_ws=0, rstrip_ws=0) - test_input(2, "strip comments", in_file, result2) - - in_file = TextFile(filename, strip_comments=0, skip_blanks=1, - lstrip_ws=0, rstrip_ws=0) - test_input(3, "strip blanks", in_file, result3) - - in_file = TextFile(filename) - test_input(4, "default processing", in_file, result4) - - in_file = TextFile(filename, strip_comments=1, skip_blanks=1, - join_lines=1, rstrip_ws=1) - test_input(5, "join lines without collapsing", in_file, result5) - - in_file = TextFile(filename, strip_comments=1, skip_blanks=1, - join_lines=1, rstrip_ws=1, collapse_join=1) - test_input(6, "join lines with collapsing", in_file, result6) - - del in_file - os.remove(filename) From python-checkins at python.org Sun Feb 22 21:08:16 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 22 Feb 2009 21:08:16 +0100 (CET) Subject: [Python-checkins] r69877 - python/branches/release30-maint Message-ID: <20090222200816.8E6061E4002@bag.python.org> Author: tarek.ziade Date: Sun Feb 22 21:08:16 2009 New Revision: 69877 Log: Blocked revisions 69876 via svnmerge ................ r69876 | tarek.ziade | 2009-02-22 21:05:16 +0100 (Sun, 22 Feb 2009) | 9 lines Merged revisions 69874 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69874 | tarek.ziade | 2009-02-22 20:58:12 +0100 (Sun, 22 Feb 2009) | 1 line moved distutils.text_file tests into a real unittest class ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun Feb 22 21:11:46 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 22 Feb 2009 21:11:46 +0100 (CET) Subject: [Python-checkins] r69878 - python/trunk/Lib/distutils/tests/test_text_file.py Message-ID: <20090222201146.3AD921E4035@bag.python.org> Author: tarek.ziade Date: Sun Feb 22 21:11:46 2009 New Revision: 69878 Log: removing map and lambda usage, so the test is similar to py3k's branch one Modified: python/trunk/Lib/distutils/tests/test_text_file.py Modified: python/trunk/Lib/distutils/tests/test_text_file.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_text_file.py (original) +++ python/trunk/Lib/distutils/tests/test_text_file.py Sun Feb 22 21:11:46 2009 @@ -18,8 +18,9 @@ # so they are really called by the buildbots # result 1: no fancy options - result1 = map(lambda x: x + "\n", - TEST_DATA.split("\n")[0:-1]) + result1 = ['# test file\n', '\n', 'line 3 \\\n', + '# intervening comment\n', + ' continues on next line\n'] # result 2: just strip comments result2 = ["\n", From python-checkins at python.org Sun Feb 22 21:12:32 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 22 Feb 2009 21:12:32 +0100 (CET) Subject: [Python-checkins] r69879 - python/branches/release26-maint Message-ID: <20090222201232.AB2481E4011@bag.python.org> Author: tarek.ziade Date: Sun Feb 22 21:12:32 2009 New Revision: 69879 Log: Blocked revisions 69878 via svnmerge ........ r69878 | tarek.ziade | 2009-02-22 21:11:46 +0100 (Sun, 22 Feb 2009) | 1 line removing map and lambda usage, so the test is similar to py3k's branch one ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun Feb 22 21:14:01 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 22 Feb 2009 21:14:01 +0100 (CET) Subject: [Python-checkins] r69880 - python/branches/py3k Message-ID: <20090222201401.3DFE91E4002@bag.python.org> Author: tarek.ziade Date: Sun Feb 22 21:14:01 2009 New Revision: 69880 Log: Blocked revisions 69878 via svnmerge ........ r69878 | tarek.ziade | 2009-02-22 21:11:46 +0100 (Sun, 22 Feb 2009) | 1 line removing map and lambda usage, so the test is similar to py3k's branch one ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sun Feb 22 21:15:41 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 22 Feb 2009 21:15:41 +0100 (CET) Subject: [Python-checkins] r69881 - in python/trunk/Lib/distutils: cmd.py dist.py Message-ID: <20090222201541.7D1EA1E401E@bag.python.org> Author: tarek.ziade Date: Sun Feb 22 21:15:41 2009 New Revision: 69881 Log: Removing unused __main__ sections Modified: python/trunk/Lib/distutils/cmd.py python/trunk/Lib/distutils/dist.py Modified: python/trunk/Lib/distutils/cmd.py ============================================================================== --- python/trunk/Lib/distutils/cmd.py (original) +++ python/trunk/Lib/distutils/cmd.py Sun Feb 22 21:15:41 2009 @@ -474,7 +474,3 @@ def get_outputs (self): return self.outfiles - - -if __name__ == "__main__": - print "ok" Modified: python/trunk/Lib/distutils/dist.py ============================================================================== --- python/trunk/Lib/distutils/dist.py (original) +++ python/trunk/Lib/distutils/dist.py Sun Feb 22 21:15:41 2009 @@ -1224,8 +1224,3 @@ for help_tuple in options: new_options.append(help_tuple[0:3]) return new_options - - -if __name__ == "__main__": - dist = Distribution() - print "ok" From python-checkins at python.org Sun Feb 22 21:16:21 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 22 Feb 2009 21:16:21 +0100 (CET) Subject: [Python-checkins] r69882 - python/branches/release26-maint Message-ID: <20090222201621.DD5441E401B@bag.python.org> Author: tarek.ziade Date: Sun Feb 22 21:16:21 2009 New Revision: 69882 Log: Blocked revisions 69881 via svnmerge ........ r69881 | tarek.ziade | 2009-02-22 21:15:41 +0100 (Sun, 22 Feb 2009) | 1 line Removing unused __main__ sections ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun Feb 22 21:20:59 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 22 Feb 2009 21:20:59 +0100 (CET) Subject: [Python-checkins] r69883 - in python/branches/py3k: Lib/distutils/cmd.py Lib/distutils/dist.py Message-ID: <20090222202059.F26151E4002@bag.python.org> Author: tarek.ziade Date: Sun Feb 22 21:20:59 2009 New Revision: 69883 Log: Merged revisions 69881 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69881 | tarek.ziade | 2009-02-22 21:15:41 +0100 (Sun, 22 Feb 2009) | 1 line Removing unused __main__ sections ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/cmd.py python/branches/py3k/Lib/distutils/dist.py Modified: python/branches/py3k/Lib/distutils/cmd.py ============================================================================== --- python/branches/py3k/Lib/distutils/cmd.py (original) +++ python/branches/py3k/Lib/distutils/cmd.py Sun Feb 22 21:20:59 2009 @@ -436,7 +436,3 @@ def get_outputs (self): return self.outfiles - - -if __name__ == "__main__": - print("ok") Modified: python/branches/py3k/Lib/distutils/dist.py ============================================================================== --- python/branches/py3k/Lib/distutils/dist.py (original) +++ python/branches/py3k/Lib/distutils/dist.py Sun Feb 22 21:20:59 2009 @@ -1180,8 +1180,3 @@ for help_tuple in options: new_options.append(help_tuple[0:3]) return new_options - - -if __name__ == "__main__": - dist = Distribution() - print("ok") From python-checkins at python.org Sun Feb 22 21:21:48 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 22 Feb 2009 21:21:48 +0100 (CET) Subject: [Python-checkins] r69884 - python/branches/release30-maint Message-ID: <20090222202148.128901E4002@bag.python.org> Author: tarek.ziade Date: Sun Feb 22 21:21:47 2009 New Revision: 69884 Log: Blocked revisions 69883 via svnmerge ................ r69883 | tarek.ziade | 2009-02-22 21:20:59 +0100 (Sun, 22 Feb 2009) | 9 lines Merged revisions 69881 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69881 | tarek.ziade | 2009-02-22 21:15:41 +0100 (Sun, 22 Feb 2009) | 1 line Removing unused __main__ sections ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Sun Feb 22 21:22:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 22 Feb 2009 20:22:47 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090222202247.A9FD51E4002@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/4670 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_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun Feb 22 21:25:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 22 Feb 2009 20:25:34 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090222202534.84E091E4002@bag.python.org> The Buildbot has detected a new failure of OS X x86 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/175 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_site test_urllib2net ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun Feb 22 22:05:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 22 Feb 2009 21:05:41 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090222210541.4E8A61E4033@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/182 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 nnorwitz at gmail.com Sun Feb 22 22:16:39 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 22 Feb 2009 16:16:39 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090222211639.GA4008@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [664047 refs] From nnorwitz at gmail.com Sun Feb 22 22:29:26 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 22 Feb 2009 16:29:26 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090222212926.GA7329@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 [17163 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17142 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663314 refs] From python-checkins at python.org Sun Feb 22 22:30:14 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 22 Feb 2009 22:30:14 +0100 (CET) Subject: [Python-checkins] r69885 - in python/branches/io-c/Lib/test: test_bufio.py test_file.py Message-ID: <20090222213014.97CA11E401A@bag.python.org> Author: benjamin.peterson Date: Sun Feb 22 22:30:14 2009 New Revision: 69885 Log: convert some other tests to use both io implementations Modified: python/branches/io-c/Lib/test/test_bufio.py python/branches/io-c/Lib/test/test_file.py Modified: python/branches/io-c/Lib/test/test_bufio.py ============================================================================== --- python/branches/io-c/Lib/test/test_bufio.py (original) +++ python/branches/io-c/Lib/test/test_bufio.py Sun Feb 22 22:30:14 2009 @@ -1,9 +1,12 @@ import unittest from test import support -# Simple test to ensure that optimizations in fileobject.c deliver -# the expected results. For best testing, run this under a debug-build -# Python too (to exercise asserts in the C code). +import io # C implementation. +import _pyio as pyio # Python implementation. + +# Simple test to ensure that optimizations in the IO library deliver the +# expected results. For best testing, run this under a debug-build Python too +# (to exercise asserts in the C code). lengths = list(range(1, 257)) + [512, 1000, 1024, 2048, 4096, 8192, 10000, 16384, 32768, 65536, 1000000] @@ -18,7 +21,7 @@ # Since C doesn't guarantee we can write/read arbitrary bytes in text # files, use binary mode. - f = open(support.TESTFN, "wb") + f = self.open(support.TESTFN, "wb") try: # write once with \n and once without f.write(s) @@ -58,8 +61,16 @@ def test_nullpat(self): self.drive_one(bytes(1000)) + +class CBufferSizeTest(BufferSizeTest): + open = io.open + +class PyBufferSizeTest(BufferSizeTest): + open = staticmethod(pyio.open) + + def test_main(): - support.run_unittest(BufferSizeTest) + support.run_unittest(CBufferSizeTest, PyBufferSizeTest) if __name__ == "__main__": test_main() Modified: python/branches/io-c/Lib/test/test_file.py ============================================================================== --- python/branches/io-c/Lib/test/test_file.py (original) +++ python/branches/io-c/Lib/test/test_file.py Sun Feb 22 22:30:14 2009 @@ -4,6 +4,9 @@ from array import array from weakref import proxy +import io +import _pyio as pyio + from test.support import TESTFN, findfile, run_unittest from collections import UserList @@ -11,7 +14,7 @@ # file tests for which a test file is automatically set up def setUp(self): - self.f = open(TESTFN, 'wb') + self.f = self.open(TESTFN, 'wb') def tearDown(self): if self.f: @@ -39,7 +42,7 @@ self.f.write(b'12') self.f.close() a = array('b', b'x'*10) - self.f = open(TESTFN, 'rb') + self.f = self.open(TESTFN, 'rb') n = self.f.readinto(a) self.assertEquals(b'12', a.tostring()[:n]) @@ -47,7 +50,7 @@ # verify readinto refuses text files a = array('b', b'x'*10) self.f.close() - self.f = open(TESTFN, 'r') + self.f = self.open(TESTFN, 'r') if hasattr(self.f, "readinto"): self.assertRaises(TypeError, self.f.readinto, a) @@ -56,7 +59,7 @@ l = UserList([b'1', b'2']) self.f.writelines(l) self.f.close() - self.f = open(TESTFN, 'rb') + self.f = self.open(TESTFN, 'rb') buf = self.f.read() self.assertEquals(buf, b'12') @@ -126,13 +129,20 @@ def testReadWhenWriting(self): self.assertRaises(IOError, self.f.read) +class CAutoFileTests(AutoFileTests): + open = io.open + +class PyAutoFileTests(AutoFileTests): + open = staticmethod(pyio.open) + + class OtherFileTests(unittest.TestCase): def testModeStrings(self): # check invalid mode strings for mode in ("", "aU", "wU+"): try: - f = open(TESTFN, mode) + f = self.open(TESTFN, mode) except ValueError: pass else: @@ -153,7 +163,7 @@ # verify that we get a sensible error message for bad mode argument bad_mode = "qwerty" try: - f = open(TESTFN, bad_mode) + f = self.open(TESTFN, bad_mode) except ValueError as msg: if msg.args[0] != 0: s = str(msg) @@ -170,11 +180,11 @@ # misbehaviour especially with repeated close() calls for s in (-1, 0, 1, 512): try: - f = open(TESTFN, 'wb', s) + f = self.open(TESTFN, 'wb', s) f.write(str(s).encode("ascii")) f.close() f.close() - f = open(TESTFN, 'rb', s) + f = self.open(TESTFN, 'rb', s) d = int(f.read().decode("ascii")) f.close() f.close() @@ -187,13 +197,13 @@ # "file.truncate fault on windows" os.unlink(TESTFN) - f = open(TESTFN, 'wb') + f = self.open(TESTFN, 'wb') try: f.write(b'12345678901') # 11 bytes f.close() - f = open(TESTFN,'rb+') + f = self.open(TESTFN,'rb+') data = f.read(5) if data != b'12345': self.fail("Read on file opened for update failed %r" % data) @@ -233,13 +243,13 @@ try: # Prepare the testfile - bag = open(TESTFN, "wb") + bag = self.open(TESTFN, "wb") bag.write(filler * nchunks) bag.writelines(testlines) bag.close() # Test for appropriate errors mixing read* and iteration for methodname, args in methods: - f = open(TESTFN, 'rb') + f = self.open(TESTFN, 'rb') if next(f) != filler: self.fail, "Broken testfile" meth = getattr(f, methodname) @@ -253,7 +263,7 @@ # ("h", "a", "m", "\n"), so 4096 lines of that should get us # exactly on the buffer boundary for any power-of-2 buffersize # between 4 and 16384 (inclusive). - f = open(TESTFN, 'rb') + f = self.open(TESTFN, 'rb') for i in range(nchunks): next(f) testline = testlines.pop(0) @@ -295,7 +305,7 @@ self.fail("readlines() after next() with empty buffer " "failed. Got %r, expected %r" % (line, testline)) # Reading after iteration hit EOF shouldn't hurt either - f = open(TESTFN, 'rb') + f = self.open(TESTFN, 'rb') try: for line in f: pass @@ -311,12 +321,19 @@ finally: os.unlink(TESTFN) +class COtherFileTests(OtherFileTests): + open = io.open + +class PyOtherFileTests(OtherFileTests): + open = staticmethod(pyio.open) + def test_main(): # Historically, these tests have been sloppy about removing TESTFN. # So get rid of it no matter what. try: - run_unittest(AutoFileTests, OtherFileTests) + run_unittest(CAutoFileTests, PyAutoFileTests, + COtherFileTests, PyOtherFileTests) finally: if os.path.exists(TESTFN): os.unlink(TESTFN) From buildbot at python.org Sun Feb 22 23:30:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 22 Feb 2009 22:30:45 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090222223045.6D1B11E4002@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/412 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_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun Feb 22 23:42:22 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 22 Feb 2009 23:42:22 +0100 (CET) Subject: [Python-checkins] r69886 - peps/trunk/pep-0376.txt Message-ID: <20090222224222.7F38D1E4002@bag.python.org> Author: brett.cannon Date: Sun Feb 22 23:42:22 2009 New Revision: 69886 Log: Minor wording changes. Modified: peps/trunk/pep-0376.txt Modified: peps/trunk/pep-0376.txt ============================================================================== --- peps/trunk/pep-0376.txt (original) +++ peps/trunk/pep-0376.txt Sun Feb 22 23:42:22 2009 @@ -1,7 +1,7 @@ PEP: 376 Title: Changing the .egg-info structure -Version: $Revision:$ -Last-Modified: $Date:$ +Version: $Revision$ +Last-Modified: $Date$ Author: Tarek Ziad? Status: Draft Type: Standards Track @@ -17,9 +17,9 @@ This PEP proposes various enhancements for Distutils: -- a new format for the .egg-info structure. -- an install script to install package in Python. -- an uninstall script to uninstall a package in Python. +- A new format for the .egg-info structure. +- An install script to install a package in Python. +- An uninstall script to uninstall a package in Python. Rationale ========= @@ -27,8 +27,8 @@ There are three problems right now in the way packages are installed in Python: -- There are too many different ways to install a package in - Python nowadays +- There are too many ways to install a package in + Python. - There is no way to uninstall a package. From python-checkins at python.org Sun Feb 22 23:42:44 2009 From: python-checkins at python.org (brett.cannon) Date: Sun, 22 Feb 2009 23:42:44 +0100 (CET) Subject: [Python-checkins] r69887 - peps/trunk/pep-0374.txt Message-ID: <20090222224244.E876D1E4002@bag.python.org> Author: brett.cannon Date: Sun Feb 22 23:42:44 2009 New Revision: 69887 Log: Update timing info to add another set of data points. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Sun Feb 22 23:42:44 2009 @@ -203,8 +203,8 @@ ========== ========== ======= =================================== ========================================== Name Short Name Version 2.x Trunk Mirror 3.x Trunk Mirror ---------- ---------- ------- ----------------------------------- ------------------------------------------ -Bazaar_ bzr 1.11 http://code.python.org/python/trunk http://code.python.org/python/3.0 -Mercurial_ hg 1.1.2 http://code.python.org/hg/trunk/ http://code.python.org/hg/branches/py3k/ +Bazaar_ bzr 1.12 http://code.python.org/python/trunk http://code.python.org/python/3.0 +Mercurial_ hg 1.1.2 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 ========== ========== ======= =================================== ========================================== @@ -1353,18 +1353,18 @@ person wishing to contribute to Python may very well give up. That cannot be allowed to happen. -I measured the checking out of code as if I was a non-core +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 Time Space -------- ---------------- -------------- -svn 1:04 139 M -bzr 10:45 276 M -hg 2:30 171 M -git 2:54 134 M -======= ================ ============== +======= ================ ========= ===== +DVCS San Francisco Vancouver Space +------- ---------------- --------- ----- +svn 1:04 2:59 139 M +bzr 10:45 23:51 276 M +hg 2:30 5:24 171 M +git 2:54 5:28 134 M +======= ================ ========= ===== .. note:: The version of bzr running on code.python.org is 1.5. Changes were @@ -1375,7 +1375,7 @@ 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 worry about. +that it has less information to download for the network. Performance of basic information functionality @@ -1420,7 +1420,10 @@ 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``. +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 From python-checkins at python.org Mon Feb 23 00:03:21 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 23 Feb 2009 00:03:21 +0100 (CET) Subject: [Python-checkins] r69888 - python/branches/io-c/Modules/_iobase.c Message-ID: <20090222230321.904731E4002@bag.python.org> Author: antoine.pitrou Date: Mon Feb 23 00:03:16 2009 New Revision: 69888 Log: Silence all exceptions when finalizing Modified: python/branches/io-c/Modules/_iobase.c Modified: python/branches/io-c/Modules/_iobase.c ============================================================================== --- python/branches/io-c/Modules/_iobase.c (original) +++ python/branches/io-c/Modules/_iobase.c Mon Feb 23 00:03:16 2009 @@ -219,14 +219,16 @@ closed = PyObject_IsTrue(res); Py_DECREF(res); if (closed == -1) - PyErr_WriteUnraisable(self); + PyErr_Clear(); } if (closed == 0) { res = PyObject_CallMethodObjArgs((PyObject *) self, _PyIO_str_close, NULL); - /* Silencing I/O errors is bad, so we print them out on the console. */ + /* Silencing I/O errors is bad, but printing spurious tracebacks is + equally as bad, and potentially more frequent (because of + shutdown issues). */ if (res == NULL) - PyErr_WriteUnraisable(self); + PyErr_Clear(); else Py_DECREF(res); } From python-checkins at python.org Mon Feb 23 00:14:26 2009 From: python-checkins at python.org (matthias.klose) Date: Mon, 23 Feb 2009 00:14:26 +0100 (CET) Subject: [Python-checkins] r69889 - in python/trunk: Makefile.pre.in Misc/NEWS Message-ID: <20090222231426.A16A31E4002@bag.python.org> Author: matthias.klose Date: Mon Feb 23 00:14:26 2009 New Revision: 69889 Log: - Link the shared python library with $(MODLIBS). Modified: python/trunk/Makefile.pre.in python/trunk/Misc/NEWS Modified: python/trunk/Makefile.pre.in ============================================================================== --- python/trunk/Makefile.pre.in (original) +++ python/trunk/Makefile.pre.in Mon Feb 23 00:14:26 2009 @@ -411,10 +411,10 @@ libpython$(VERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ - $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ $(LN) -f $(INSTSONAME) $@; \ else \ - $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ fi libpython$(VERSION).dylib: $(LIBRARY_OBJS) @@ -422,7 +422,7 @@ libpython$(VERSION).sl: $(LIBRARY_OBJS) - $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) + $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary # minimal framework (not including the Lib directory and such) in the current Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Feb 23 00:14:26 2009 @@ -494,6 +494,8 @@ Build ----- +- Link the shared python library with $(MODLIBS). + - Issue #5134: Silence compiler warnings when compiling sqlite with VC++. - Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. From python-checkins at python.org Mon Feb 23 00:18:38 2009 From: python-checkins at python.org (matthias.klose) Date: Mon, 23 Feb 2009 00:18:38 +0100 (CET) Subject: [Python-checkins] r69890 - in python/branches/py3k: Makefile.pre.in Misc/NEWS Message-ID: <20090222231838.569051E4002@bag.python.org> Author: matthias.klose Date: Mon Feb 23 00:18:38 2009 New Revision: 69890 Log: Merged revisions 69889 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69889 | matthias.klose | 2009-02-23 00:14:26 +0100 (Mo, 23 Feb 2009) | 2 lines - Link the shared python library with $(MODLIBS). ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Makefile.pre.in python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Makefile.pre.in ============================================================================== --- python/branches/py3k/Makefile.pre.in (original) +++ python/branches/py3k/Makefile.pre.in Mon Feb 23 00:18:38 2009 @@ -419,10 +419,10 @@ libpython$(VERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ - $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ $(LN) -f $(INSTSONAME) $@; \ else \ - $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ fi libpython$(VERSION).dylib: $(LIBRARY_OBJS) @@ -430,7 +430,7 @@ libpython$(VERSION).sl: $(LIBRARY_OBJS) - $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) + $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary # minimal framework (not including the Lib directory and such) in the current Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon Feb 23 00:18:38 2009 @@ -479,6 +479,8 @@ Build ----- +- Link the shared python library with $(MODLIBS). + - Issue #5134: Silence compiler warnings when compiling sqlite with VC++. - Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. From python-checkins at python.org Mon Feb 23 00:27:24 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 23 Feb 2009 00:27:24 +0100 (CET) Subject: [Python-checkins] r69891 - python/branches/io-c/Lib/test/test_univnewlines.py Message-ID: <20090222232724.32D431E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 23 00:27:24 2009 New Revision: 69891 Log: convert another test to test both io implementations Modified: python/branches/io-c/Lib/test/test_univnewlines.py Modified: python/branches/io-c/Lib/test/test_univnewlines.py ============================================================================== --- python/branches/io-c/Lib/test/test_univnewlines.py (original) +++ python/branches/io-c/Lib/test/test_univnewlines.py Mon Feb 23 00:27:24 2009 @@ -1,4 +1,6 @@ # Tests universal newline support for both reading and parsing files. +import io +import _pyio as pyio import unittest import os import sys @@ -35,7 +37,7 @@ WRITEMODE = 'wb' def setUp(self): - fp = open(support.TESTFN, self.WRITEMODE) + fp = self.open(support.TESTFN, self.WRITEMODE) data = self.DATA if "b" in self.WRITEMODE: data = data.encode("ascii") @@ -49,19 +51,19 @@ pass def test_read(self): - fp = open(support.TESTFN, self.READMODE) + fp = self.open(support.TESTFN, self.READMODE) data = fp.read() self.assertEqual(data, DATA_LF) self.assertEqual(repr(fp.newlines), repr(self.NEWLINE)) def test_readlines(self): - fp = open(support.TESTFN, self.READMODE) + fp = self.open(support.TESTFN, self.READMODE) data = fp.readlines() self.assertEqual(data, DATA_SPLIT) self.assertEqual(repr(fp.newlines), repr(self.NEWLINE)) def test_readline(self): - fp = open(support.TESTFN, self.READMODE) + fp = self.open(support.TESTFN, self.READMODE) data = [] d = fp.readline() while d: @@ -71,7 +73,7 @@ self.assertEqual(repr(fp.newlines), repr(self.NEWLINE)) def test_seek(self): - fp = open(support.TESTFN, self.READMODE) + fp = self.open(support.TESTFN, self.READMODE) fp.readline() pos = fp.tell() data = fp.readlines() @@ -94,7 +96,7 @@ DATA = DATA_CRLF def test_tell(self): - fp = open(support.TESTFN, self.READMODE) + fp = self.open(support.TESTFN, self.READMODE) self.assertEqual(repr(fp.newlines), repr(None)) data = fp.readline() pos = fp.tell() @@ -106,12 +108,22 @@ def test_main(): - support.run_unittest( - TestCRNewlines, - TestLFNewlines, - TestCRLFNewlines, - TestMixedNewlines - ) + base_tests = (TestCRNewlines, + TestLFNewlines, + TestCRLFNewlines, + TestMixedNewlines) + tests = [] + # Test the C and Python implementations. + for test in base_tests: + class CTest(test): + open = io.open + CTest.__name__ = "C" + test.__name__ + class PyTest(test): + open = staticmethod(pyio.open) + PyTest.__name__ = "Py" + test.__name__ + tests.append(CTest) + tests.append(PyTest) + support.run_unittest(*tests) if __name__ == '__main__': test_main() From python-checkins at python.org Mon Feb 23 00:32:15 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 23 Feb 2009 00:32:15 +0100 (CET) Subject: [Python-checkins] r69892 - python/branches/io-c/Lib/test/test_io.py Message-ID: <20090222233215.F40FE1E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 23 00:32:15 2009 New Revision: 69892 Log: help poor people like me to find their io tests (did I miss any?) Modified: python/branches/io-c/Lib/test/test_io.py Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Mon Feb 23 00:32:15 2009 @@ -1,4 +1,12 @@ -"""Unit tests for io.py.""" +"""Unit tests for the io module.""" + +# Tests of io are scattered over the test suite: +# * test_bufio - tests file buffering +# * test_memoryio - tests BytesIO and StringIO +# * test_fileio - tests FileIO +# * test_file - tests the file interface +# * test_io - tests everything else in the io module +# * test_univnewlines - tests universal newline support import os import sys From python-checkins at python.org Mon Feb 23 00:37:56 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 23 Feb 2009 00:37:56 +0100 (CET) Subject: [Python-checkins] r69893 - python/branches/io-c/Lib/test/test_io.py Message-ID: <20090222233756.D2B691E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 23 00:37:56 2009 New Revision: 69893 Log: put a big note in the test telling people to write tests for both implementations now Modified: python/branches/io-c/Lib/test/test_io.py Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Mon Feb 23 00:37:56 2009 @@ -8,6 +8,15 @@ # * test_io - tests everything else in the io module # * test_univnewlines - tests universal newline support +################################################################################ +# ATTENTION TEST WRITERS!!! +################################################################################ +# When writing tests for io, it's important to test both the C and Python +# implementations. This is usually done by writing a base test that refers to +# the type it is testing as a attribute. Then it provides custom subclasses to +# test both implementations. This file has lots of examples. +################################################################################ + import os import sys import time From buildbot at python.org Mon Feb 23 00:42:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 22 Feb 2009 23:42:39 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090222234239.8FB701E4002@bag.python.org> The Buildbot has detected a new failure of OS X x86 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/177 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: matthias.klose BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Feb 23 01:06:42 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 23 Feb 2009 00:06:42 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090223000642.D48991E4002@bag.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/318 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: matthias.klose BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Feb 23 02:42:55 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 23 Feb 2009 01:42:55 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090223014256.049811E4002@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/174 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 buildbot at python.org Mon Feb 23 04:10:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 23 Feb 2009 03:10:41 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.0 Message-ID: <20090223031042.23D5D1E4002@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/173 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 test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/3.0.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.0.klose-debian-ia64/build/Lib/test/test_urllibnet.py", line 25, in _open_with_retry raise last_exc File "/home/pybot/buildarea/3.0.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.0.klose-debian-ia64/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib/request.py", line 358, in open response = self._open(req, data) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib/request.py", line 376, in _open '_open', req) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib/request.py", line 336, in _call_chain result = func(*args) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib/request.py", line 1082, in http_open return self.do_open(http.client.HTTPConnection, req) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib/request.py", line 1070, in do_open raise URLError(err) urllib.error.URLError: 1 test failed: test_urllibnet make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Feb 23 04:38:43 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 23 Feb 2009 04:38:43 +0100 (CET) Subject: [Python-checkins] r69894 - python/branches/py3k/Misc/python.man Message-ID: <20090223033843.DB2341E4002@bag.python.org> Author: benjamin.peterson Date: Mon Feb 23 04:38:43 2009 New Revision: 69894 Log: .pythonrc.py is no more Modified: python/branches/py3k/Misc/python.man Modified: python/branches/py3k/Misc/python.man ============================================================================== --- python/branches/py3k/Misc/python.man (original) +++ python/branches/py3k/Misc/python.man Mon Feb 23 04:38:43 2009 @@ -306,9 +306,6 @@ needed for developing Python extensions and embedding the interpreter. .RE -.IP \fI~/.pythonrc.py\fP -User-specific initialization file loaded by the \fIuser\fP module; -not used by default or by most applications. .SH ENVIRONMENT VARIABLES .IP PYTHONHOME Change the location of the standard Python libraries. By default, the From buildbot at python.org Mon Feb 23 06:01:36 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 23 Feb 2009 05:01:36 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090223050136.7C9E51E4002@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/324 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: matthias.klose BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Mon Feb 23 10:09:19 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 23 Feb 2009 04:09:19 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090223090919.GA19499@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17142 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [664044 refs] From nnorwitz at gmail.com Mon Feb 23 10:16:31 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 23 Feb 2009 04:16:31 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090223091631.GA21890@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 [17163 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17142 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663314 refs] From python-checkins at python.org Mon Feb 23 11:24:05 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 23 Feb 2009 11:24:05 +0100 (CET) Subject: [Python-checkins] r69895 - python/branches/py3k/Doc/library/functions.rst Message-ID: <20090223102405.7FFA21E4002@bag.python.org> Author: georg.brandl Date: Mon Feb 23 11:24:05 2009 New Revision: 69895 Log: #5348: format() converts all kinds of values. Modified: python/branches/py3k/Doc/library/functions.rst Modified: python/branches/py3k/Doc/library/functions.rst ============================================================================== --- python/branches/py3k/Doc/library/functions.rst (original) +++ python/branches/py3k/Doc/library/functions.rst Mon Feb 23 11:24:05 2009 @@ -415,14 +415,15 @@ pair: str; format single: __format__ - Convert a string or a number to a "formatted" representation, as controlled - by *format_spec*. The interpretation of *format_spec* will depend on the - type of the *value* argument, however there is a standard formatting syntax - that is used by most built-in types: :ref:`formatspec`. + Convert a *value* to a "formatted" representation, as controlled by + *format_spec*. The interpretation of *format_spec* will depend on the type + of the *value* argument, however there is a standard formatting syntax that + is used by most built-in types: :ref:`formatspec`. .. note:: - ``format(value, format_spec)`` merely calls ``value.__format__(format_spec)``. + ``format(value, format_spec)`` merely calls + ``value.__format__(format_spec)``. .. function:: frozenset([iterable]) From python-checkins at python.org Mon Feb 23 11:24:23 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 23 Feb 2009 11:24:23 +0100 (CET) Subject: [Python-checkins] r69896 - python/trunk/Doc/library/functions.rst Message-ID: <20090223102423.2F7C71E4002@bag.python.org> Author: georg.brandl Date: Mon Feb 23 11:24:23 2009 New Revision: 69896 Log: #5348: format() converts all kinds of values. 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 Mon Feb 23 11:24:23 2009 @@ -425,6 +425,26 @@ The float type is described in :ref:`typesnumeric`. + +.. function:: format(value[, format_spec]) + + .. index:: + pair: str; format + single: __format__ + + Convert a *value* to a "formatted" representation, as controlled by + *format_spec*. The interpretation of *format_spec* will depend on the type + of the *value* argument, however there is a standard formatting syntax that + is used by most built-in types: :ref:`formatspec`. + + .. note:: + + ``format(value, format_spec)`` merely calls + ``value.__format__(format_spec)``. + + .. versionadded:: 2.6 + + .. function:: frozenset([iterable]) :noindex: From python-checkins at python.org Mon Feb 23 11:25:20 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 23 Feb 2009 11:25:20 +0100 (CET) Subject: [Python-checkins] r69897 - python/branches/py3k Message-ID: <20090223102520.DDA971E4002@bag.python.org> Author: georg.brandl Date: Mon Feb 23 11:25:20 2009 New Revision: 69897 Log: Blocked revisions 69896 via svnmerge ........ r69896 | georg.brandl | 2009-02-23 11:24:23 +0100 (Mo, 23 Feb 2009) | 1 line #5348: format() converts all kinds of values. ........ Modified: python/branches/py3k/ (props changed) From nnorwitz at gmail.com Mon Feb 23 11:40:27 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 23 Feb 2009 05:40:27 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090223104027.GA23037@python.psfb.org> 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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-7950 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 test_slice test_smtplib test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [677744 refs] From python-checkins at python.org Mon Feb 23 11:41:13 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 23 Feb 2009 11:41:13 +0100 (CET) Subject: [Python-checkins] r69898 - in python/branches/release26-maint: Doc/c-api/exceptions.rst Doc/c-api/init.rst Doc/c-api/intro.rst Doc/c-api/veryhigh.rst Doc/documenting/markup.rst Doc/howto/webservers.rst Doc/library/base64.rst Doc/library/cgi.rst Doc/library/cgitb.rst Doc/library/cookielib.rst Doc/library/ctypes.rst Doc/library/datetime.rst Doc/library/exceptions.rst Doc/library/functions.rst Doc/library/optparse.rst Doc/library/random.rst Doc/library/socketserver.rst Doc/library/stdtypes.rst Doc/library/threading.rst Doc/library/urllib2.rst Doc/library/xml.etree.elementtree.rst Doc/library/xmlrpclib.rst Doc/reference/datamodel.rst Doc/reference/expressions.rst Doc/reference/introduction.rst Doc/reference/simple_stmts.rst Doc/tools/rstlint.py Doc/tools/sphinxext/pyspecific.py Doc/whatsnew/2.5.rst Lib/test/test_ast.py Message-ID: <20090223104113.40B321E4029@bag.python.org> Author: georg.brandl Date: Mon Feb 23 11:41:11 2009 New Revision: 69898 Log: Merged revisions 68582,68718,68720-68721,68724-68727,68859,68973,69288-69289,69293,69295,69297-69301,69409,69414,69570,69573,69576,69728-69730,69769,69776,69803-69805,69840,69896 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r68582 | georg.brandl | 2009-01-13 23:14:01 +0100 (Di, 13 Jan 2009) | 2 lines Use assertRaises. ........ r68718 | georg.brandl | 2009-01-18 11:42:35 +0100 (So, 18 Jan 2009) | 1 line #4976: union() and intersection() take multiple args, but talk about "the other". ........ r68720 | georg.brandl | 2009-01-18 11:45:22 +0100 (So, 18 Jan 2009) | 1 line #4974: fix redundant mention of lists and tuples. ........ r68721 | georg.brandl | 2009-01-18 11:48:16 +0100 (So, 18 Jan 2009) | 1 line #4914: trunc is in math. ........ r68724 | georg.brandl | 2009-01-18 14:24:10 +0100 (So, 18 Jan 2009) | 1 line #4979: correct result range for some random functions. ........ r68725 | georg.brandl | 2009-01-18 14:47:26 +0100 (So, 18 Jan 2009) | 1 line #4857: fix augmented assignment target spec. ........ r68726 | georg.brandl | 2009-01-18 15:41:52 +0100 (So, 18 Jan 2009) | 1 line #4923: clarify what was added. ........ r68727 | georg.brandl | 2009-01-18 19:25:30 +0100 (So, 18 Jan 2009) | 1 line #4986: augassigns are not expressions. ........ r68859 | georg.brandl | 2009-01-22 19:29:28 +0100 (Do, 22 Jan 2009) | 2 lines Clarify wording. ........ r68973 | georg.brandl | 2009-01-26 22:29:38 +0100 (Mo, 26 Jan 2009) | 2 lines Copy over docs on advanced role features from Sphinx docs. ........ r69288 | georg.brandl | 2009-02-05 11:30:57 +0100 (Do, 05 Feb 2009) | 1 line #5153: fix typo in example. ........ r69289 | georg.brandl | 2009-02-05 11:37:07 +0100 (Do, 05 Feb 2009) | 1 line #5144: document that PySys_SetArgv prepends the script directory (or the empty string) to sys.path. ........ r69293 | georg.brandl | 2009-02-05 11:59:28 +0100 (Do, 05 Feb 2009) | 1 line #5059: fix example. ........ r69295 | georg.brandl | 2009-02-05 12:23:47 +0100 (Do, 05 Feb 2009) | 1 line PyErr_PrintEx is also in 2.x... ........ r69297 | georg.brandl | 2009-02-05 12:32:18 +0100 (Do, 05 Feb 2009) | 1 line #5015: document PythonHome API functions. ........ r69298 | georg.brandl | 2009-02-05 12:33:21 +0100 (Do, 05 Feb 2009) | 1 line #4827: fix callback example. ........ r69299 | georg.brandl | 2009-02-05 12:35:28 +0100 (Do, 05 Feb 2009) | 1 line #4820: use correct module for ctypes.util. ........ r69300 | georg.brandl | 2009-02-05 12:38:23 +0100 (Do, 05 Feb 2009) | 1 line #4563: disable alpha and roman lists, fixes wrong formatting of contributor list. ........ r69301 | georg.brandl | 2009-02-05 12:40:35 +0100 (Do, 05 Feb 2009) | 1 line #5031: fix Thread.daemon property docs. ........ r69409 | georg.brandl | 2009-02-07 13:21:17 +0100 (Sa, 07 Feb 2009) | 1 line #5174: fix wrong file closing in example. ........ r69414 | georg.brandl | 2009-02-07 19:49:54 +0100 (Sa, 07 Feb 2009) | 1 line make "super only for new-style classes" a note. ........ r69570 | georg.brandl | 2009-02-13 11:40:14 +0100 (Fr, 13 Feb 2009) | 1 line #4894: document "newurl" parameter to redirect_request(). ........ r69573 | georg.brandl | 2009-02-13 11:44:17 +0100 (Fr, 13 Feb 2009) | 1 line #3734: document complex coercing behavior better. ........ r69576 | georg.brandl | 2009-02-13 11:56:50 +0100 (Fr, 13 Feb 2009) | 1 line #1661108: note that urlsafe encoded string can contain "=". ........ r69728 | georg.brandl | 2009-02-18 01:22:55 +0100 (Mi, 18 Feb 2009) | 2 lines #5297: fix example. ........ r69729 | georg.brandl | 2009-02-18 01:25:13 +0100 (Mi, 18 Feb 2009) | 2 lines #5296: sequence -> iterable. ........ r69730 | georg.brandl | 2009-02-18 01:31:36 +0100 (Mi, 18 Feb 2009) | 2 lines #5268: mention VMSError. ........ r69769 | georg.brandl | 2009-02-19 09:30:06 +0100 (Do, 19 Feb 2009) | 1 line #5310, #3558: fix operator precedence table. ........ r69776 | georg.brandl | 2009-02-19 17:34:51 +0100 (Do, 19 Feb 2009) | 2 lines #5317: update IronPython URL. ........ r69803 | georg.brandl | 2009-02-20 08:48:21 +0100 (Fr, 20 Feb 2009) | 1 line #5327: fix a broken link by joining it. ........ r69804 | georg.brandl | 2009-02-20 09:22:21 +0100 (Fr, 20 Feb 2009) | 1 line At least separate imports from other statements. ........ r69805 | georg.brandl | 2009-02-20 09:45:47 +0100 (Fr, 20 Feb 2009) | 2 lines Fix punctuation. ........ r69840 | georg.brandl | 2009-02-21 20:09:40 +0100 (Sa, 21 Feb 2009) | 1 line #5338, #5339: two types in the API manual. ........ r69896 | georg.brandl | 2009-02-23 11:24:23 +0100 (Mo, 23 Feb 2009) | 1 line #5348: format() converts all kinds of values. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/c-api/exceptions.rst python/branches/release26-maint/Doc/c-api/init.rst python/branches/release26-maint/Doc/c-api/intro.rst python/branches/release26-maint/Doc/c-api/veryhigh.rst python/branches/release26-maint/Doc/documenting/markup.rst python/branches/release26-maint/Doc/howto/webservers.rst python/branches/release26-maint/Doc/library/base64.rst python/branches/release26-maint/Doc/library/cgi.rst python/branches/release26-maint/Doc/library/cgitb.rst python/branches/release26-maint/Doc/library/cookielib.rst python/branches/release26-maint/Doc/library/ctypes.rst python/branches/release26-maint/Doc/library/datetime.rst python/branches/release26-maint/Doc/library/exceptions.rst python/branches/release26-maint/Doc/library/functions.rst python/branches/release26-maint/Doc/library/optparse.rst python/branches/release26-maint/Doc/library/random.rst python/branches/release26-maint/Doc/library/socketserver.rst python/branches/release26-maint/Doc/library/stdtypes.rst python/branches/release26-maint/Doc/library/threading.rst python/branches/release26-maint/Doc/library/urllib2.rst python/branches/release26-maint/Doc/library/xml.etree.elementtree.rst python/branches/release26-maint/Doc/library/xmlrpclib.rst python/branches/release26-maint/Doc/reference/datamodel.rst python/branches/release26-maint/Doc/reference/expressions.rst python/branches/release26-maint/Doc/reference/introduction.rst python/branches/release26-maint/Doc/reference/simple_stmts.rst python/branches/release26-maint/Doc/tools/rstlint.py python/branches/release26-maint/Doc/tools/sphinxext/pyspecific.py python/branches/release26-maint/Doc/whatsnew/2.5.rst python/branches/release26-maint/Lib/test/test_ast.py Modified: python/branches/release26-maint/Doc/c-api/exceptions.rst ============================================================================== --- python/branches/release26-maint/Doc/c-api/exceptions.rst (original) +++ python/branches/release26-maint/Doc/c-api/exceptions.rst Mon Feb 23 11:41:11 2009 @@ -41,12 +41,21 @@ Either alphabetical or some kind of structure. -.. cfunction:: void PyErr_Print() +.. cfunction:: void PyErr_PrintEx(int set_sys_last_vars) Print a standard traceback to ``sys.stderr`` and clear the error indicator. Call this function only when the error indicator is set. (Otherwise it will cause a fatal error!) + If *set_sys_last_vars* is nonzero, the variables :data:`sys.last_type`, + :data:`sys.last_value` and :data:`sys.last_traceback` will be set to the + type, value and traceback of the printed exception, respectively. + + +.. cfunction:: void PyErr_Print() + + Alias for ``PyErr_PrintEx(1)``. + .. cfunction:: PyObject* PyErr_Occurred() Modified: python/branches/release26-maint/Doc/c-api/init.rst ============================================================================== --- python/branches/release26-maint/Doc/c-api/init.rst (original) +++ python/branches/release26-maint/Doc/c-api/init.rst Mon Feb 23 11:41:11 2009 @@ -353,18 +353,36 @@ single: Py_FatalError() single: argv (in module sys) - Set ``sys.argv`` based on *argc* and *argv*. These parameters are similar to - those passed to the program's :cfunc:`main` function with the difference that - the first entry should refer to the script file to be executed rather than the - executable hosting the Python interpreter. If there isn't a script that will be - run, the first entry in *argv* can be an empty string. If this function fails - to initialize ``sys.argv``, a fatal condition is signalled using - :cfunc:`Py_FatalError`. + Set :data:`sys.argv` based on *argc* and *argv*. These parameters are + similar to those passed to the program's :cfunc:`main` function with the + difference that the first entry should refer to the script file to be + executed rather than the executable hosting the Python interpreter. If there + isn't a script that will be run, the first entry in *argv* can be an empty + string. If this function fails to initialize :data:`sys.argv`, a fatal + condition is signalled using :cfunc:`Py_FatalError`. + + This function also prepends the executed script's path to :data:`sys.path`. + If no script is executed (in the case of calling ``python -c`` or just the + interactive interpreter), the empty string is used instead. .. XXX impl. doesn't seem consistent in allowing 0/NULL for the params; check w/ Guido. +.. cfunction:: void Py_SetPythonHome(char *home) + + Set the default "home" directory, that is, the location of the standard + Python libraries. The libraries are searched in + :file:`{home}/lib/python{version}` and :file:`{home}/lib/python{version}`. + + +.. cfunction:: char* Py_GetPythonHome() + + Return the default "home", that is, the value set by a previous call to + :cfunc:`Py_SetPythonHome`, or the value of the :envvar:`PYTHONHOME` + environment variable if it is set. + + .. _threads: Thread State and the Global Interpreter Lock Modified: python/branches/release26-maint/Doc/c-api/intro.rst ============================================================================== --- python/branches/release26-maint/Doc/c-api/intro.rst (original) +++ python/branches/release26-maint/Doc/c-api/intro.rst Mon Feb 23 11:41:11 2009 @@ -187,7 +187,7 @@ the caller is said to *borrow* the reference. Nothing needs to be done for a borrowed reference. -Conversely, when a calling function passes it a reference to an object, there +Conversely, when a calling function passes in a reference to an object, there are two possibilities: the function *steals* a reference to the object, or it does not. *Stealing a reference* means that when you pass a reference to a function, that function assumes that it now owns that reference, and you are not Modified: python/branches/release26-maint/Doc/c-api/veryhigh.rst ============================================================================== --- python/branches/release26-maint/Doc/c-api/veryhigh.rst (original) +++ python/branches/release26-maint/Doc/c-api/veryhigh.rst Mon Feb 23 11:41:11 2009 @@ -16,7 +16,7 @@ :const:`Py_file_input`, and :const:`Py_single_input`. These are described following the functions which accept them as parameters. -Note also that several of these functions take :ctype:`FILE\*` parameters. On +Note also that several of these functions take :ctype:`FILE\*` parameters. One particular issue which needs to be handled carefully is that the :ctype:`FILE` structure for different C libraries can be different and incompatible. Under Windows (at least), it is possible for dynamically linked extensions to actually Modified: python/branches/release26-maint/Doc/documenting/markup.rst ============================================================================== --- python/branches/release26-maint/Doc/documenting/markup.rst (original) +++ python/branches/release26-maint/Doc/documenting/markup.rst Mon Feb 23 11:41:11 2009 @@ -285,14 +285,27 @@ As said before, Sphinx uses interpreted text roles to insert semantic markup in documents. -Variable names are an exception, they should be marked simply with ``*var*``. +Names of local variables, such as function/method arguments, are an exception, +they should be marked simply with ``*var*``. For all other roles, you have to write ``:rolename:`content```. -.. note:: +There are some additional facilities that make cross-referencing roles more +versatile: - For all cross-referencing roles, if you prefix the content with ``!``, no - reference/hyperlink will be created. +* You may supply an explicit title and reference target, like in reST direct + hyperlinks: ``:role:`title ``` will refer to *target*, but the link + text will be *title*. + +* If you prefix the content with ``!``, no reference/hyperlink will be created. + +* For the Python object roles, if you prefix the content with ``~``, the link + text will only be the last component of the target. For example, + ``:meth:`~Queue.Queue.get``` will refer to ``Queue.Queue.get`` but only + display ``get`` as the link text. + + In HTML output, the link's ``title`` attribute (that is e.g. shown as a + tool-tip on mouse-hover) will always be the full target name. The following roles refer to objects in modules and are possibly hyperlinked if a matching identifier is found: @@ -310,7 +323,7 @@ .. describe:: data - The name of a module-level variable. + The name of a module-level variable or constant. .. describe:: const Modified: python/branches/release26-maint/Doc/howto/webservers.rst ============================================================================== --- python/branches/release26-maint/Doc/howto/webservers.rst (original) +++ python/branches/release26-maint/Doc/howto/webservers.rst Mon Feb 23 11:41:11 2009 @@ -99,7 +99,8 @@ # -*- coding: UTF-8 -*- # enable debugging - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() print "Content-Type: text/plain;charset=utf-8" print Modified: python/branches/release26-maint/Doc/library/base64.rst ============================================================================== --- python/branches/release26-maint/Doc/library/base64.rst (original) +++ python/branches/release26-maint/Doc/library/base64.rst Mon Feb 23 11:41:11 2009 @@ -63,7 +63,8 @@ .. function:: urlsafe_b64encode(s) Encode string *s* using a URL-safe alphabet, which substitutes ``-`` instead of - ``+`` and ``_`` instead of ``/`` in the standard Base64 alphabet. + ``+`` and ``_`` instead of ``/`` in the standard Base64 alphabet. The result + can still contain ``=``. .. function:: urlsafe_b64decode(s) Modified: python/branches/release26-maint/Doc/library/cgi.rst ============================================================================== --- python/branches/release26-maint/Doc/library/cgi.rst (original) +++ python/branches/release26-maint/Doc/library/cgi.rst Mon Feb 23 11:41:11 2009 @@ -67,16 +67,18 @@ module defines all sorts of names for its own use or for backward compatibility that you don't want in your namespace. -When you write a new script, consider adding the line:: +When you write a new script, consider adding these lines:: - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() This activates a special exception handler that will display detailed reports in the Web browser if any errors occur. If you'd rather not show the guts of your program to users of your script, you can have the reports saved to files -instead, with a line like this:: +instead, with code like this:: - import cgitb; cgitb.enable(display=0, logdir="/tmp") + import cgitb + cgitb.enable(display=0, logdir="/tmp") It's very helpful to use this feature during script development. The reports produced by :mod:`cgitb` provide information that can save you a lot of time in @@ -470,9 +472,10 @@ Fortunately, once you have managed to get your script to execute *some* code, you can easily send tracebacks to the Web browser using the :mod:`cgitb` module. -If you haven't done so already, just add the line:: +If you haven't done so already, just add the lines:: - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() to the top of your script. Then try running it again; when a problem occurs, you should see a detailed report that will likely make apparent the cause of the Modified: python/branches/release26-maint/Doc/library/cgitb.rst ============================================================================== --- python/branches/release26-maint/Doc/library/cgitb.rst (original) +++ python/branches/release26-maint/Doc/library/cgitb.rst Mon Feb 23 11:41:11 2009 @@ -26,9 +26,10 @@ functions, to help you debug the problem. Optionally, you can save this information to a file instead of sending it to the browser. -To enable this feature, simply add one line to the top of your CGI script:: +To enable this feature, simply add this to the top of your CGI script:: - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() The options to the :func:`enable` function control whether the report is displayed in the browser and whether the report is logged to a file for later Modified: python/branches/release26-maint/Doc/library/cookielib.rst ============================================================================== --- python/branches/release26-maint/Doc/library/cookielib.rst (original) +++ python/branches/release26-maint/Doc/library/cookielib.rst Mon Feb 23 11:41:11 2009 @@ -769,7 +769,7 @@ import urllib2 from cookielib import CookieJar, DefaultCookiePolicy policy = DefaultCookiePolicy( - rfc2965=True, strict_ns_domain=Policy.DomainStrict, + rfc2965=True, strict_ns_domain=DefaultCookiePolicy.DomainStrict, blocked_domains=["ads.net", ".ads.net"]) cj = CookieJar(policy) opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) 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 Mon Feb 23 11:41:11 2009 @@ -1274,6 +1274,7 @@ .. data:: find_library(name) + :module: ctypes.util :noindex: Try to find a library and return a pathname. *name* is the library name without Modified: python/branches/release26-maint/Doc/library/datetime.rst ============================================================================== --- python/branches/release26-maint/Doc/library/datetime.rst (original) +++ python/branches/release26-maint/Doc/library/datetime.rst Mon Feb 23 11:41:11 2009 @@ -1497,11 +1497,10 @@ microseconds should not be used, as :class:`date` objects have no such values. If they're used anyway, ``0`` is substituted for them. -:class:`time` and :class:`datetime` objects support a ``%f`` format code -which expands to the number of microseconds in the object, zero-padded on -the left to six places. - .. versionadded:: 2.6 + :class:`time` and :class:`datetime` objects support a ``%f`` format code + which expands to the number of microseconds in the object, zero-padded on + the left to six places. For a naive object, the ``%z`` and ``%Z`` format codes are replaced by empty strings. @@ -1621,7 +1620,9 @@ (1) When used with the :func:`strptime` function, the ``%f`` directive accepts from one to six digits and zero pads on the right. ``%f`` is - an extension to the set of format characters in the C standard. + an extension to the set of format characters in the C standard (but + implemented separately in datetime objects, and therefore always + available). (2) When used with the :func:`strptime` function, the ``%p`` directive only affects Modified: python/branches/release26-maint/Doc/library/exceptions.rst ============================================================================== --- python/branches/release26-maint/Doc/library/exceptions.rst (original) +++ python/branches/release26-maint/Doc/library/exceptions.rst Mon Feb 23 11:41:11 2009 @@ -398,6 +398,11 @@ more precise exception such as :exc:`IndexError`. +.. exception:: VMSError + + Only available on VMS. Raised when a VMS-specific error occurs. + + .. exception:: WindowsError Raised when a Windows-specific error occurs or when the error number does not 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 Mon Feb 23 11:41:11 2009 @@ -425,6 +425,26 @@ The float type is described in :ref:`typesnumeric`. + +.. function:: format(value[, format_spec]) + + .. index:: + pair: str; format + single: __format__ + + Convert a *value* to a "formatted" representation, as controlled by + *format_spec*. The interpretation of *format_spec* will depend on the type + of the *value* argument, however there is a standard formatting syntax that + is used by most built-in types: :ref:`formatspec`. + + .. note:: + + ``format(value, format_spec)`` merely calls + ``value.__format__(format_spec)``. + + .. versionadded:: 2.6 + + .. function:: frozenset([iterable]) :noindex: @@ -1178,8 +1198,10 @@ If the second argument is omitted the super object returned is unbound. If the second argument is an object, ``isinstance(obj, type)`` must be true. If the second argument is a type, - ``issubclass(type2, type)`` must be true. :func:`super` only works for - :term:`new-style class`\es. + ``issubclass(type2, type)`` must be true. + + .. note:: + :func:`super` only works for :term:`new-style class`\es. There are two typical use cases for "super". In a class hierarchy with single inheritance, "super" can be used to refer to parent classes without 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 Mon Feb 23 11:41:11 2009 @@ -1511,7 +1511,7 @@ records that the option was seen:: def record_foo_seen(option, opt_str, value, parser): - parser.saw_foo = True + parser.values.saw_foo = True parser.add_option("--foo", action="callback", callback=record_foo_seen) @@ -1651,7 +1651,7 @@ value.append(arg) del parser.rargs[:len(value)] - setattr(parser.values, option.dest, value)) + setattr(parser.values, option.dest, value) [...] parser.add_option("-c", "--callback", dest="vararg_attr", Modified: python/branches/release26-maint/Doc/library/random.rst ============================================================================== --- python/branches/release26-maint/Doc/library/random.rst (original) +++ python/branches/release26-maint/Doc/library/random.rst Mon Feb 23 11:41:11 2009 @@ -188,13 +188,13 @@ .. function:: uniform(a, b) - Return a random floating point number *N* such that ``a <= N < b`` for - ``a <= b`` and ``b <= N < a`` for ``b < a``. + Return a random floating point number *N* such that ``a <= N <= b`` for + ``a <= b`` and ``b <= N <= a`` for ``b < a``. .. function:: triangular(low, high, mode) - Return a random floating point number *N* such that ``low <= N < high`` and + Return a random floating point number *N* such that ``low <= N <= high`` and with the specified *mode* between those bounds. The *low* and *high* bounds default to zero and one. The *mode* argument defaults to the midpoint between the bounds, giving a symmetric distribution. @@ -204,8 +204,8 @@ .. function:: betavariate(alpha, beta) - Beta distribution. Conditions on the parameters are ``alpha > 0`` and ``beta > - 0``. Returned values range between 0 and 1. + Beta distribution. Conditions on the parameters are ``alpha > 0`` and + ``beta > 0``. Returned values range between 0 and 1. .. function:: expovariate(lambd) @@ -219,14 +219,15 @@ .. function:: gammavariate(alpha, beta) - Gamma distribution. (*Not* the gamma function!) Conditions on the parameters - are ``alpha > 0`` and ``beta > 0``. + Gamma distribution. (*Not* the gamma function!) Conditions on the + parameters are ``alpha > 0`` and ``beta > 0``. .. function:: gauss(mu, sigma) - Gaussian distribution. *mu* is the mean, and *sigma* is the standard deviation. - This is slightly faster than the :func:`normalvariate` function defined below. + Gaussian distribution. *mu* is the mean, and *sigma* is the standard + deviation. This is slightly faster than the :func:`normalvariate` function + defined below. .. function:: lognormvariate(mu, sigma) Modified: python/branches/release26-maint/Doc/library/socketserver.rst ============================================================================== --- python/branches/release26-maint/Doc/library/socketserver.rst (original) +++ python/branches/release26-maint/Doc/library/socketserver.rst Mon Feb 23 11:41:11 2009 @@ -517,7 +517,7 @@ # Exit the server thread when the main thread terminates server_thread.setDaemon(True) server_thread.start() - print "Server loop running in thread:", t.getName() + print "Server loop running in thread:", server_thread.getName() client(ip, port, "Hello World 1") client(ip, port, "Hello World 2") 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 Mon Feb 23 11:41:11 2009 @@ -375,7 +375,7 @@ +--------------------+------------------------------------+--------+ | Operation | Result | Notes | +====================+====================================+========+ -| ``trunc(x)`` | *x* truncated to Integral | | +| ``math.trunc(x)`` | *x* truncated to Integral | | +--------------------+------------------------------------+--------+ | ``round(x[, n])`` | *x* rounded to n digits, | | | | rounding half to even. If n is | | @@ -601,9 +601,9 @@ There are six sequence types: strings, Unicode strings, lists, tuples, buffers, and xrange objects. -(For other containers see the built in :class:`dict`, :class:`list`, -:class:`set`, and :class:`tuple` classes, and the :mod:`collections` -module.) + +For other containers see the built in :class:`dict` and :class:`set` classes, +and the :mod:`collections` module. .. index:: @@ -1648,7 +1648,7 @@ .. method:: union(other, ...) set | other | ... - Return a new set with elements from both sets. + Return a new set with elements from the set and all others. .. versionchanged:: 2.6 Accepts multiple input iterables. @@ -1656,7 +1656,7 @@ .. method:: intersection(other, ...) set & other & ... - Return a new set with elements common to both sets. + Return a new set with elements common to the set and all others. .. versionchanged:: 2.6 Accepts multiple input iterables. Modified: python/branches/release26-maint/Doc/library/threading.rst ============================================================================== --- python/branches/release26-maint/Doc/library/threading.rst (original) +++ python/branches/release26-maint/Doc/library/threading.rst Mon Feb 23 11:41:11 2009 @@ -210,7 +210,7 @@ A thread can be flagged as a "daemon thread". The significance of this flag is that the entire Python program exits when only daemon threads are left. The initial value is inherited from the creating thread. The flag can be set -through the :attr:`daemon` attribute. +through the :attr:`daemon` property. There is a "main thread" object; this corresponds to the initial thread of control in the Python program. It is not a daemon thread. @@ -332,10 +332,11 @@ .. attribute:: Thread.daemon - The thread's daemon flag. This must be set before :meth:`start` is called, - otherwise :exc:`RuntimeError` is raised. - - The initial value is inherited from the creating thread. + A boolean value indicating whether this thread is a daemon thread (True) or + not (False). This must be set before :meth:`start` is called, otherwise + :exc:`RuntimeError` is raised. Its initial value is inherited from the + creating thread; the main thread is not a daemon thread and therefore all + threads created in the main thread default to :attr:`daemon` = ``False``. The entire Python program exits when no alive non-daemon threads are left. Modified: python/branches/release26-maint/Doc/library/urllib2.rst ============================================================================== --- python/branches/release26-maint/Doc/library/urllib2.rst (original) +++ python/branches/release26-maint/Doc/library/urllib2.rst Mon Feb 23 11:41:11 2009 @@ -602,14 +602,15 @@ precise meanings of the various redirection codes. -.. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs) +.. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs, newurl) Return a :class:`Request` or ``None`` in response to a redirect. This is called by the default implementations of the :meth:`http_error_30\*` methods when a redirection is received from the server. If a redirection should take place, return a new :class:`Request` to allow :meth:`http_error_30\*` to perform the - redirect. Otherwise, raise :exc:`HTTPError` if no other handler should try to - handle this URL, or return ``None`` if you can't but another handler might. + redirect to *newurl*. Otherwise, raise :exc:`HTTPError` if no other handler + should try to handle this URL, or return ``None`` if you can't but another + handler might. .. note:: @@ -622,8 +623,8 @@ .. method:: HTTPRedirectHandler.http_error_301(req, fp, code, msg, hdrs) - Redirect to the ``Location:`` URL. This method is called by the parent - :class:`OpenerDirector` when getting an HTTP 'moved permanently' response. + Redirect to the ``Location:`` or ``URI:`` URL. This method is called by the + parent :class:`OpenerDirector` when getting an HTTP 'moved permanently' response. .. method:: HTTPRedirectHandler.http_error_302(req, fp, code, msg, hdrs) Modified: python/branches/release26-maint/Doc/library/xml.etree.elementtree.rst ============================================================================== --- python/branches/release26-maint/Doc/library/xml.etree.elementtree.rst (original) +++ python/branches/release26-maint/Doc/library/xml.etree.elementtree.rst Mon Feb 23 11:41:11 2009 @@ -529,5 +529,5 @@ .. [#] The encoding string included in XML output should conform to the appropriate standards. For example, "UTF-8" is valid, but "UTF8" is not. See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl - and http://www.iana.org/assignments/character-sets . + and http://www.iana.org/assignments/character-sets. 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 Mon Feb 23 11:41:11 2009 @@ -318,9 +318,8 @@ import xmlrpclib def python_logo(): - handle = open("python_logo.jpg") - return xmlrpclib.Binary(handle.read()) - handle.close() + with open("python_logo.jpg") as handle: + return xmlrpclib.Binary(handle.read()) server = SimpleXMLRPCServer(("localhost", 8000)) print "Listening on port 8000..." @@ -333,9 +332,8 @@ import xmlrpclib proxy = xmlrpclib.ServerProxy("http://localhost:8000/") - handle = open("fetched_python_logo.jpg", "w") - handle.write(proxy.python_logo().data) - handle.close() + with open("fetched_python_logo.jpg", "w") as handle: + handle.write(proxy.python_logo().data) .. _fault-objects: 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 Mon Feb 23 11:41:11 2009 @@ -2078,13 +2078,13 @@ object.__ixor__(self, other) object.__ior__(self, other) - These methods are called to implement the augmented arithmetic operations + These methods are called to implement the augmented arithmetic assignments (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods should attempt to do the operation in-place (modifying *self*) and return the result (which could be, but does not have to be, *self*). If a specific method is not defined, the augmented - operation falls back to the normal methods. For instance, to evaluate the - expression ``x += y``, where *x* is an instance of a class that has an + assignment falls back to the normal methods. For instance, to execute the + statement ``x += y``, where *x* is an instance of a class that has an :meth:`__iadd__` method, ``x.__iadd__(y)`` is called. If *x* is an instance of a class that does not define a :meth:`__iadd__` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are considered, as with the evaluation of ``x + y``. @@ -2244,7 +2244,8 @@ In the current implementation, the built-in numeric types :class:`int`, :class:`long` and :class:`float` do not use coercion; the type :class:`complex` - however does use it. The difference can become apparent when subclassing these + however does use coercion for binary operators and rich comparisons, despite + the above rules. The difference can become apparent when subclassing these types. Over time, the type :class:`complex` may be fixed to avoid coercion. All these types implement a :meth:`__coerce__` method, for use by the built-in :func:`coerce` function. Modified: python/branches/release26-maint/Doc/reference/expressions.rst ============================================================================== --- python/branches/release26-maint/Doc/reference/expressions.rst (original) +++ python/branches/release26-maint/Doc/reference/expressions.rst Mon Feb 23 11:41:11 2009 @@ -816,14 +816,14 @@ .. _unary: -Unary arithmetic operations -=========================== +Unary arithmetic and bitwise operations +======================================= .. index:: triple: unary; arithmetic; operation triple: unary; bitwise; operation -All unary arithmetic (and bitwise) operations have the same priority: +All unary arithmetic and bitwise operations have the same priority: .. productionlist:: u_expr: `power` | "-" `u_expr` | "+" `u_expr` | "~" `u_expr` @@ -1276,12 +1276,9 @@ +-----------------------------------------------+-------------------------------------+ | :keyword:`not` *x* | Boolean NOT | +-----------------------------------------------+-------------------------------------+ -| :keyword:`in`, :keyword:`not` :keyword:`in` | Membership tests | -+-----------------------------------------------+-------------------------------------+ -| :keyword:`is`, :keyword:`is not` | Identity tests | -+-----------------------------------------------+-------------------------------------+ -| ``<``, ``<=``, ``>``, ``>=``, ``<>``, ``!=``, | Comparisons | -| ``==`` | | +| :keyword:`in`, :keyword:`not` :keyword:`in`, | Comparisons, including membership | +| :keyword:`is`, :keyword:`is not`, ``<``, | tests and identity tests, | +| ``<=``, ``>``, ``>=``, ``<>``, ``!=``, ``==`` | | +-----------------------------------------------+-------------------------------------+ | ``|`` | Bitwise OR | +-----------------------------------------------+-------------------------------------+ @@ -1293,29 +1290,19 @@ +-----------------------------------------------+-------------------------------------+ | ``+``, ``-`` | Addition and subtraction | +-----------------------------------------------+-------------------------------------+ -| ``*``, ``/``, ``%`` | Multiplication, division, remainder | -+-----------------------------------------------+-------------------------------------+ -| ``+x``, ``-x`` | Positive, negative | -+-----------------------------------------------+-------------------------------------+ -| ``~x`` | Bitwise not | -+-----------------------------------------------+-------------------------------------+ -| ``**`` | Exponentiation | +| ``*``, ``/``, ``//``, ``%`` | Multiplication, division, remainder | +-----------------------------------------------+-------------------------------------+ -| ``x[index]`` | Subscription | +| ``+x``, ``-x``, ``~x`` | Positive, negative, bitwise NOT | +-----------------------------------------------+-------------------------------------+ -| ``x[index:index]`` | Slicing | +| ``**`` | Exponentiation [#]_ | +-----------------------------------------------+-------------------------------------+ -| ``x(arguments...)`` | Call | +| ``x[index]``, ``x[index:index]``, | Subscription, slicing, | +| ``x(arguments...)``, ``x.attribute`` | call, attribute reference | +-----------------------------------------------+-------------------------------------+ -| ``x.attribute`` | Attribute reference | -+-----------------------------------------------+-------------------------------------+ -| ``(expressions...)`` | Binding or tuple display | -+-----------------------------------------------+-------------------------------------+ -| ``[expressions...]`` | List display | -+-----------------------------------------------+-------------------------------------+ -| ``{key:datum...}`` | Dictionary display | -+-----------------------------------------------+-------------------------------------+ -| ```expressions...``` | String conversion | +| ``(expressions...)``, | Binding or tuple display, | +| ``[expressions...]``, | list display, | +| ``{key:datum...}``, | dictionary display, | +| ```expressions...``` | string conversion | +-----------------------------------------------+-------------------------------------+ .. rubric:: Footnotes @@ -1358,3 +1345,6 @@ descriptors, you may notice seemingly unusual behaviour in certain uses of the :keyword:`is` operator, like those involving comparisons between instance methods, or constants. Check their documentation for more info. + +.. [#] The power operator ``**`` binds less tightly than an arithmetic or + bitwise unary operator on its right, that is, ``2**-1`` is ``0.5``. Modified: python/branches/release26-maint/Doc/reference/introduction.rst ============================================================================== --- python/branches/release26-maint/Doc/reference/introduction.rst (original) +++ python/branches/release26-maint/Doc/reference/introduction.rst Mon Feb 23 11:41:11 2009 @@ -65,8 +65,7 @@ An alternate Python for .NET. Unlike Python.NET, this is a complete Python implementation that generates IL, and compiles Python code directly to .NET assemblies. It was created by Jim Hugunin, the original creator of Jython. For - more information, see `the IronPython website - `_. + more information, see `the IronPython website `_. PyPy An implementation of Python written in Python; even the bytecode interpreter is 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 Mon Feb 23 11:41:11 2009 @@ -118,8 +118,8 @@ * If the target list is a single target: The object is assigned to that target. -* If the target list is a comma-separated list of targets: The object must be a - sequence with the same number of items as there are targets in the target list, +* If the target list is a comma-separated list of targets: The object must be an + iterable with the same number of items as there are targets in the target list, and the items are assigned, from left to right, to the corresponding targets. (This rule is relaxed as of Python 1.5; in earlier versions, the object had to be a tuple. Since strings are sequences, an assignment like ``a, b = "xy"`` is @@ -143,9 +143,9 @@ be deallocated and its destructor (if it has one) to be called. * If the target is a target list enclosed in parentheses or in square brackets: - The object must be a sequence with the same number of items as there are targets - in the target list, and its items are assigned, from left to right, to the - corresponding targets. + The object must be an iterable with the same number of items as there are + targets in the target list, and its items are assigned, from left to right, + to the corresponding targets. .. index:: pair: attribute; assignment @@ -228,7 +228,8 @@ operation and an assignment statement: .. productionlist:: - augmented_assignment_stmt: `target` `augop` (`expression_list` | `yield_expression`) + augmented_assignment_stmt: `augtarget` `augop` (`expression_list` | `yield_expression`) + augtarget: `identifier` | `attributeref` | `subscription` | `slicing` augop: "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**=" : | ">>=" | "<<=" | "&=" | "^=" | "|=" Modified: python/branches/release26-maint/Doc/tools/rstlint.py ============================================================================== --- python/branches/release26-maint/Doc/tools/rstlint.py (original) +++ python/branches/release26-maint/Doc/tools/rstlint.py Mon Feb 23 11:41:11 2009 @@ -6,6 +6,9 @@ # # 01/2009, Georg Brandl +# TODO: - wrong versions in versionadded/changed +# - wrong markup after versionchanged directive + from __future__ import with_statement import os Modified: python/branches/release26-maint/Doc/tools/sphinxext/pyspecific.py ============================================================================== --- python/branches/release26-maint/Doc/tools/sphinxext/pyspecific.py (original) +++ python/branches/release26-maint/Doc/tools/sphinxext/pyspecific.py Mon Feb 23 11:41:11 2009 @@ -13,6 +13,14 @@ from docutils import nodes, utils +# monkey-patch reST parser to disable alphabetic and roman enumerated lists +from docutils.parsers.rst.states import Body +Body.enum.converters['loweralpha'] = \ + Body.enum.converters['upperalpha'] = \ + Body.enum.converters['lowerroman'] = \ + Body.enum.converters['upperroman'] = lambda x: None + + def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): issue = utils.unescape(text) text = 'issue ' + issue Modified: python/branches/release26-maint/Doc/whatsnew/2.5.rst ============================================================================== --- python/branches/release26-maint/Doc/whatsnew/2.5.rst (original) +++ python/branches/release26-maint/Doc/whatsnew/2.5.rst Mon Feb 23 11:41:11 2009 @@ -1761,8 +1761,8 @@ included. The rest of this section will provide a brief overview of using ElementTree. -Full documentation for ElementTree is available at http://effbot.org/zone -/element-index.htm. +Full documentation for ElementTree is available at +http://effbot.org/zone/element-index.htm. ElementTree represents an XML document as a tree of element nodes. The text content of the document is stored as the :attr:`.text` and :attr:`.tail` Modified: python/branches/release26-maint/Lib/test/test_ast.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_ast.py (original) +++ python/branches/release26-maint/Lib/test/test_ast.py Mon Feb 23 11:41:11 2009 @@ -271,7 +271,6 @@ self.assertEqual(ast.literal_eval('(True, False, None)'), (True, False, None)) self.assertRaises(ValueError, ast.literal_eval, 'foo()') - def test_main(): test_support.run_unittest(AST_Tests, ASTHelpers_Test) From python-checkins at python.org Mon Feb 23 11:42:25 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 23 Feb 2009 11:42:25 +0100 (CET) Subject: [Python-checkins] r69899 - python/branches/release30-maint Message-ID: <20090223104225.8B46F1E4002@bag.python.org> Author: georg.brandl Date: Mon Feb 23 11:42:25 2009 New Revision: 69899 Log: Block all blocking commits on the py3k branch. Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Mon Feb 23 12:02:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 23 Feb 2009 11:02:20 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090223110221.2C4041E4010@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/361 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,georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Feb 23 12:09:00 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 23 Feb 2009 12:09:00 +0100 (CET) Subject: [Python-checkins] r69900 - python/branches/release26-maint Message-ID: <20090223110900.CACF61E4002@bag.python.org> Author: georg.brandl Date: Mon Feb 23 12:09:00 2009 New Revision: 69900 Log: Blocked revisions 68395,68462,68571,68592,68597,68603-68604,68648,68665,68737,68764,68766,68773,68785,68789,68792-68793,68803,68805,68831,68840,68843,68845,68850,68853,68881,68884,68892,68925,68927,68941,68985,68998,69001,69010,69012,69018,69039 via svnmerge ........ r68395 | raymond.hettinger | 2009-01-08 07:39:04 +0100 (Do, 08 Jan 2009) | 1 line Forward port r68394 for issue 4816. ........ r68462 | antoine.pitrou | 2009-01-09 22:40:55 +0100 (Fr, 09 Jan 2009) | 6 lines Issue #4074: Change the criteria for doing a full garbage collection (i.e. collecting the oldest generation) so that allocating lots of objects without destroying them does not show quadratic performance. Based on a proposal by Martin von L?wis at http://mail.python.org/pipermail/python-dev/2008-June/080579.html. ........ r68571 | armin.ronacher | 2009-01-13 12:52:23 +0100 (Di, 13 Jan 2009) | 3 lines ast.literal_eval can properly evaluate complex numbers now. This fixes issue4907. ........ r68592 | amaury.forgeotdarc | 2009-01-14 00:19:08 +0100 (Mi, 14 Jan 2009) | 5 lines #4807: Remove a wrong usage of wsprintf in the winreg module ("windows sprintf", different than swprintf) Needed for the windows CE port. ........ r68597 | benjamin.peterson | 2009-01-14 00:43:50 +0100 (Mi, 14 Jan 2009) | 1 line fix test_xmlrpc failures #4939 ........ r68603 | raymond.hettinger | 2009-01-14 01:15:21 +0100 (Mi, 14 Jan 2009) | 1 line Minor doc tweaks. ........ r68604 | raymond.hettinger | 2009-01-14 02:15:06 +0100 (Mi, 14 Jan 2009) | 1 line Add tests for __init__() and update() with no args. ........ r68648 | benjamin.peterson | 2009-01-17 05:28:57 +0100 (Sa, 17 Jan 2009) | 1 line use enumerate ........ r68665 | amaury.forgeotdarc | 2009-01-17 18:11:50 +0100 (Sa, 17 Jan 2009) | 3 lines #4930: Slightly cleaner (and faster) code in type creation: compare slots by address, not by name. ........ r68737 | jesse.noller | 2009-01-18 22:04:36 +0100 (So, 18 Jan 2009) | 1 line issue 4301: patch logging to add processName, remove the old _check_logger_class code ........ r68764 | benjamin.peterson | 2009-01-19 16:04:35 +0100 (Mo, 19 Jan 2009) | 3 lines Removed merge tracking for "svnmerge" for svn+ssh://pythondev at svn.python.org/python/branches/trunk-math ........ r68766 | benjamin.peterson | 2009-01-19 16:06:33 +0100 (Mo, 19 Jan 2009) | 3 lines Removed merge tracking for "svnmerge" for svn+ssh://pythondev at svn.python.org/python/branches/tnelson-trunk-bsddb-47-upgrade ........ r68773 | benjamin.peterson | 2009-01-19 16:51:27 +0100 (Mo, 19 Jan 2009) | 1 line simplify code ........ r68785 | benjamin.peterson | 2009-01-19 22:08:37 +0100 (Mo, 19 Jan 2009) | 1 line I'm sick of these deprecations warnings in test_os ........ r68789 | raymond.hettinger | 2009-01-20 02:19:26 +0100 (Di, 20 Jan 2009) | 6 lines Build-outs for Counter() class: * Constructor and update() support keyword args (like their dict counterparts). * The 'del' statement no longer raises KeyError for missing values. * Add multiset operations: __add__, __sub__, __and__, __or__. ........ r68792 | raymond.hettinger | 2009-01-20 03:24:38 +0100 (Di, 20 Jan 2009) | 1 line Add Counter() to __all__. ........ r68793 | raymond.hettinger | 2009-01-20 04:36:36 +0100 (Di, 20 Jan 2009) | 1 line Make merging easier by formattng comment blocks the same in Py3.1 ........ r68803 | raymond.hettinger | 2009-01-20 13:59:36 +0100 (Di, 20 Jan 2009) | 1 line Fix typos. ........ r68805 | benjamin.peterson | 2009-01-20 15:21:16 +0100 (Di, 20 Jan 2009) | 1 line allow unicode keyword arguments for the ** syntax #4978 ........ r68831 | raymond.hettinger | 2009-01-21 00:42:54 +0100 (Mi, 21 Jan 2009) | 1 line Beautify and cleanup the references section. ........ r68840 | andrew.kuchling | 2009-01-21 03:15:43 +0100 (Mi, 21 Jan 2009) | 1 line Add some items ........ r68843 | raymond.hettinger | 2009-01-21 21:31:50 +0100 (Mi, 21 Jan 2009) | 1 line Simplify explanation of multiset operations by removing restrictions on negative inputs. ........ r68845 | raymond.hettinger | 2009-01-22 00:12:51 +0100 (Do, 22 Jan 2009) | 1 line Tighten-up the docs for Counter(). ........ r68850 | raymond.hettinger | 2009-01-22 06:20:47 +0100 (Do, 22 Jan 2009) | 1 line More doc tweaks. ........ r68853 | raymond.hettinger | 2009-01-22 10:05:43 +0100 (Do, 22 Jan 2009) | 1 line Update comments and add an optimized path for Counter.update(). ........ r68881 | andrew.kuchling | 2009-01-24 04:28:18 +0100 (Sa, 24 Jan 2009) | 1 line Add various items ........ r68884 | kristjan.jonsson | 2009-01-24 11:52:26 +0100 (Sa, 24 Jan 2009) | 1 line Add a test for UNC import paths, see issue 3677 ........ r68892 | martin.v.loewis | 2009-01-24 16:45:18 +0100 (Sa, 24 Jan 2009) | 2 lines Add heading for 2.7a0. ........ r68925 | benjamin.peterson | 2009-01-25 18:15:10 +0100 (So, 25 Jan 2009) | 5 lines fix building the core with --disable-unicode I changed some bytearray methods to use strings instead of unicode like bytes_repr Also, bytearray.fromhex() can take strings as well as unicode ........ r68927 | hirokazu.yamamoto | 2009-01-25 18:46:48 +0100 (So, 25 Jan 2009) | 1 line Fixed compile error on windows. ........ r68941 | raymond.hettinger | 2009-01-25 22:04:14 +0100 (So, 25 Jan 2009) | 1 line Promote compress() from a recipe to being a regular itertool. ........ r68985 | raymond.hettinger | 2009-01-27 00:29:09 +0100 (Di, 27 Jan 2009) | 6 lines Remove startup firewall message. That is handled by an error dialog whenever a connection cannot be formed. Also, the Idle version number is already in the About Idle dialog. Now, the startup is clean looking once again. ........ r68998 | raymond.hettinger | 2009-01-27 03:36:33 +0100 (Di, 27 Jan 2009) | 3 lines Tweak column alignment for collections docs. ........ r69001 | raymond.hettinger | 2009-01-27 03:58:49 +0100 (Di, 27 Jan 2009) | 1 line Promote combinations_with_replacement() from a recipe to a regular itertool. ........ r69010 | raymond.hettinger | 2009-01-27 10:33:06 +0100 (Di, 27 Jan 2009) | 1 line Add tests to verify combinatoric relationships. ........ r69012 | raymond.hettinger | 2009-01-27 10:52:35 +0100 (Di, 27 Jan 2009) | 1 line Stronger tests for combinatoric relationships. ........ r69018 | raymond.hettinger | 2009-01-27 11:36:14 +0100 (Di, 27 Jan 2009) | 1 line More exhaustive combinatoric checks. ........ r69039 | benjamin.peterson | 2009-01-28 00:15:48 +0100 (Mi, 28 Jan 2009) | 1 line use True and False ........ Modified: python/branches/release26-maint/ (props changed) From buildbot at python.org Mon Feb 23 12:17:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 23 Feb 2009 11:17:31 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 2.6 Message-ID: <20090223111731.E4E7E1E4002@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/143 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: georg.brandl 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 Mon Feb 23 12:24:46 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 23 Feb 2009 12:24:46 +0100 (CET) Subject: [Python-checkins] r69901 - python/trunk/Doc/library/abc.rst Message-ID: <20090223112446.CBB0D1E4002@bag.python.org> Author: georg.brandl Date: Mon Feb 23 12:24:46 2009 New Revision: 69901 Log: #5349: C++ pure virtuals can also have an implementation. Modified: python/trunk/Doc/library/abc.rst Modified: python/trunk/Doc/library/abc.rst ============================================================================== --- python/trunk/Doc/library/abc.rst (original) +++ python/trunk/Doc/library/abc.rst Mon Feb 23 12:24:46 2009 @@ -153,7 +153,7 @@ .. note:: - Unlike C++'s pure virtual functions, or Java abstract methods, these abstract + Unlike Java abstract methods, these abstract methods may have an implementation. This implementation can be called via the :func:`super` mechanism from the class that overrides it. This could be useful as an end-point for a From python-checkins at python.org Mon Feb 23 13:41:30 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 23 Feb 2009 13:41:30 +0100 (CET) Subject: [Python-checkins] r69902 - in python/trunk/Lib/distutils/tests: test_bdist_dumb.py test_version.py Message-ID: <20090223124130.40BCB1E400C@bag.python.org> Author: tarek.ziade Date: Mon Feb 23 13:41:29 2009 New Revision: 69902 Log: more test coverage Added: python/trunk/Lib/distutils/tests/test_bdist_dumb.py (contents, props changed) python/trunk/Lib/distutils/tests/test_version.py (contents, props changed) Added: python/trunk/Lib/distutils/tests/test_bdist_dumb.py ============================================================================== --- (empty file) +++ python/trunk/Lib/distutils/tests/test_bdist_dumb.py Mon Feb 23 13:41:29 2009 @@ -0,0 +1,80 @@ +"""Tests for distutils.command.bdist_dumb.""" + +import unittest +import sys +import os + +from distutils.core import Distribution +from distutils.command.bdist_dumb import bdist_dumb +from distutils.tests import support + +SETUP_PY = """\ +from distutils.core import setup +import foo + +setup(name='foo', version='0.1', py_modules=['foo'], + url='xxx', author='xxx', author_email='xxx') + +""" + +class BuildDumbTestCase(support.TempdirManager, + support.LoggingSilencer, + unittest.TestCase): + + def setUp(self): + support.TempdirManager.setUp(self) + support.LoggingSilencer.setUp(self) + 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) + + def test_simple_built(self): + + # let's create a simple package + tmp_dir = self.mkdtemp() + pkg_dir = os.path.join(tmp_dir, 'foo') + os.mkdir(pkg_dir) + self.write_file((pkg_dir, 'setup.py'), SETUP_PY) + self.write_file((pkg_dir, 'foo.py'), '#') + self.write_file((pkg_dir, 'MANIFEST.in'), 'include foo.py') + self.write_file((pkg_dir, 'README'), '') + + dist = Distribution({'name': 'foo', 'version': '0.1', + 'py_modules': ['foo'], + 'url': 'xxx', 'author': 'xxx', + 'author_email': 'xxx'}) + dist.script_name = 'setup.py' + os.chdir(pkg_dir) + + sys.argv = ['setup.py'] + cmd = bdist_dumb(dist) + + # so the output is the same no matter + # what is the platform + cmd.format = 'zip' + + cmd.ensure_finalized() + cmd.run() + + # see what we have + dist_created = os.listdir(os.path.join(pkg_dir, 'dist')) + base = "%s.%s" % (dist.get_fullname(), cmd.plat_name) + if os.name == 'os2': + base = base.replace(':', '-') + + wanted = ['%s.zip' % base] + self.assertEquals(dist_created, wanted) + + # now let's check what we have in the zip file + # XXX to be done + +def test_suite(): + return unittest.makeSuite(BuildDumbTestCase) + +if __name__ == '__main__': + test_support.run_unittest(test_suite()) Added: python/trunk/Lib/distutils/tests/test_version.py ============================================================================== --- (empty file) +++ python/trunk/Lib/distutils/tests/test_version.py Mon Feb 23 13:41:29 2009 @@ -0,0 +1,70 @@ +"""Tests for distutils.version.""" +import unittest +from distutils.version import LooseVersion +from distutils.version import StrictVersion + +class VersionTestCase(unittest.TestCase): + + def test_prerelease(self): + version = StrictVersion('1.2.3a1') + self.assertEquals(version.version, (1, 2, 3)) + self.assertEquals(version.prerelease, ('a', 1)) + self.assertEquals(str(version), '1.2.3a1') + + version = StrictVersion('1.2.0') + self.assertEquals(str(version), '1.2') + + def test_cmp_strict(self): + versions = (('1.5.1', '1.5.2b2', -1), + ('161', '3.10a', ValueError), + ('8.02', '8.02', 0), + ('3.4j', '1996.07.12', ValueError), + ('3.2.pl0', '3.1.1.6', ValueError), + ('2g6', '11g', ValueError), + ('0.9', '2.2', -1), + ('1.2.1', '1.2', 1), + ('1.1', '1.2.2', -1), + ('1.2', '1.1', 1), + ('1.2.1', '1.2.2', -1), + ('1.2.2', '1.2', 1), + ('1.2', '1.2.2', -1), + ('0.4.0', '0.4', 0), + ('1.13++', '5.5.kw', ValueError)) + + for v1, v2, wanted in versions: + try: + res = StrictVersion(v1).__cmp__(StrictVersion(v2)) + except ValueError: + if wanted is ValueError: + continue + else: + raise AssertionError(("cmp(%s, %s) " + "shouldn't raise ValueError") + % (v1, v2)) + self.assertEquals(res, wanted, + 'cmp(%s, %s) should be %s, got %s' % + (v1, v2, wanted, res)) + + + def test_cmp(self): + versions = (('1.5.1', '1.5.2b2', -1), + ('161', '3.10a', 1), + ('8.02', '8.02', 0), + ('3.4j', '1996.07.12', -1), + ('3.2.pl0', '3.1.1.6', 1), + ('2g6', '11g', -1), + ('0.960923', '2.2beta29', -1), + ('1.13++', '5.5.kw', -1)) + + + for v1, v2, wanted in versions: + res = LooseVersion(v1).__cmp__(LooseVersion(v2)) + self.assertEquals(res, wanted, + 'cmp(%s, %s) should be %s, got %s' % + (v1, v2, wanted, res)) + +def test_suite(): + return unittest.makeSuite(VersionTestCase) + +if __name__ == "__main__": + unittest.main(defaultTest="test_suite") From python-checkins at python.org Mon Feb 23 13:42:24 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 23 Feb 2009 13:42:24 +0100 (CET) Subject: [Python-checkins] r69903 - python/branches/release26-maint Message-ID: <20090223124224.0BCE31E4002@bag.python.org> Author: tarek.ziade Date: Mon Feb 23 13:42:23 2009 New Revision: 69903 Log: Blocked revisions 69902 via svnmerge ........ r69902 | tarek.ziade | 2009-02-23 13:41:29 +0100 (Mon, 23 Feb 2009) | 1 line more test coverage ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Mon Feb 23 13:47:55 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 23 Feb 2009 13:47:55 +0100 (CET) Subject: [Python-checkins] r69904 - in python/branches/py3k: Lib/distutils/tests/test_bdist_dumb.py Lib/distutils/tests/test_version.py Message-ID: <20090223124755.B23131E4002@bag.python.org> Author: tarek.ziade Date: Mon Feb 23 13:47:55 2009 New Revision: 69904 Log: Merged revisions 69902 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69902 | tarek.ziade | 2009-02-23 13:41:29 +0100 (Mon, 23 Feb 2009) | 1 line more test coverage ........ Added: python/branches/py3k/Lib/distutils/tests/test_bdist_dumb.py - copied unchanged from r69902, /python/trunk/Lib/distutils/tests/test_bdist_dumb.py python/branches/py3k/Lib/distutils/tests/test_version.py - copied, changed from r69902, /python/trunk/Lib/distutils/tests/test_version.py Modified: python/branches/py3k/ (props changed) Copied: python/branches/py3k/Lib/distutils/tests/test_version.py (from r69902, /python/trunk/Lib/distutils/tests/test_version.py) ============================================================================== --- /python/trunk/Lib/distutils/tests/test_version.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_version.py Mon Feb 23 13:47:55 2009 @@ -33,7 +33,7 @@ for v1, v2, wanted in versions: try: - res = StrictVersion(v1).__cmp__(StrictVersion(v2)) + res = StrictVersion(v1)._cmp(StrictVersion(v2)) except ValueError: if wanted is ValueError: continue @@ -58,7 +58,7 @@ for v1, v2, wanted in versions: - res = LooseVersion(v1).__cmp__(LooseVersion(v2)) + res = LooseVersion(v1)._cmp(LooseVersion(v2)) self.assertEquals(res, wanted, 'cmp(%s, %s) should be %s, got %s' % (v1, v2, wanted, res)) From buildbot at python.org Mon Feb 23 14:06:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 23 Feb 2009 13:06:47 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090223130647.E80261E4002@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/4673 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,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Feb 23 14:11:42 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 23 Feb 2009 13:11:42 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090223131143.3BCEC1E4014@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/676 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 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_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Feb 23 14:24:55 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 23 Feb 2009 13:24:55 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090223132456.5DF3A1E4002@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/185 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,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Feb 23 14:41:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 23 Feb 2009 13:41:39 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090223134139.D1E8F1E4002@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/415 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_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon Feb 23 16:17:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 23 Feb 2009 15:17:19 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090223151720.534A71E4002@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/339 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 Mon Feb 23 16:51:27 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 23 Feb 2009 16:51:27 +0100 (CET) Subject: [Python-checkins] r69905 - python/trunk/Doc/library/stdtypes.rst Message-ID: <20090223155127.ABDE91E4002@bag.python.org> Author: georg.brandl Date: Mon Feb 23 16:51:27 2009 New Revision: 69905 Log: #5352: str.count() counts non-overlapping instances. 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 Mon Feb 23 16:51:27 2009 @@ -826,9 +826,9 @@ .. method:: str.count(sub[, start[, end]]) - Return the number of occurrences of substring *sub* in the range [*start*, - *end*]. Optional arguments *start* and *end* are interpreted as in slice - notation. + Return the number of non-overlapping occurrences of substring *sub* in the + range [*start*, *end*]. Optional arguments *start* and *end* are + interpreted as in slice notation. .. method:: str.decode([encoding[, errors]]) From python-checkins at python.org Mon Feb 23 16:53:26 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 23 Feb 2009 16:53:26 +0100 (CET) Subject: [Python-checkins] r69906 - in python/branches/release26-maint: Doc/library/stdtypes.rst Message-ID: <20090223155326.1272E1E4002@bag.python.org> Author: georg.brandl Date: Mon Feb 23 16:53:25 2009 New Revision: 69906 Log: Merged revisions 69905 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69905 | georg.brandl | 2009-02-23 16:51:27 +0100 (Mo, 23 Feb 2009) | 2 lines #5352: str.count() counts non-overlapping instances. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/library/stdtypes.rst 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 Mon Feb 23 16:53:25 2009 @@ -795,9 +795,9 @@ .. method:: str.count(sub[, start[, end]]) - Return the number of occurrences of substring *sub* in the range [*start*, - *end*]. Optional arguments *start* and *end* are interpreted as in slice - notation. + Return the number of non-overlapping occurrences of substring *sub* in the + range [*start*, *end*]. Optional arguments *start* and *end* are + interpreted as in slice notation. .. method:: str.decode([encoding[, errors]]) From python-checkins at python.org Mon Feb 23 19:33:48 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 23 Feb 2009 19:33:48 +0100 (CET) Subject: [Python-checkins] r69907 - python/trunk/Doc/library/2to3.rst Message-ID: <20090223183348.B19201E4002@bag.python.org> Author: georg.brandl Date: Mon Feb 23 19:33:48 2009 New Revision: 69907 Log: Fix grammar. 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 Mon Feb 23 19:33:48 2009 @@ -38,9 +38,9 @@ $ 2to3 example.py A diff against the original source file is printed. 2to3 can also write the -needed modifications right back to the source file. (Of course, a backup of the -original is also be made unless :option:`-n` is also given.) Writing the -changes back is enabled with the :option:`-w` flag:: +needed modifications right back to the source file. (A backup of the original +file is made unless :option:`-n` is also given.) Writing the changes back is +enabled with the :option:`-w` flag:: $ 2to3 -w example.py From python-checkins at python.org Mon Feb 23 20:32:55 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 23 Feb 2009 20:32:55 +0100 (CET) Subject: [Python-checkins] r69908 - python/trunk/Doc/library/itertools.rst Message-ID: <20090223193255.D4EDB1E4015@bag.python.org> Author: raymond.hettinger Date: Mon Feb 23 20:32:55 2009 New Revision: 69908 Log: Update itertools recipes to use next(). Modified: python/trunk/Doc/library/itertools.rst Modified: python/trunk/Doc/library/itertools.rst ============================================================================== --- python/trunk/Doc/library/itertools.rst (original) +++ python/trunk/Doc/library/itertools.rst Mon Feb 23 20:32:55 2009 @@ -321,14 +321,14 @@ return self def next(self): while self.currkey == self.tgtkey: - self.currvalue = self.it.next() # Exit on StopIteration + self.currvalue = next(self.it) # Exit on StopIteration self.currkey = self.keyfunc(self.currvalue) self.tgtkey = self.currkey return (self.currkey, self._grouper(self.tgtkey)) def _grouper(self, tgtkey): while self.currkey == tgtkey: yield self.currvalue - self.currvalue = self.it.next() # Exit on StopIteration + self.currvalue = next(self.it) # Exit on StopIteration self.currkey = self.keyfunc(self.currvalue) .. versionadded:: 2.4 @@ -378,7 +378,7 @@ # imap(pow, (2,3,10), (5,2,3)) --> 32 9 1000 iterables = map(iter, iterables) while True: - args = [it.next() for it in iterables] + args = [next(it) for it in iterables] if function is None: yield tuple(args) else: @@ -404,11 +404,11 @@ # islice('ABCDEFG', 0, None, 2) --> A C E G s = slice(*args) it = iter(xrange(s.start or 0, s.stop or sys.maxint, s.step or 1)) - nexti = it.next() + nexti = next(it) for i, element in enumerate(iterable): if i == nexti: yield element - nexti = it.next() + nexti = next(it) If *start* is ``None``, then iteration starts at zero. If *step* is ``None``, then the step defaults to one. @@ -738,8 +738,7 @@ def pairwise(iterable): "s -> (s0,s1), (s1,s2), (s2, s3), ..." a, b = tee(iterable) - for elem in b: - break + next(b, None) return izip(a, b) def grouper(n, iterable, fillvalue=None): From python-checkins at python.org Mon Feb 23 20:38:11 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 23 Feb 2009 20:38:11 +0100 (CET) Subject: [Python-checkins] r69909 - python/branches/py3k/Doc/library/itertools.rst Message-ID: <20090223193811.E14BE1E4002@bag.python.org> Author: raymond.hettinger Date: Mon Feb 23 20:38:09 2009 New Revision: 69909 Log: Update itertools recipes to use next(). 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 Mon Feb 23 20:38:09 2009 @@ -326,14 +326,14 @@ return self def __next__(self): while self.currkey == self.tgtkey: - self.currvalue = next(self.it) # Exit on StopIteration + self.currvalue = next(self.it) # Exit on StopIteration self.currkey = self.keyfunc(self.currvalue) self.tgtkey = self.currkey return (self.currkey, self._grouper(self.tgtkey)) def _grouper(self, tgtkey): while self.currkey == tgtkey: yield self.currvalue - self.currvalue = next(self.it) # Exit on StopIteration + self.currvalue = next(self.it) # Exit on StopIteration self.currkey = self.keyfunc(self.currvalue) @@ -652,8 +652,7 @@ def pairwise(iterable): "s -> (s0,s1), (s1,s2), (s2, s3), ..." a, b = tee(iterable) - for elem in b: - break + next(b, None) return zip(a, b) def grouper(n, iterable, fillvalue=None): From python-checkins at python.org Mon Feb 23 20:44:00 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 23 Feb 2009 20:44:00 +0100 (CET) Subject: [Python-checkins] r69910 - python/branches/release30-maint/Doc/library/itertools.rst Message-ID: <20090223194400.F21731E4002@bag.python.org> Author: raymond.hettinger Date: Mon Feb 23 20:44:00 2009 New Revision: 69910 Log: Update itertools recipes to use next(). 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 Mon Feb 23 20:44:00 2009 @@ -240,14 +240,14 @@ return self def __next__(self): while self.currkey == self.tgtkey: - self.currvalue = next(self.it) # Exit on StopIteration + self.currvalue = next(self.it) # Exit on StopIteration self.currkey = self.keyfunc(self.currvalue) self.tgtkey = self.currkey return (self.currkey, self._grouper(self.tgtkey)) def _grouper(self, tgtkey): while self.currkey == tgtkey: yield self.currvalue - self.currvalue = next(self.it) # Exit on StopIteration + self.currvalue = next(self.it) # Exit on StopIteration self.currkey = self.keyfunc(self.currvalue) @@ -566,8 +566,7 @@ def pairwise(iterable): "s -> (s0,s1), (s1,s2), (s2, s3), ..." a, b = tee(iterable) - for elem in b: - break + next(b, None) return zip(a, b) def grouper(n, iterable, fillvalue=None): From python-checkins at python.org Mon Feb 23 20:57:18 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 23 Feb 2009 20:57:18 +0100 (CET) Subject: [Python-checkins] r69911 - in python/branches/io-c: Lib/io.py Modules/io.c Message-ID: <20090223195718.3747A1E4002@bag.python.org> Author: antoine.pitrou Date: Mon Feb 23 20:57:18 2009 New Revision: 69911 Log: expose DEFAULT_BUFFER_SIZE again (fixes a bunch of test failures) Modified: python/branches/io-c/Lib/io.py python/branches/io-c/Modules/io.c Modified: python/branches/io-c/Lib/io.py ============================================================================== --- python/branches/io-c/Lib/io.py (original) +++ python/branches/io-c/Lib/io.py Mon Feb 23 20:57:18 2009 @@ -55,6 +55,7 @@ import _io +DEFAULT_BUFFER_SIZE = _io.DEFAULT_BUFFER_SIZE BlockingIOError = _io.BlockingIOError UnsupportedOperation = _io.UnsupportedOperation open = _io.open Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Mon Feb 23 20:57:18 2009 @@ -633,7 +633,10 @@ Py_DECREF(type); \ goto fail; \ } - + + /* DEFAULT_BUFFER_SIZE */ + if (PyModule_AddIntMacro(m, DEFAULT_BUFFER_SIZE) < 0) + goto fail; /* UnsupportedOperation inherits from ValueError and IOError */ state->unsupported_operation = PyObject_CallFunction( From buildbot at python.org Mon Feb 23 20:59:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 23 Feb 2009 19:59:30 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian 3.0 Message-ID: <20090223195930.44A971E404D@bag.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/65 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: georg.brandl,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_doctest make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon Feb 23 20:59:58 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 23 Feb 2009 20:59:58 +0100 (CET) Subject: [Python-checkins] r69912 - python/branches/release26-maint/Doc/library/itertools.rst Message-ID: <20090223195958.0EBDD1E4002@bag.python.org> Author: raymond.hettinger Date: Mon Feb 23 20:59:57 2009 New Revision: 69912 Log: Update itertools recipes to use next(). Modified: python/branches/release26-maint/Doc/library/itertools.rst Modified: python/branches/release26-maint/Doc/library/itertools.rst ============================================================================== --- python/branches/release26-maint/Doc/library/itertools.rst (original) +++ python/branches/release26-maint/Doc/library/itertools.rst Mon Feb 23 20:59:57 2009 @@ -232,14 +232,14 @@ return self def next(self): while self.currkey == self.tgtkey: - self.currvalue = self.it.next() # Exit on StopIteration + self.currvalue = next(self.it) # Exit on StopIteration self.currkey = self.keyfunc(self.currvalue) self.tgtkey = self.currkey return (self.currkey, self._grouper(self.tgtkey)) def _grouper(self, tgtkey): while self.currkey == tgtkey: yield self.currvalue - self.currvalue = self.it.next() # Exit on StopIteration + self.currvalue = next(self.it) # Exit on StopIteration self.currkey = self.keyfunc(self.currvalue) .. versionadded:: 2.4 @@ -289,7 +289,7 @@ # imap(pow, (2,3,10), (5,2,3)) --> 32 9 1000 iterables = map(iter, iterables) while True: - args = [it.next() for it in iterables] + args = [next(it) for it in iterables] if function is None: yield tuple(args) else: @@ -315,11 +315,11 @@ # islice('ABCDEFG', 0, None, 2) --> A C E G s = slice(*args) it = iter(xrange(s.start or 0, s.stop or sys.maxint, s.step or 1)) - nexti = it.next() + nexti = next(it) for i, element in enumerate(iterable): if i == nexti: yield element - nexti = it.next() + nexti = next(it) If *start* is ``None``, then iteration starts at zero. If *step* is ``None``, then the step defaults to one. @@ -649,8 +649,7 @@ def pairwise(iterable): "s -> (s0,s1), (s1,s2), (s2, s3), ..." a, b = tee(iterable) - for elem in b: - break + next(b, None) return izip(a, b) def grouper(n, iterable, fillvalue=None): From python-checkins at python.org Mon Feb 23 21:10:30 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 23 Feb 2009 21:10:30 +0100 (CET) Subject: [Python-checkins] r69913 - python/branches/io-c/Lib/test/test_io.py Message-ID: <20090223201030.941BC1E400C@bag.python.org> Author: antoine.pitrou Date: Mon Feb 23 21:10:30 2009 New Revision: 69913 Log: Do the cyclic garbage collection tests only on the C version. The Python version is helpless as it uses __del__. Modified: python/branches/io-c/Lib/test/test_io.py Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Mon Feb 23 21:10:30 2009 @@ -738,16 +738,6 @@ self.assertRaises(IOError, bufio.seek, 0) self.assertRaises(IOError, bufio.tell) - def test_garbage_collection(self): - # BufferedReader objects are collected - rawio = self.FileIO(support.TESTFN, "w+b") - f = self.tp(rawio) - f.f = f - wr = weakref.ref(f) - del f - gc.collect() - self.assert_(wr() is None, wr) - class CBufferedReaderTest(BufferedReaderTest): tp = io.BufferedReader @@ -768,6 +758,17 @@ # checking this is not so easy. self.assertRaises(IOError, bufio.read, 10) + def test_garbage_collection(self): + # C BufferedReader objects are collected. + # The Python version has __del__, so it ends into gc.garbage instead + rawio = self.FileIO(support.TESTFN, "w+b") + f = self.tp(rawio) + f.f = f + wr = weakref.ref(f) + del f + gc.collect() + self.assert_(wr() is None, wr) + class PyBufferedReaderTest(BufferedReaderTest): tp = pyio.BufferedReader @@ -977,20 +978,6 @@ self.assertRaises(IOError, bufio.tell) self.assertRaises(IOError, bufio.write, b"abcdef") - def test_garbage_collection(self): - # BufferedWriter objects are collected, and collecting them flushes - # all data to disk. - rawio = self.FileIO(support.TESTFN, "w+b") - f = self.tp(rawio) - f.write(b"123xxx") - f.x = f - wr = weakref.ref(f) - del f - gc.collect() - self.assert_(wr() is None, wr) - with open(support.TESTFN, "rb") as f: - self.assertEqual(f.read(), b"123xxx") - class CBufferedWriterTest(BufferedWriterTest): tp = io.BufferedWriter @@ -1004,6 +991,21 @@ self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1) self.assertRaises(ValueError, bufio.write, b"def") + def test_garbage_collection(self): + # C BufferedWriter objects are collected, and collecting them flushes + # all data to disk. + # The Python version has __del__, so it ends into gc.garbage instead + rawio = self.FileIO(support.TESTFN, "w+b") + f = self.tp(rawio) + f.write(b"123xxx") + f.x = f + wr = weakref.ref(f) + del f + gc.collect() + self.assert_(wr() is None, wr) + with open(support.TESTFN, "rb") as f: + self.assertEqual(f.read(), b"123xxx") + class PyBufferedWriterTest(BufferedWriterTest): tp = pyio.BufferedWriter @@ -1152,13 +1154,13 @@ BufferedReaderTest.testMisbehavedRawIO(self) BufferedWriterTest.testMisbehavedRawIO(self) +class CBufferedRandomTest(BufferedRandomTest): + tp = io.BufferedRandom + def test_garbage_collection(self): BufferedReaderTest.test_garbage_collection(self) BufferedWriterTest.test_garbage_collection(self) -class CBufferedRandomTest(BufferedRandomTest): - tp = io.BufferedRandom - class PyBufferedRandomTest(BufferedRandomTest): tp = pyio.BufferedRandom @@ -1519,21 +1521,6 @@ self.assert_(s.startswith("Exception IOError: "), s) self.assert_(s.endswith(" ignored"), s) - def test_garbage_collection(self): - # TextIOWrapper objects are collected, and collecting them flushes - # all data to disk. - rawio = io.FileIO(support.TESTFN, "wb") - b = self.BufferedWriter(rawio) - t = self.TextIOWrapper(b, encoding="ascii") - t.write("456def") - t.x = t - wr = weakref.ref(t) - del t - gc.collect() - self.assert_(wr() is None, wr) - with open(support.TESTFN, "rb") as f: - self.assertEqual(f.read(), b"456def") - # Systematic tests of the text I/O API def testBasicIO(self): @@ -1829,6 +1816,22 @@ self.assertRaises(ValueError, t.__init__, b, newline='xyzzy') self.assertRaises(ValueError, t.read) + def test_garbage_collection(self): + # C TextIOWrapper objects are collected, and collecting them flushes + # all data to disk. + # The Python version has __del__, so it ends in gc.garbage instead. + rawio = io.FileIO(support.TESTFN, "wb") + b = self.BufferedWriter(rawio) + t = self.TextIOWrapper(b, encoding="ascii") + t.write("456def") + t.x = t + wr = weakref.ref(t) + del t + gc.collect() + self.assert_(wr() is None, wr) + with open(support.TESTFN, "rb") as f: + self.assertEqual(f.read(), b"456def") + class PyTextIOWrapperTest(TextIOWrapperTest): pass From python-checkins at python.org Mon Feb 23 21:21:41 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 23 Feb 2009 21:21:41 +0100 (CET) Subject: [Python-checkins] r69914 - python/branches/io-c/Lib/test/test_largefile.py Message-ID: <20090223202141.A5A281E4002@bag.python.org> Author: antoine.pitrou Date: Mon Feb 23 21:21:41 2009 New Revision: 69914 Log: Adapt test_largefile to test both implementations Modified: python/branches/io-c/Lib/test/test_largefile.py Modified: python/branches/io-c/Lib/test/test_largefile.py ============================================================================== --- python/branches/io-c/Lib/test/test_largefile.py (original) +++ python/branches/io-c/Lib/test/test_largefile.py Mon Feb 23 21:21:41 2009 @@ -7,6 +7,8 @@ import unittest from test.support import run_unittest, TESTFN, verbose, requires, \ TestSkipped, unlink +import io # C implementation of io +import _pyio as pyio # Python implementation of io try: import signal @@ -21,7 +23,7 @@ size = 2500000000 -class TestCase(unittest.TestCase): +class LargeFileTest(unittest.TestCase): """Test that each file function works as expected for a large (i.e. > 2GB, do we have to check > 4GB) files. @@ -34,7 +36,7 @@ def test_seek(self): if verbose: print('create large file via seek (may be sparse file) ...') - with open(TESTFN, 'wb') as f: + with self.open(TESTFN, 'wb') as f: f.write(b'z') f.seek(0) f.seek(size) @@ -52,7 +54,7 @@ def test_seek_read(self): if verbose: print('play around with seek() and read() with the built largefile') - with open(TESTFN, 'rb') as f: + with self.open(TESTFN, 'rb') as f: self.assertEqual(f.tell(), 0) self.assertEqual(f.read(1), b'z') self.assertEqual(f.tell(), 1) @@ -85,7 +87,7 @@ def test_lseek(self): if verbose: print('play around with os.lseek() with the built largefile') - with open(TESTFN, 'rb') as f: + with self.open(TESTFN, 'rb') as f: self.assertEqual(os.lseek(f.fileno(), 0, 0), 0) self.assertEqual(os.lseek(f.fileno(), 42, 0), 42) self.assertEqual(os.lseek(f.fileno(), 42, 1), 84) @@ -100,7 +102,7 @@ def test_truncate(self): if verbose: print('try truncate') - with open(TESTFN, 'r+b') as f: + with self.open(TESTFN, 'r+b') as f: # this is already decided before start running the test suite # but we do it anyway for extra protection if not hasattr(f, 'truncate'): @@ -143,7 +145,7 @@ # Only run if the current filesystem supports large files. # (Skip this test on Windows, since we now always support # large files.) - f = open(TESTFN, 'wb') + f = open(TESTFN, 'wb', buffering=0) try: # 2**31 == 2147483648 f.seek(2147483649) @@ -158,14 +160,19 @@ else: f.close() suite = unittest.TestSuite() - suite.addTest(TestCase('test_seek')) - suite.addTest(TestCase('test_osstat')) - suite.addTest(TestCase('test_seek_read')) - suite.addTest(TestCase('test_lseek')) - with open(TESTFN, 'w') as f: - if hasattr(f, 'truncate'): - suite.addTest(TestCase('test_truncate')) - unlink(TESTFN) + for _open, prefix in [(io.open, 'C'), (pyio.open, 'Py')]: + class TestCase(LargeFileTest): + pass + TestCase.open = staticmethod(_open) + TestCase.__name__ = prefix + LargeFileTest.__name__ + suite.addTest(TestCase('test_seek')) + suite.addTest(TestCase('test_osstat')) + suite.addTest(TestCase('test_seek_read')) + suite.addTest(TestCase('test_lseek')) + with _open(TESTFN, 'wb') as f: + if hasattr(f, 'truncate'): + suite.addTest(TestCase('test_truncate')) + unlink(TESTFN) try: run_unittest(suite) finally: From benjamin at python.org Mon Feb 23 21:24:51 2009 From: benjamin at python.org (Benjamin Peterson) Date: Mon, 23 Feb 2009 14:24:51 -0600 Subject: [Python-checkins] r69914 - python/branches/io-c/Lib/test/test_largefile.py In-Reply-To: <20090223202141.A5A281E4002@bag.python.org> References: <20090223202141.A5A281E4002@bag.python.org> Message-ID: <1afaf6160902231224t5952da6dr589a981a536e3ad8@mail.gmail.com> On Mon, Feb 23, 2009 at 2:21 PM, antoine. pitrou wrote: > Author: antoine.pitrou > Date: Mon Feb 23 21:21:41 2009 > New Revision: 69914 > > Log: > Adapt test_largefile to test both implementations Will you add test_largefile to the list of tests in the comment in test_io, please? (I knew I missed another one...) -- Regards, Benjamin From python-checkins at python.org Mon Feb 23 21:25:14 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 23 Feb 2009 21:25:14 +0100 (CET) Subject: [Python-checkins] r69915 - python/branches/io-c/Lib/test/test_io.py Message-ID: <20090223202514.891F31E400C@bag.python.org> Author: antoine.pitrou Date: Mon Feb 23 21:25:14 2009 New Revision: 69915 Log: One small failure Modified: python/branches/io-c/Lib/test/test_io.py Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Mon Feb 23 21:25:14 2009 @@ -1158,8 +1158,8 @@ tp = io.BufferedRandom def test_garbage_collection(self): - BufferedReaderTest.test_garbage_collection(self) - BufferedWriterTest.test_garbage_collection(self) + CBufferedReaderTest.test_garbage_collection(self) + CBufferedWriterTest.test_garbage_collection(self) class PyBufferedRandomTest(BufferedRandomTest): tp = pyio.BufferedRandom From python-checkins at python.org Mon Feb 23 21:28:34 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 23 Feb 2009 21:28:34 +0100 (CET) Subject: [Python-checkins] r69916 - python/branches/io-c/Lib/test/test_io.py Message-ID: <20090223202834.03C091E4002@bag.python.org> Author: antoine.pitrou Date: Mon Feb 23 21:28:33 2009 New Revision: 69916 Log: Add a comment, at BP's request Modified: python/branches/io-c/Lib/test/test_io.py Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Mon Feb 23 21:28:33 2009 @@ -7,6 +7,8 @@ # * test_file - tests the file interface # * test_io - tests everything else in the io module # * test_univnewlines - tests universal newline support +# * test_largefile - tests operations on a file greater than 2**32 bytes +# (only enabled with -ulargefile) ################################################################################ # ATTENTION TEST WRITERS!!! From python-checkins at python.org Mon Feb 23 21:48:09 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 23 Feb 2009 21:48:09 +0100 (CET) Subject: [Python-checkins] r69917 - python/branches/release30-maint/Doc/library/itertools.rst Message-ID: <20090223204809.698D31E4002@bag.python.org> Author: raymond.hettinger Date: Mon Feb 23 21:48:09 2009 New Revision: 69917 Log: Sync-up itertools docs with Py3.1 version. * Merge 69722: rewrite introduction and add summary table * Merge 69740: generalize tee() recipe * Fix tab alignment on recipes to match other recipes 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 Mon Feb 23 21:48:09 2009 @@ -13,39 +13,59 @@ from itertools import * -This module implements a number of :term:`iterator` building blocks inspired by -constructs from the Haskell and SML programming languages. Each has been recast -in a form suitable for Python. +This module implements a number of :term:`iterator` building blocks inspired +by constructs from APL, Haskell, and SML. Each has been recast in a form +suitable for Python. The module standardizes a core set of fast, memory efficient tools that are -useful by themselves or in combination. Standardization helps avoid the -readability and reliability problems which arise when many different individuals -create their own slightly varying implementations, each with their own quirks -and naming conventions. - -The tools are designed to combine readily with one another. This makes it easy -to construct more specialized tools succinctly and efficiently in pure Python. +useful by themselves or in combination. Together, they form an "iterator +algebra" making it possible to construct specialized tools succinctly and +efficiently in pure Python. For instance, SML provides a tabulation tool: ``tabulate(f)`` which produces a sequence ``f(0), f(1), ...``. But, this effect can be achieved in Python by combining :func:`map` and :func:`count` to form ``map(f, count())``. -Likewise, the functional tools are designed to work well with the high-speed -functions provided by the :mod:`operator` module. - -Whether cast in pure python form or compiled code, tools that use iterators are -more memory efficient (and often faster) than their list based counterparts. Adopting -the principles of just-in-time manufacturing, they create data when and where -needed instead of consuming memory with the computer equivalent of "inventory". - - -.. seealso:: - - The Standard ML Basis Library, `The Standard ML Basis Library - `_. - - Haskell, A Purely Functional Language, `Definition of Haskell and the Standard - Libraries `_. +The tools also work well with the high-speed functions in the :mod:`operator` +module. For example, the plus-operator can be mapped across two vectors to +form an efficient dot-product: ``sum(map(operator.add, vector1, vector2))``. + + +**Infinite Iterators:** + + ================== ================= ================================================= + Iterator Arguments Results + ================== ================= ================================================= + :func:`count` start start, start+1, start+2*1, ... + :func:`cycle` p p0, p1, ... plast, p0, p1, ... + :func:`repeat` elem [,n] elem, elem, elem, ... endlessly or up to n times + ================== ================= ================================================= + +**Iterators terminating on the shortest input sequence:** + + ==================== ============================ ================================================= + Iterator Arguments Results + ==================== ============================ ================================================= + :func:`chain` p, q, ... p0, p1, ... plast, q0, q1, ... + :func:`dropwhile` pred, seq seq[n], seq[n+1], starting when pred fails + :func:`filterfalse` pred, seq elements of seq where pred(elem) is False + :func:`groupby` iterable[, keyfunc] sub-iterators grouped by value of keyfunc(v) + :func:`islice` seq, [start,] stop [, step] elements from seq[start:stop:step] + :func:`starmap` func, seq func(\*seq[0]), fun(\*seq[1]), ... + :func:`tee` it, n it1, it2 , ... itn splits one iterator into n + :func:`takewhile` pred, seq seq[0], seq[1], until pred fails + :func:`zip_longest` p, q, ... (p[0], q[0]), (p[1], q[1]), ... + ==================== ============================ ================================================= + +**Combinatoric generators:** + + ===================================== ==================== ================================================= + Iterator Arguments Results + ===================================== ==================== ================================================= + :func:`product` p, q, ... [repeat=1] cartesian product + :func:`permutations` p[, r] r-length permutations (without repeated elements) + :func:`combinations` p[, r] r-length combinations (sorted and no repeats) + ===================================== ==================== ================================================= .. _itertools-functions: @@ -108,7 +128,7 @@ return indices = list(range(r)) yield tuple(pool[i] for i in indices) - while 1: + while True: for i in reversed(range(r)): if indices[i] != i + n - r: break @@ -415,28 +435,28 @@ .. function:: tee(iterable[, n=2]) - Return *n* independent iterators from a single iterable. The case where ``n==2`` - is equivalent to:: + Return *n* independent iterators from a single iterable. Equivalent to:: - def tee(iterable): - def gen(next, data={}): - for i in count(): - if i in data: - yield data.pop(i) - else: - data[i] = next() - yield data[i] - it = iter(iterable) - return (gen(it.__next__), gen(it.__next__)) - - Note, once :func:`tee` has made a split, the original *iterable* should not be - used anywhere else; otherwise, the *iterable* could get advanced without the tee - objects being informed. - - Note, this member of the toolkit may require significant auxiliary storage - (depending on how much temporary data needs to be stored). In general, if one - iterator is going to use most or all of the data before the other iterator, it - is faster to use :func:`list` instead of :func:`tee`. + def tee(iterable, n=2): + it = iter(iterable) + deques = [collections.deque() for i in range(n)] + def gen(mydeque): + while True: + if not mydeque: # when the local deque is empty + newval = next(it) # fetch a new value and + for d in deques: # load it to all the deques + d.append(newval) + yield mydeque.popleft() + return tuple(gen(d) for d in deques) + + Once :func:`tee` has made a split, the original *iterable* should not be + used anywhere else; otherwise, the *iterable* could get advanced without + the tee objects being informed. + + This itertool may require significant auxiliary storage (depending on how + much temporary data needs to be stored). In general, if one iterator uses + most or all of the data before another iterator starts, it is faster to use + :func:`list` instead of :func:`tee`. .. function:: zip_longest(*iterables[, fillvalue]) @@ -612,26 +632,26 @@ indices[i:] = [indices[i] + 1] * (r - i) yield tuple(pool[i] for i in indices) - def unique_everseen(iterable, key=None): - "List unique elements, preserving order. Remember all elements ever seen." - # unique_everseen('AAAABBBCCDAABBB') --> A B C D - # unique_everseen('ABBCcAD', str.lower) --> A B C D - seen = set() - seen_add = seen.add - if key is None: - for element in iterable: - if element not in seen: - seen_add(element) - yield element - else: - for element in iterable: - k = key(element) - if k not in seen: - seen_add(k) - yield element - - def unique_justseen(iterable, key=None): - "List unique elements, preserving order. Remember only the element just seen." - # unique_justseen('AAAABBBCCDAABBB') --> A B C D A B - # unique_justseen('ABBCcAD', str.lower) --> A B C A D - return map(next, map(itemgetter(1), groupby(iterable, key))) + def unique_everseen(iterable, key=None): + "List unique elements, preserving order. Remember all elements ever seen." + # unique_everseen('AAAABBBCCDAABBB') --> A B C D + # unique_everseen('ABBCcAD', str.lower) --> A B C D + seen = set() + seen_add = seen.add + if key is None: + for element in iterable: + if element not in seen: + seen_add(element) + yield element + else: + for element in iterable: + k = key(element) + if k not in seen: + seen_add(k) + yield element + + def unique_justseen(iterable, key=None): + "List unique elements, preserving order. Remember only the element just seen." + # unique_justseen('AAAABBBCCDAABBB') --> A B C D A B + # unique_justseen('ABBCcAD', str.lower) --> A B C A D + return map(next, imap(itemgetter(1), groupby(iterable, key))) From nnorwitz at gmail.com Mon Feb 23 22:09:01 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 23 Feb 2009 16:09:01 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090223210901.GA25032@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [664492 refs] From nnorwitz at gmail.com Mon Feb 23 22:16:17 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 23 Feb 2009 16:16:17 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090223211617.GA27424@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 [17163 refs] [17163 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16479 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663767 refs] From python-checkins at python.org Mon Feb 23 22:23:04 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 23 Feb 2009 22:23:04 +0100 (CET) Subject: [Python-checkins] r69918 - python/branches/release26-maint/Doc/library/itertools.rst Message-ID: <20090223212304.D4B411E4002@bag.python.org> Author: raymond.hettinger Date: Mon Feb 23 22:23:04 2009 New Revision: 69918 Log: Sync-up itertools docs with Py3.1 version. * Merge 69715: rewrite introduction and add summary table * Merge 69739: generalize tee() recipe * Merge 69141: Fix tab alignment on recipes to match other recipes * Merge 68942: Update powerset() recipe Modified: python/branches/release26-maint/Doc/library/itertools.rst Modified: python/branches/release26-maint/Doc/library/itertools.rst ============================================================================== --- python/branches/release26-maint/Doc/library/itertools.rst (original) +++ python/branches/release26-maint/Doc/library/itertools.rst Mon Feb 23 22:23:04 2009 @@ -14,40 +14,63 @@ .. versionadded:: 2.3 -This module implements a number of :term:`iterator` building blocks inspired by -constructs from the Haskell and SML programming languages. Each has been recast -in a form suitable for Python. +This module implements a number of :term:`iterator` building blocks inspired +by constructs from APL, Haskell, and SML. Each has been recast in a form +suitable for Python. The module standardizes a core set of fast, memory efficient tools that are -useful by themselves or in combination. Standardization helps avoid the -readability and reliability problems which arise when many different individuals -create their own slightly varying implementations, each with their own quirks -and naming conventions. - -The tools are designed to combine readily with one another. This makes it easy -to construct more specialized tools succinctly and efficiently in pure Python. +useful by themselves or in combination. Together, they form an "iterator +algebra" making it possible to construct specialized tools succinctly and +efficiently in pure Python. For instance, SML provides a tabulation tool: ``tabulate(f)`` which produces a sequence ``f(0), f(1), ...``. This toolbox provides :func:`imap` and -:func:`count` which can be combined to form ``imap(f, count())`` and produce an +:func:`count` which can be combined to form ``imap(f, count())`` to produce an equivalent result. -Likewise, the functional tools are designed to work well with the high-speed -functions provided by the :mod:`operator` module. - -Whether cast in pure python form or compiled code, tools that use iterators are -more memory efficient (and often faster) than their list based counterparts. Adopting -the principles of just-in-time manufacturing, they create data when and where -needed instead of consuming memory with the computer equivalent of "inventory". - - -.. seealso:: - - The Standard ML Basis Library, `The Standard ML Basis Library - `_. - - Haskell, A Purely Functional Language, `Definition of Haskell and the Standard - Libraries `_. +The tools also work well with the high-speed functions in the :mod:`operator` +module. For example, the plus-operator can be mapped across two vectors to +form an efficient dot-product: ``sum(imap(operator.add, vector1, vector2))``. + + +**Infinite Iterators:** + + ================== ================= ================================================= + Iterator Arguments Results + ================== ================= ================================================= + :func:`count` start start, start+1, start+2, ... + :func:`cycle` p p0, p1, ... plast, p0, p1, ... + :func:`repeat` elem [,n] elem, elem, elem, ... endlessly or up to n times + ================== ================= ================================================= + +**Iterators terminating on the shortest input sequence:** + + ==================== ============================ ================================================= + Iterator Arguments Results + ==================== ============================ ================================================= + :func:`chain` p, q, ... p0, p1, ... plast, q0, q1, ... + :func:`dropwhile` pred, seq seq[n], seq[n+1], starting when pred fails + :func:`groupby` iterable[, keyfunc] sub-iterators grouped by value of keyfunc(v) + :func:`ifilter` pred, seq elements of seq where pred(elem) is True + :func:`ifilterfalse` pred, seq elements of seq where pred(elem) is False + :func:`islice` seq, [start,] stop [, step] elements from seq[start:stop:step] + :func:`imap` func, p, q, ... func(p0, q0), fun(p1, q1), ... + :func:`starmap` func, seq func(\*seq[0]), fun(\*seq[1]), ... + :func:`tee` it, n it1, it2 , ... itn splits one iterator into n + :func:`takewhile` pred, seq seq[0], seq[1], until pred fails + :func:`izip` p, q, ... (p[0], q[0]), (p[1], q[1]), ... + :func:`izip_longest` p, q, ... (p[0], q[0]), (p[1], q[1]), ... + ==================== ============================ ================================================= + +**Combinatoric generators:** + + ===================================== ==================== ================================================= + Iterator Arguments Results + ===================================== ==================== ================================================= + :func:`product` p, q, ... [repeat=1] cartesian product + :func:`permutations` p[, r] r-length permutations (without repeated elements) + :func:`combinations` p[, r] r-length combinations (sorted and no repeats) + ===================================== ==================== ================================================= .. _itertools-functions: @@ -697,26 +720,31 @@ indices[i:] = [indices[i] + 1] * (r - i) yield tuple(pool[i] for i in indices) - def unique_everseen(iterable, key=None): - "List unique elements, preserving order. Remember all elements ever seen." - # unique_everseen('AAAABBBCCDAABBB') --> A B C D - # unique_everseen('ABBCcAD', str.lower) --> A B C D - seen = set() - seen_add = seen.add - if key is None: - for element in iterable: - if element not in seen: - seen_add(element) - yield element - else: - for element in iterable: - k = key(element) - if k not in seen: - seen_add(k) - yield element + def powerset(iterable): + "powerset([1,2,3]) --> () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)" + s = list(iterable) + return chain.from_iterable(combinations(s, r) for r in range(len(s)+1)) - def unique_justseen(iterable, key=None): - "List unique elements, preserving order. Remember only the element just seen." - # unique_justseen('AAAABBBCCDAABBB') --> A B C D A B - # unique_justseen('ABBCcAD', str.lower) --> A B C A D - return imap(next, imap(itemgetter(1), groupby(iterable, key))) + def unique_everseen(iterable, key=None): + "List unique elements, preserving order. Remember all elements ever seen." + # unique_everseen('AAAABBBCCDAABBB') --> A B C D + # unique_everseen('ABBCcAD', str.lower) --> A B C D + seen = set() + seen_add = seen.add + if key is None: + for element in iterable: + if element not in seen: + seen_add(element) + yield element + else: + for element in iterable: + k = key(element) + if k not in seen: + seen_add(k) + yield element + + def unique_justseen(iterable, key=None): + "List unique elements, preserving order. Remember only the element just seen." + # unique_justseen('AAAABBBCCDAABBB') --> A B C D A B + # unique_justseen('ABBCcAD', str.lower) --> A B C A D + return imap(next, imap(itemgetter(1), groupby(iterable, key))) From nnorwitz at gmail.com Mon Feb 23 23:36:47 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 23 Feb 2009 17:36:47 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090223223647.GA17094@python.psfb.org> 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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-13487 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 test_slice test_smtplib test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17142 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [678195 refs] From python-checkins at python.org Tue Feb 24 02:01:05 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 24 Feb 2009 02:01:05 +0100 (CET) Subject: [Python-checkins] r69920 - peps/trunk/pep-0376.txt Message-ID: <20090224010105.0AC221E4002@bag.python.org> Author: tarek.ziade Date: Tue Feb 24 02:01:04 2009 New Revision: 69920 Log: fixes and more details (Floris 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 Feb 24 02:01:04 2009 @@ -166,6 +166,8 @@ MANIFEST RECORD +XXX See if we want to keep the 2.5.2-py2.6 part + New functions in pkgutil ======================== @@ -174,11 +176,15 @@ The new functions added in the package are : -- get_egg_info(pkg_name) -> directory or None +- get_egg_info(pkg_name) -> path or None + + Scans all site-packages directories and look for all `pkg_name.egg-info` + directory. Returns the directory path that contains a PKG-INFO that matches + `pkg_name` for the `name` metadata. Notice that there should be at most + one result. If moe that one path matches the pkg_name, a DistutilsError + is raised. - Scans all site-packages directories and look for all `pkg_name*.egg-info` - directory. If founded, returns the path. If the directory is not found, - returns None. + If the directory is not found, returns None. - get_metadata(pkg_name) -> DistributionMetadata or None @@ -202,7 +208,7 @@ >>> metadata.version '2.5.2' >>> from distutils.dist import EGG_INFO_FILES - >>> get_metadata('zlib', EGG_INFO_FILES.manifest).read() + >>> get_egg_info_file('zlib', EGG_INFO_FILES.manifest).read() some ... files From python-checkins at python.org Tue Feb 24 03:11:07 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 24 Feb 2009 03:11:07 +0100 (CET) Subject: [Python-checkins] r69922 - peps/trunk/pep-0374.txt Message-ID: <20090224021107.9EB1B1E4002@bag.python.org> Author: brett.cannon Date: Tue Feb 24 03:11:07 2009 New Revision: 69922 Log: Update one-off scenario for hg. Turns out that 'hg export' doesn't exactly work if you have multiple commits. Better to use 'hg outgoing -p' to catch everything that differs from the remote repository. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Tue Feb 24 03:11:07 2009 @@ -477,14 +477,12 @@ cd trunk # Edit some code. hg commit -m "Stuff I did" - # Create a patch containing the last commit. Use hg export REV: to - # export all changes from revision REV (inclusive). - hg export tip >> stuff-i-did.patch + hg outgoing -p > fixes.patch # Upload patch to bugs.python.org # Receive reviewer comments # Edit some code hg commit -m "Address reviewer comments." - hg export tip >> additional-fixes.patch + hg outgoing -p > additional-fixes.patch # Upload patch to bugs.python.org From python-checkins at python.org Tue Feb 24 03:12:39 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 24 Feb 2009 03:12:39 +0100 (CET) Subject: [Python-checkins] r69923 - peps/trunk/pep-0374.txt Message-ID: <20090224021239.2E7631E4002@bag.python.org> Author: brett.cannon Date: Tue Feb 24 03:12:39 2009 New Revision: 69923 Log: Add a note that hg supports git's extended patch format. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Tue Feb 24 03:12:39 2009 @@ -485,6 +485,11 @@ 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 ''' From python-checkins at python.org Tue Feb 24 03:45:36 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 24 Feb 2009 03:45:36 +0100 (CET) Subject: [Python-checkins] r69924 - python/trunk/README Message-ID: <20090224024536.1403D1E403A@bag.python.org> Author: benjamin.peterson Date: Tue Feb 24 03:45:35 2009 New Revision: 69924 Log: update README on running tests Modified: python/trunk/README Modified: python/trunk/README ============================================================================== --- python/trunk/README (original) +++ python/trunk/README Tue Feb 24 03:45:35 2009 @@ -945,11 +945,14 @@ non-standard implementation of strftime() in the C library. Please ignore this, or upgrade to glibc version 6. +By default, tests are prevented from overusing resources like disk space and +memory. To enable these tests, run "make testall". + IMPORTANT: If the tests fail and you decide to mail a bug report, *don't* include the output of "make test". It is useless. Run the failing test manually, as follows: - ./python ./Lib/test/test_whatever.py + ./python Lib/test/regrtest.py -v test_whatever (substituting the top of the source tree for '.' if you built in a different directory). This runs the test in verbose mode. From buildbot at python.org Tue Feb 24 04:08:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 24 Feb 2009 03:08:14 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090224030814.AB7501E4002@bag.python.org> The Buildbot has detected a new failure of OS X x86 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/179 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson,georg.brandl,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Abort trap sincerely, -The Buildbot From python-checkins at python.org Tue Feb 24 04:09:20 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 24 Feb 2009 04:09:20 +0100 (CET) Subject: [Python-checkins] r69925 - peps/trunk/pep-0374.txt Message-ID: <20090224030920.E83641E4002@bag.python.org> Author: brett.cannon Date: Tue Feb 24 04:09:20 2009 New Revision: 69925 Log: Fix a minor grammatical mistake. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Tue Feb 24 04:09:20 2009 @@ -995,7 +995,7 @@ # Edit some code Another approach uses the loom plugin. Looms can -greatly simply working on dependent branches because they +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 From buildbot at python.org Tue Feb 24 04:15:32 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 24 Feb 2009 03:15:32 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090224031533.0A4971E4002@bag.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/1900 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,georg.brandl,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Feb 24 04:16:28 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 24 Feb 2009 04:16:28 +0100 (CET) Subject: [Python-checkins] r69926 - python/branches/py3k Message-ID: <20090224031628.EFC9A1E4018@bag.python.org> Author: benjamin.peterson Date: Tue Feb 24 04:16:28 2009 New Revision: 69926 Log: Blocked revisions 69870-69871,69908 via svnmerge ........ r69870 | antoine.pitrou | 2009-02-22 11:25:52 -0600 (Sun, 22 Feb 2009) | 3 lines Try to make sense of the test_site buildbot failures ........ r69871 | antoine.pitrou | 2009-02-22 12:20:46 -0600 (Sun, 22 Feb 2009) | 3 lines Revert debugging statements, culprit is possibly test_distutils (see #5316) ........ r69908 | raymond.hettinger | 2009-02-23 13:32:55 -0600 (Mon, 23 Feb 2009) | 1 line Update itertools recipes to use next(). ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Tue Feb 24 05:10:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 24 Feb 2009 04:10:20 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090224041021.094741E4011@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/363 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,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pipes make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Feb 24 05:23:25 2009 From: python-checkins at python.org (neil.schemenauer) Date: Tue, 24 Feb 2009 05:23:25 +0100 (CET) Subject: [Python-checkins] r69927 - python/trunk/Lib/SocketServer.py Message-ID: <20090224042325.68B111E4002@bag.python.org> Author: neil.schemenauer Date: Tue Feb 24 05:23:25 2009 New Revision: 69927 Log: Fix call to os.waitpid, it does not take keyword args. Modified: python/trunk/Lib/SocketServer.py Modified: python/trunk/Lib/SocketServer.py ============================================================================== --- python/trunk/Lib/SocketServer.py (original) +++ python/trunk/Lib/SocketServer.py Tue Feb 24 05:23:25 2009 @@ -487,7 +487,7 @@ # libraries that expect to be able to wait for their own # children. try: - pid, status = os.waitpid(0, options=0) + pid, status = os.waitpid(0, 0) except os.error: pid = None if pid not in self.active_children: continue From buildbot at python.org Tue Feb 24 05:52:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 24 Feb 2009 04:52:25 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090224045226.22B091E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/678 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neil.schemenauer BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Feb 24 09:08:40 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 24 Feb 2009 09:08:40 +0100 (CET) Subject: [Python-checkins] r69928 - peps/trunk/pep-0374.txt Message-ID: <20090224080840.7F7611E4002@bag.python.org> Author: brett.cannon Date: Tue Feb 24 09:08:40 2009 New Revision: 69928 Log: Minor typos. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Tue Feb 24 09:08:40 2009 @@ -999,7 +999,7 @@ 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 -thread, merge changes up the stack to descendant threads, create +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 @@ -1032,7 +1032,7 @@ bzr down-thread trunk # Get all new revisions to the trunk. If you've done things - # correctly, this must succeed without conflict. + # correctly, this will succeed without conflict. bzr pull bzr up-thread # See? The fix-socket thread is now identical to the trunk From nnorwitz at gmail.com Tue Feb 24 10:08:45 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 24 Feb 2009 04:08:45 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090224090845.GA10858@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17983 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [664492 refs] From nnorwitz at gmail.com Tue Feb 24 10:15:59 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 24 Feb 2009 04:15:59 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090224091559.GA13250@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 [17163 refs] [17163 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17142 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663767 refs] From nnorwitz at gmail.com Tue Feb 24 11:37:54 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 24 Feb 2009 05:37:54 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090224103754.GA2894@python.psfb.org> 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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-31747 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 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 [12983 refs] [12983 refs] [22537 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14638 refs] [14638 refs] test_plistlib test_poll test_popen [12988 refs] [12988 refs] [12988 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 [18033 refs] test_pyexpat test_queue test_quopri [15508 refs] [15508 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 [12983 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 test_slice test_smtplib test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [14883 refs] [13198 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] [12983 refs] . [12983 refs] [12983 refs] this bit of output is from a test of stdout in a different process ... [12983 refs] [12983 refs] [13198 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [12983 refs] [12983 refs] [13212 refs] [13006 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [12986 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16476 refs] [17142 refs] [16958 refs] [16958 refs] [16958 refs] [16958 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 runtktests 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 test_xmlrpc test_xpickle 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 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [678195 refs] From python-checkins at python.org Tue Feb 24 11:52:16 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 24 Feb 2009 11:52:16 +0100 (CET) Subject: [Python-checkins] r69929 - python/branches/release30-maint/Doc/library/random.rst Message-ID: <20090224105216.D5C661E400C@bag.python.org> Author: raymond.hettinger Date: Tue Feb 24 11:52:16 2009 New Revision: 69929 Log: Fix-up random docs. Jumpahead was removed long ago. Other minor corrections. Modified: python/branches/release30-maint/Doc/library/random.rst Modified: python/branches/release30-maint/Doc/library/random.rst ============================================================================== --- python/branches/release30-maint/Doc/library/random.rst (original) +++ python/branches/release30-maint/Doc/library/random.rst Tue Feb 24 11:52:16 2009 @@ -32,7 +32,7 @@ Class :class:`Random` can also be subclassed if you want to use a different basic generator of your own devising: in that case, override the :meth:`random`, -:meth:`seed`, :meth:`getstate`, and :meth:`setstate`. +:meth:`seed`, :meth:`getstate`, and :meth:`setstate` methods. Optionally, a new generator can supply a :meth:`getrandbits` method --- this allows :meth:`randrange` to produce selections over an arbitrarily large range. @@ -66,17 +66,6 @@ the time :func:`setstate` was called. -.. function:: jumpahead(n) - - Change the internal state to one different from and likely far away from the - current state. *n* is a non-negative integer which is used to scramble the - current state vector. This is most useful in multi-threaded programs, in - conjunction with multiple instances of the :class:`Random` class: - :meth:`setstate` or :meth:`seed` can be used to force all instances into the - same internal state, and then :meth:`jumpahead` can be used to force the - instances' states far apart. - - .. function:: getrandbits(k) Returns a python integer with *k* random bits. This method is supplied with @@ -96,7 +85,8 @@ .. function:: randint(a, b) - Return a random integer *N* such that ``a <= N <= b``. + Return a random integer *N* such that ``a <= N <= b``. Alias for + ``randrange(a, b+1)``. Functions for sequences: @@ -226,7 +216,7 @@ Class that uses the :func:`os.urandom` function for generating random numbers from sources provided by the operating system. Not available on all systems. Does not rely on software state and sequences are not reproducible. Accordingly, - the :meth:`seed` and :meth:`jumpahead` methods have no effect and are ignored. + the :meth:`seed` method has no effect and is ignored. The :meth:`getstate` and :meth:`setstate` methods raise :exc:`NotImplementedError` if called. From python-checkins at python.org Tue Feb 24 11:57:03 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 24 Feb 2009 11:57:03 +0100 (CET) Subject: [Python-checkins] r69930 - python/branches/py3k/Doc/library/random.rst Message-ID: <20090224105703.27D461E400C@bag.python.org> Author: raymond.hettinger Date: Tue Feb 24 11:57:02 2009 New Revision: 69930 Log: Fix-up random docs. Jumpahead was removed long ago. Other minor corrections. Modified: python/branches/py3k/Doc/library/random.rst Modified: python/branches/py3k/Doc/library/random.rst ============================================================================== --- python/branches/py3k/Doc/library/random.rst (original) +++ python/branches/py3k/Doc/library/random.rst Tue Feb 24 11:57:02 2009 @@ -32,7 +32,7 @@ Class :class:`Random` can also be subclassed if you want to use a different basic generator of your own devising: in that case, override the :meth:`random`, -:meth:`seed`, :meth:`getstate`, and :meth:`setstate`. +:meth:`seed`, :meth:`getstate`, and :meth:`setstate` methods. Optionally, a new generator can supply a :meth:`getrandbits` method --- this allows :meth:`randrange` to produce selections over an arbitrarily large range. @@ -66,17 +66,6 @@ the time :func:`setstate` was called. -.. function:: jumpahead(n) - - Change the internal state to one different from and likely far away from the - current state. *n* is a non-negative integer which is used to scramble the - current state vector. This is most useful in multi-threaded programs, in - conjunction with multiple instances of the :class:`Random` class: - :meth:`setstate` or :meth:`seed` can be used to force all instances into the - same internal state, and then :meth:`jumpahead` can be used to force the - instances' states far apart. - - .. function:: getrandbits(k) Returns a python integer with *k* random bits. This method is supplied with @@ -96,7 +85,8 @@ .. function:: randint(a, b) - Return a random integer *N* such that ``a <= N <= b``. + Return a random integer *N* such that ``a <= N <= b``. Alias for + ``randrange(a, b+1)``. Functions for sequences: @@ -228,7 +218,7 @@ Class that uses the :func:`os.urandom` function for generating random numbers from sources provided by the operating system. Not available on all systems. Does not rely on software state and sequences are not reproducible. Accordingly, - the :meth:`seed` and :meth:`jumpahead` methods have no effect and are ignored. + the :meth:`seed` method has no effect and is ignored. The :meth:`getstate` and :meth:`setstate` methods raise :exc:`NotImplementedError` if called. From python-checkins at python.org Tue Feb 24 12:06:12 2009 From: python-checkins at python.org (matthias.klose) Date: Tue, 24 Feb 2009 12:06:12 +0100 (CET) Subject: [Python-checkins] r69931 - in python/branches/release30-maint: Makefile.pre.in Misc/NEWS Message-ID: <20090224110612.607FA1E4002@bag.python.org> Author: matthias.klose Date: Tue Feb 24 12:06:11 2009 New Revision: 69931 Log: - Link the shared python library with $(MODLIBS). Modified: python/branches/release30-maint/Makefile.pre.in python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Makefile.pre.in ============================================================================== --- python/branches/release30-maint/Makefile.pre.in (original) +++ python/branches/release30-maint/Makefile.pre.in Tue Feb 24 12:06:11 2009 @@ -410,10 +410,10 @@ libpython$(VERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ - $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ $(LN) -f $(INSTSONAME) $@; \ else \ - $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ fi libpython$(VERSION).dylib: $(LIBRARY_OBJS) @@ -421,7 +421,7 @@ libpython$(VERSION).sl: $(LIBRARY_OBJS) - $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) + $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary # minimal framework (not including the Lib directory and such) in the current Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Tue Feb 24 12:06:11 2009 @@ -22,6 +22,11 @@ Library ------- +Build +----- + +- Link the shared python library with $(MODLIBS). + What's New in Python 3.0.1? =========================== From python-checkins at python.org Tue Feb 24 12:07:44 2009 From: python-checkins at python.org (matthias.klose) Date: Tue, 24 Feb 2009 12:07:44 +0100 (CET) Subject: [Python-checkins] r69932 - in python/branches/release26-maint: Makefile.pre.in Misc/NEWS Message-ID: <20090224110744.D8DAD1E4002@bag.python.org> Author: matthias.klose Date: Tue Feb 24 12:07:44 2009 New Revision: 69932 Log: - Link the shared python library with $(MODLIBS). Modified: python/branches/release26-maint/Makefile.pre.in python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Makefile.pre.in ============================================================================== --- python/branches/release26-maint/Makefile.pre.in (original) +++ python/branches/release26-maint/Makefile.pre.in Tue Feb 24 12:07:44 2009 @@ -412,10 +412,10 @@ libpython$(VERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ - $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ $(LN) -f $(INSTSONAME) $@; \ else \ - $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ fi libpython$(VERSION).dylib: $(LIBRARY_OBJS) @@ -423,7 +423,7 @@ libpython$(VERSION).sl: $(LIBRARY_OBJS) - $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) + $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary # minimal framework (not including the Lib directory and such) in the current Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Tue Feb 24 12:07:44 2009 @@ -201,6 +201,11 @@ - Issue #1040026: Fix os.times result on systems where HZ is incorrect. +Build +----- + +- Link the shared python library with $(MODLIBS). + What's New in Python 2.6.1 ========================== From python-checkins at python.org Tue Feb 24 12:18:40 2009 From: python-checkins at python.org (matthias.klose) Date: Tue, 24 Feb 2009 12:18:40 +0100 (CET) Subject: [Python-checkins] r69933 - python/branches/release30-maint/Misc/NEWS Message-ID: <20090224111840.3C5BE1E4002@bag.python.org> Author: matthias.klose Date: Tue Feb 24 12:18:39 2009 New Revision: 69933 Log: Move issues in Misc/NEWS fixed in 3.0.2 from the 3.0.1 to the 3.0.2 section. Modified: python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Tue Feb 24 12:18:39 2009 @@ -12,7 +12,6 @@ Core and Builtins ----------------- -======= - Issue #5247: Improve error message when unknown format codes are used when using str.format() with str, int, and float arguments. @@ -22,6 +21,14 @@ Library ------- +- Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0, + The file was resized to wrong size. + +- Issue #5292: Fixed mmap crash on its boundary access m[len(m)]. + +- Issue #4524: distutils build_script command failed with --with-suffix=3. + Initial patch by Amaury Forgeot d'Arc. + Build ----- @@ -140,14 +147,6 @@ Library ------- -- Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0, - The file was resized to wrong size. - -- Issue #5292: Fixed mmap crash on its boundary access m[len(m)]. - -- Issue #4524: distutils build_script command failed with --with-suffix=3. - Initial patch by Amaury Forgeot d'Arc. - - Issue #4998: The memory saving effect of __slots__ had been lost on Fractions which inherited from numbers.py which did not have __slots__ defined. The numbers hierarchy now has its own __slots__ declarations. From python-checkins at python.org Tue Feb 24 12:25:35 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 24 Feb 2009 12:25:35 +0100 (CET) Subject: [Python-checkins] r69934 - in python/branches/py3k/Lib: _abcoll.py test/test_collections.py Message-ID: <20090224112535.F345B1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 24 12:25:35 2009 New Revision: 69934 Log: range() should have been registered as a Sequence. Needs to be backported to 2.6, 2.7, and 3.0. Modified: python/branches/py3k/Lib/_abcoll.py python/branches/py3k/Lib/test/test_collections.py Modified: python/branches/py3k/Lib/_abcoll.py ============================================================================== --- python/branches/py3k/Lib/_abcoll.py (original) +++ python/branches/py3k/Lib/_abcoll.py Tue Feb 24 12:25:35 2009 @@ -546,6 +546,7 @@ Sequence.register(tuple) Sequence.register(str) +Sequence.register(range) class ByteString(Sequence): 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 Tue Feb 24 12:25:35 2009 @@ -406,6 +406,8 @@ for sample in [tuple, list, bytes, str]: self.failUnless(isinstance(sample(), Sequence)) self.failUnless(issubclass(sample, Sequence)) + self.failUnless(isinstance(range(10), Sequence)) + self.failUnless(issubclass(range, Sequence)) self.failUnless(issubclass(str, Sequence)) self.validate_abstract_methods(Sequence, '__contains__', '__iter__', '__len__', '__getitem__') From python-checkins at python.org Tue Feb 24 12:27:15 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 24 Feb 2009 12:27:15 +0100 (CET) Subject: [Python-checkins] r69935 - python/branches/py3k/Lib/random.py Message-ID: <20090224112715.837341E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 24 12:27:15 2009 New Revision: 69935 Log: Use ABCs to validate documented restriction to Sets or Sequences. Modified: python/branches/py3k/Lib/random.py Modified: python/branches/py3k/Lib/random.py ============================================================================== --- python/branches/py3k/Lib/random.py (original) +++ python/branches/py3k/Lib/random.py Tue Feb 24 12:27:15 2009 @@ -43,6 +43,7 @@ from math import sqrt as _sqrt, acos as _acos, cos as _cos, sin as _sin from os import urandom as _urandom from binascii import hexlify as _hexlify +import collections as _collections __all__ = ["Random","seed","random","uniform","randint","choice","sample", "randrange","shuffle","normalvariate","lognormvariate", @@ -296,10 +297,10 @@ # preferred since the list takes less space than the # set and it doesn't suffer from frequent reselections. - if isinstance(population, (set, frozenset)): + if isinstance(population, _collections.Set): population = tuple(population) - if not hasattr(population, '__getitem__') or hasattr(population, 'keys'): - raise TypeError("Population must be a sequence or set. For dicts, use dict.keys().") + if not isinstance(population, _collections.Sequence): + raise TypeError("Population must be a sequence or Set. For dicts, use list(d).") random = self.random n = len(population) if not 0 <= k <= n: From python-checkins at python.org Tue Feb 24 12:31:49 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 24 Feb 2009 12:31:49 +0100 (CET) Subject: [Python-checkins] r69936 - in python/branches/release30-maint/Lib: _abcoll.py random.py test/test_collections.py Message-ID: <20090224113149.7430F1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 24 12:31:49 2009 New Revision: 69936 Log: Backport r69934 and r69935: register range() as a sequence Use ABCs for input validation in random.sample() Modified: python/branches/release30-maint/Lib/_abcoll.py python/branches/release30-maint/Lib/random.py python/branches/release30-maint/Lib/test/test_collections.py Modified: python/branches/release30-maint/Lib/_abcoll.py ============================================================================== --- python/branches/release30-maint/Lib/_abcoll.py (original) +++ python/branches/release30-maint/Lib/_abcoll.py Tue Feb 24 12:31:49 2009 @@ -546,6 +546,7 @@ Sequence.register(tuple) Sequence.register(str) +Sequence.register(range) class ByteString(Sequence): Modified: python/branches/release30-maint/Lib/random.py ============================================================================== --- python/branches/release30-maint/Lib/random.py (original) +++ python/branches/release30-maint/Lib/random.py Tue Feb 24 12:31:49 2009 @@ -43,6 +43,7 @@ from math import sqrt as _sqrt, acos as _acos, cos as _cos, sin as _sin from os import urandom as _urandom from binascii import hexlify as _hexlify +import collections as _collections __all__ = ["Random","seed","random","uniform","randint","choice","sample", "randrange","shuffle","normalvariate","lognormvariate", @@ -296,10 +297,10 @@ # preferred since the list takes less space than the # set and it doesn't suffer from frequent reselections. - if isinstance(population, (set, frozenset)): + if isinstance(population, _collections.Set): population = tuple(population) - if not hasattr(population, '__getitem__') or hasattr(population, 'keys'): - raise TypeError("Population must be a sequence or set. For dicts, use dict.keys().") + if not isinstance(population, _collections.Sequence): + raise TypeError("Population must be a sequence or Set. For dicts, use list(d).") random = self.random n = len(population) if not 0 <= k <= n: 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 Tue Feb 24 12:31:49 2009 @@ -393,6 +393,8 @@ for sample in [tuple, list, bytes, str]: self.failUnless(isinstance(sample(), Sequence)) self.failUnless(issubclass(sample, Sequence)) + self.failUnless(isinstance(range(10), Sequence)) + self.failUnless(issubclass(range, Sequence)) self.failUnless(issubclass(str, Sequence)) self.validate_abstract_methods(Sequence, '__contains__', '__iter__', '__len__', '__getitem__') From buildbot at python.org Tue Feb 24 13:17:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 24 Feb 2009 12:17:56 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090224121756.424771E4002@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/176 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: matthias.klose,raymond.hettinger 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 Feb 24 13:23:23 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 24 Feb 2009 13:23:23 +0100 (CET) Subject: [Python-checkins] r69937 - in python/trunk/Lib: _abcoll.py test/test_collections.py Message-ID: <20090224122323.505A31E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 24 13:23:23 2009 New Revision: 69937 Log: Backport 69934: Register xrange() as a Sequence. Modified: python/trunk/Lib/_abcoll.py python/trunk/Lib/test/test_collections.py Modified: python/trunk/Lib/_abcoll.py ============================================================================== --- python/trunk/Lib/_abcoll.py (original) +++ python/trunk/Lib/_abcoll.py Tue Feb 24 13:23:23 2009 @@ -519,6 +519,7 @@ Sequence.register(tuple) Sequence.register(basestring) Sequence.register(buffer) +Sequence.register(xrange) class MutableSequence(Sequence): Modified: python/trunk/Lib/test/test_collections.py ============================================================================== --- python/trunk/Lib/test/test_collections.py (original) +++ python/trunk/Lib/test/test_collections.py Tue Feb 24 13:23:23 2009 @@ -406,6 +406,9 @@ self.failUnless(isinstance(sample(), Sequence)) self.failUnless(issubclass(sample, Sequence)) self.failUnless(issubclass(basestring, Sequence)) + self.failUnless(isinstance(range(10), Sequence)) + self.failUnless(issubclass(xrange, Sequence)) + self.failUnless(issubclass(str, Sequence)) self.validate_abstract_methods(Sequence, '__contains__', '__iter__', '__len__', '__getitem__') From python-checkins at python.org Tue Feb 24 13:25:32 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 24 Feb 2009 13:25:32 +0100 (CET) Subject: [Python-checkins] r69938 - in python/branches/release26-maint: Lib/_abcoll.py Lib/test/test_collections.py Misc/NEWS Message-ID: <20090224122532.B33521E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 24 13:25:32 2009 New Revision: 69938 Log: Backport 69934: Register xrange() as a Sequence. Modified: python/branches/release26-maint/Lib/_abcoll.py python/branches/release26-maint/Lib/test/test_collections.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/_abcoll.py ============================================================================== --- python/branches/release26-maint/Lib/_abcoll.py (original) +++ python/branches/release26-maint/Lib/_abcoll.py Tue Feb 24 13:25:32 2009 @@ -519,6 +519,7 @@ Sequence.register(tuple) Sequence.register(basestring) Sequence.register(buffer) +Sequence.register(xrange) class MutableSequence(Sequence): 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 Tue Feb 24 13:25:32 2009 @@ -393,6 +393,9 @@ self.failUnless(isinstance(sample(), Sequence)) self.failUnless(issubclass(sample, Sequence)) self.failUnless(issubclass(basestring, Sequence)) + self.failUnless(isinstance(range(10), Sequence)) + self.failUnless(issubclass(xrange, Sequence)) + self.failUnless(issubclass(str, Sequence)) self.validate_abstract_methods(Sequence, '__contains__', '__iter__', '__len__', '__getitem__') Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Tue Feb 24 13:25:32 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- xrange() is now registered as a Sequence. + - Issue #5247: Improve error message when unknown format codes are used when using str.format() with str, unicode, long, int, and float arguments. From python-checkins at python.org Tue Feb 24 13:49:33 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 24 Feb 2009 13:49:33 +0100 (CET) Subject: [Python-checkins] r69939 - python/branches/release30-maint/Doc/library/random.rst Message-ID: <20090224124933.71CFD1E4002@bag.python.org> Author: raymond.hettinger Date: Tue Feb 24 13:49:33 2009 New Revision: 69939 Log: random.py: sync-up 3.0 docs from 3.1 updates. Modified: python/branches/release30-maint/Doc/library/random.rst Modified: python/branches/release30-maint/Doc/library/random.rst ============================================================================== --- python/branches/release30-maint/Doc/library/random.rst (original) +++ python/branches/release30-maint/Doc/library/random.rst Tue Feb 24 13:49:33 2009 @@ -159,9 +159,11 @@ .. function:: expovariate(lambd) - Exponential distribution. *lambd* is 1.0 divided by the desired mean. (The - parameter would be called "lambda", but that is a reserved word in Python.) - Returned values range from 0 to positive infinity. + Exponential distribution. *lambd* is 1.0 divided by the desired + mean. It should be nonzero. (The parameter would be called + "lambda", but that is a reserved word in Python.) Returned values + range from 0 to positive infinity if *lambd* is positive, and from + negative infinity to 0 if *lambd* is negative. .. function:: gammavariate(alpha, beta) From buildbot at python.org Tue Feb 24 14:31:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 24 Feb 2009 13:31:14 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090224133115.2A62B1E4010@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/328 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 buildbot at python.org Tue Feb 24 15:11:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 24 Feb 2009 14:11:35 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090224141135.F05211E4002@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/341 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: 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.x.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Tue Feb 24 21:00:55 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Tue, 24 Feb 2009 21:00:55 +0100 (CET) Subject: [Python-checkins] r69940 - sandbox/trunk/mmap Message-ID: <20090224200055.D54D61E4026@bag.python.org> Author: hirokazu.yamamoto Date: Tue Feb 24 21:00:55 2009 New Revision: 69940 Log: Branch to fix mmap module issues. Added: sandbox/trunk/mmap/ - copied from r69939, /python/trunk/ From python-checkins at python.org Tue Feb 24 21:11:25 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Tue, 24 Feb 2009 21:11:25 +0100 (CET) Subject: [Python-checkins] r69941 - sandbox/trunk/mmap/Modules/mmapmodule.c Message-ID: <20090224201125.B15E31E4002@bag.python.org> Author: hirokazu.yamamoto Date: Tue Feb 24 21:11:25 2009 New Revision: 69941 Log: Issue #1733986: If mapping object is opened with same tagname but larger size, accessing its element crashes python. (windows) import mmap, tempfile f = tempfile.TemporaryFile() m1 = mmap.mmap(f.fileno(), 1000, tagname="foo") m2 = mmap.mmap(f.fileno(), 5000, tagname="foo") # same tagname, but larger size print len(m2[:]) # crash Modified: sandbox/trunk/mmap/Modules/mmapmodule.c Modified: sandbox/trunk/mmap/Modules/mmapmodule.c ============================================================================== --- sandbox/trunk/mmap/Modules/mmapmodule.c (original) +++ sandbox/trunk/mmap/Modules/mmapmodule.c Tue Feb 24 21:11:25 2009 @@ -1366,7 +1366,7 @@ dwDesiredAccess, off_hi, off_lo, - 0); + m_obj->size); if (m_obj->data != NULL) return (PyObject *)m_obj; else From python-checkins at python.org Tue Feb 24 21:18:29 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Tue, 24 Feb 2009 21:18:29 +0100 (CET) Subject: [Python-checkins] r69942 - sandbox/trunk/mmap/Modules/mmapmodule.c Message-ID: <20090224201829.023CD1E4002@bag.python.org> Author: hirokazu.yamamoto Date: Tue Feb 24 21:18:28 2009 New Revision: 69942 Log: Fixed crash bug bellow. After mmap.resize raised error, self->map_handle becomes NULL, but it should become INVALID_HANDLE_VALUE otherwise CHECK_VALID is passed through. import mmap m = mmap.mmap(-1, 5) try: m.resize(-1) except WindowsError: pass m[0] = '1' # crash Modified: sandbox/trunk/mmap/Modules/mmapmodule.c Modified: sandbox/trunk/mmap/Modules/mmapmodule.c ============================================================================== --- sandbox/trunk/mmap/Modules/mmapmodule.c (original) +++ sandbox/trunk/mmap/Modules/mmapmodule.c Tue Feb 24 21:18:28 2009 @@ -432,10 +432,13 @@ } else { DWORD dwErrCode = 0; DWORD off_hi, off_lo, newSizeLow, newSizeHigh; + HANDLE map_handle; /* First, unmap the file view */ UnmapViewOfFile(self->data); + self->data = NULL; /* Close the mapping object */ CloseHandle(self->map_handle); + self->map_handle = INVALID_HANDLE_VALUE; /* Move to the desired EOF position */ #if SIZEOF_SIZE_T > 4 newSizeHigh = (DWORD)((self->offset + new_size) >> 32); @@ -453,25 +456,27 @@ /* Change the size of the file */ SetEndOfFile(self->file_handle); /* Create another mapping object and remap the file view */ - self->map_handle = CreateFileMapping( + map_handle = CreateFileMapping( self->file_handle, NULL, PAGE_READWRITE, 0, 0, self->tagname); - if (self->map_handle != NULL) { - self->data = (char *) MapViewOfFile(self->map_handle, + if (map_handle != NULL) { + self->data = (char *) MapViewOfFile(map_handle, FILE_MAP_WRITE, off_hi, off_lo, new_size); if (self->data != NULL) { + self->map_handle = map_handle; self->size = new_size; Py_INCREF(Py_None); return Py_None; } else { dwErrCode = GetLastError(); + CloseHandle(map_handle); } } else { dwErrCode = GetLastError(); @@ -1212,6 +1217,7 @@ HANDLE fh = 0; int access = (access_mode)ACCESS_DEFAULT; DWORD flProtect, dwDesiredAccess; + HANDLE map_handle; static char *keywords[] = { "fileno", "length", "tagname", "access", "offset", NULL }; @@ -1355,22 +1361,26 @@ #endif /* For files, it would be sufficient to pass 0 as size. For anonymous maps, we have to pass the size explicitly. */ - m_obj->map_handle = CreateFileMapping(m_obj->file_handle, - NULL, - flProtect, - size_hi, - size_lo, - m_obj->tagname); - if (m_obj->map_handle != NULL) { - m_obj->data = (char *) MapViewOfFile(m_obj->map_handle, + map_handle = CreateFileMapping(m_obj->file_handle, + NULL, + flProtect, + size_hi, + size_lo, + m_obj->tagname); + if (map_handle != NULL) { + m_obj->data = (char *) MapViewOfFile(map_handle, dwDesiredAccess, off_hi, off_lo, m_obj->size); - if (m_obj->data != NULL) + if (m_obj->data != NULL) { + m_obj->map_handle = map_handle; return (PyObject *)m_obj; - else + } + else { dwErr = GetLastError(); + CloseHandle(map_handle); + } } else dwErr = GetLastError(); Py_DECREF(m_obj); From python-checkins at python.org Tue Feb 24 21:21:57 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Tue, 24 Feb 2009 21:21:57 +0100 (CET) Subject: [Python-checkins] r69943 - sandbox/trunk/mmap/Modules/mmapmodule.c Message-ID: <20090224202157.6CB881E4002@bag.python.org> Author: hirokazu.yamamoto Date: Tue Feb 24 21:21:57 2009 New Revision: 69943 Log: mmap.move crashed by integer overflow. See http://www.nabble.com/Segv-in-mmap.move()-td18617044.html I think mmap.move should raise ValueError for negative value though. import mmap data = mmap.mmap(-1, 1) data.move(1,1,-1) # crash Modified: sandbox/trunk/mmap/Modules/mmapmodule.c Modified: sandbox/trunk/mmap/Modules/mmapmodule.c ============================================================================== --- sandbox/trunk/mmap/Modules/mmapmodule.c (original) +++ sandbox/trunk/mmap/Modules/mmapmodule.c Tue Feb 24 21:21:57 2009 @@ -606,10 +606,8 @@ return NULL; } else { /* bounds check the values */ - if (/* end of source after end of data?? */ - ((src+count) > self->size) - /* dest will fit? */ - || (dest+count > self->size)) { + unsigned long pos = max(src, dest); + if (self->size >= pos && count > self->size - pos) { PyErr_SetString(PyExc_ValueError, "source or destination out of range"); return NULL; From python-checkins at python.org Tue Feb 24 21:27:43 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Tue, 24 Feb 2009 21:27:43 +0100 (CET) Subject: [Python-checkins] r69944 - sandbox/trunk/mmap/Modules/mmapmodule.c Message-ID: <20090224202743.BBCBF1E4002@bag.python.org> Author: hirokazu.yamamoto Date: Tue Feb 24 21:27:43 2009 New Revision: 69944 Log: Issue #2733: Fixed resize error for anonymous mapping object (windows). I'm doubtful anonymous mapping object is resizable, but if another process changes file size between SetFilePointer and CreateFileMapping it may cause segfault, so I think explicitly specifying size is good practice. Modified: sandbox/trunk/mmap/Modules/mmapmodule.c Modified: sandbox/trunk/mmap/Modules/mmapmodule.c ============================================================================== --- sandbox/trunk/mmap/Modules/mmapmodule.c (original) +++ sandbox/trunk/mmap/Modules/mmapmodule.c Tue Feb 24 21:27:43 2009 @@ -451,17 +451,21 @@ off_hi = 0; off_lo = (DWORD)self->offset; #endif - SetFilePointer(self->file_handle, - newSizeLow, &newSizeHigh, FILE_BEGIN); - /* Change the size of the file */ - SetEndOfFile(self->file_handle); + /* XXX: Is anonymous map really resizable? */ + if (self->file_handle != INVALID_HANDLE_VALUE) { + DWORD copySizeHigh = newSizeHigh; + SetFilePointer(self->file_handle, + newSizeLow, ©SizeHigh, FILE_BEGIN); + /* Change the size of the file */ + SetEndOfFile(self->file_handle); + } /* Create another mapping object and remap the file view */ map_handle = CreateFileMapping( self->file_handle, NULL, PAGE_READWRITE, - 0, - 0, + newSizeHigh, + newSizeLow, self->tagname); if (map_handle != NULL) { self->data = (char *) MapViewOfFile(map_handle, From python-checkins at python.org Tue Feb 24 21:31:42 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Tue, 24 Feb 2009 21:31:42 +0100 (CET) Subject: [Python-checkins] r69945 - sandbox/trunk/mmap/Modules/mmapmodule.c Message-ID: <20090224203142.A8E4B1E4002@bag.python.org> Author: hirokazu.yamamoto Date: Tue Feb 24 21:31:42 2009 New Revision: 69945 Log: mmap.write_byte didn't check buffer size. import mmap m = mmap.mmap(-1, 1) for i in xrange(10000): # enough? print i m.write_byte('1') # crash Modified: sandbox/trunk/mmap/Modules/mmapmodule.c Modified: sandbox/trunk/mmap/Modules/mmapmodule.c ============================================================================== --- sandbox/trunk/mmap/Modules/mmapmodule.c (original) +++ sandbox/trunk/mmap/Modules/mmapmodule.c Tue Feb 24 21:31:42 2009 @@ -365,6 +365,11 @@ if (!is_writeable(self)) return NULL; + + if (self->pos >= self->size) { + PyErr_SetString(PyExc_ValueError, "data out of range"); + return NULL; + } *(self->data+self->pos) = value; self->pos += 1; Py_INCREF(Py_None); From nnorwitz at gmail.com Tue Feb 24 22:08:53 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 24 Feb 2009 16:08:53 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090224210853.GA1990@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 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 [13025 refs] [13025 refs] [22579 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14680 refs] [14680 refs] test_plistlib test_poll test_popen [13030 refs] [13030 refs] [13030 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 [18075 refs] test_pyexpat test_queue test_quopri [15550 refs] [15550 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 [13025 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [14925 refs] [13240 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] . [13025 refs] [13025 refs] this bit of output is from a test of stdout in a different process ... [13025 refs] [13025 refs] [13240 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [13025 refs] [13025 refs] [13254 refs] [13048 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [13028 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16521 refs] [17184 refs] [17000 refs] [17000 refs] [17000 refs] [17000 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [664502 refs] From nnorwitz at gmail.com Tue Feb 24 22:16:28 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 24 Feb 2009 16:16:28 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090224211628.GA4382@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 [17205 refs] [17205 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 [13025 refs] [13025 refs] [22579 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14680 refs] [14680 refs] test_plistlib test_poll test_popen [13030 refs] [13030 refs] [13030 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 [18075 refs] test_pyexpat test_queue test_quopri [15550 refs] [15550 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 [13025 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [14925 refs] [13240 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] . [13025 refs] [13025 refs] this bit of output is from a test of stdout in a different process ... [13025 refs] [13025 refs] [13240 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [13025 refs] [13025 refs] [13254 refs] [13048 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [13028 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16521 refs] [18025 refs] [17000 refs] [17000 refs] [17000 refs] [17000 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663772 refs] From python-checkins at python.org Tue Feb 24 23:01:03 2009 From: python-checkins at python.org (brett.cannon) Date: Tue, 24 Feb 2009 23:01:03 +0100 (CET) Subject: [Python-checkins] r69946 - python/trunk/Lib/test/test_site.py Message-ID: <20090224220103.4B0E01E4002@bag.python.org> Author: brett.cannon Date: Tue Feb 24 23:01:02 2009 New Revision: 69946 Log: Expand upon test_site.test_s_option to try to debug its failure. Modified: python/trunk/Lib/test/test_site.py Modified: python/trunk/Lib/test/test_site.py ============================================================================== --- python/trunk/Lib/test/test_site.py (original) +++ python/trunk/Lib/test/test_site.py Tue Feb 24 23:01:02 2009 @@ -102,7 +102,8 @@ rc = subprocess.call([sys.executable, '-c', 'import sys; sys.exit(%r in sys.path)' % usersite]) - self.assertEqual(rc, 1) + self.assertEqual(rc, 1, "%r is not in sys.path (sys.exit returned %r)" + % (usersite, rc)) rc = subprocess.call([sys.executable, '-s', '-c', 'import sys; sys.exit(%r in sys.path)' % usersite]) From buildbot at python.org Tue Feb 24 23:31:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 24 Feb 2009 22:31:53 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090224223154.350751E4002@bag.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/1903 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_site.py", line 106, in test_s_option % (usersite, rc)) AssertionError: '/home/buildbot/.local/lib/python2.7/site-packages' is not in sys.path (sys.exit returned 0) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue Feb 24 23:48:34 2009 From: python-checkins at python.org (jeffrey.yasskin) Date: Tue, 24 Feb 2009 23:48:34 +0100 (CET) Subject: [Python-checkins] r69947 - in python/trunk/Tools/scripts: README analyze_dxp.py Message-ID: <20090224224834.887D81E4002@bag.python.org> Author: jeffrey.yasskin Date: Tue Feb 24 23:48:34 2009 New Revision: 69947 Log: Tools/scripts/analyze_dxp.py, a module with some helper functions to analyze the output of sys.getdxp(). Added: python/trunk/Tools/scripts/analyze_dxp.py Modified: python/trunk/Tools/scripts/README Modified: python/trunk/Tools/scripts/README ============================================================================== --- python/trunk/Tools/scripts/README (original) +++ python/trunk/Tools/scripts/README Tue Feb 24 23:48:34 2009 @@ -4,6 +4,7 @@ See also the Demo/scripts directory! +analyze_dxp.py Analyzes the result of sys.getdxp() byext.py Print lines/words/chars stats of files by extension byteyears.py Print product of a file's size and age checkappend.py Search for multi-argument .append() calls Added: python/trunk/Tools/scripts/analyze_dxp.py ============================================================================== --- (empty file) +++ python/trunk/Tools/scripts/analyze_dxp.py Tue Feb 24 23:48:34 2009 @@ -0,0 +1,129 @@ +""" +Some helper functions to analyze the output of sys.getdxp() (which is +only available if Python was built with -DDYNAMIC_EXECUTION_PROFILE). +These will tell you which opcodes have been executed most frequently +in the current process, and, if Python was also built with -DDXPAIRS, +will tell you which instruction _pairs_ were executed most frequently, +which may help in choosing new instructions. + +If Python was built without -DDYNAMIC_EXECUTION_PROFILE, importing +this module will raise a RuntimeError. + +If you're running a script you want to profile, a simple way to get +the common pairs is: + +$ PYTHONPATH=$PYTHONPATH:/Tools/scripts \ +./python -i -O the_script.py --args +... +> from analyze_dxp import * +> s = render_common_pairs() +> open('/tmp/some_file', 'w').write(s) +""" + +import copy +import opcode +import operator +import sys +import threading + +if not hasattr(sys, "getdxp"): + raise RuntimeError("Can't import analyze_dxp: Python built without" + " -DDYNAMIC_EXECUTION_PROFILE.") + + +_profile_lock = threading.RLock() +_cumulative_profile = sys.getdxp() + +# If Python was built with -DDXPAIRS, sys.getdxp() returns a list of +# lists of ints. Otherwise it returns just a list of ints. +def has_pairs(profile): + """Returns True if the Python that produced the argument profile + was built with -DDXPAIRS.""" + + return len(profile) > 0 and isinstance(profile[0], list) + + +def reset_profile(): + """Forgets any execution profile that has been gathered so far.""" + with _profile_lock: + sys.getdxp() # Resets the internal profile + global _cumulative_profile + _cumulative_profile = sys.getdxp() # 0s out our copy. + + +def merge_profile(): + """Reads sys.getdxp() and merges it into this module's cached copy. + + We need this because sys.getdxp() 0s itself every time it's called.""" + + with _profile_lock: + new_profile = sys.getdxp() + if has_pairs(new_profile): + for first_inst in range(len(_cumulative_profile)): + for second_inst in range(len(_cumulative_profile[first_inst])): + _cumulative_profile[first_inst][second_inst] += ( + new_profile[first_inst][second_inst]) + else: + for inst in range(len(_cumulative_profile)): + _cumulative_profile[inst] += new_profile[inst] + + +def snapshot_profile(): + """Returns the cumulative execution profile until this call.""" + with _profile_lock: + merge_profile() + return copy.deepcopy(_cumulative_profile) + + +def common_instructions(profile): + """Returns the most common opcodes in order of descending frequency. + + The result is a list of tuples of the form + (opcode, opname, # of occurrences) + + """ + if has_pairs(profile) and profile: + inst_list = profile[-1] + else: + inst_list = profile + result = [(op, opcode.opname[op], count) + for op, count in enumerate(inst_list) + if count > 0] + result.sort(key=operator.itemgetter(2), reverse=True) + return result + + +def common_pairs(profile): + """Returns the most common opcode pairs in order of descending frequency. + + The result is a list of tuples of the form + ((1st opcode, 2nd opcode), + (1st opname, 2nd opname), + # of occurrences of the pair) + + """ + if not has_pairs(profile): + return [] + result = [((op1, op2), (opcode.opname[op1], opcode.opname[op2]), count) + # Drop the row of single-op profiles with [:-1] + for op1, op1profile in enumerate(profile[:-1]) + for op2, count in enumerate(op1profile) + if count > 0] + result.sort(key=operator.itemgetter(2), reverse=True) + return result + + +def render_common_pairs(profile=None): + """Renders the most common opcode pairs to a string in order of + descending frequency. + + The result is a series of lines of the form: + # of occurrences: ('1st opname', '2nd opname') + + """ + if profile is None: + profile = snapshot_profile() + def seq(): + for _, ops, count in common_pairs(profile): + yield "%s: %s\n" % (count, ops) + return ''.join(seq()) From nnorwitz at gmail.com Tue Feb 24 23:49:24 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 24 Feb 2009 17:49:24 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090224224924.GA9621@python.psfb.org> 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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-2583 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 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 [13025 refs] [13025 refs] [22579 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14680 refs] [14680 refs] test_plistlib test_poll test_popen [13030 refs] [13030 refs] [13030 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 [18075 refs] test_pyexpat test_queue test_quopri [15550 refs] [15550 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 [13025 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 test_slice test_smtplib test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [14925 refs] [13240 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] . [13025 refs] [13025 refs] this bit of output is from a test of stdout in a different process ... [13025 refs] [13025 refs] [13240 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [13025 refs] [13025 refs] [13254 refs] [13048 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [13028 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16521 refs] [18025 refs] [17000 refs] [17000 refs] [17000 refs] [17000 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 runtktests 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 test_xmlrpc test_xpickle 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 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [678200 refs] From python at rcn.com Wed Feb 25 00:10:15 2009 From: python at rcn.com (Raymond Hettinger) Date: Tue, 24 Feb 2009 15:10:15 -0800 Subject: [Python-checkins] r69946 - python/trunk/Lib/test/test_site.py References: <20090224220103.4B0E01E4002@bag.python.org> Message-ID: <5A64A22C0EE240D4953BE50F4EF6451F@RaymondLaptop1> I wonder if the failures are due to the subprocess changes made around Feb 14th. Are some of the machines running out of file descriptors? ----- Original Message ----- From: "brett.cannon" To: Sent: Tuesday, February 24, 2009 2:01 PM Subject: [Python-checkins] r69946 - python/trunk/Lib/test/test_site.py > Author: brett.cannon > Date: Tue Feb 24 23:01:02 2009 > New Revision: 69946 > > Log: > Expand upon test_site.test_s_option to try to debug its failure. > > > Modified: > python/trunk/Lib/test/test_site.py > > Modified: python/trunk/Lib/test/test_site.py > ============================================================================== > --- python/trunk/Lib/test/test_site.py (original) > +++ python/trunk/Lib/test/test_site.py Tue Feb 24 23:01:02 2009 > @@ -102,7 +102,8 @@ > > rc = subprocess.call([sys.executable, '-c', > 'import sys; sys.exit(%r in sys.path)' % usersite]) > - self.assertEqual(rc, 1) > + self.assertEqual(rc, 1, "%r is not in sys.path (sys.exit returned %r)" > + % (usersite, rc)) > > rc = subprocess.call([sys.executable, '-s', '-c', > 'import sys; sys.exit(%r in sys.path)' % usersite]) > _______________________________________________ > Python-checkins mailing list > Python-checkins at python.org > http://mail.python.org/mailman/listinfo/python-checkins From buildbot at python.org Wed Feb 25 00:14:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 24 Feb 2009 23:14:28 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090224231428.3C2E61E4002@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/913 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 BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_site.py", line 106, in test_s_option % (usersite, rc)) AssertionError: '/home/pybot/.local/lib/python2.7/site-packages' is not in sys.path (sys.exit returned 0) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed Feb 25 00:30:43 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 25 Feb 2009 00:30:43 +0100 (CET) Subject: [Python-checkins] r69948 - in python/branches/py3k: Doc/library/functions.rst Lib/pydoc.py Message-ID: <20090224233043.B25B61E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 25 00:30:43 2009 New Revision: 69948 Log: Refine docs for super() noting that sibling classes can be called, not just parents. Add a comparison to getattr() which has the same search order but also includes the type itself. Modified: python/branches/py3k/Doc/library/functions.rst python/branches/py3k/Lib/pydoc.py Modified: python/branches/py3k/Doc/library/functions.rst ============================================================================== --- python/branches/py3k/Doc/library/functions.rst (original) +++ python/branches/py3k/Doc/library/functions.rst Wed Feb 25 00:30:43 2009 @@ -1045,11 +1045,14 @@ .. function:: super([type[, object-or-type]]) - Return a proxy object that delegates method calls to a parent class of - *type*. This is useful for accessing inherited methods that have been - overriden in a child class. The search order for parent classes is - determined by the ``__mro__`` attribute of the *type* and can change - whenever the parent classes are updated. + Return a proxy object that delegates method calls to a parent or sibling + class of *type*. This is useful for accessing inherited methods that have + been overridden in a class. The search order is same as that used by + :func:`getattr` except that the *type* itself is skipped. + + The ``__mro__`` attribute of the *type* lists the method resolution search + order used by both func:`getattr` and :func:`super`. The attribue is dynamic + and can change whenever the inheritance hierarchy is updated. If the second argument is omitted the super object returned is unbound. If the second argument is an object, ``isinstance(obj, type)`` must be true. If @@ -1061,14 +1064,15 @@ naming them explicitly, thus making the code more maintainable. This use closely parallels the use of "super" in other programming languages. - The second use case is to support cooperative multiple inheritence in a + The second use case is to support cooperative multiple inheritance in a dynamic execution environment. This use case is unique to Python and is not found in statically compiled languages or languages that only support single inheritance. This makes in possible to implement "diamond diagrams" where multiple base classes implement the same method. Good design dictates that this method have the same calling signature in every case (because the - order of parent calls is determined at runtime and because that order adapts - to changes in the class hierarchy). + order of calls is determined at runtime, because that order adapts + to changes in the class hierarchy, and because that order can include + sibling classes that are unknown prior to runtime). For both use cases, a typical superclass call looks like this:: @@ -1079,7 +1083,7 @@ Note that :func:`super` is implemented as part of the binding process for explicit dotted attribute lookups such as ``super().__getitem__(name)``. It does so by implementing its own :meth:`__getattribute__` method for searching - parent classes in a predictable order that supports cooperative multiple inheritance. + classes in a predictable order that supports cooperative multiple inheritance. Accordingly, :func:`super` is undefined for implicit lookups using statements or operators such as ``super()[name]``. Modified: python/branches/py3k/Lib/pydoc.py ============================================================================== --- python/branches/py3k/Lib/pydoc.py (original) +++ python/branches/py3k/Lib/pydoc.py Wed Feb 25 00:30:43 2009 @@ -390,7 +390,7 @@ # needed to make any special characters, so show a raw string. return 'r' + testrepr[0] + self.escape(test) + testrepr[0] return re.sub(r'((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)', - r'\1', + r'\1', self.escape(testrepr)) repr_str = repr_string @@ -417,7 +417,7 @@ return ''' Python: %s - + %s ''' % (title, contents) @@ -456,7 +456,7 @@ def bigsection(self, title, *args): """Format a section with a big heading.""" - title = '%s' % title + title = '%s' % title return self.section(title, *args) def preformat(self, text): @@ -477,7 +477,7 @@ result = result + '' return '%s
' % result - def grey(self, text): return '%s' % text + def grey(self, text): return '%s' % text def namelink(self, name, *dicts): """Make a link for an identifier, given name-to-URL mappings.""" @@ -508,7 +508,7 @@ else: url = '%s.html' % name if ispackage: - text = '%s (package)' % name + text = '%s (package)' % name else: text = name return '%s' % (url, text) @@ -542,7 +542,7 @@ elif text[end:end+1] == '(': results.append(self.namelink(name, methods, funcs, classes)) elif selfdot: - results.append('self.%s' % name) + results.append('self.%s' % name) else: results.append(self.namelink(name, classes)) here = end @@ -557,14 +557,14 @@ for entry in tree: if type(entry) is type(()): c, bases = entry - result = result + '
' + result = result + '
' + result = result + '\n' elif type(entry) is type([]): result = result + '
\n%s
\n' % self.formattree( entry, modname, c) @@ -581,10 +581,10 @@ links = [] for i in range(len(parts)-1): links.append( - '%s' % + '%s' % ('.'.join(parts[:i+1]), parts[i])) linkedname = '.'.join(links + parts[-1:]) - head = '%s' % linkedname + head = '%s' % linkedname try: path = inspect.getabsfile(object) url = path From python-checkins at python.org Wed Feb 25 00:41:47 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 25 Feb 2009 00:41:47 +0100 (CET) Subject: [Python-checkins] r69949 - python/branches/py3k/Lib/pydoc.py Message-ID: <20090224234147.E39291E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 25 00:41:47 2009 New Revision: 69949 Log: Revert unintended part of r69948. Pydoc was not supposed to change. Modified: python/branches/py3k/Lib/pydoc.py Modified: python/branches/py3k/Lib/pydoc.py ============================================================================== --- python/branches/py3k/Lib/pydoc.py (original) +++ python/branches/py3k/Lib/pydoc.py Wed Feb 25 00:41:47 2009 @@ -390,7 +390,7 @@ # needed to make any special characters, so show a raw string. return 'r' + testrepr[0] + self.escape(test) + testrepr[0] return re.sub(r'((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)', - r'\1', + r'\1', self.escape(testrepr)) repr_str = repr_string @@ -417,7 +417,7 @@ return ''' Python: %s - + %s ''' % (title, contents) @@ -456,7 +456,7 @@ def bigsection(self, title, *args): """Format a section with a big heading.""" - title = '%s' % title + title = '%s' % title return self.section(title, *args) def preformat(self, text): @@ -477,7 +477,7 @@ result = result + '' return '%s
' % result - def grey(self, text): return '%s' % text + def grey(self, text): return '%s' % text def namelink(self, name, *dicts): """Make a link for an identifier, given name-to-URL mappings.""" @@ -508,7 +508,7 @@ else: url = '%s.html' % name if ispackage: - text = '%s (package)' % name + text = '%s (package)' % name else: text = name return '%s' % (url, text) @@ -542,7 +542,7 @@ elif text[end:end+1] == '(': results.append(self.namelink(name, methods, funcs, classes)) elif selfdot: - results.append('self.%s' % name) + results.append('self.%s' % name) else: results.append(self.namelink(name, classes)) here = end @@ -557,14 +557,14 @@ for entry in tree: if type(entry) is type(()): c, bases = entry - result = result + '
' result = result + self.classlink(c, modname) if bases and bases != (parent,): parents = [] for base in bases: parents.append(self.classlink(base, modname)) result = result + '(' + ', '.join(parents) + ')' - result = result + '\n
' + result = result + '\n' elif type(entry) is type([]): result = result + '
\n%s
\n' % self.formattree( entry, modname, c) @@ -581,10 +581,10 @@ links = [] for i in range(len(parts)-1): links.append( - '%s' % + '%s' % ('.'.join(parts[:i+1]), parts[i])) linkedname = '.'.join(links + parts[-1:]) - head = '%s' % linkedname + head = '%s' % linkedname try: path = inspect.getabsfile(object) url = path From buildbot at python.org Wed Feb 25 00:48:43 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 24 Feb 2009 23:48:43 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090224234843.6C9D51E4011@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/418 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: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pydoc ====================================================================== FAIL: test_html_doc (test.test_pydoc.PyDocDocTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_pydoc.py", line 240, in test_html_doc self.fail("outputs are not equal, see diff above") AssertionError: outputs are not equal, see diff above make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Feb 25 00:57:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 24 Feb 2009 23:57:45 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090224235745.BDD3D1E4002@bag.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/323 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_pydoc ====================================================================== FAIL: test_html_doc (test.test_pydoc.PyDocDocTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_pydoc.py", line 240, in test_html_doc self.fail("outputs are not equal, see diff above") AssertionError: outputs are not equal, see diff above make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Feb 25 01:14:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 25 Feb 2009 00:14:15 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian 2.6 Message-ID: <20090225001416.165101E4002@bag.python.org> The Buildbot has detected a new failure of alpha Debian 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%20Debian%202.6/builds/59 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-alpha Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: matthias.klose,raymond.hettinger BUILD FAILED: failed configure sincerely, -The Buildbot From benjamin at python.org Wed Feb 25 01:18:16 2009 From: benjamin at python.org (Benjamin Peterson) Date: Tue, 24 Feb 2009 18:18:16 -0600 Subject: [Python-checkins] r69946 - python/trunk/Lib/test/test_site.py In-Reply-To: <5A64A22C0EE240D4953BE50F4EF6451F@RaymondLaptop1> References: <20090224220103.4B0E01E4002@bag.python.org> <5A64A22C0EE240D4953BE50F4EF6451F@RaymondLaptop1> Message-ID: <1afaf6160902241618w359a3666y5ddcc8584d175bdd@mail.gmail.com> On Tue, Feb 24, 2009 at 5:10 PM, Raymond Hettinger wrote: > I wonder if the failures are due to the subprocess changes made around Feb > 14th. > Are some of the machines running out of file descriptors? Apparently, the problem is test_distutils. http://bugs.python.org/issue5316 -- Regards, Benjamin From python-checkins at python.org Wed Feb 25 01:23:16 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 25 Feb 2009 01:23:16 +0100 (CET) Subject: [Python-checkins] r69950 - peps/trunk/pep-0375.txt Message-ID: <20090225002316.5C05E1E4002@bag.python.org> Author: benjamin.peterson Date: Wed Feb 25 01:23:16 2009 New Revision: 69950 Log: forgot about the ip address library Modified: peps/trunk/pep-0375.txt Modified: peps/trunk/pep-0375.txt ============================================================================== --- peps/trunk/pep-0375.txt (original) +++ peps/trunk/pep-0375.txt Wed Feb 25 01:23:16 2009 @@ -50,6 +50,7 @@ - importlib - io in C - A reworked email package +- Adding an IP Address library to the stdlib. References From python-checkins at python.org Wed Feb 25 01:32:51 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 25 Feb 2009 01:32:51 +0100 (CET) Subject: [Python-checkins] r69951 - python/branches/py3k/Doc/library/functions.rst Message-ID: <20090225003251.9FAEB1E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 25 01:32:51 2009 New Revision: 69951 Log: Tweak markup, grammar, and punctuation. Modified: python/branches/py3k/Doc/library/functions.rst Modified: python/branches/py3k/Doc/library/functions.rst ============================================================================== --- python/branches/py3k/Doc/library/functions.rst (original) +++ python/branches/py3k/Doc/library/functions.rst Wed Feb 25 01:32:51 2009 @@ -1051,10 +1051,10 @@ :func:`getattr` except that the *type* itself is skipped. The ``__mro__`` attribute of the *type* lists the method resolution search - order used by both func:`getattr` and :func:`super`. The attribue is dynamic - and can change whenever the inheritance hierarchy is updated. + order used by both :func:`getattr` and :func:`super`. The attribue is + dynamic and can change whenever the inheritance hierarchy is updated. - If the second argument is omitted the super object returned is unbound. If + If the second argument is omitted, the super object returned is unbound. If the second argument is an object, ``isinstance(obj, type)`` must be true. If the second argument is a type, ``issubclass(type2, type)`` must be true (this is useful for classmethods). @@ -1087,8 +1087,8 @@ Accordingly, :func:`super` is undefined for implicit lookups using statements or operators such as ``super()[name]``. - Also note that :func:`super` is not limited to use inside methods. The - two argument specifies the arguments exactly and makes the appropriate + Also note that :func:`super` is not limited to use inside methods. The two + argument form specifies the arguments exactly and makes the appropriate references. The zero argument form automatically searches the stack frame for the class (``__class__``) and the first argument. From python-checkins at python.org Wed Feb 25 01:37:57 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 25 Feb 2009 01:37:57 +0100 (CET) Subject: [Python-checkins] r69952 - python/trunk/Doc/library/functions.rst Message-ID: <20090225003757.DC7FE1E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 25 01:37:57 2009 New Revision: 69952 Log: Sync-up py3.1 doc updates for super(). 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 Wed Feb 25 01:37:57 2009 @@ -1193,16 +1193,19 @@ .. function:: super(type[, object-or-type]) - Return a proxy object that delegates method calls to a parent class of - *type*. This is useful for accessing inherited methods that have been - overriden in a child class. The search order for parent classes is - determined by the ``__mro__`` attribute of the *type* and can change - whenever the parent classes are updated. - - If the second argument is omitted the super - object returned is unbound. If the second argument is an object, - ``isinstance(obj, type)`` must be true. If the second argument is a type, - ``issubclass(type2, type)`` must be true (this is useful for classmethods). + Return a proxy object that delegates method calls to a parent or sibling + class of *type*. This is useful for accessing inherited methods that have + been overridden in a class. The search order is same as that used by + :func:`getattr` except that the *type* itself is skipped. + + The ``__mro__`` attribute of the *type* lists the method resolution search + order used by both :func:`getattr` and :func:`super`. The attribue is + dynamic and can change whenever the inheritance hierarchy is updated. + + If the second argument is omitted, the super object returned is unbound. If + the second argument is an object, ``isinstance(obj, type)`` must be true. If + the second argument is a type, ``issubclass(type2, type)`` must be true (this + is useful for classmethods). .. note:: :func:`super` only works for :term:`new-style class`\es. @@ -1212,27 +1215,33 @@ naming them explicitly, thus making the code more maintainable. This use closely parallels the use of "super" in other programming languages. - The second use case is to support cooperative multiple inheritence in a + The second use case is to support cooperative multiple inheritance in a dynamic execution environment. This use case is unique to Python and is not found in statically compiled languages or languages that only support single inheritance. This makes in possible to implement "diamond diagrams" where multiple base classes implement the same method. Good design dictates that this method have the same calling signature in every case (because the - order of parent calls is determined at runtime and because that order adapts - to changes in the class hierarchy). + order of calls is determined at runtime, because that order adapts + to changes in the class hierarchy, and because that order can include + sibling classes that are unknown prior to runtime). For both use cases, a typical superclass call looks like this:: class C(B): - def meth(self, arg): - super(C, self).meth(arg) + def method(self, 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(C, self).__getitem__(name)``. + explicit dotted attribute lookups such as ``super().__getitem__(name)``. It does so by implementing its own :meth:`__getattribute__` method for searching - parent classes in a predictable order that supports cooperative multiple inheritance. + classes in a predictable order that supports cooperative multiple inheritance. Accordingly, :func:`super` is undefined for implicit lookups using statements or - operators such as ``super(C, self)[name]``. + operators such as ``super()[name]``. + + Also note that :func:`super` is not limited to use inside methods. The two + argument form specifies the arguments exactly and makes the appropriate + references. The zero argument form automatically searches the stack frame + for the class (``__class__``) and the first argument. .. versionadded:: 2.2 From python-checkins at python.org Wed Feb 25 01:39:47 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 25 Feb 2009 01:39:47 +0100 (CET) Subject: [Python-checkins] r69953 - in python/trunk/Doc/library: collections.rst functions.rst Message-ID: <20090225003947.4721F1E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 25 01:39:47 2009 New Revision: 69953 Log: Restore Py2.x version of sample call to super(). Modified: python/trunk/Doc/library/collections.rst python/trunk/Doc/library/functions.rst Modified: python/trunk/Doc/library/collections.rst ============================================================================== --- python/trunk/Doc/library/collections.rst (original) +++ python/trunk/Doc/library/collections.rst Wed Feb 25 01:39:47 2009 @@ -252,11 +252,12 @@ c += Counter() # remove zero and negative counts Several multiset mathematical operations are provided for combining -:class:`Counter` objects. Multisets are like regular sets but are allowed to -contain repeated elements (with counts of one or more). Addition and -subtraction combine counters by adding or subtracting the counts of -corresponding elements. Intersection and union return the minimum and maximum -of corresponding counts. Each operation can accept inputs with signed counts, +:class:`Counter` objects. Multisets are counters with the restriction +that all counts are at least one. They are like regular sets but are +allowed to contain repeated elements. Addition and subtraction combine +counters by adding or subtracting the counts of corresponding elements. +Intersection and union return the minimum and maximum of corresponding +counts. Each operation can accept inputs with signed counts, but the output excludes results with counts less than one. >>> c = Counter(a=3, b=1) Modified: python/trunk/Doc/library/functions.rst ============================================================================== --- python/trunk/Doc/library/functions.rst (original) +++ python/trunk/Doc/library/functions.rst Wed Feb 25 01:39:47 2009 @@ -1229,7 +1229,7 @@ class C(B): def method(self, arg): - super().method(arg) # This does the same thing as: super(C, self).method(arg) + 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)``. From python-checkins at python.org Wed Feb 25 01:41:33 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 25 Feb 2009 01:41:33 +0100 (CET) Subject: [Python-checkins] r69954 - python/branches/release26-maint/Doc/library/functions.rst Message-ID: <20090225004133.0C2F91E4025@bag.python.org> Author: raymond.hettinger Date: Wed Feb 25 01:41:32 2009 New Revision: 69954 Log: Backport doc updates for super(). Modified: python/branches/release26-maint/Doc/library/functions.rst 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 Wed Feb 25 01:41:32 2009 @@ -1193,12 +1193,19 @@ .. function:: super(type[, object-or-type]) - Return a "super" object that acts like the superclass of *type*. - - If the second argument is omitted the super - object returned is unbound. If the second argument is an object, - ``isinstance(obj, type)`` must be true. If the second argument is a type, - ``issubclass(type2, type)`` must be true. + Return a proxy object that delegates method calls to a parent or sibling + class of *type*. This is useful for accessing inherited methods that have + been overridden in a class. The search order is same as that used by + :func:`getattr` except that the *type* itself is skipped. + + The ``__mro__`` attribute of the *type* lists the method resolution search + order used by both :func:`getattr` and :func:`super`. The attribue is + dynamic and can change whenever the inheritance hierarchy is updated. + + If the second argument is omitted, the super object returned is unbound. If + the second argument is an object, ``isinstance(obj, type)`` must be true. If + the second argument is a type, ``issubclass(type2, type)`` must be true (this + is useful for classmethods). .. note:: :func:`super` only works for :term:`new-style class`\es. @@ -1208,27 +1215,33 @@ naming them explicitly, thus making the code more maintainable. This use closely parallels the use of "super" in other programming languages. - The second use case is to support cooperative multiple inheritence in a + The second use case is to support cooperative multiple inheritance in a dynamic execution environment. This use case is unique to Python and is not found in statically compiled languages or languages that only support single inheritance. This makes in possible to implement "diamond diagrams" where multiple base classes implement the same method. Good design dictates that this method have the same calling signature in every case (because the - order of parent calls is determined at runtime and because that order adapts - to changes in the class hierarchy). + order of calls is determined at runtime, because that order adapts + to changes in the class hierarchy, and because that order can include + sibling classes that are unknown prior to runtime). For both use cases, a typical superclass call looks like this:: class C(B): - def meth(self, arg): - super(C, self).meth(arg) + def method(self, arg): + 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(C, self).__getitem__(name)``. + explicit dotted attribute lookups such as ``super().__getitem__(name)``. It does so by implementing its own :meth:`__getattribute__` method for searching - parent classes in a predictable order that supports cooperative multiple inheritance. + classes in a predictable order that supports cooperative multiple inheritance. Accordingly, :func:`super` is undefined for implicit lookups using statements or - operators such as ``super(C, self)[name]``. + operators such as ``super()[name]``. + + Also note that :func:`super` is not limited to use inside methods. The two + argument form specifies the arguments exactly and makes the appropriate + references. The zero argument form automatically searches the stack frame + for the class (``__class__``) and the first argument. .. versionadded:: 2.2 From python-checkins at python.org Wed Feb 25 01:52:37 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 25 Feb 2009 01:52:37 +0100 (CET) Subject: [Python-checkins] r69955 - python/trunk/Doc/library/functions.rst Message-ID: <20090225005237.DD8861E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 25 01:52:37 2009 New Revision: 69955 Log: More markup and spelling fixes. 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 Wed Feb 25 01:52:37 2009 @@ -1198,9 +1198,9 @@ been overridden in a class. The search order is same as that used by :func:`getattr` except that the *type* itself is skipped. - The ``__mro__`` attribute of the *type* lists the method resolution search - order used by both :func:`getattr` and :func:`super`. The attribue is - dynamic and can change whenever the inheritance hierarchy is updated. + The :attr:`__mro__` attribute of the *type* lists the method resolution + search order used by both :func:`getattr` and :func:`super`. The attribute + is dynamic and can change whenever the inheritance hierarchy is updated. If the second argument is omitted, the super object returned is unbound. If the second argument is an object, ``isinstance(obj, type)`` must be true. If @@ -1210,10 +1210,10 @@ .. note:: :func:`super` only works for :term:`new-style class`\es. - There are two typical use cases for "super". In a class hierarchy with - single inheritance, "super" can be used to refer to parent classes without + There are two typical use cases for *super*. In a class hierarchy with + single inheritance, *super* can be used to refer to parent classes without naming them explicitly, thus making the code more maintainable. This use - closely parallels the use of "super" in other programming languages. + closely parallels the use of *super* in other programming languages. The second use case is to support cooperative multiple inheritance in a dynamic execution environment. This use case is unique to Python and is From python-checkins at python.org Wed Feb 25 01:53:46 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 25 Feb 2009 01:53:46 +0100 (CET) Subject: [Python-checkins] r69956 - python/branches/release26-maint/Doc/library/functions.rst Message-ID: <20090225005346.DE67D1E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 25 01:53:46 2009 New Revision: 69956 Log: More markup and spelling fixes. Modified: python/branches/release26-maint/Doc/library/functions.rst 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 Wed Feb 25 01:53:46 2009 @@ -1198,9 +1198,9 @@ been overridden in a class. The search order is same as that used by :func:`getattr` except that the *type* itself is skipped. - The ``__mro__`` attribute of the *type* lists the method resolution search - order used by both :func:`getattr` and :func:`super`. The attribue is - dynamic and can change whenever the inheritance hierarchy is updated. + The :attr:`__mro__` attribute of the *type* lists the method resolution + search order used by both :func:`getattr` and :func:`super`. The attribute + is dynamic and can change whenever the inheritance hierarchy is updated. If the second argument is omitted, the super object returned is unbound. If the second argument is an object, ``isinstance(obj, type)`` must be true. If @@ -1210,10 +1210,10 @@ .. note:: :func:`super` only works for :term:`new-style class`\es. - There are two typical use cases for "super". In a class hierarchy with - single inheritance, "super" can be used to refer to parent classes without + There are two typical use cases for *super*. In a class hierarchy with + single inheritance, *super* can be used to refer to parent classes without naming them explicitly, thus making the code more maintainable. This use - closely parallels the use of "super" in other programming languages. + closely parallels the use of *super* in other programming languages. The second use case is to support cooperative multiple inheritance in a dynamic execution environment. This use case is unique to Python and is From python-checkins at python.org Wed Feb 25 01:58:47 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 25 Feb 2009 01:58:47 +0100 (CET) Subject: [Python-checkins] r69957 - python/branches/py3k/Doc/library/functions.rst Message-ID: <20090225005847.484C81E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 25 01:58:47 2009 New Revision: 69957 Log: More markup and spelling fixes. Modified: python/branches/py3k/Doc/library/functions.rst Modified: python/branches/py3k/Doc/library/functions.rst ============================================================================== --- python/branches/py3k/Doc/library/functions.rst (original) +++ python/branches/py3k/Doc/library/functions.rst Wed Feb 25 01:58:47 2009 @@ -1050,19 +1050,19 @@ been overridden in a class. The search order is same as that used by :func:`getattr` except that the *type* itself is skipped. - The ``__mro__`` attribute of the *type* lists the method resolution search - order used by both :func:`getattr` and :func:`super`. The attribue is - dynamic and can change whenever the inheritance hierarchy is updated. + The :attr:`__mro__` attribute of the *type* lists the method resolution + search order used by both :func:`getattr` and :func:`super`. The attribute + is dynamic and can change whenever the inheritance hierarchy is updated. If the second argument is omitted, the super object returned is unbound. If the second argument is an object, ``isinstance(obj, type)`` must be true. If the second argument is a type, ``issubclass(type2, type)`` must be true (this is useful for classmethods). - There are two typical use cases for "super". In a class hierarchy with - single inheritance, "super" can be used to refer to parent classes without + There are two typical use cases for *super*. In a class hierarchy with + single inheritance, *super* can be used to refer to parent classes without naming them explicitly, thus making the code more maintainable. This use - closely parallels the use of "super" in other programming languages. + closely parallels the use of *super* in other programming languages. The second use case is to support cooperative multiple inheritance in a dynamic execution environment. This use case is unique to Python and is From python-checkins at python.org Wed Feb 25 02:01:05 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 25 Feb 2009 02:01:05 +0100 (CET) Subject: [Python-checkins] r69958 - python/branches/release30-maint/Doc/library/functions.rst Message-ID: <20090225010105.6B09E1E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 25 02:01:05 2009 New Revision: 69958 Log: Backport 3.1 changes to super() docs. Modified: python/branches/release30-maint/Doc/library/functions.rst Modified: python/branches/release30-maint/Doc/library/functions.rst ============================================================================== --- python/branches/release30-maint/Doc/library/functions.rst (original) +++ python/branches/release30-maint/Doc/library/functions.rst Wed Feb 25 02:01:05 2009 @@ -1039,30 +1039,34 @@ .. function:: super([type[, object-or-type]]) - Return a proxy object that delegates method calls to a parent class of - *type*. This is useful for accessing inherited methods that have been - overriden in a child class. The search order for parent classes is - determined by the ``__mro__`` attribute of the *type* and can change - whenever the parent classes are updated. + Return a proxy object that delegates method calls to a parent or sibling + class of *type*. This is useful for accessing inherited methods that have + been overridden in a class. The search order is same as that used by + :func:`getattr` except that the *type* itself is skipped. + + The :attr:`__mro__` attribute of the *type* lists the method resolution + search order used by both :func:`getattr` and :func:`super`. The attribute + is dynamic and can change whenever the inheritance hierarchy is updated. - If the second argument is omitted the super object returned is unbound. If + If the second argument is omitted, the super object returned is unbound. If the second argument is an object, ``isinstance(obj, type)`` must be true. If the second argument is a type, ``issubclass(type2, type)`` must be true (this is useful for classmethods). - There are two typical use cases for "super". In a class hierarchy with - single inheritance, "super" can be used to refer to parent classes without + There are two typical use cases for *super*. In a class hierarchy with + single inheritance, *super* can be used to refer to parent classes without naming them explicitly, thus making the code more maintainable. This use - closely parallels the use of "super" in other programming languages. + closely parallels the use of *super* in other programming languages. - The second use case is to support cooperative multiple inheritence in a + The second use case is to support cooperative multiple inheritance in a dynamic execution environment. This use case is unique to Python and is not found in statically compiled languages or languages that only support single inheritance. This makes in possible to implement "diamond diagrams" where multiple base classes implement the same method. Good design dictates that this method have the same calling signature in every case (because the - order of parent calls is determined at runtime and because that order adapts - to changes in the class hierarchy). + order of calls is determined at runtime, because that order adapts + to changes in the class hierarchy, and because that order can include + sibling classes that are unknown prior to runtime). For both use cases, a typical superclass call looks like this:: @@ -1073,12 +1077,12 @@ Note that :func:`super` is implemented as part of the binding process for explicit dotted attribute lookups such as ``super().__getitem__(name)``. It does so by implementing its own :meth:`__getattribute__` method for searching - parent classes in a predictable order that supports cooperative multiple inheritance. + classes in a predictable order that supports cooperative multiple inheritance. Accordingly, :func:`super` is undefined for implicit lookups using statements or operators such as ``super()[name]``. - Also note that :func:`super` is not limited to use inside methods. The - two argument specifies the arguments exactly and makes the appropriate + Also note that :func:`super` is not limited to use inside methods. The two + argument form specifies the arguments exactly and makes the appropriate references. The zero argument form automatically searches the stack frame for the class (``__class__``) and the first argument. From python-checkins at python.org Wed Feb 25 02:06:52 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 25 Feb 2009 02:06:52 +0100 (CET) Subject: [Python-checkins] r69959 - python/trunk/Doc/library/functions.rst Message-ID: <20090225010652.EB4DD1E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 25 02:06:52 2009 New Revision: 69959 Log: Remove reference to zero argument form of super() in 2.x docs. 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 Wed Feb 25 02:06:52 2009 @@ -1240,8 +1240,7 @@ Also note that :func:`super` is not limited to use inside methods. The two argument form specifies the arguments exactly and makes the appropriate - references. The zero argument form automatically searches the stack frame - for the class (``__class__``) and the first argument. + references. .. versionadded:: 2.2 From python-checkins at python.org Wed Feb 25 02:08:27 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 25 Feb 2009 02:08:27 +0100 (CET) Subject: [Python-checkins] r69960 - python/branches/release26-maint/Doc/library/functions.rst Message-ID: <20090225010827.C925F1E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 25 02:08:27 2009 New Revision: 69960 Log: Remove reference to zero argument form of super() in 2.x docs. Modified: python/branches/release26-maint/Doc/library/functions.rst 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 Wed Feb 25 02:08:27 2009 @@ -1240,8 +1240,7 @@ Also note that :func:`super` is not limited to use inside methods. The two argument form specifies the arguments exactly and makes the appropriate - references. The zero argument form automatically searches the stack frame - for the class (``__class__``) and the first argument. + references. .. versionadded:: 2.2 From python-checkins at python.org Wed Feb 25 03:25:05 2009 From: python-checkins at python.org (jeffrey.yasskin) Date: Wed, 25 Feb 2009 03:25:05 +0100 (CET) Subject: [Python-checkins] r69961 - in python/branches/py3k: Doc/library/dis.rst Include/opcode.h Lib/opcode.py Lib/test/test_peepholer.py Python/ceval.c Python/compile.c Python/import.c Python/opcode_targets.h Python/peephole.c Message-ID: <20090225022505.2B9D11E4002@bag.python.org> Author: jeffrey.yasskin Date: Wed Feb 25 03:25:04 2009 New Revision: 69961 Log: http://bugs.python.org/issue4715 This patch by Antoine Pitrou optimizes the bytecode for conditional branches by merging the following "POP_TOP" instruction into the conditional jump. For example, the list comprehension "[x for x in l if not x]" produced the following bytecode: 1 0 BUILD_LIST 0 3 LOAD_FAST 0 (.0) >> 6 FOR_ITER 23 (to 32) 9 STORE_FAST 1 (x) 12 LOAD_FAST 1 (x) 15 JUMP_IF_TRUE 10 (to 28) 18 POP_TOP 19 LOAD_FAST 1 (x) 22 LIST_APPEND 2 25 JUMP_ABSOLUTE 6 >> 28 POP_TOP 29 JUMP_ABSOLUTE 6 >> 32 RETURN_VALUE but after the patch it produces the following bytecode: 1 0 BUILD_LIST 0 3 LOAD_FAST 0 (.0) >> 6 FOR_ITER 18 (to 27) 9 STORE_FAST 1 (x) 12 LOAD_FAST 1 (x) 15 POP_JUMP_IF_TRUE 6 18 LOAD_FAST 1 (x) 21 LIST_APPEND 2 24 JUMP_ABSOLUTE 6 >> 27 RETURN_VALUE Notice that not only the code is shorter, but the conditional jump (POP_JUMP_IF_TRUE) jumps right to the start of the loop instead of going through the JUMP_ABSOLUTE at the end. "continue" statements are helped similarly. Furthermore, the old jump opcodes (JUMP_IF_FALSE, JUMP_IF_TRUE) have been replaced by two new opcodes: - JUMP_IF_TRUE_OR_POP, which jumps if true and pops otherwise - JUMP_IF_FALSE_OR_POP, which jumps if false and pops otherwise Modified: python/branches/py3k/Doc/library/dis.rst python/branches/py3k/Include/opcode.h python/branches/py3k/Lib/opcode.py python/branches/py3k/Lib/test/test_peepholer.py python/branches/py3k/Python/ceval.c python/branches/py3k/Python/compile.c python/branches/py3k/Python/import.c python/branches/py3k/Python/opcode_targets.h python/branches/py3k/Python/peephole.c Modified: python/branches/py3k/Doc/library/dis.rst ============================================================================== --- python/branches/py3k/Doc/library/dis.rst (original) +++ python/branches/py3k/Doc/library/dis.rst Wed Feb 25 03:25:04 2009 @@ -595,16 +595,26 @@ Increments bytecode counter by *delta*. -.. opcode:: JUMP_IF_TRUE (delta) +.. opcode:: POP_JUMP_IF_TRUE (target) - If TOS is true, increment the bytecode counter by *delta*. TOS is left on the - stack. + If TOS is true, sets the bytecode counter to *target*. TOS is popped. -.. opcode:: JUMP_IF_FALSE (delta) +.. opcode:: POP_JUMP_IF_FALSE (target) - If TOS is false, increment the bytecode counter by *delta*. TOS is not - changed. + If TOS is false, sets the bytecode counter to *target*. TOS is popped. + + +.. opcode:: JUMP_IF_TRUE_OR_POP (target) + + If TOS is true, sets the bytecode counter to *target* and leaves TOS + on the stack. Otherwise (TOS is false), TOS is popped. + + +.. opcode:: JUMP_IF_FALSE_OR_POP (target) + + If TOS is false, sets the bytecode counter to *target* and leaves + TOS on the stack. Otherwise (TOS is true), TOS is popped. .. opcode:: JUMP_ABSOLUTE (target) Modified: python/branches/py3k/Include/opcode.h ============================================================================== --- python/branches/py3k/Include/opcode.h (original) +++ python/branches/py3k/Include/opcode.h Wed Feb 25 03:25:04 2009 @@ -96,9 +96,11 @@ #define IMPORT_FROM 109 /* Index in name list */ #define JUMP_FORWARD 110 /* Number of bytes to skip */ -#define JUMP_IF_FALSE 111 /* "" */ -#define JUMP_IF_TRUE 112 /* "" */ -#define JUMP_ABSOLUTE 113 /* Target byte offset from beginning of code */ +#define JUMP_IF_FALSE_OR_POP 111 /* Target byte offset from beginning of code */ +#define JUMP_IF_TRUE_OR_POP 112 /* "" */ +#define JUMP_ABSOLUTE 113 /* "" */ +#define POP_JUMP_IF_FALSE 114 /* "" */ +#define POP_JUMP_IF_TRUE 115 /* "" */ #define LOAD_GLOBAL 116 /* Index in name list */ Modified: python/branches/py3k/Lib/opcode.py ============================================================================== --- python/branches/py3k/Lib/opcode.py (original) +++ python/branches/py3k/Lib/opcode.py Wed Feb 25 03:25:04 2009 @@ -131,9 +131,11 @@ name_op('IMPORT_FROM', 109) # Index in name list jrel_op('JUMP_FORWARD', 110) # Number of bytes to skip -jrel_op('JUMP_IF_FALSE', 111) # "" -jrel_op('JUMP_IF_TRUE', 112) # "" -jabs_op('JUMP_ABSOLUTE', 113) # Target byte offset from beginning of code +jabs_op('JUMP_IF_FALSE_OR_POP', 111) # Target byte offset from beginning of code +jabs_op('JUMP_IF_TRUE_OR_POP', 112) # "" +jabs_op('JUMP_ABSOLUTE', 113) # "" +jabs_op('POP_JUMP_IF_FALSE', 114) # "" +jabs_op('POP_JUMP_IF_TRUE', 115) # "" name_op('LOAD_GLOBAL', 116) # Index in name list Modified: python/branches/py3k/Lib/test/test_peepholer.py ============================================================================== --- python/branches/py3k/Lib/test/test_peepholer.py (original) +++ python/branches/py3k/Lib/test/test_peepholer.py Wed Feb 25 03:25:04 2009 @@ -19,14 +19,14 @@ class TestTranforms(unittest.TestCase): def test_unot(self): - # UNARY_NOT JUMP_IF_FALSE POP_TOP --> JUMP_IF_TRUE POP_TOP' + # UNARY_NOT POP_JUMP_IF_FALSE --> POP_JUMP_IF_TRUE' def unot(x): if not x == 2: del x asm = disassemble(unot) - for elem in ('UNARY_NOT', 'JUMP_IF_FALSE'): + for elem in ('UNARY_NOT', 'POP_JUMP_IF_FALSE'): self.assert_(elem not in asm) - for elem in ('JUMP_IF_TRUE', 'POP_TOP'): + for elem in ('POP_JUMP_IF_TRUE',): self.assert_(elem in asm) def test_elim_inversion_of_is_or_in(self): @@ -64,13 +64,13 @@ self.assert_('LOAD_GLOBAL' not in disassemble(f)) def test_while_one(self): - # Skip over: LOAD_CONST trueconst JUMP_IF_FALSE xx POP_TOP + # Skip over: LOAD_CONST trueconst POP_JUMP_IF_FALSE xx def f(): while 1: pass return list asm = disassemble(f) - for elem in ('LOAD_CONST', 'JUMP_IF_FALSE'): + for elem in ('LOAD_CONST', 'POP_JUMP_IF_FALSE'): self.assert_(elem not in asm) for elem in ('JUMP_ABSOLUTE',): self.assert_(elem in asm) Modified: python/branches/py3k/Python/ceval.c ============================================================================== --- python/branches/py3k/Python/ceval.c (original) +++ python/branches/py3k/Python/ceval.c Wed Feb 25 03:25:04 2009 @@ -1295,7 +1295,6 @@ SETLOCAL(oparg, v); FAST_DISPATCH(); - PREDICTED(POP_TOP); TARGET(POP_TOP) v = POP(); Py_DECREF(v); @@ -2204,8 +2203,8 @@ Py_DECREF(w); SET_TOP(x); if (x == NULL) break; - PREDICT(JUMP_IF_FALSE); - PREDICT(JUMP_IF_TRUE); + PREDICT(POP_JUMP_IF_FALSE); + PREDICT(POP_JUMP_IF_TRUE); DISPATCH(); TARGET(IMPORT_NAME) @@ -2282,41 +2281,45 @@ JUMPBY(oparg); FAST_DISPATCH(); - PREDICTED_WITH_ARG(JUMP_IF_FALSE); - TARGET(JUMP_IF_FALSE) - w = TOP(); + PREDICTED_WITH_ARG(POP_JUMP_IF_FALSE); + TARGET(POP_JUMP_IF_FALSE) + w = POP(); if (w == Py_True) { - PREDICT(POP_TOP); + Py_DECREF(w); FAST_DISPATCH(); } if (w == Py_False) { - JUMPBY(oparg); + Py_DECREF(w); + JUMPTO(oparg); FAST_DISPATCH(); } err = PyObject_IsTrue(w); + Py_DECREF(w); if (err > 0) err = 0; else if (err == 0) - JUMPBY(oparg); + JUMPTO(oparg); else break; DISPATCH(); - PREDICTED_WITH_ARG(JUMP_IF_TRUE); - TARGET(JUMP_IF_TRUE) - w = TOP(); + PREDICTED_WITH_ARG(POP_JUMP_IF_TRUE); + TARGET(POP_JUMP_IF_TRUE) + w = POP(); if (w == Py_False) { - PREDICT(POP_TOP); + Py_DECREF(w); FAST_DISPATCH(); } if (w == Py_True) { - JUMPBY(oparg); + Py_DECREF(w); + JUMPTO(oparg); FAST_DISPATCH(); } err = PyObject_IsTrue(w); + Py_DECREF(w); if (err > 0) { err = 0; - JUMPBY(oparg); + JUMPTO(oparg); } else if (err == 0) ; @@ -2324,6 +2327,53 @@ break; DISPATCH(); + TARGET(JUMP_IF_FALSE_OR_POP) + w = TOP(); + if (w == Py_True) { + STACKADJ(-1); + Py_DECREF(w); + FAST_DISPATCH(); + } + if (w == Py_False) { + JUMPTO(oparg); + FAST_DISPATCH(); + } + err = PyObject_IsTrue(w); + if (err > 0) { + STACKADJ(-1); + Py_DECREF(w); + err = 0; + } + else if (err == 0) + JUMPTO(oparg); + else + break; + DISPATCH(); + + TARGET(JUMP_IF_TRUE_OR_POP) + w = TOP(); + if (w == Py_False) { + STACKADJ(-1); + Py_DECREF(w); + FAST_DISPATCH(); + } + if (w == Py_True) { + JUMPTO(oparg); + FAST_DISPATCH(); + } + err = PyObject_IsTrue(w); + if (err > 0) { + err = 0; + JUMPTO(oparg); + } + else if (err == 0) { + STACKADJ(-1); + Py_DECREF(w); + } + else + break; + DISPATCH(); + PREDICTED_WITH_ARG(JUMP_ABSOLUTE); TARGET(JUMP_ABSOLUTE) JUMPTO(oparg); Modified: python/branches/py3k/Python/compile.c ============================================================================== --- python/branches/py3k/Python/compile.c (original) +++ python/branches/py3k/Python/compile.c Wed Feb 25 03:25:04 2009 @@ -818,11 +818,15 @@ return 1; case JUMP_FORWARD: - case JUMP_IF_FALSE: - case JUMP_IF_TRUE: + case JUMP_IF_TRUE_OR_POP: /* -1 if jump not taken */ + case JUMP_IF_FALSE_OR_POP: /* "" */ case JUMP_ABSOLUTE: return 0; + case POP_JUMP_IF_FALSE: + case POP_JUMP_IF_TRUE: + return -1; + case LOAD_GLOBAL: return 1; @@ -1664,12 +1668,10 @@ if (next == NULL) return 0; VISIT(c, expr, e->v.IfExp.test); - ADDOP_JREL(c, JUMP_IF_FALSE, next); - ADDOP(c, POP_TOP); + ADDOP_JABS(c, POP_JUMP_IF_FALSE, next); VISIT(c, expr, e->v.IfExp.body); ADDOP_JREL(c, JUMP_FORWARD, end); compiler_use_next_block(c, next); - ADDOP(c, POP_TOP); VISIT(c, expr, e->v.IfExp.orelse); compiler_use_next_block(c, end); return 1; @@ -1732,9 +1734,6 @@ end = compiler_new_block(c); if (end == NULL) return 0; - next = compiler_new_block(c); - if (next == NULL) - return 0; constant = expr_constant(s->v.If.test); /* constant = 0: "if 0" @@ -1746,15 +1745,21 @@ } else if (constant == 1) { VISIT_SEQ(c, stmt, s->v.If.body); } else { + if (s->v.If.orelse) { + next = compiler_new_block(c); + if (next == NULL) + return 0; + } + else + next = end; VISIT(c, expr, s->v.If.test); - ADDOP_JREL(c, JUMP_IF_FALSE, next); - ADDOP(c, POP_TOP); + ADDOP_JABS(c, POP_JUMP_IF_FALSE, next); VISIT_SEQ(c, stmt, s->v.If.body); ADDOP_JREL(c, JUMP_FORWARD, end); - compiler_use_next_block(c, next); - ADDOP(c, POP_TOP); - if (s->v.If.orelse) + if (s->v.If.orelse) { + compiler_use_next_block(c, next); VISIT_SEQ(c, stmt, s->v.If.orelse); + } } compiler_use_next_block(c, end); return 1; @@ -1828,8 +1833,7 @@ so we need to set an extra line number. */ c->u->u_lineno_set = 0; VISIT(c, expr, s->v.While.test); - ADDOP_JREL(c, JUMP_IF_FALSE, anchor); - ADDOP(c, POP_TOP); + ADDOP_JABS(c, POP_JUMP_IF_FALSE, anchor); } VISIT_SEQ(c, stmt, s->v.While.body); ADDOP_JABS(c, JUMP_ABSOLUTE, loop); @@ -1840,7 +1844,6 @@ if (constant == -1) { compiler_use_next_block(c, anchor); - ADDOP(c, POP_TOP); ADDOP(c, POP_BLOCK); } compiler_pop_fblock(c, LOOP, loop); @@ -1947,7 +1950,7 @@ } /* - Code generated for "try: S except E1, V1: S1 except E2, V2: S2 ...": + Code generated for "try: S except E1 as V1: S1 except E2 as V2: S2 ...": (The contents of the value stack is shown in [], with the top at the right; 'tb' is trace-back info, 'val' the exception's associated value, and 'exc' the exception.) @@ -1961,20 +1964,17 @@ [tb, val, exc] L1: DUP ) [tb, val, exc, exc] ) [tb, val, exc, exc, E1] COMPARE_OP EXC_MATCH ) only if E1 - [tb, val, exc, 1-or-0] JUMP_IF_FALSE L2 ) - [tb, val, exc, 1] POP ) + [tb, val, exc, 1-or-0] POP_JUMP_IF_FALSE L2 ) [tb, val, exc] POP [tb, val] (or POP if no V1) [tb] POP [] JUMP_FORWARD L0 - [tb, val, exc, 0] L2: POP - [tb, val, exc] DUP + [tb, val, exc] L2: DUP .............................etc....................... - [tb, val, exc, 0] Ln+1: POP - [tb, val, exc] END_FINALLY # re-raise exception + [tb, val, exc] Ln+1: END_FINALLY # re-raise exception [] L0: @@ -2016,8 +2016,7 @@ ADDOP(c, DUP_TOP); VISIT(c, expr, handler->v.ExceptHandler.type); ADDOP_I(c, COMPARE_OP, PyCmp_EXC_MATCH); - ADDOP_JREL(c, JUMP_IF_FALSE, except); - ADDOP(c, POP_TOP); + ADDOP_JABS(c, POP_JUMP_IF_FALSE, except); } ADDOP(c, POP_TOP); if (handler->v.ExceptHandler.name) { @@ -2088,8 +2087,6 @@ } ADDOP_JREL(c, JUMP_FORWARD, end); compiler_use_next_block(c, except); - if (handler->v.ExceptHandler.type) - ADDOP(c, POP_TOP); } ADDOP(c, END_FINALLY); compiler_use_next_block(c, orelse); @@ -2268,8 +2265,7 @@ end = compiler_new_block(c); if (end == NULL) return 0; - ADDOP_JREL(c, JUMP_IF_TRUE, end); - ADDOP(c, POP_TOP); + ADDOP_JABS(c, POP_JUMP_IF_TRUE, end); ADDOP_O(c, LOAD_GLOBAL, assertion_error, names); if (s->v.Assert.msg) { VISIT(c, expr, s->v.Assert.msg); @@ -2277,7 +2273,6 @@ } ADDOP_I(c, RAISE_VARARGS, 1); compiler_use_next_block(c, end); - ADDOP(c, POP_TOP); return 1; } @@ -2629,9 +2624,9 @@ assert(e->kind == BoolOp_kind); if (e->v.BoolOp.op == And) - jumpi = JUMP_IF_FALSE; + jumpi = JUMP_IF_FALSE_OR_POP; else - jumpi = JUMP_IF_TRUE; + jumpi = JUMP_IF_TRUE_OR_POP; end = compiler_new_block(c); if (end == NULL) return 0; @@ -2640,8 +2635,7 @@ assert(n >= 0); for (i = 0; i < n; ++i) { VISIT(c, expr, (expr_ty)asdl_seq_GET(s, i)); - ADDOP_JREL(c, jumpi, end); - ADDOP(c, POP_TOP) + ADDOP_JABS(c, jumpi, end); } VISIT(c, expr, (expr_ty)asdl_seq_GET(s, n)); compiler_use_next_block(c, end); @@ -2737,9 +2731,8 @@ ADDOP_I(c, COMPARE_OP, cmpop((cmpop_ty)(asdl_seq_GET( e->v.Compare.ops, i - 1)))); - ADDOP_JREL(c, JUMP_IF_FALSE, cleanup); + ADDOP_JABS(c, JUMP_IF_FALSE_OR_POP, cleanup); NEXT_BLOCK(c); - ADDOP(c, POP_TOP); if (i < (n - 1)) VISIT(c, expr, (expr_ty)asdl_seq_GET(e->v.Compare.comparators, i)); @@ -2872,10 +2865,9 @@ for (i = 0; i < n; i++) { expr_ty e = (expr_ty)asdl_seq_GET(gen->ifs, i); VISIT(c, expr, e); - ADDOP_JREL(c, JUMP_IF_FALSE, if_cleanup); + ADDOP_JABS(c, POP_JUMP_IF_FALSE, if_cleanup); NEXT_BLOCK(c); - ADDOP(c, POP_TOP); - } + } if (++gen_index < asdl_seq_LEN(generators)) if (!compiler_comprehension_generator(c, @@ -2913,13 +2905,7 @@ compiler_use_next_block(c, skip); } - for (i = 0; i < n; i++) { - ADDOP_I(c, JUMP_FORWARD, 1); - if (i == 0) - compiler_use_next_block(c, if_cleanup); - - ADDOP(c, POP_TOP); - } + compiler_use_next_block(c, if_cleanup); ADDOP_JABS(c, JUMP_ABSOLUTE, start); compiler_use_next_block(c, anchor); Modified: python/branches/py3k/Python/import.c ============================================================================== --- python/branches/py3k/Python/import.c (original) +++ python/branches/py3k/Python/import.c Wed Feb 25 03:25:04 2009 @@ -87,8 +87,10 @@ Python 3.0a5: 3130 (lexical exception stacking, including POP_EXCEPT) Python 3.1a0: 3140 (optimize list, set and dict comprehensions: change LIST_APPEND and SET_ADD, add MAP_ADD) + Python 3.1a0: 3150 (optimize conditional branches: + introduce POP_JUMP_IF_FALSE and POP_JUMP_IF_TRUE) */ -#define MAGIC (3140 | ((long)'\r'<<16) | ((long)'\n'<<24)) +#define MAGIC (3150 | ((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 Modified: python/branches/py3k/Python/opcode_targets.h ============================================================================== --- python/branches/py3k/Python/opcode_targets.h (original) +++ python/branches/py3k/Python/opcode_targets.h Wed Feb 25 03:25:04 2009 @@ -110,11 +110,11 @@ &&TARGET_IMPORT_NAME, &&TARGET_IMPORT_FROM, &&TARGET_JUMP_FORWARD, - &&TARGET_JUMP_IF_FALSE, - &&TARGET_JUMP_IF_TRUE, + &&TARGET_JUMP_IF_FALSE_OR_POP, + &&TARGET_JUMP_IF_TRUE_OR_POP, &&TARGET_JUMP_ABSOLUTE, - &&_unknown_opcode, - &&_unknown_opcode, + &&TARGET_POP_JUMP_IF_FALSE, + &&TARGET_POP_JUMP_IF_TRUE, &&TARGET_LOAD_GLOBAL, &&_unknown_opcode, &&_unknown_opcode, Modified: python/branches/py3k/Python/peephole.c ============================================================================== --- python/branches/py3k/Python/peephole.c (original) +++ python/branches/py3k/Python/peephole.c Wed Feb 25 03:25:04 2009 @@ -13,7 +13,12 @@ #define GETARG(arr, i) ((int)((arr[i+2]<<8) + arr[i+1])) #define UNCONDITIONAL_JUMP(op) (op==JUMP_ABSOLUTE || op==JUMP_FORWARD) -#define ABSOLUTE_JUMP(op) (op==JUMP_ABSOLUTE || op==CONTINUE_LOOP) +#define CONDITIONAL_JUMP(op) (op==POP_JUMP_IF_FALSE || op==POP_JUMP_IF_TRUE \ + || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP) +#define ABSOLUTE_JUMP(op) (op==JUMP_ABSOLUTE || op==CONTINUE_LOOP \ + || op==POP_JUMP_IF_FALSE || op==POP_JUMP_IF_TRUE \ + || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP) +#define JUMPS_ON_TRUE(op) (op==POP_JUMP_IF_TRUE || op==JUMP_IF_TRUE_OR_POP) #define GETJUMPTGT(arr, i) (GETARG(arr,i) + (ABSOLUTE_JUMP(arr[i]) ? 0 : i+3)) #define SETARG(arr, i, val) arr[i+2] = val>>8; arr[i+1] = val & 255 #define CODESIZE(op) (HAS_ARG(op) ? 3 : 1) @@ -237,8 +242,10 @@ switch (opcode) { case FOR_ITER: case JUMP_FORWARD: - case JUMP_IF_FALSE: - case JUMP_IF_TRUE: + case JUMP_IF_FALSE_OR_POP: + case JUMP_IF_TRUE_OR_POP: + case POP_JUMP_IF_FALSE: + case POP_JUMP_IF_TRUE: case JUMP_ABSOLUTE: case CONTINUE_LOOP: case SETUP_LOOP: @@ -363,29 +370,24 @@ assert(PyList_Check(consts)); for (i=0 ; i a is not b not a in b --> a not in b @@ -417,29 +419,19 @@ break; /* Skip over LOAD_CONST trueconst - JUMP_IF_FALSE xx POP_TOP */ + POP_JUMP_IF_FALSE xx. This improves + "while 1" performance. */ case LOAD_CONST: cumlc = lastlc + 1; j = GETARG(codestr, i); - if (codestr[i+3] != JUMP_IF_FALSE || - codestr[i+6] != POP_TOP || + if (codestr[i+3] != POP_JUMP_IF_FALSE || !ISBASICBLOCK(blocks,i,7) || !PyObject_IsTrue(PyList_GET_ITEM(consts, j))) continue; - memset(codestr+i, NOP, 7); + memset(codestr+i, NOP, 6); cumlc = 0; break; - /* Replace POP_TOP JUMP_FORWARD 1 POP_TOP - with NOP NOP NOP NOP POP_TOP. */ - case POP_TOP: - if (UNCONDITIONAL_JUMP(codestr[i+1]) && - GETJUMPTGT(codestr, i+1) == i+5 && - codestr[i+4] == POP_TOP && - ISBASICBLOCK(blocks,i,4)) - memset(codestr+i, NOP, 4); - break; - /* Try to fold tuples of constants (includes a case for lists which are only used for "in" and "not in" tests). Skip over BUILD_SEQN 1 UNPACK_SEQN 1. @@ -524,27 +516,47 @@ "if a or b:" "a and b or c" "(a and b) and c" - x:JUMP_IF_FALSE y y:JUMP_IF_FALSE z --> x:JUMP_IF_FALSE z - x:JUMP_IF_FALSE y y:JUMP_IF_TRUE z --> x:JUMP_IF_FALSE y+3 + x:POP_OR_JUMP y y:POP_OR_JUMP z --> x:POP_OR_JUMP z + x:POP_OR_JUMP y y:JUMP_OR_POP z --> x:POP_JUMP_IF_FALSE y+3 where y+3 is the instruction following the second test. */ - case JUMP_IF_FALSE: - case JUMP_IF_TRUE: + case JUMP_IF_FALSE_OR_POP: + case JUMP_IF_TRUE_OR_POP: tgt = GETJUMPTGT(codestr, i); j = codestr[tgt]; - if (j == JUMP_IF_FALSE || j == JUMP_IF_TRUE) { - if (j == opcode) { - tgttgt = GETJUMPTGT(codestr, tgt) - i - 3; + if (CONDITIONAL_JUMP(j)) { + /* NOTE: all possible jumps here are + absolute! */ + if (JUMPS_ON_TRUE(j) == JUMPS_ON_TRUE(opcode)) { + /* The second jump will be + taken iff the first is. */ + tgttgt = GETJUMPTGT(codestr, tgt); + /* The current opcode inherits + its target's stack behaviour */ + codestr[i] = j; SETARG(codestr, i, tgttgt); + goto reoptimize_current; } else { - tgt -= i; - SETARG(codestr, i, tgt); + /* The second jump is not taken + if the first is (so jump past + it), and all conditional + jumps pop their argument when + they're not taken (so change + the first jump to pop its + argument when it's taken). */ + if (JUMPS_ON_TRUE(opcode)) + codestr[i] = POP_JUMP_IF_TRUE; + else + codestr[i] = POP_JUMP_IF_FALSE; + SETARG(codestr, i, (tgt + 3)); + goto reoptimize_current; } - break; } - /* Intentional fallthrough */ + /* Intentional fallthrough */ /* Replace jumps to unconditional jumps */ + case POP_JUMP_IF_FALSE: + case POP_JUMP_IF_TRUE: case FOR_ITER: case JUMP_FORWARD: case JUMP_ABSOLUTE: @@ -621,14 +633,16 @@ case JUMP_ABSOLUTE: case CONTINUE_LOOP: + case POP_JUMP_IF_FALSE: + case POP_JUMP_IF_TRUE: + case JUMP_IF_FALSE_OR_POP: + case JUMP_IF_TRUE_OR_POP: j = addrmap[GETARG(codestr, i)]; SETARG(codestr, i, j); break; case FOR_ITER: case JUMP_FORWARD: - case JUMP_IF_FALSE: - case JUMP_IF_TRUE: case SETUP_LOOP: case SETUP_EXCEPT: case SETUP_FINALLY: From buildbot at python.org Wed Feb 25 03:51:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 25 Feb 2009 02:51:25 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090225025126.1D1071E4036@bag.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/325 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: jeffrey.yasskin,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_site ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed Feb 25 04:12:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 25 Feb 2009 03:12:57 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090225031257.59F291E4002@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/331 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: jeffrey.yasskin,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/test/test_urllib2net.py", line 226, in test_ftp_basic u = _urlopen_with_retry(self.FTP_HOST) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 27, in wrapped return _retry_thrice(func, exc, *args, **kwargs) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 23, in _retry_thrice raise last_exc File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_urllib2net.py", line 17, in _retry_thrice return func(*args, **kwargs) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 122, in urlopen return _opener.open(url, data, timeout) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 358, in open response = self._open(req, data) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 376, in _open '_open', req) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 336, in _call_chain result = func(*args) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 1248, in ftp_open raise URLError(msg) urllib.error.URLError: 2 tests failed: test_site test_urllib2net ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_site.py", line 105, in test_s_option self.assertEqual(rc, 1) AssertionError: 0 != 1 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed Feb 25 07:11:58 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Wed, 25 Feb 2009 07:11:58 +0100 (CET) Subject: [Python-checkins] r69944 - svn:log Message-ID: <20090225061158.A318C1E4002@bag.python.org> Author: hirokazu.yamamoto Revision: 69944 Property Name: svn:log Action: modified Property diff: --- old property value +++ new property value @@ -1,4 +1,4 @@ Issue #2733: Fixed resize error for anonymous mapping object (windows). -I'm doubtful anonymous mapping object is resizable, but if another process +It's doubtful anonymous mapping object is resizable, but if another process changes file size between SetFilePointer and CreateFileMapping it may cause segfault, so I think explicitly specifying size is good practice. From nnorwitz at gmail.com Wed Feb 25 10:08:57 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 25 Feb 2009 04:08:57 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090225090857.GA16070@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 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 [13025 refs] [13025 refs] [22579 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14680 refs] [14680 refs] test_plistlib test_poll test_popen [13030 refs] [13030 refs] [13030 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 [18075 refs] test_pyexpat test_queue test_quopri [15550 refs] [15550 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 [13025 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 106, in test_s_option % (usersite, rc)) AssertionError: '/home/neal/.local/lib/python2.7/site-packages' is not in sys.path (sys.exit returned 0) 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [14925 refs] [13240 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] . [13025 refs] [13025 refs] this bit of output is from a test of stdout in a different process ... [13025 refs] [13025 refs] [13240 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [13025 refs] [13025 refs] [13254 refs] [13048 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [13028 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16521 refs] [17184 refs] [17000 refs] [17000 refs] [17000 refs] [17000 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [664503 refs] From nnorwitz at gmail.com Wed Feb 25 10:15:59 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 25 Feb 2009 04:15:59 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090225091559.GA18462@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 [17205 refs] [17205 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 [13025 refs] [13025 refs] [22579 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14680 refs] [14680 refs] test_plistlib test_poll test_popen [13030 refs] [13030 refs] [13030 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 [18075 refs] test_pyexpat test_queue test_quopri [15550 refs] [15550 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 [13025 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 106, in test_s_option % (usersite, rc)) AssertionError: '/home/neal/.local/lib/python2.7/site-packages' is not in sys.path (sys.exit returned 0) 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [14925 refs] [13240 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] . [13025 refs] [13025 refs] this bit of output is from a test of stdout in a different process ... [13025 refs] [13025 refs] [13240 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [13025 refs] [13025 refs] [13254 refs] [13048 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [13028 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16521 refs] [18025 refs] [17000 refs] [17000 refs] [17000 refs] [17000 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663773 refs] From nnorwitz at gmail.com Wed Feb 25 11:38:04 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 25 Feb 2009 05:38:04 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090225103804.GA8125@python.psfb.org> 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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-4494 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 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 [13025 refs] [13025 refs] [22579 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14680 refs] [14680 refs] test_plistlib test_poll test_popen [13030 refs] [13030 refs] [13030 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 [18075 refs] test_pyexpat test_queue test_quopri [15550 refs] [15550 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 [13025 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 106, in test_s_option % (usersite, rc)) AssertionError: '/home/neal/.local/lib/python2.7/site-packages' is not in sys.path (sys.exit returned 0) test_slice test_smtplib test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [14925 refs] [13240 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] . [13025 refs] [13025 refs] this bit of output is from a test of stdout in a different process ... [13025 refs] [13025 refs] [13240 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [13025 refs] [13025 refs] [13254 refs] [13048 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [13028 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16521 refs] [18025 refs] [17000 refs] [17000 refs] [17000 refs] [17000 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 runtktests 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 test_xmlrpc test_xpickle 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 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [678201 refs] From python-checkins at python.org Wed Feb 25 13:53:41 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 25 Feb 2009 13:53:41 +0100 (CET) Subject: [Python-checkins] r69962 - in python/branches/io-c: Demo/tkinter/matt/menu-all-types-of-entries.py Demo/tkinter/matt/menu-simple.py Doc/distutils/setupscript.rst Doc/distutils/sourcedist.rst Doc/howto/webservers.rst Doc/library/base64.rst Doc/library/collections.rst Doc/library/dis.rst Doc/library/exceptions.rst Doc/library/functions.rst Doc/library/importlib.rst Doc/library/io.rst Doc/library/itertools.rst Doc/library/math.rst Doc/library/pty.rst Doc/library/random.rst Doc/library/socket.rst Doc/library/socketserver.rst Doc/library/subprocess.rst Doc/reference/expressions.rst Doc/reference/introduction.rst Doc/reference/simple_stmts.rst Doc/tutorial/classes.rst Doc/tutorial/datastructures.rst Doc/tutorial/floatingpoint.rst Doc/tutorial/inputoutput.rst Doc/tutorial/stdlib.rst Doc/whatsnew/2.7.rst INTBENCH Include/longintrepr.h Include/opcode.h Lib/_abcoll.py Lib/_pyio.py Lib/decimal.py Lib/difflib.py Lib/distutils/cmd.py Lib/distutils/command/sdist.py Lib/distutils/dist.py Lib/distutils/tests/support.py Lib/distutils/tests/test_bdist_dumb.py Lib/distutils/tests/test_core.py Lib/distutils/tests/test_sdist.py Lib/distutils/tests/test_text_file.py Lib/distutils/tests/test_version.py Lib/distutils/text_file.py Lib/distutils/version.py Lib/email/message.py Lib/heapq.py Lib/idlelib/AutoComplete.py Lib/idlelib/NEWS.txt Lib/importlib/NOTES Lib/importlib/_bootstrap.py Lib/importlib/test/extension/test_case_sensitivity.py Lib/importlib/test/extension/test_finder.py Lib/importlib/test/extension/test_path_hook.py Lib/importlib/test/import_/test_path.py Lib/importlib/test/import_/util.py Lib/importlib/test/source/test_case_sensitivity.py Lib/importlib/test/source/test_finder.py Lib/importlib/test/source/test_loader.py Lib/importlib/test/source/test_path_hook.py Lib/importlib/test/source/test_source_encoding.py Lib/importlib/test/test_util.py Lib/importlib/util.py Lib/io.py Lib/logging/__init__.py Lib/modulefinder.py Lib/opcode.py Lib/optparse.py Lib/os.py Lib/pkgutil.py Lib/random.py Lib/shutil.py Lib/smtpd.py Lib/subprocess.py Lib/tarfile.py Lib/test/test_calendar.py Lib/test/test_cfgparser.py Lib/test/test_codeccallbacks.py Lib/test/test_collections.py Lib/test/test_descrtut.py Lib/test/test_funcattrs.py Lib/test/test_itertools.py Lib/test/test_mmap.py Lib/test/test_os.py Lib/test/test_peepholer.py Lib/test/test_pep263.py Lib/test/test_random.py Lib/test/test_shutil.py Lib/test/test_subprocess.py Lib/test/test_urllib2net.py Lib/tkinter/__init__.py Lib/tkinter/test/test_ttk/test_style.py Lib/tkinter/test/test_ttk/test_widgets.py Lib/turtle.py Lib/wsgiref/headers.py Mac/Tools/bundlebuilder.py Makefile.pre.in Misc/ACKS Misc/AIX-NOTES Misc/HISTORY Misc/NEWS Misc/cheatsheet Misc/python.man Modules/Setup.dist Modules/_ctypes/_ctypes.c Modules/_ctypes/libffi/aclocal.m4 Modules/_ctypes/libffi/configure Modules/_ctypes/libffi/src/x86/ffi64.c Modules/_ctypes/libffi_osx/x86/x86-ffi64.c Modules/_sqlite/connection.c Modules/arraymodule.c Modules/itertoolsmodule.c Modules/mmapmodule.c Modules/posixmodule.c Modules/timemodule.c Objects/abstract.c Objects/listsort.txt Object Message-ID: <20090225125341.C6B631E4002@bag.python.org> Author: antoine.pitrou Date: Wed Feb 25 13:53:37 2009 New Revision: 69962 Log: Merged revisions 69630-69631,69635,69637,69640,69643,69662,69664,69667,69674-69676,69682,69686-69687,69691,69696-69697,69702,69706-69708,69712,69722-69723,69726,69736,69740,69745,69747,69749-69750,69752-69755,69759,69763,69768,69771,69773,69793-69794,69797-69798,69800,69808,69819,69821,69831-69836,69847,69849,69851,69853,69856-69858,69863,69869,69876,69880,69883,69890,69894-69895,69897,69904,69909,69926,69930,69934-69935,69948-69949,69951,69957,69961 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69630 | brett.cannon | 2009-02-15 06:46:50 +0100 (dim., 15 f?vr. 2009) | 2 lines Add a NOTE about the new specific semantics for failed loads. ................ r69631 | brett.cannon | 2009-02-15 06:48:13 +0100 (dim., 15 f?vr. 2009) | 3 lines Change importlib.machinery.PathFinder to not have implicit semantics (that's not handled by importlib._bootstrap._DefaultPathFinder). ................ r69635 | mark.dickinson | 2009-02-15 12:04:38 +0100 (dim., 15 f?vr. 2009) | 13 lines Merged revisions 69634 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69634 | mark.dickinson | 2009-02-15 10:13:41 +0000 (Sun, 15 Feb 2009) | 6 lines Issue #5260: Various portability and standards compliance fixes, optimizations and cleanups in Objects/longobject.c. The most significant change is that longs now use less memory: average savings are 2 bytes per long on 32-bit systems and 6 bytes per long on 64-bit systems. (This memory saving already exists in py3k.) ........ ................ r69637 | mark.dickinson | 2009-02-15 16:14:57 +0100 (dim., 15 f?vr. 2009) | 2 lines A few more type fixes for py3k that were missed in r69635 ................ r69640 | mark.dickinson | 2009-02-15 16:49:16 +0100 (dim., 15 f?vr. 2009) | 8 lines Blocked revisions 69639 via svnmerge ........ r69639 | mark.dickinson | 2009-02-15 15:48:39 +0000 (Sun, 15 Feb 2009) | 2 lines A few more minor fixed in longobject.c ........ ................ r69643 | mark.dickinson | 2009-02-15 18:27:41 +0100 (dim., 15 f?vr. 2009) | 3 lines Fix more places in Objects/longobject.c where it's silently assumed that sizeof(digit) < sizeof(int). ................ r69662 | brett.cannon | 2009-02-16 05:18:01 +0100 (lun., 16 f?vr. 2009) | 1 line Document importlib.machinery.PathFinder. ................ r69664 | hirokazu.yamamoto | 2009-02-16 10:13:20 +0100 (lun., 16 f?vr. 2009) | 2 lines Issue #5249: time.strftime returned malformed string when format string contained non ascii character on windows. ................ r69667 | eric.smith | 2009-02-16 13:37:11 +0100 (lun., 16 f?vr. 2009) | 9 lines Merged revisions 69666 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69666 | eric.smith | 2009-02-16 04:56:39 -0500 (Mon, 16 Feb 2009) | 1 line Added Ross Light to ACKS, for bug 4285 (r69331). ........ ................ r69674 | facundo.batista | 2009-02-16 16:41:37 +0100 (lun., 16 f?vr. 2009) | 3 lines Removed message about compatibility with 2.3. ................ r69675 | benjamin.peterson | 2009-02-16 17:15:34 +0100 (lun., 16 f?vr. 2009) | 1 line raise more generic Exception() instead of RuntimeError() #5281 ................ r69676 | benjamin.peterson | 2009-02-16 17:20:10 +0100 (lun., 16 f?vr. 2009) | 1 line no 2.3 compat in the py3k lib #3676 ................ r69682 | benjamin.peterson | 2009-02-16 19:22:15 +0100 (lun., 16 f?vr. 2009) | 1 line remove another use of cmp() ................ r69686 | raymond.hettinger | 2009-02-16 21:50:56 +0100 (lun., 16 f?vr. 2009) | 1 line Add GC support to count() objects. ................ r69687 | benjamin.peterson | 2009-02-16 22:02:16 +0100 (lun., 16 f?vr. 2009) | 8 lines Blocked revisions 69685 via svnmerge ........ r69685 | raymond.hettinger | 2009-02-16 14:39:12 -0600 (Mon, 16 Feb 2009) | 1 line Add GC support to count() objects. Backport candidate. ........ ................ r69691 | benjamin.peterson | 2009-02-16 22:28:29 +0100 (lun., 16 f?vr. 2009) | 13 lines Merged revisions 69688,69690 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69688 | benjamin.peterson | 2009-02-16 15:07:52 -0600 (Mon, 16 Feb 2009) | 1 line fix compiler warnings ........ r69690 | benjamin.peterson | 2009-02-16 15:23:04 -0600 (Mon, 16 Feb 2009) | 1 line PyList_Append() can fail ........ ................ r69696 | tarek.ziade | 2009-02-16 22:49:12 +0100 (lun., 16 f?vr. 2009) | 9 lines Merged revisions 69692 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69692 | tarek.ziade | 2009-02-16 22:38:01 +0100 (Mon, 16 Feb 2009) | 1 line Fixed #2279: distutils.sdist.add_defaults now add files listed in package_data and data_files ........ ................ r69697 | tarek.ziade | 2009-02-16 22:51:13 +0100 (lun., 16 f?vr. 2009) | 9 lines Merged revisions 69693 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69693 | tarek.ziade | 2009-02-16 22:41:54 +0100 (Mon, 16 Feb 2009) | 1 line #2279: use os.sep so the MANIFEST file test work on win32 ........ ................ r69702 | tarek.ziade | 2009-02-16 23:42:39 +0100 (lun., 16 f?vr. 2009) | 9 lines Merged revisions 69700 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69700 | tarek.ziade | 2009-02-16 23:38:43 +0100 (Mon, 16 Feb 2009) | 1 line note about #2279 ........ ................ r69706 | benjamin.peterson | 2009-02-17 02:53:19 +0100 (mar., 17 f?vr. 2009) | 1 line I think this file has long outlived its usefulness ................ r69707 | brett.cannon | 2009-02-17 03:45:03 +0100 (mar., 17 f?vr. 2009) | 5 lines Implement the more specific PEP 302 semantics for loaders and what happens upon load failure in relation to reloads. Also expose importlib.util.module_for_loader to handle all of the details of this along with making sure all current loaders behave nicely. ................ r69708 | brett.cannon | 2009-02-17 08:15:17 +0100 (mar., 17 f?vr. 2009) | 1 line Outline a possible way to separate out source loading from bytecode loading. ................ r69712 | tarek.ziade | 2009-02-17 10:47:25 +0100 (mar., 17 f?vr. 2009) | 9 lines Merged revisions 69710 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69710 | tarek.ziade | 2009-02-17 10:42:44 +0100 (Tue, 17 Feb 2009) | 1 line #2279 added the plain path case for data_files ........ ................ r69722 | raymond.hettinger | 2009-02-17 21:00:59 +0100 (mar., 17 f?vr. 2009) | 3 lines Fixup intro paragraphs for the itertools docs. Add some tables for quick reference. ................ r69723 | raymond.hettinger | 2009-02-17 21:06:51 +0100 (mar., 17 f?vr. 2009) | 3 lines Fix-up intro paragraph for collections docs. ................ r69726 | tarek.ziade | 2009-02-18 00:10:18 +0100 (mer., 18 f?vr. 2009) | 9 lines Merged revisions 69724 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69724 | tarek.ziade | 2009-02-18 00:06:51 +0100 (Wed, 18 Feb 2009) | 1 line fixed the data_files inclusion behavior ........ ................ r69736 | hirokazu.yamamoto | 2009-02-18 17:38:00 +0100 (mer., 18 f?vr. 2009) | 14 lines Merged revisions 69714,69718 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69714 | hirokazu.yamamoto | 2009-02-17 19:12:10 +0900 | 1 line Issue #5292: Fixed mmap crash on its boundary access m[len(m)]. ........ r69718 | hirokazu.yamamoto | 2009-02-17 22:17:26 +0900 | 3 lines Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0, The file was resized to wrong size. ........ ................ r69740 | raymond.hettinger | 2009-02-18 21:56:51 +0100 (mer., 18 f?vr. 2009) | 1 line Generalize the itertools.tee() recipe. ................ r69745 | gregory.p.smith | 2009-02-19 02:25:51 +0100 (jeu., 19 f?vr. 2009) | 2 lines merge socket module documentation update from trunk r69731. ................ r69747 | benjamin.peterson | 2009-02-19 03:12:26 +0100 (jeu., 19 f?vr. 2009) | 49 lines Blocked revisions 69414,69561,69604,69672,69689,69709,69715,69717,69739,69743 via svnmerge ........ r69414 | georg.brandl | 2009-02-07 12:49:54 -0600 (Sat, 07 Feb 2009) | 1 line make "super only for new-style classes" a note. ........ r69561 | gregory.p.smith | 2009-02-12 21:00:00 -0600 (Thu, 12 Feb 2009) | 5 lines - 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). (backported from a py3k branch) ........ r69604 | raymond.hettinger | 2009-02-13 18:25:51 -0600 (Fri, 13 Feb 2009) | 1 line Add keyword argument support to itertools.count(). ........ r69672 | benjamin.peterson | 2009-02-16 08:54:34 -0600 (Mon, 16 Feb 2009) | 1 line note functions that are not aliased to PyBytes_ #5280 ........ r69689 | benjamin.peterson | 2009-02-16 15:09:09 -0600 (Mon, 16 Feb 2009) | 1 line remove some PyBytes_* aliases that are not in 3.x ........ r69709 | raymond.hettinger | 2009-02-17 02:33:01 -0600 (Tue, 17 Feb 2009) | 1 line Fix-up intro paragraph for collections docs. ........ r69715 | raymond.hettinger | 2009-02-17 05:00:27 -0600 (Tue, 17 Feb 2009) | 1 line Fixup intro paragraphs for the itertools docs. Add some tables for quick reference. ........ r69717 | marc-andre.lemburg | 2009-02-17 06:48:19 -0600 (Tue, 17 Feb 2009) | 5 lines Clarify the deprecation of platform.dist(). Add versionadded tags. ........ r69739 | raymond.hettinger | 2009-02-18 14:54:53 -0600 (Wed, 18 Feb 2009) | 1 line Generalize the itertools.tee() recipe. ........ r69743 | raymond.hettinger | 2009-02-18 17:10:19 -0600 (Wed, 18 Feb 2009) | 1 line Py3k warnings now automatically include -Qwarn for division. ........ ................ r69749 | benjamin.peterson | 2009-02-19 03:17:08 +0100 (jeu., 19 f?vr. 2009) | 8 lines Blocked revisions 69716 via svnmerge ........ r69716 | ronald.oussoren | 2009-02-17 06:38:42 -0600 (Tue, 17 Feb 2009) | 2 lines Fix issue776533. ........ ................ r69750 | raymond.hettinger | 2009-02-19 03:17:09 +0100 (jeu., 19 f?vr. 2009) | 1 line Add keyword arg support to itertools.compress(). ................ r69752 | raymond.hettinger | 2009-02-19 03:44:01 +0100 (jeu., 19 f?vr. 2009) | 1 line Add keyword arg support to itertools.repeat(). ................ r69753 | benjamin.peterson | 2009-02-19 04:24:17 +0100 (jeu., 19 f?vr. 2009) | 12 lines Blocked revisions 69748,69751 via svnmerge ........ r69748 | raymond.hettinger | 2009-02-18 20:15:14 -0600 (Wed, 18 Feb 2009) | 1 line Add keyword arg support to itertools.compress(). ........ r69751 | raymond.hettinger | 2009-02-18 20:38:25 -0600 (Wed, 18 Feb 2009) | 1 line Add keyword arg support to itertools.repeat(). ........ ................ r69754 | benjamin.peterson | 2009-02-19 05:22:03 +0100 (jeu., 19 f?vr. 2009) | 54 lines Merged revisions 69576,69579-69580,69589,69619-69620,69633,69703-69704,69728-69730 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69576 | georg.brandl | 2009-02-13 04:56:50 -0600 (Fri, 13 Feb 2009) | 1 line #1661108: note that urlsafe encoded string can contain "=". ........ r69579 | georg.brandl | 2009-02-13 05:06:59 -0600 (Fri, 13 Feb 2009) | 2 lines Fix warnings GCC emits where the argument of PyErr_Format is a single variable. ........ r69580 | georg.brandl | 2009-02-13 05:10:04 -0600 (Fri, 13 Feb 2009) | 2 lines Fix warnings GCC emits where the argument of PyErr_Format is a single variable. ........ r69589 | martin.v.loewis | 2009-02-13 14:11:34 -0600 (Fri, 13 Feb 2009) | 2 lines Move amd64 properties further to the top, so that they override the linker options correctly. ........ r69619 | benjamin.peterson | 2009-02-14 11:00:51 -0600 (Sat, 14 Feb 2009) | 1 line this needn't be a shebang line ........ r69620 | georg.brandl | 2009-02-14 11:01:36 -0600 (Sat, 14 Feb 2009) | 1 line #5179: don't leak PIPE fds when child execution fails. ........ r69633 | hirokazu.yamamoto | 2009-02-15 03:19:48 -0600 (Sun, 15 Feb 2009) | 1 line Fixed typo. ........ r69703 | raymond.hettinger | 2009-02-16 16:42:54 -0600 (Mon, 16 Feb 2009) | 3 lines Issue 5229: Documentation for super() neglects to say what super() actually does ........ r69704 | raymond.hettinger | 2009-02-16 17:00:25 -0600 (Mon, 16 Feb 2009) | 1 line Add explanation for super(type1, type2). ........ r69728 | georg.brandl | 2009-02-17 18:22:55 -0600 (Tue, 17 Feb 2009) | 2 lines #5297: fix example. ........ r69729 | georg.brandl | 2009-02-17 18:25:13 -0600 (Tue, 17 Feb 2009) | 2 lines #5296: sequence -> iterable. ........ r69730 | georg.brandl | 2009-02-17 18:31:36 -0600 (Tue, 17 Feb 2009) | 2 lines #5268: mention VMSError. ........ ................ r69755 | raymond.hettinger | 2009-02-19 05:45:07 +0100 (jeu., 19 f?vr. 2009) | 1 line Add some cross-references to the docs. Simplify the python code equivalent for zip(). Supply an optional argument for the nth() recipe. ................ r69759 | raymond.hettinger | 2009-02-19 06:48:05 +0100 (jeu., 19 f?vr. 2009) | 1 line Add an example for math.fsum() and elaborate on the accurary note. ................ r69763 | raymond.hettinger | 2009-02-19 07:44:30 +0100 (jeu., 19 f?vr. 2009) | 1 line Add links to helpful external resources. ................ r69768 | martin.v.loewis | 2009-02-19 08:51:52 +0100 (jeu., 19 f?vr. 2009) | 2 lines Regenerate with autoconf 2.61. ................ r69771 | raymond.hettinger | 2009-02-19 10:53:18 +0100 (jeu., 19 f?vr. 2009) | 1 line Inline coefficients in gamma(). Add reflection formula. Add comments. ................ r69773 | vinay.sajip | 2009-02-19 13:36:11 +0100 (jeu., 19 f?vr. 2009) | 1 line #5287: Add exception handling around findCaller() call to help out IronPython. ................ r69793 | amaury.forgeotdarc | 2009-02-20 00:23:47 +0100 (ven., 20 f?vr. 2009) | 8 lines #5306: Fix compilation on Windows by properly merging change 69495. + fixed an obvious merge glitch in a windows-only test. Patch by Hirokazu Yamamoto. I added a _PyVerify_fd() call to os.device_encoding() (new in python 3.0) which also uses a raw file descriptor. ................ r69794 | benjamin.peterson | 2009-02-20 04:19:25 +0100 (ven., 20 f?vr. 2009) | 1 line fix None errno #5312 ................ r69797 | benjamin.peterson | 2009-02-20 04:40:57 +0100 (ven., 20 f?vr. 2009) | 42 lines Blocked revisions 69268,69516,69757,69761,69765,69770,69772,69777,69795 via svnmerge ........ r69268 | kristjan.jonsson | 2009-02-04 04:05:25 -0600 (Wed, 04 Feb 2009) | 1 line issue 4804: Provide checks for the format string of strftime, and for the "mode" string of fopen on Windows. These strings are user provided from python and so we can avoid invoking the C runtime invalid parameter handler by first checking that they are valid. ........ r69516 | hirokazu.yamamoto | 2009-02-10 22:13:06 -0600 (Tue, 10 Feb 2009) | 2 lines Issue #5204: Define _PyVerify_fd on VC6 to make test_fdopen (test_os.py) pass. ........ r69757 | raymond.hettinger | 2009-02-18 23:34:35 -0600 (Wed, 18 Feb 2009) | 1 line Add some cross-references to the docs. Simplify the python code equivalent for izip(). Supply an optional argument for the nth() recipe. ........ r69761 | raymond.hettinger | 2009-02-18 23:51:41 -0600 (Wed, 18 Feb 2009) | 1 line Add an example for math.fsum() and elaborate on the accurary note. ........ r69765 | raymond.hettinger | 2009-02-19 00:55:03 -0600 (Thu, 19 Feb 2009) | 1 line Add links to helpful external resources. ........ r69770 | raymond.hettinger | 2009-02-19 03:50:24 -0600 (Thu, 19 Feb 2009) | 1 line Inline coefficients in gamma(). Add reflection formula. Add comments. ........ r69772 | vinay.sajip | 2009-02-19 06:31:32 -0600 (Thu, 19 Feb 2009) | 1 line #5287: Add exception handling around findCaller() call to help out IronPython. ........ r69777 | jeroen.ruigrok | 2009-02-19 12:52:21 -0600 (Thu, 19 Feb 2009) | 3 lines Since we recommend one module per import line, reflect this also in the documentation. ........ r69795 | benjamin.peterson | 2009-02-19 21:31:23 -0600 (Thu, 19 Feb 2009) | 1 line revert r69777 since all the experts agree that extra import lines distract from the code ........ ................ r69798 | benjamin.peterson | 2009-02-20 05:02:38 +0100 (ven., 20 f?vr. 2009) | 13 lines Merged revisions 69769,69776 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69769 | georg.brandl | 2009-02-19 02:30:06 -0600 (Thu, 19 Feb 2009) | 1 line #5310, #3558: fix operator precedence table. ........ r69776 | georg.brandl | 2009-02-19 10:34:51 -0600 (Thu, 19 Feb 2009) | 2 lines #5317: update IronPython URL. ........ ................ r69800 | benjamin.peterson | 2009-02-20 05:09:19 +0100 (ven., 20 f?vr. 2009) | 17 lines Merged revisions 69415,69591,69593 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69415 | benjamin.peterson | 2009-02-07 13:08:22 -0600 (Sat, 07 Feb 2009) | 1 line make destinsrc private ........ r69591 | martin.v.loewis | 2009-02-13 14:26:16 -0600 (Fri, 13 Feb 2009) | 1 line Update Tix build procedure. ........ r69593 | martin.v.loewis | 2009-02-13 14:51:48 -0600 (Fri, 13 Feb 2009) | 1 line Add optional code signing after merging. ........ ................ r69808 | eric.smith | 2009-02-20 15:25:03 +0100 (ven., 20 f?vr. 2009) | 9 lines Merged revisions 69806 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69806 | eric.smith | 2009-02-20 09:02:36 -0500 (Fri, 20 Feb 2009) | 1 line Issue #5247: Improve error message when unknown format codes are used when using str.format() with str, int, and float arguments. ........ ................ r69819 | mark.dickinson | 2009-02-20 21:50:21 +0100 (ven., 20 f?vr. 2009) | 9 lines Merged revisions 69816 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69816 | mark.dickinson | 2009-02-20 20:42:53 +0000 (Fri, 20 Feb 2009) | 2 lines Issue #5295: Typos in turtle.py ........ ................ r69821 | mark.dickinson | 2009-02-20 21:53:56 +0100 (ven., 20 f?vr. 2009) | 2 lines More typos in Lib/turtle.py ................ r69831 | brett.cannon | 2009-02-21 03:51:12 +0100 (sam., 21 f?vr. 2009) | 2 lines Minor NOTES changes for importlib. ................ r69832 | brett.cannon | 2009-02-21 04:12:17 +0100 (sam., 21 f?vr. 2009) | 2 lines Add some notes about importlib and some API exposure cleanup. ................ r69833 | brett.cannon | 2009-02-21 04:15:37 +0100 (sam., 21 f?vr. 2009) | 7 lines Do some cleanup in importlib: + Ditch using arguments to super(). + Ditch subclassing from object directly. + Move directory check out of chaining path hook to file path hook/finder. + Rename some classes to better reflect they are finders, not importers. ................ r69834 | brett.cannon | 2009-02-21 04:31:35 +0100 (sam., 21 f?vr. 2009) | 2 lines Separate out finder for source and source/bytecode. ................ r69835 | brett.cannon | 2009-02-21 04:53:06 +0100 (sam., 21 f?vr. 2009) | 3 lines Tweak the source/bytecode loader from importlib to use more of the PEP 302 protocol API. ................ r69836 | brett.cannon | 2009-02-21 06:41:15 +0100 (sam., 21 f?vr. 2009) | 3 lines Refactor source and bytecode file loaders in importlib so that there are source-only and source/bytecode loaders. ................ r69847 | mark.dickinson | 2009-02-21 21:59:32 +0100 (sam., 21 f?vr. 2009) | 9 lines Merged revisions 69846 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69846 | mark.dickinson | 2009-02-21 20:27:01 +0000 (Sat, 21 Feb 2009) | 2 lines Issue #5341: Fix a variety of spelling errors. ........ ................ r69849 | raymond.hettinger | 2009-02-21 23:10:18 +0100 (sam., 21 f?vr. 2009) | 3 lines Port r69838: Speedup and simplify negative counter using count's new step argument. ................ r69851 | raymond.hettinger | 2009-02-21 23:30:12 +0100 (sam., 21 f?vr. 2009) | 3 lines Port r69837: Fix keyword arguments for itertools.count(). Step arg without a start arg was ignored. ................ r69853 | benjamin.peterson | 2009-02-21 23:39:38 +0100 (sam., 21 f?vr. 2009) | 13 lines Blocked revisions 69837-69838 via svnmerge ........ r69837 | raymond.hettinger | 2009-02-21 01:17:22 -0600 (Sat, 21 Feb 2009) | 4 lines Fix keyword arguments for itertools.count(). Step arg without a start arg was ignored. ........ r69838 | raymond.hettinger | 2009-02-21 02:58:42 -0600 (Sat, 21 Feb 2009) | 1 line Speedup and simplify negative counter using count's new step argument. ........ ................ r69856 | brett.cannon | 2009-02-22 00:12:24 +0100 (dim., 22 f?vr. 2009) | 2 lines Relocate source_mtime in importlib to PyPycLoader. ................ r69857 | benjamin.peterson | 2009-02-22 00:14:55 +0100 (dim., 22 f?vr. 2009) | 9 lines Merged revisions 69855 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69855 | benjamin.peterson | 2009-02-21 17:09:33 -0600 (Sat, 21 Feb 2009) | 1 line fix compiler warnings ........ ................ r69858 | raymond.hettinger | 2009-02-22 00:20:57 +0100 (dim., 22 f?vr. 2009) | 3 lines In Py3.x, a list comprehension is now faster than list(map(itemgetter(0), iterable)). ................ r69863 | tarek.ziade | 2009-02-22 01:10:58 +0100 (dim., 22 f?vr. 2009) | 9 lines Merged revisions 69861 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69861 | tarek.ziade | 2009-02-22 01:07:45 +0100 (Sun, 22 Feb 2009) | 1 line using versionchanged instead of versionadded for distutils doc on sdist default files ........ ................ r69869 | matthias.klose | 2009-02-22 13:57:58 +0100 (dim., 22 f?vr. 2009) | 2 lines - Modules/Setup.dist: Mention _heapq ................ r69876 | tarek.ziade | 2009-02-22 21:05:16 +0100 (dim., 22 f?vr. 2009) | 9 lines Merged revisions 69874 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69874 | tarek.ziade | 2009-02-22 20:58:12 +0100 (Sun, 22 Feb 2009) | 1 line moved distutils.text_file tests into a real unittest class ........ ................ r69880 | tarek.ziade | 2009-02-22 21:14:01 +0100 (dim., 22 f?vr. 2009) | 8 lines Blocked revisions 69878 via svnmerge ........ r69878 | tarek.ziade | 2009-02-22 21:11:46 +0100 (Sun, 22 Feb 2009) | 1 line removing map and lambda usage, so the test is similar to py3k's branch one ........ ................ r69883 | tarek.ziade | 2009-02-22 21:20:59 +0100 (dim., 22 f?vr. 2009) | 9 lines Merged revisions 69881 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69881 | tarek.ziade | 2009-02-22 21:15:41 +0100 (Sun, 22 Feb 2009) | 1 line Removing unused __main__ sections ........ ................ r69890 | matthias.klose | 2009-02-23 00:18:38 +0100 (lun., 23 f?vr. 2009) | 9 lines Merged revisions 69889 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69889 | matthias.klose | 2009-02-23 00:14:26 +0100 (Mo, 23 Feb 2009) | 2 lines - Link the shared python library with $(MODLIBS). ........ ................ r69894 | benjamin.peterson | 2009-02-23 04:38:43 +0100 (lun., 23 f?vr. 2009) | 1 line .pythonrc.py is no more ................ r69895 | georg.brandl | 2009-02-23 11:24:05 +0100 (lun., 23 f?vr. 2009) | 1 line #5348: format() converts all kinds of values. ................ r69897 | georg.brandl | 2009-02-23 11:25:20 +0100 (lun., 23 f?vr. 2009) | 8 lines Blocked revisions 69896 via svnmerge ........ r69896 | georg.brandl | 2009-02-23 11:24:23 +0100 (Mo, 23 Feb 2009) | 1 line #5348: format() converts all kinds of values. ........ ................ r69904 | tarek.ziade | 2009-02-23 13:47:55 +0100 (lun., 23 f?vr. 2009) | 9 lines Merged revisions 69902 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69902 | tarek.ziade | 2009-02-23 13:41:29 +0100 (Mon, 23 Feb 2009) | 1 line more test coverage ........ ................ r69909 | raymond.hettinger | 2009-02-23 20:38:09 +0100 (lun., 23 f?vr. 2009) | 1 line Update itertools recipes to use next(). ................ r69926 | benjamin.peterson | 2009-02-24 04:16:28 +0100 (mar., 24 f?vr. 2009) | 16 lines Blocked revisions 69870-69871,69908 via svnmerge ........ r69870 | antoine.pitrou | 2009-02-22 11:25:52 -0600 (Sun, 22 Feb 2009) | 3 lines Try to make sense of the test_site buildbot failures ........ r69871 | antoine.pitrou | 2009-02-22 12:20:46 -0600 (Sun, 22 Feb 2009) | 3 lines Revert debugging statements, culprit is possibly test_distutils (see #5316) ........ r69908 | raymond.hettinger | 2009-02-23 13:32:55 -0600 (Mon, 23 Feb 2009) | 1 line Update itertools recipes to use next(). ........ ................ r69930 | raymond.hettinger | 2009-02-24 11:57:02 +0100 (mar., 24 f?vr. 2009) | 1 line Fix-up random docs. Jumpahead was removed long ago. Other minor corrections. ................ r69934 | raymond.hettinger | 2009-02-24 12:25:35 +0100 (mar., 24 f?vr. 2009) | 4 lines range() should have been registered as a Sequence. Needs to be backported to 2.6, 2.7, and 3.0. ................ r69935 | raymond.hettinger | 2009-02-24 12:27:15 +0100 (mar., 24 f?vr. 2009) | 1 line Use ABCs to validate documented restriction to Sets or Sequences. ................ r69948 | raymond.hettinger | 2009-02-25 00:30:43 +0100 (mer., 25 f?vr. 2009) | 7 lines Refine docs for super() noting that sibling classes can be called, not just parents. Add a comparison to getattr() which has the same search order but also includes the type itself. ................ r69949 | raymond.hettinger | 2009-02-25 00:41:47 +0100 (mer., 25 f?vr. 2009) | 1 line Revert unintended part of r69948. Pydoc was not supposed to change. ................ r69951 | raymond.hettinger | 2009-02-25 01:32:51 +0100 (mer., 25 f?vr. 2009) | 1 line Tweak markup, grammar, and punctuation. ................ r69957 | raymond.hettinger | 2009-02-25 01:58:47 +0100 (mer., 25 f?vr. 2009) | 1 line More markup and spelling fixes. ................ r69961 | jeffrey.yasskin | 2009-02-25 03:25:04 +0100 (mer., 25 f?vr. 2009) | 45 lines http://bugs.python.org/issue4715 This patch by Antoine Pitrou optimizes the bytecode for conditional branches by merging the following "POP_TOP" instruction into the conditional jump. For example, the list comprehension "[x for x in l if not x]" produced the following bytecode: 1 0 BUILD_LIST 0 3 LOAD_FAST 0 (.0) >> 6 FOR_ITER 23 (to 32) 9 STORE_FAST 1 (x) 12 LOAD_FAST 1 (x) 15 JUMP_IF_TRUE 10 (to 28) 18 POP_TOP 19 LOAD_FAST 1 (x) 22 LIST_APPEND 2 25 JUMP_ABSOLUTE 6 >> 28 POP_TOP 29 JUMP_ABSOLUTE 6 >> 32 RETURN_VALUE but after the patch it produces the following bytecode: 1 0 BUILD_LIST 0 3 LOAD_FAST 0 (.0) >> 6 FOR_ITER 18 (to 27) 9 STORE_FAST 1 (x) 12 LOAD_FAST 1 (x) 15 POP_JUMP_IF_TRUE 6 18 LOAD_FAST 1 (x) 21 LIST_APPEND 2 24 JUMP_ABSOLUTE 6 >> 27 RETURN_VALUE Notice that not only the code is shorter, but the conditional jump (POP_JUMP_IF_TRUE) jumps right to the start of the loop instead of going through the JUMP_ABSOLUTE at the end. "continue" statements are helped similarly. Furthermore, the old jump opcodes (JUMP_IF_FALSE, JUMP_IF_TRUE) have been replaced by two new opcodes: - JUMP_IF_TRUE_OR_POP, which jumps if true and pops otherwise - JUMP_IF_FALSE_OR_POP, which jumps if false and pops otherwise ................ Added: python/branches/io-c/Lib/distutils/tests/test_bdist_dumb.py - copied unchanged from r69961, /python/branches/py3k/Lib/distutils/tests/test_bdist_dumb.py python/branches/io-c/Lib/distutils/tests/test_text_file.py - copied unchanged from r69961, /python/branches/py3k/Lib/distutils/tests/test_text_file.py python/branches/io-c/Lib/distutils/tests/test_version.py - copied unchanged from r69961, /python/branches/py3k/Lib/distutils/tests/test_version.py python/branches/io-c/Lib/importlib/test/test_util.py - copied unchanged from r69961, /python/branches/py3k/Lib/importlib/test/test_util.py python/branches/io-c/Lib/importlib/util.py - copied unchanged from r69961, /python/branches/py3k/Lib/importlib/util.py Removed: python/branches/io-c/INTBENCH Modified: python/branches/io-c/ (props changed) python/branches/io-c/Demo/tkinter/matt/menu-all-types-of-entries.py python/branches/io-c/Demo/tkinter/matt/menu-simple.py python/branches/io-c/Doc/distutils/setupscript.rst python/branches/io-c/Doc/distutils/sourcedist.rst python/branches/io-c/Doc/howto/webservers.rst python/branches/io-c/Doc/library/base64.rst python/branches/io-c/Doc/library/collections.rst python/branches/io-c/Doc/library/dis.rst python/branches/io-c/Doc/library/exceptions.rst python/branches/io-c/Doc/library/functions.rst python/branches/io-c/Doc/library/importlib.rst python/branches/io-c/Doc/library/io.rst python/branches/io-c/Doc/library/itertools.rst python/branches/io-c/Doc/library/math.rst python/branches/io-c/Doc/library/pty.rst python/branches/io-c/Doc/library/random.rst python/branches/io-c/Doc/library/socket.rst python/branches/io-c/Doc/library/socketserver.rst python/branches/io-c/Doc/library/subprocess.rst python/branches/io-c/Doc/reference/expressions.rst python/branches/io-c/Doc/reference/introduction.rst python/branches/io-c/Doc/reference/simple_stmts.rst python/branches/io-c/Doc/tutorial/classes.rst python/branches/io-c/Doc/tutorial/datastructures.rst python/branches/io-c/Doc/tutorial/floatingpoint.rst python/branches/io-c/Doc/tutorial/inputoutput.rst python/branches/io-c/Doc/tutorial/stdlib.rst python/branches/io-c/Doc/whatsnew/2.7.rst python/branches/io-c/Include/longintrepr.h python/branches/io-c/Include/opcode.h python/branches/io-c/Lib/_abcoll.py python/branches/io-c/Lib/_pyio.py python/branches/io-c/Lib/decimal.py python/branches/io-c/Lib/difflib.py python/branches/io-c/Lib/distutils/cmd.py python/branches/io-c/Lib/distutils/command/sdist.py python/branches/io-c/Lib/distutils/dist.py python/branches/io-c/Lib/distutils/tests/support.py python/branches/io-c/Lib/distutils/tests/test_core.py python/branches/io-c/Lib/distutils/tests/test_sdist.py python/branches/io-c/Lib/distutils/text_file.py python/branches/io-c/Lib/distutils/version.py python/branches/io-c/Lib/email/message.py python/branches/io-c/Lib/heapq.py python/branches/io-c/Lib/idlelib/AutoComplete.py python/branches/io-c/Lib/idlelib/NEWS.txt python/branches/io-c/Lib/importlib/NOTES python/branches/io-c/Lib/importlib/_bootstrap.py python/branches/io-c/Lib/importlib/test/extension/test_case_sensitivity.py python/branches/io-c/Lib/importlib/test/extension/test_finder.py python/branches/io-c/Lib/importlib/test/extension/test_path_hook.py python/branches/io-c/Lib/importlib/test/import_/test_path.py python/branches/io-c/Lib/importlib/test/import_/util.py python/branches/io-c/Lib/importlib/test/source/test_case_sensitivity.py python/branches/io-c/Lib/importlib/test/source/test_finder.py python/branches/io-c/Lib/importlib/test/source/test_loader.py python/branches/io-c/Lib/importlib/test/source/test_path_hook.py python/branches/io-c/Lib/importlib/test/source/test_source_encoding.py python/branches/io-c/Lib/io.py python/branches/io-c/Lib/logging/__init__.py python/branches/io-c/Lib/modulefinder.py python/branches/io-c/Lib/opcode.py python/branches/io-c/Lib/optparse.py python/branches/io-c/Lib/os.py python/branches/io-c/Lib/pkgutil.py python/branches/io-c/Lib/random.py python/branches/io-c/Lib/shutil.py python/branches/io-c/Lib/smtpd.py python/branches/io-c/Lib/subprocess.py python/branches/io-c/Lib/tarfile.py python/branches/io-c/Lib/test/test_calendar.py python/branches/io-c/Lib/test/test_cfgparser.py python/branches/io-c/Lib/test/test_codeccallbacks.py python/branches/io-c/Lib/test/test_collections.py python/branches/io-c/Lib/test/test_descrtut.py python/branches/io-c/Lib/test/test_funcattrs.py python/branches/io-c/Lib/test/test_itertools.py python/branches/io-c/Lib/test/test_mmap.py python/branches/io-c/Lib/test/test_os.py python/branches/io-c/Lib/test/test_peepholer.py python/branches/io-c/Lib/test/test_pep263.py python/branches/io-c/Lib/test/test_random.py python/branches/io-c/Lib/test/test_shutil.py python/branches/io-c/Lib/test/test_subprocess.py python/branches/io-c/Lib/test/test_urllib2net.py python/branches/io-c/Lib/tkinter/__init__.py python/branches/io-c/Lib/tkinter/test/test_ttk/test_style.py python/branches/io-c/Lib/tkinter/test/test_ttk/test_widgets.py python/branches/io-c/Lib/turtle.py python/branches/io-c/Lib/wsgiref/headers.py python/branches/io-c/Mac/Tools/bundlebuilder.py python/branches/io-c/Makefile.pre.in python/branches/io-c/Misc/ACKS python/branches/io-c/Misc/AIX-NOTES python/branches/io-c/Misc/HISTORY python/branches/io-c/Misc/NEWS python/branches/io-c/Misc/cheatsheet python/branches/io-c/Misc/python.man python/branches/io-c/Modules/Setup.dist python/branches/io-c/Modules/_ctypes/_ctypes.c python/branches/io-c/Modules/_ctypes/libffi/aclocal.m4 python/branches/io-c/Modules/_ctypes/libffi/configure python/branches/io-c/Modules/_ctypes/libffi/src/x86/ffi64.c python/branches/io-c/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c python/branches/io-c/Modules/_sqlite/connection.c python/branches/io-c/Modules/arraymodule.c python/branches/io-c/Modules/itertoolsmodule.c python/branches/io-c/Modules/mmapmodule.c python/branches/io-c/Modules/posixmodule.c python/branches/io-c/Modules/timemodule.c python/branches/io-c/Objects/abstract.c python/branches/io-c/Objects/listsort.txt python/branches/io-c/Objects/longobject.c python/branches/io-c/Objects/object.c python/branches/io-c/Objects/stringlib/formatter.h python/branches/io-c/Objects/unicodeobject.c python/branches/io-c/PCbuild/build_tkinter.py python/branches/io-c/PCbuild/sqlite3.vcproj python/branches/io-c/Python/ceval.c python/branches/io-c/Python/compile.c python/branches/io-c/Python/import.c python/branches/io-c/Python/opcode_targets.h python/branches/io-c/Python/peephole.c python/branches/io-c/Tools/msi/merge.py python/branches/io-c/Tools/scripts/texi2html.py python/branches/io-c/configure python/branches/io-c/pyconfig.h.in Modified: python/branches/io-c/Demo/tkinter/matt/menu-all-types-of-entries.py ============================================================================== --- python/branches/io-c/Demo/tkinter/matt/menu-all-types-of-entries.py (original) +++ python/branches/io-c/Demo/tkinter/matt/menu-all-types-of-entries.py Wed Feb 25 13:53:37 2009 @@ -110,12 +110,12 @@ Cascade_button.menu.choices = Menu(Cascade_button.menu) # ...and this is a menu that cascades from that. - Cascade_button.menu.choices.wierdones = Menu(Cascade_button.menu.choices) + Cascade_button.menu.choices.weirdones = Menu(Cascade_button.menu.choices) # then you define the menus from the deepest level on up. - Cascade_button.menu.choices.wierdones.add_command(label='avacado') - Cascade_button.menu.choices.wierdones.add_command(label='belgian endive') - Cascade_button.menu.choices.wierdones.add_command(label='beefaroni') + Cascade_button.menu.choices.weirdones.add_command(label='avacado') + Cascade_button.menu.choices.weirdones.add_command(label='belgian endive') + Cascade_button.menu.choices.weirdones.add_command(label='beefaroni') # definition of the menu one level up... Cascade_button.menu.choices.add_command(label='Chocolate') @@ -125,8 +125,8 @@ Cascade_button.menu.choices.add_command(label='Rocky Road') Cascade_button.menu.choices.add_command(label='BubbleGum') Cascade_button.menu.choices.add_cascade( - label='Wierd Flavors', - menu=Cascade_button.menu.choices.wierdones) + label='Weird Flavors', + menu=Cascade_button.menu.choices.weirdones) # and finally, the definition for the top level Cascade_button.menu.add_cascade(label='more choices', Modified: python/branches/io-c/Demo/tkinter/matt/menu-simple.py ============================================================================== --- python/branches/io-c/Demo/tkinter/matt/menu-simple.py (original) +++ python/branches/io-c/Demo/tkinter/matt/menu-simple.py Wed Feb 25 13:53:37 2009 @@ -48,7 +48,7 @@ File_button.menu = Menu(File_button) # add an item. The first param is a menu entry type, - # must be one of: "cascade", "checkbutton", "command", "radiobutton", "seperator" + # must be one of: "cascade", "checkbutton", "command", "radiobutton", "separator" # see menu-demo-2.py for examples of use File_button.menu.add_command(label='New...', underline=0, command=new_file) Modified: python/branches/io-c/Doc/distutils/setupscript.rst ============================================================================== --- python/branches/io-c/Doc/distutils/setupscript.rst (original) +++ python/branches/io-c/Doc/distutils/setupscript.rst Wed Feb 25 13:53:37 2009 @@ -427,6 +427,7 @@ distribution being described. If no qualifiers are given, all versions of the named module or package are understood to be obsoleted. +.. _distutils-installing-scripts: Installing Scripts ================== @@ -449,6 +450,11 @@ scripts=['scripts/xmlproc_parse', 'scripts/xmlproc_val'] ) +.. versionchanged:: 2.7 + All the scripts will also be added to the ``MANIFEST`` + file if no template is provided. See :ref:`manifest`. + +.. _distutils-installing-package-data: Installing Package Data ======================= @@ -491,6 +497,13 @@ ) +.. versionchanged:: 2.7 + All the files that match ``package_data`` will be added to the ``MANIFEST`` + file if no template is provided. See :ref:`manifest`. + + +.. _distutils-additional-files: + Installing Additional Files =========================== @@ -525,6 +538,11 @@ files directly in the target directory, an empty string should be given as the directory. +.. versionchanged:: 2.7 + All the files that match ``data_files`` will be added to the ``MANIFEST`` + file if no template is provided. See :ref:`manifest`. + + .. _meta-data: Modified: python/branches/io-c/Doc/distutils/sourcedist.rst ============================================================================== --- python/branches/io-c/Doc/distutils/sourcedist.rst (original) +++ python/branches/io-c/Doc/distutils/sourcedist.rst Wed Feb 25 13:53:37 2009 @@ -74,6 +74,7 @@ :meth:`get_source_files` method in :file:`build_clib.py`! **\*\***) * scripts identified by the :option:`scripts` option + See :ref:`distutils-installing-scripts`. * anything that looks like a test script: :file:`test/test\*.py` (currently, the Distutils don't do anything with test scripts except include them in source @@ -83,6 +84,12 @@ * :file:`README.txt` (or :file:`README`), :file:`setup.py` (or whatever you called your setup script), and :file:`setup.cfg` +* all files that matches the ``package_data`` metadata. + See :ref:`distutils-installing-package-data`. + +* all files that matches the ``data_files`` metadata. + See :ref:`distutils-additional-files`. + Sometimes this is enough, but usually you will want to specify additional files to distribute. The typical way to do this is to write a *manifest template*, called :file:`MANIFEST.in` by default. The manifest template is just a list of Modified: python/branches/io-c/Doc/howto/webservers.rst ============================================================================== --- python/branches/io-c/Doc/howto/webservers.rst (original) +++ python/branches/io-c/Doc/howto/webservers.rst Wed Feb 25 13:53:37 2009 @@ -426,7 +426,7 @@ user. Typically this component is represented by the templates. * The *controller*. This is the layer between the user and the model. The controller reacts on user actions (like opening some specific URL) and tells - the model to modify the data if neccessary. + the model to modify the data if necessary. While one might think that MVC is a complex design pattern, in fact it is not. It is used in Python because it has turned out to be useful for creating clean, @@ -435,9 +435,9 @@ .. note:: While not all Python frameworks explicitly support MVC, it is often trivial - to create a web site which uses the MVC pattern by seperating the data logic + to create a web site which uses the MVC pattern by separating the data logic (the model) from the user interaction logic (the controller) and the - templates (the view). That's why it is important not to write unneccessary + templates (the view). That's why it is important not to write unnecessary Python code in the templates -- it is against MVC and creates more chaos. .. seealso:: @@ -607,7 +607,7 @@ ----------------------- There is an incredible number of frameworks, so there is no way to describe them -all. It is not even neccessary, as most of these frameworks are nothing special +all. It is not even necessary, as most of these frameworks are nothing special and everything that can be done with these can also be done with one of the popular ones. @@ -679,7 +679,7 @@ Another framework that's already been mentioned is `Pylons`_. Pylons is much like TurboGears with ab even stronger emphasis on flexibility, which is bought at the cost of being more difficult to use. Nearly every component can be -exchanged, which makes it neccessary to use the documentation of every single +exchanged, which makes it necessary to use the documentation of every single component, because there are so many Pylons combinations possible that can satisfy every requirement. Pylons builds upon `Paste `_, an extensive set of tools which are handy for WSGI. Modified: python/branches/io-c/Doc/library/base64.rst ============================================================================== --- python/branches/io-c/Doc/library/base64.rst (original) +++ python/branches/io-c/Doc/library/base64.rst Wed Feb 25 13:53:37 2009 @@ -62,7 +62,8 @@ .. function:: urlsafe_b64encode(s) Encode string *s* using a URL-safe alphabet, which substitutes ``-`` instead of - ``+`` and ``_`` instead of ``/`` in the standard Base64 alphabet. + ``+`` and ``_`` instead of ``/`` in the standard Base64 alphabet. The result + can still contain ``=``. .. function:: urlsafe_b64decode(s) Modified: python/branches/io-c/Doc/library/collections.rst ============================================================================== --- python/branches/io-c/Doc/library/collections.rst (original) +++ python/branches/io-c/Doc/library/collections.rst Wed Feb 25 13:53:37 2009 @@ -14,11 +14,8 @@ __name__ = '' This module implements high-performance container datatypes. Currently, -there are two datatypes, :class:`deque` and :class:`defaultdict`, and -one datatype factory function, :func:`namedtuple`. This module also -provides the :class:`UserDict` and :class:`UserList` classes which may -be useful when inheriting directly from :class:`dict` or -:class:`list` isn't convenient. +there are three datatypes, :class:`Counter`, :class:`deque` and +:class:`defaultdict`, and one datatype factory function, :func:`namedtuple`. The specialized containers provided in this module provide alternatives to Python's general purpose built-in containers, :class:`dict`, @@ -26,8 +23,8 @@ In addition to containers, the collections module provides some ABCs (abstract base classes) that can be used to test whether a class -provides a particular interface, for example, is it hashable or -a mapping, and some of them can also be used as mixin classes. +provides a particular interface, for example, whether it is hashable or +a mapping. ABCs - abstract base classes ---------------------------- Modified: python/branches/io-c/Doc/library/dis.rst ============================================================================== --- python/branches/io-c/Doc/library/dis.rst (original) +++ python/branches/io-c/Doc/library/dis.rst Wed Feb 25 13:53:37 2009 @@ -595,16 +595,26 @@ Increments bytecode counter by *delta*. -.. opcode:: JUMP_IF_TRUE (delta) +.. opcode:: POP_JUMP_IF_TRUE (target) - If TOS is true, increment the bytecode counter by *delta*. TOS is left on the - stack. + If TOS is true, sets the bytecode counter to *target*. TOS is popped. -.. opcode:: JUMP_IF_FALSE (delta) +.. opcode:: POP_JUMP_IF_FALSE (target) - If TOS is false, increment the bytecode counter by *delta*. TOS is not - changed. + If TOS is false, sets the bytecode counter to *target*. TOS is popped. + + +.. opcode:: JUMP_IF_TRUE_OR_POP (target) + + If TOS is true, sets the bytecode counter to *target* and leaves TOS + on the stack. Otherwise (TOS is false), TOS is popped. + + +.. opcode:: JUMP_IF_FALSE_OR_POP (target) + + If TOS is false, sets the bytecode counter to *target* and leaves + TOS on the stack. Otherwise (TOS is true), TOS is popped. .. opcode:: JUMP_ABSOLUTE (target) Modified: python/branches/io-c/Doc/library/exceptions.rst ============================================================================== --- python/branches/io-c/Doc/library/exceptions.rst (original) +++ python/branches/io-c/Doc/library/exceptions.rst Wed Feb 25 13:53:37 2009 @@ -348,6 +348,11 @@ more precise exception such as :exc:`IndexError`. +.. exception:: VMSError + + Only available on VMS. Raised when a VMS-specific error occurs. + + .. exception:: WindowsError Raised when a Windows-specific error occurs or when the error number does not Modified: python/branches/io-c/Doc/library/functions.rst ============================================================================== --- python/branches/io-c/Doc/library/functions.rst (original) +++ python/branches/io-c/Doc/library/functions.rst Wed Feb 25 13:53:37 2009 @@ -380,6 +380,9 @@ not ``None`` and ``(item for item in iterable if item)`` if function is ``None``. + See :func:`itertools.filterfalse` for the complementary function that returns + elements of *iterable* for which *function* returns false. + .. function:: float([x]) @@ -412,14 +415,15 @@ pair: str; format single: __format__ - Convert a string or a number to a "formatted" representation, as controlled - by *format_spec*. The interpretation of *format_spec* will depend on the - type of the *value* argument, however there is a standard formatting syntax - that is used by most built-in types: :ref:`formatspec`. + Convert a *value* to a "formatted" representation, as controlled by + *format_spec*. The interpretation of *format_spec* will depend on the type + of the *value* argument, however there is a standard formatting syntax that + is used by most built-in types: :ref:`formatspec`. .. note:: - ``format(value, format_spec)`` merely calls ``value.__format__(format_spec)``. + ``format(value, format_spec)`` merely calls + ``value.__format__(format_spec)``. .. function:: frozenset([iterable]) @@ -595,7 +599,8 @@ yielding the results. If additional *iterable* arguments are passed, *function* must take that many arguments and is applied to the items from all iterables in parallel. With multiple iterables, the iterator stops when the - shortest iterable is exhausted. + shortest iterable is exhausted. For cases where the function inputs are + already arranged into argument tuples, see :func:`itertools.starmap`\. .. function:: max(iterable[, args...], *[, key]) @@ -953,7 +958,8 @@ default). They have no other explicit functionality; however they are used by Numerical Python and other third party extensions. Slice objects are also generated when extended indexing syntax is used. For example: - ``a[start:stop:step]`` or ``a[start:stop, i]``. + ``a[start:stop:step]`` or ``a[start:stop, i]``. See :func:`itertools.islice` + for an alternate version that returns an iterator. .. function:: sorted(iterable[, key[, reverse]]) @@ -968,6 +974,9 @@ *reverse* is a boolean value. If set to ``True``, then the list elements are sorted as if each comparison were reversed. + To convert an old-style *cmp* function to a *key* function, see the + `CmpToKey recipe in the ASPN cookbook + `_\. .. function:: staticmethod(function) @@ -1030,32 +1039,40 @@ Sums *start* and the items of an *iterable* from left to right and returns the total. *start* defaults to ``0``. The *iterable*'s items are normally numbers, and are not allowed to be strings. The fast, correct way to concatenate a - sequence of strings is by calling ``''.join(sequence)``. + sequence of strings is by calling ``''.join(sequence)``. To add floating + point values with extended precision, see :func:`math.fsum`\. .. function:: super([type[, object-or-type]]) - Return a *super* object that acts as a proxy to superclasses of *type*. + Return a proxy object that delegates method calls to a parent or sibling + class of *type*. This is useful for accessing inherited methods that have + been overridden in a class. The search order is same as that used by + :func:`getattr` except that the *type* itself is skipped. + + The :attr:`__mro__` attribute of the *type* lists the method resolution + search order used by both :func:`getattr` and :func:`super`. The attribute + is dynamic and can change whenever the inheritance hierarchy is updated. - If the second argument is omitted the super object returned is unbound. If + If the second argument is omitted, the super object returned is unbound. If the second argument is an object, ``isinstance(obj, type)`` must be true. If - the second argument is a type, ``issubclass(type2, type)`` must be true. - Calling :func:`super` without arguments is equivalent to ``super(this_class, - first_arg)``. + the second argument is a type, ``issubclass(type2, type)`` must be true (this + is useful for classmethods). - There are two typical use cases for :func:`super`. In a class hierarchy with - single inheritance, :func:`super` can be used to refer to parent classes without + There are two typical use cases for *super*. In a class hierarchy with + single inheritance, *super* can be used to refer to parent classes without naming them explicitly, thus making the code more maintainable. This use - closely parallels the use of "super" in other programming languages. + closely parallels the use of *super* in other programming languages. - The second use case is to support cooperative multiple inheritence in a + The second use case is to support cooperative multiple inheritance in a dynamic execution environment. This use case is unique to Python and is not found in statically compiled languages or languages that only support single inheritance. This makes in possible to implement "diamond diagrams" where multiple base classes implement the same method. Good design dictates that this method have the same calling signature in every case (because the - order of parent calls is determined at runtime and because that order adapts - to changes in the class hierarchy). + order of calls is determined at runtime, because that order adapts + to changes in the class hierarchy, and because that order can include + sibling classes that are unknown prior to runtime). For both use cases, a typical superclass call looks like this:: @@ -1066,12 +1083,12 @@ Note that :func:`super` is implemented as part of the binding process for explicit dotted attribute lookups such as ``super().__getitem__(name)``. It does so by implementing its own :meth:`__getattribute__` method for searching - parent classes in a predictable order that supports cooperative multiple inheritance. + classes in a predictable order that supports cooperative multiple inheritance. Accordingly, :func:`super` is undefined for implicit lookups using statements or operators such as ``super()[name]``. - Also note that :func:`super` is not limited to use inside methods. The - two argument specifies the arguments exactly and makes the appropriate + Also note that :func:`super` is not limited to use inside methods. The two + argument form specifies the arguments exactly and makes the appropriate references. The zero argument form automatically searches the stack frame for the class (``__class__``) and the first argument. @@ -1142,8 +1159,7 @@ # zip('ABCD', 'xy') --> Ax By iterables = map(iter, iterables) while iterables: - result = [it.next() for it in iterables] - yield tuple(result) + yield tuple(map(next, iterables)) The left-to-right evaluation order of the iterables is guaranteed. This makes possible an idiom for clustering a data series into n-length groups Modified: python/branches/io-c/Doc/library/importlib.rst ============================================================================== --- python/branches/io-c/Doc/library/importlib.rst (original) +++ python/branches/io-c/Doc/library/importlib.rst Wed Feb 25 13:53:37 2009 @@ -18,12 +18,12 @@ :func:`__import__` function) in Python source code. This provides an implementaiton of :keyword:`import` which is portable to any Python interpreter. This also provides a reference implementation which is easier to -read than one in a programming language other than Python. +comprehend than one in a programming language other than Python. Two, the components to implement :keyword:`import` can be exposed in this package, making it easier for users to create their own custom objects (known -generically as importers) to participate in the import process. Details on -providing custom importers can be found in :pep:`302`. +generically as an :term:`importer`) to participate in the import process. +Details on providing custom importers can be found in :pep:`302`. .. seealso:: @@ -126,3 +126,61 @@ Class method that allows this class to be a :term:`loader` for frozen modules. + + +.. class:: PathFinder + + :term:`Finder` for :data:`sys.path`. + + This class does not perfectly mirror the semantics of :keyword:`import` in + terms of :data:`sys.path`. No implicit path hooks are assumed for + simplification of the class and its semantics. + + Only class method are defined by this class to alleviate the need for + instantiation. + + .. classmethod:: find_module(fullname, path=None) + + Class method that attempts to find a :term:`loader` for the module + specified by *fullname* either on :data:`sys.path` or, if defined, on + *path*. For each path entry that is searched, + :data:`sys.path_importer_cache` is checked. If an non-false object is + found then it is used as the :term:`finder` to query for the module + being searched for. For no entry is found in + :data:`sys.path_importer_cache`, then :data:`sys.path_hooks` is + searched for a finder for the path entry and, if found, is stored in + :data:`sys.path_importer_cache` along with being queried about the + module. + + +:mod:`importlib.util` -- Utility code for importers +--------------------------------------------------- + +.. module:: importlib.util + :synopsis: Importers and path hooks + +This module contains the various objects that help in the construction of +an :term:`importer`. + +.. function:: module_for_loader(method) + + A :term:`decorator` for a :term:`loader` which handles selecting the proper + module object to load with. The decorated method is expected to have a call + signature of ``method(self, module_object)`` for which the second argument + will be the module object to be used (note that the decorator will not work + on static methods because of the assumption of two arguments). + + The decorated method will take in the name of the module to be loaded as + normal. If the module is not found in :data:`sys.modules` then a new one is + constructed with its :attr:`__name__` attribute set. Otherwise the module + found in :data:`sys.modules` will be passed into the method. If an + exception is raised by the decorated method and a module was added to + :data:`sys.modules` it will be removed to prevent a partially initialized + module from being in left in :data:`sys.modules` If an exception is raised + by the decorated method and a module was added to :data:`sys.modules` it + will be removed to prevent a partially initialized module from being in + left in :data:`sys.modules`. If the module was already in + :data:`sys.modules` then it is left alone. + + Use of this decorator handles all the details of what module a loader + should use as specified by :pep:`302`. Modified: python/branches/io-c/Doc/library/io.rst ============================================================================== --- python/branches/io-c/Doc/library/io.rst (original) +++ python/branches/io-c/Doc/library/io.rst Wed Feb 25 13:53:37 2009 @@ -13,7 +13,7 @@ At the top of the I/O hierarchy is the abstract base class :class:`IOBase`. It defines the basic interface to a stream. Note, however, that there is no -seperation between reading and writing to streams; implementations are allowed +separation between reading and writing to streams; implementations are allowed to throw an :exc:`IOError` if they do not support a given operation. Extending :class:`IOBase` is :class:`RawIOBase` which deals simply with the @@ -611,7 +611,7 @@ is enabled. With this enabled, on input, the lines endings ``'\n'``, ``'\r'``, or ``'\r\n'`` are translated to ``'\n'`` before being returned to the caller. Conversely, on output, ``'\n'`` is translated to the system - default line seperator, :data:`os.linesep`. If *newline* is any other of its + default line separator, :data:`os.linesep`. If *newline* is any other of its legal values, that newline becomes the newline when the file is read and it is returned untranslated. On output, ``'\n'`` is converted to the *newline*. Modified: python/branches/io-c/Doc/library/itertools.rst ============================================================================== --- python/branches/io-c/Doc/library/itertools.rst (original) +++ python/branches/io-c/Doc/library/itertools.rst Wed Feb 25 13:53:37 2009 @@ -13,39 +13,61 @@ from itertools import * -This module implements a number of :term:`iterator` building blocks inspired by -constructs from the Haskell and SML programming languages. Each has been recast -in a form suitable for Python. +This module implements a number of :term:`iterator` building blocks inspired +by constructs from APL, Haskell, and SML. Each has been recast in a form +suitable for Python. The module standardizes a core set of fast, memory efficient tools that are -useful by themselves or in combination. Standardization helps avoid the -readability and reliability problems which arise when many different individuals -create their own slightly varying implementations, each with their own quirks -and naming conventions. - -The tools are designed to combine readily with one another. This makes it easy -to construct more specialized tools succinctly and efficiently in pure Python. +useful by themselves or in combination. Together, they form an "iterator +algebra" making it possible to construct specialized tools succinctly and +efficiently in pure Python. For instance, SML provides a tabulation tool: ``tabulate(f)`` which produces a sequence ``f(0), f(1), ...``. But, this effect can be achieved in Python by combining :func:`map` and :func:`count` to form ``map(f, count())``. -Likewise, the functional tools are designed to work well with the high-speed -functions provided by the :mod:`operator` module. - -Whether cast in pure python form or compiled code, tools that use iterators are -more memory efficient (and often faster) than their list based counterparts. Adopting -the principles of just-in-time manufacturing, they create data when and where -needed instead of consuming memory with the computer equivalent of "inventory". - - -.. seealso:: - - The Standard ML Basis Library, `The Standard ML Basis Library - `_. - - Haskell, A Purely Functional Language, `Definition of Haskell and the Standard - Libraries `_. +The tools also work well with the high-speed functions in the :mod:`operator` +module. For example, the plus-operator can be mapped across two vectors to +form an efficient dot-product: ``sum(map(operator.add, vector1, vector2))``. + + +**Infinite Iterators:** + + ================== ================= ================================================= + Iterator Arguments Results + ================== ================= ================================================= + :func:`count` start, [step] start, start+step, start+2*step, ... + :func:`cycle` p p0, p1, ... plast, p0, p1, ... + :func:`repeat` elem [,n] elem, elem, elem, ... endlessly or up to n times + ================== ================= ================================================= + +**Iterators terminating on the shortest input sequence:** + + ==================== ============================ ================================================= + Iterator Arguments Results + ==================== ============================ ================================================= + :func:`chain` p, q, ... p0, p1, ... plast, q0, q1, ... + :func:`compress` data, selectors (d[0] if s[0]), (d[1] if s[1]), ... + :func:`dropwhile` pred, seq seq[n], seq[n+1], starting when pred fails + :func:`filterfalse` pred, seq elements of seq where pred(elem) is False + :func:`groupby` iterable[, keyfunc] sub-iterators grouped by value of keyfunc(v) + :func:`islice` seq, [start,] stop [, step] elements from seq[start:stop:step] + :func:`starmap` func, seq func(\*seq[0]), fun(\*seq[1]), ... + :func:`tee` it, n it1, it2 , ... itn splits one iterator into n + :func:`takewhile` pred, seq seq[0], seq[1], until pred fails + :func:`zip_longest` p, q, ... (p[0], q[0]), (p[1], q[1]), ... + ==================== ============================ ================================================= + +**Combinatoric generators:** + + ===================================== ==================== ================================================= + Iterator Arguments Results + ===================================== ==================== ================================================= + :func:`product` p, q, ... [repeat=1] cartesian product + :func:`permutations` p[, r] r-length permutations (without repeated elements) + :func:`combinations` p[, r] r-length combinations (sorted and no repeats) + :func:`combinations_with_replacement` p[, r] r-length combinations (sorted but with repeats) + ===================================== ==================== ================================================= .. _itertools-functions: @@ -108,7 +130,7 @@ return indices = list(range(r)) yield tuple(pool[i] for i in indices) - while 1: + while True: for i in reversed(range(r)): if indices[i] != i + n - r: break @@ -156,7 +178,7 @@ return indices = [0] * r yield tuple(pool[i] for i in indices) - while 1: + while True: for i in reversed(range(r)): if indices[i] != n - 1: break @@ -304,14 +326,14 @@ return self def __next__(self): while self.currkey == self.tgtkey: - self.currvalue = next(self.it) # Exit on StopIteration + self.currvalue = next(self.it) # Exit on StopIteration self.currkey = self.keyfunc(self.currvalue) self.tgtkey = self.currkey return (self.currkey, self._grouper(self.tgtkey)) def _grouper(self, tgtkey): while self.currkey == tgtkey: yield self.currvalue - self.currvalue = next(self.it) # Exit on StopIteration + self.currvalue = next(self.it) # Exit on StopIteration self.currkey = self.keyfunc(self.currvalue) @@ -479,28 +501,28 @@ .. function:: tee(iterable[, n=2]) - Return *n* independent iterators from a single iterable. The case where ``n==2`` - is equivalent to:: + Return *n* independent iterators from a single iterable. Equivalent to:: - def tee(iterable): - def gen(next, data={}): - for i in count(): - if i in data: - yield data.pop(i) - else: - data[i] = next() - yield data[i] - it = iter(iterable) - return (gen(it.__next__), gen(it.__next__)) - - Note, once :func:`tee` has made a split, the original *iterable* should not be - used anywhere else; otherwise, the *iterable* could get advanced without the tee - objects being informed. - - Note, this member of the toolkit may require significant auxiliary storage - (depending on how much temporary data needs to be stored). In general, if one - iterator is going to use most or all of the data before the other iterator, it - is faster to use :func:`list` instead of :func:`tee`. + def tee(iterable, n=2): + it = iter(iterable) + deques = [collections.deque() for i in range(n)] + def gen(mydeque): + while True: + if not mydeque: # when the local deque is empty + newval = next(it) # fetch a new value and + for d in deques: # load it to all the deques + d.append(newval) + yield mydeque.popleft() + return tuple(gen(d) for d in deques) + + Once :func:`tee` has made a split, the original *iterable* should not be + used anywhere else; otherwise, the *iterable* could get advanced without + the tee objects being informed. + + This itertool may require significant auxiliary storage (depending on how + much temporary data needs to be stored). In general, if one iterator uses + most or all of the data before another iterator starts, it is faster to use + :func:`list` instead of :func:`tee`. .. function:: zip_longest(*iterables[, fillvalue]) @@ -593,9 +615,9 @@ "Return function(0), function(1), ..." return map(function, count(start)) - def nth(iterable, n): - "Returns the nth item or None" - return next(islice(iterable, n, None), None) + def nth(iterable, n, default=None): + "Returns the nth item or a default value" + return next(islice(iterable, n, None), default) def quantify(iterable, pred=bool): "Count how many times the predicate is true" @@ -630,8 +652,7 @@ def pairwise(iterable): "s -> (s0,s1), (s1,s2), (s2, s3), ..." a, b = tee(iterable) - for elem in b: - break + next(b, None) return zip(a, b) def grouper(n, iterable, fillvalue=None): Modified: python/branches/io-c/Doc/library/math.rst ============================================================================== --- python/branches/io-c/Doc/library/math.rst (original) +++ python/branches/io-c/Doc/library/math.rst Wed Feb 25 13:53:37 2009 @@ -80,14 +80,22 @@ .. function:: fsum(iterable) Return an accurate floating point sum of values in the iterable. Avoids - loss of precision by tracking multiple intermediate partial sums. The - algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the - typical case where the rounding mode is half-even. + loss of precision by tracking multiple intermediate partial sums:: - .. note:: - - The accuracy of fsum() may be impaired on builds that use - extended precision addition and then double-round the results. + >>> sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1]) + 0.99999999999999989 + >>> fsum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1]) + 1.0 + + The algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the + typical case where the rounding mode is half-even. On some non-Windows + builds, the underlying C library uses extended precision addition and may + occasionally double-round an intermediate sum causing it to be off in its + least significant bit. + + For further discussion and two alternative approaches, see the `ASPN cookbook + recipes for accurate floating point summation + `_\. .. function:: isinf(x) Modified: python/branches/io-c/Doc/library/pty.rst ============================================================================== --- python/branches/io-c/Doc/library/pty.rst (original) +++ python/branches/io-c/Doc/library/pty.rst Wed Feb 25 13:53:37 2009 @@ -13,7 +13,7 @@ concept: starting another process and being able to write to and read from its controlling terminal programmatically. -Because pseudo-terminal handling is highly platform dependant, there is code to +Because pseudo-terminal handling is highly platform dependent, there is code to do it only for SGI and Linux. (The Linux code is supposed to work on other platforms, but hasn't been tested yet.) Modified: python/branches/io-c/Doc/library/random.rst ============================================================================== --- python/branches/io-c/Doc/library/random.rst (original) +++ python/branches/io-c/Doc/library/random.rst Wed Feb 25 13:53:37 2009 @@ -32,7 +32,7 @@ Class :class:`Random` can also be subclassed if you want to use a different basic generator of your own devising: in that case, override the :meth:`random`, -:meth:`seed`, :meth:`getstate`, and :meth:`setstate`. +:meth:`seed`, :meth:`getstate`, and :meth:`setstate` methods. Optionally, a new generator can supply a :meth:`getrandbits` method --- this allows :meth:`randrange` to produce selections over an arbitrarily large range. @@ -66,17 +66,6 @@ the time :func:`setstate` was called. -.. function:: jumpahead(n) - - Change the internal state to one different from and likely far away from the - current state. *n* is a non-negative integer which is used to scramble the - current state vector. This is most useful in multi-threaded programs, in - conjunction with multiple instances of the :class:`Random` class: - :meth:`setstate` or :meth:`seed` can be used to force all instances into the - same internal state, and then :meth:`jumpahead` can be used to force the - instances' states far apart. - - .. function:: getrandbits(k) Returns a python integer with *k* random bits. This method is supplied with @@ -96,7 +85,8 @@ .. function:: randint(a, b) - Return a random integer *N* such that ``a <= N <= b``. + Return a random integer *N* such that ``a <= N <= b``. Alias for + ``randrange(a, b+1)``. Functions for sequences: @@ -228,7 +218,7 @@ Class that uses the :func:`os.urandom` function for generating random numbers from sources provided by the operating system. Not available on all systems. Does not rely on software state and sequences are not reproducible. Accordingly, - the :meth:`seed` and :meth:`jumpahead` methods have no effect and are ignored. + the :meth:`seed` method has no effect and is ignored. The :meth:`getstate` and :meth:`setstate` methods raise :exc:`NotImplementedError` if called. Modified: python/branches/io-c/Doc/library/socket.rst ============================================================================== --- python/branches/io-c/Doc/library/socket.rst (original) +++ python/branches/io-c/Doc/library/socket.rst Wed Feb 25 13:53:37 2009 @@ -673,12 +673,13 @@ Some notes on socket blocking and timeouts: A socket object can be in one of three modes: blocking, non-blocking, or timeout. Sockets are always created in -blocking mode. In blocking mode, operations block until complete. In +blocking mode. In blocking mode, operations block until complete or +the system returns an error (such as connection timed out). In non-blocking mode, operations fail (with an error that is unfortunately system-dependent) if they cannot be completed immediately. In timeout mode, operations fail if they cannot be completed within the timeout specified for the -socket. The :meth:`setblocking` method is simply a shorthand for certain -:meth:`settimeout` calls. +socket or if the system returns an error. The :meth:`setblocking` method is simply +a shorthand for certain :meth:`settimeout` calls. Timeout mode internally sets the socket in non-blocking mode. The blocking and timeout modes are shared between file descriptors and socket objects that refer @@ -689,7 +690,9 @@ Note that the :meth:`connect` operation is subject to the timeout setting, and in general it is recommended to call :meth:`settimeout` before calling -:meth:`connect`. +:meth:`connect` or pass a timeout parameter to :meth:`create_connection`. +The system network stack may return a connection timeout error +of its own regardless of any python socket timeout setting. .. method:: socket.setsockopt(level, optname, value) Modified: python/branches/io-c/Doc/library/socketserver.rst ============================================================================== --- python/branches/io-c/Doc/library/socketserver.rst (original) +++ python/branches/io-c/Doc/library/socketserver.rst Wed Feb 25 13:53:37 2009 @@ -508,7 +508,7 @@ # Exit the server thread when the main thread terminates server_thread.setDaemon(True) server_thread.start() - print("Server loop running in thread:", server_thread.getName()) + print("Server loop running in thread:", server_thread.name) client(ip, port, b"Hello World 1") client(ip, port, b"Hello World 2") Modified: python/branches/io-c/Doc/library/subprocess.rst ============================================================================== --- python/branches/io-c/Doc/library/subprocess.rst (original) +++ python/branches/io-c/Doc/library/subprocess.rst Wed Feb 25 13:53:37 2009 @@ -174,9 +174,9 @@ To capture standard error in the result, use stderr=subprocess.STDOUT. >>> subprocess.check_output( - ["/bin/sh", "-c", "ls non_existant_file ; exit 0"], + ["/bin/sh", "-c", "ls non_existent_file ; exit 0"], stderr=subprocess.STDOUT) - 'ls: non_existant_file: No such file or directory\n' + 'ls: non_existent_file: No such file or directory\n' .. versionadded:: 3.1 Modified: python/branches/io-c/Doc/reference/expressions.rst ============================================================================== --- python/branches/io-c/Doc/reference/expressions.rst (original) +++ python/branches/io-c/Doc/reference/expressions.rst Wed Feb 25 13:53:37 2009 @@ -785,14 +785,14 @@ .. _unary: -Unary arithmetic operations -=========================== +Unary arithmetic and bitwise operations +======================================= .. index:: triple: unary; arithmetic; operation triple: unary; bitwise; operation -All unary arithmetic (and bitwise) operations have the same priority: +All unary arithmetic and bitwise operations have the same priority: .. productionlist:: u_expr: `power` | "-" `u_expr` | "+" `u_expr` | "~" `u_expr` @@ -1240,56 +1240,46 @@ left to right --- see section :ref:`comparisons` --- and exponentiation, which groups from right to left). -+----------------------------------------------+-------------------------------------+ -| Operator | Description | -+==============================================+=====================================+ -| :keyword:`lambda` | Lambda expression | -+----------------------------------------------+-------------------------------------+ -| :keyword:`or` | Boolean OR | -+----------------------------------------------+-------------------------------------+ -| :keyword:`and` | Boolean AND | -+----------------------------------------------+-------------------------------------+ -| :keyword:`not` *x* | Boolean NOT | -+----------------------------------------------+-------------------------------------+ -| :keyword:`in`, :keyword:`not` :keyword:`in` | Membership tests | -+----------------------------------------------+-------------------------------------+ -| :keyword:`is`, :keyword:`is not` | Identity tests | -+----------------------------------------------+-------------------------------------+ -| ``<``, ``<=``, ``>``, ``>=``, ``!=``, ``==`` | Comparisons | -+----------------------------------------------+-------------------------------------+ -| ``|`` | Bitwise OR | -+----------------------------------------------+-------------------------------------+ -| ``^`` | Bitwise XOR | -+----------------------------------------------+-------------------------------------+ -| ``&`` | Bitwise AND | -+----------------------------------------------+-------------------------------------+ -| ``<<``, ``>>`` | Shifts | -+----------------------------------------------+-------------------------------------+ -| ``+``, ``-`` | Addition and subtraction | -+----------------------------------------------+-------------------------------------+ -| ``*``, ``/``, ``//``, ``%`` | Multiplication, division, remainder | -+----------------------------------------------+-------------------------------------+ -| ``+x``, ``-x`` | Positive, negative | -+----------------------------------------------+-------------------------------------+ -| ``~x`` | Bitwise not | -+----------------------------------------------+-------------------------------------+ -| ``**`` | Exponentiation | -+----------------------------------------------+-------------------------------------+ -| ``x[index]`` | Subscription | -+----------------------------------------------+-------------------------------------+ -| ``x[index:index]`` | Slicing | -+----------------------------------------------+-------------------------------------+ -| ``x(arguments...)`` | Call | -+----------------------------------------------+-------------------------------------+ -| ``x.attribute`` | Attribute reference | -+----------------------------------------------+-------------------------------------+ -| ``(expressions...)`` | Binding, tuple display, generator | -| | expressions | -+----------------------------------------------+-------------------------------------+ -| ``[expressions...]`` | List display | -+----------------------------------------------+-------------------------------------+ -| ``{expressions...}`` | Dictionary or set display | -+----------------------------------------------+-------------------------------------+ + ++-----------------------------------------------+-------------------------------------+ +| Operator | Description | ++===============================================+=====================================+ +| :keyword:`lambda` | Lambda expression | ++-----------------------------------------------+-------------------------------------+ +| :keyword:`or` | Boolean OR | ++-----------------------------------------------+-------------------------------------+ +| :keyword:`and` | Boolean AND | ++-----------------------------------------------+-------------------------------------+ +| :keyword:`not` *x* | Boolean NOT | ++-----------------------------------------------+-------------------------------------+ +| :keyword:`in`, :keyword:`not` :keyword:`in`, | Comparisons, including membership | +| :keyword:`is`, :keyword:`is not`, ``<``, | tests and identity tests, | +| ``<=``, ``>``, ``>=``, ``<>``, ``!=``, ``==`` | | ++-----------------------------------------------+-------------------------------------+ +| ``|`` | Bitwise OR | ++-----------------------------------------------+-------------------------------------+ +| ``^`` | Bitwise XOR | ++-----------------------------------------------+-------------------------------------+ +| ``&`` | Bitwise AND | ++-----------------------------------------------+-------------------------------------+ +| ``<<``, ``>>`` | Shifts | ++-----------------------------------------------+-------------------------------------+ +| ``+``, ``-`` | Addition and subtraction | ++-----------------------------------------------+-------------------------------------+ +| ``*``, ``/``, ``//``, ``%`` | Multiplication, division, remainder | ++-----------------------------------------------+-------------------------------------+ +| ``+x``, ``-x``, ``~x`` | Positive, negative, bitwise NOT | ++-----------------------------------------------+-------------------------------------+ +| ``**`` | Exponentiation [#]_ | ++-----------------------------------------------+-------------------------------------+ +| ``x[index]``, ``x[index:index]``, | Subscription, slicing, | +| ``x(arguments...)``, ``x.attribute`` | call, attribute reference | ++-----------------------------------------------+-------------------------------------+ +| ``(expressions...)``, | Binding or tuple display, | +| ``[expressions...]``, | list display, | +| ``{key:datum...}``, | dictionary display, | ++-----------------------------------------------+-------------------------------------+ + .. rubric:: Footnotes @@ -1327,3 +1317,6 @@ descriptors, you may notice seemingly unusual behaviour in certain uses of the :keyword:`is` operator, like those involving comparisons between instance methods, or constants. Check their documentation for more info. + +.. [#] The power operator ``**`` binds less tightly than an arithmetic or + bitwise unary operator on its right, that is, ``2**-1`` is ``0.5``. Modified: python/branches/io-c/Doc/reference/introduction.rst ============================================================================== --- python/branches/io-c/Doc/reference/introduction.rst (original) +++ python/branches/io-c/Doc/reference/introduction.rst Wed Feb 25 13:53:37 2009 @@ -66,8 +66,7 @@ An alternate Python for .NET. Unlike Python.NET, this is a complete Python implementation that generates IL, and compiles Python code directly to .NET assemblies. It was created by Jim Hugunin, the original creator of Jython. For - more information, see `the IronPython website - `_. + more information, see `the IronPython website `_. PyPy An implementation of Python written in Python; even the bytecode interpreter is Modified: python/branches/io-c/Doc/reference/simple_stmts.rst ============================================================================== --- python/branches/io-c/Doc/reference/simple_stmts.rst (original) +++ python/branches/io-c/Doc/reference/simple_stmts.rst Wed Feb 25 13:53:37 2009 @@ -116,7 +116,12 @@ * If the target list is a single target: The object is assigned to that target. -* If the target list is a comma-separated list of targets: +* If the target list is a comma-separated list of targets: The object must be an + iterable with the same number of items as there are targets in the target list, + and the items are assigned, from left to right, to the corresponding targets. + (This rule is relaxed as of Python 1.5; in earlier versions, the object had to + be a tuple. Since strings are sequences, an assignment like ``a, b = "xy"`` is + now legal as long as the string has the right length.) * If the target list contains one target prefixed with an asterisk, called a "starred" target: The object must be a sequence with at least as many items @@ -152,9 +157,9 @@ be deallocated and its destructor (if it has one) to be called. * If the target is a target list enclosed in parentheses or in square brackets: - The object must be a sequence with the same number of items as there are targets - in the target list, and its items are assigned, from left to right, to the - corresponding targets. + The object must be an iterable with the same number of items as there are + targets in the target list, and its items are assigned, from left to right, + to the corresponding targets. .. index:: pair: attribute; assignment @@ -503,7 +508,7 @@ :meth:`with_traceback` exception method (which returns the same exception instance, with its traceback set to its argument), like so:: - raise RuntimeError("foo occurred").with_traceback(tracebackobj) + raise Exception("foo occurred").with_traceback(tracebackobj) .. index:: pair: exception; chaining __cause__ (exception attribute) Modified: python/branches/io-c/Doc/tutorial/classes.rst ============================================================================== --- python/branches/io-c/Doc/tutorial/classes.rst (original) +++ python/branches/io-c/Doc/tutorial/classes.rst Wed Feb 25 13:53:37 2009 @@ -522,7 +522,7 @@ only works if the base class is defined or imported directly in the global scope.) -Python has two builtin functions that work with inheritance: +Python has two built-in functions that work with inheritance: * Use :func:`isinstance` to check an object's type: ``isinstance(obj, int)`` will be ``True`` only if ``obj.__class__`` is :class:`int` or some class Modified: python/branches/io-c/Doc/tutorial/datastructures.rst ============================================================================== --- python/branches/io-c/Doc/tutorial/datastructures.rst (original) +++ python/branches/io-c/Doc/tutorial/datastructures.rst Wed Feb 25 13:53:37 2009 @@ -254,7 +254,7 @@ print(row[i], end="") print() -In real world, you should prefer builtin functions to complex flow statements. +In real world, you should prefer built-in functions to complex flow statements. The :func:`zip` function would do a great job for this use case:: >>> list(zip(*mat)) Modified: python/branches/io-c/Doc/tutorial/floatingpoint.rst ============================================================================== --- python/branches/io-c/Doc/tutorial/floatingpoint.rst (original) +++ python/branches/io-c/Doc/tutorial/floatingpoint.rst Wed Feb 25 13:53:37 2009 @@ -65,7 +65,7 @@ >>> 0.1 0.1000000000000000055511151231257827021181583404541015625 -instead! The Python prompt uses the builtin :func:`repr` function to obtain a +instead! The Python prompt uses the built-in :func:`repr` function to obtain a string version of everything it displays. For floats, ``repr(float)`` rounds the true decimal value to 17 significant digits, giving :: @@ -81,7 +81,7 @@ (although some languages may not *display* the difference by default, or in all output modes). -Python's builtin :func:`str` function produces only 12 significant digits, and +Python's built-in :func:`str` function produces only 12 significant digits, and you may wish to use that instead. It's unusual for ``eval(str(x))`` to reproduce *x*, but the output may be more pleasant to look at:: Modified: python/branches/io-c/Doc/tutorial/inputoutput.rst ============================================================================== --- python/branches/io-c/Doc/tutorial/inputoutput.rst (original) +++ python/branches/io-c/Doc/tutorial/inputoutput.rst Wed Feb 25 13:53:37 2009 @@ -190,7 +190,7 @@ This is particularly useful in combination with the new built-in :func:`vars` function, which returns a dictionary containing all local variables. -For a complete overview of string formating with :meth:`str.format`, see +For a complete overview of string formatting with :meth:`str.format`, see :ref:`formatstrings`. Modified: python/branches/io-c/Doc/tutorial/stdlib.rst ============================================================================== --- python/branches/io-c/Doc/tutorial/stdlib.rst (original) +++ python/branches/io-c/Doc/tutorial/stdlib.rst Wed Feb 25 13:53:37 2009 @@ -21,12 +21,12 @@ >>> os.chdir('/server/accesslogs') Be sure to use the ``import os`` style instead of ``from os import *``. This -will keep :func:`os.open` from shadowing the builtin :func:`open` function which +will keep :func:`os.open` from shadowing the built-in :func:`open` function which operates much differently. .. index:: builtin: help -The builtin :func:`dir` and :func:`help` functions are useful as interactive +The built-in :func:`dir` and :func:`help` functions are useful as interactive aids for working with large modules like :mod:`os`:: >>> import os Modified: python/branches/io-c/Doc/whatsnew/2.7.rst ============================================================================== --- python/branches/io-c/Doc/whatsnew/2.7.rst (original) +++ python/branches/io-c/Doc/whatsnew/2.7.rst Wed Feb 25 13:53:37 2009 @@ -117,6 +117,9 @@ :file:`Misc/NEWS` file in the source tree for a more complete list of changes, or look through the Subversion logs for all the details. +* In Distutils, distutils.sdist.add_defaults now uses package_dir and data_files + to feed MANIFEST. + * It is not mandatory anymore to store clear text passwords in the :file:`.pypirc` file when registering and uploading packages to PyPI. As long as the username is present in that file, the :mod:`distutils` package will Deleted: python/branches/io-c/INTBENCH ============================================================================== --- python/branches/io-c/INTBENCH Wed Feb 25 13:53:37 2009 +++ (empty file) @@ -1,50 +0,0 @@ -Measurements of _testcapi.profile_int, on an 800MHz G3, OSX 10.4.7 -best of three runs - -r51476 (original p3yk) -Test 1: 1.601978s -Test 2: 1.696623s -Test 3: 1.900683s -Test 4: 5.307155s -Test 5: 2.546707s -Test 6: 1.670252s -Test 7: 1.910734s - -r51506 (int type dropped) -Test 1: 4.134757s -Test 2: 4.398235s -Test 3: 4.611636s -Test 4: 10.665429s - -r51509 (small int cache) -Test 1: 3.457184s -Test 2: 4.514800s -Test 3: 4.999010s -Test 4: 10.818277s - -r51452 (special-casing medium int allocation) -Test 1: 3.258219s -Test 2: 4.255007s -Test 3: 4.547923s -Test 4: 10.615123s -Test 5: 5.255545s -Test 6: 3.775941s -Test 7: 4.001805s - -r51562 (special-case one-digit operations) -Test 1: 3.527860s -Test 2: 3.975953s -Test 3: 4.226751s -Test 4: 10.605721s -Test 5: 5.233576s -Test 6: 2.161525s -Test 7: 3.421624s - -r51573 (speed up PyLong_FromLong) -Test 1: 3.149116s -Test 2: 3.948204s -Test 3: 4.012080s -Test 4: 8.589921s -Test 5: 4.481723s -Test 6: 2.259849s -Test 7: 3.453212s Modified: python/branches/io-c/Include/longintrepr.h ============================================================================== --- python/branches/io-c/Include/longintrepr.h (original) +++ python/branches/io-c/Include/longintrepr.h Wed Feb 25 13:53:37 2009 @@ -19,14 +19,14 @@ long_pow() requires that SHIFT be divisible by 5. */ typedef unsigned short digit; -typedef unsigned int wdigit; /* digit widened to parameter size */ +typedef short sdigit; /* signed variant of digit */ #define BASE_TWODIGITS_TYPE long typedef unsigned BASE_TWODIGITS_TYPE twodigits; typedef BASE_TWODIGITS_TYPE stwodigits; /* signed variant of twodigits */ #define PyLong_SHIFT 15 #define PyLong_BASE ((digit)1 << PyLong_SHIFT) -#define PyLong_MASK ((int)(PyLong_BASE - 1)) +#define PyLong_MASK ((digit)(PyLong_BASE - 1)) #if PyLong_SHIFT % 5 != 0 #error "longobject.c requires that SHIFT be divisible by 5" Modified: python/branches/io-c/Include/opcode.h ============================================================================== --- python/branches/io-c/Include/opcode.h (original) +++ python/branches/io-c/Include/opcode.h Wed Feb 25 13:53:37 2009 @@ -96,9 +96,11 @@ #define IMPORT_FROM 109 /* Index in name list */ #define JUMP_FORWARD 110 /* Number of bytes to skip */ -#define JUMP_IF_FALSE 111 /* "" */ -#define JUMP_IF_TRUE 112 /* "" */ -#define JUMP_ABSOLUTE 113 /* Target byte offset from beginning of code */ +#define JUMP_IF_FALSE_OR_POP 111 /* Target byte offset from beginning of code */ +#define JUMP_IF_TRUE_OR_POP 112 /* "" */ +#define JUMP_ABSOLUTE 113 /* "" */ +#define POP_JUMP_IF_FALSE 114 /* "" */ +#define POP_JUMP_IF_TRUE 115 /* "" */ #define LOAD_GLOBAL 116 /* Index in name list */ Modified: python/branches/io-c/Lib/_abcoll.py ============================================================================== --- python/branches/io-c/Lib/_abcoll.py (original) +++ python/branches/io-c/Lib/_abcoll.py Wed Feb 25 13:53:37 2009 @@ -546,6 +546,7 @@ Sequence.register(tuple) Sequence.register(str) +Sequence.register(range) class ByteString(Sequence): Modified: python/branches/io-c/Lib/_pyio.py ============================================================================== --- python/branches/io-c/Lib/_pyio.py (original) +++ python/branches/io-c/Lib/_pyio.py Wed Feb 25 13:53:37 2009 @@ -1319,7 +1319,7 @@ enabled. With this enabled, on input, the lines endings '\n', '\r', or '\r\n' are translated to '\n' before being returned to the caller. Conversely, on output, '\n' is translated to the system - default line seperator, os.linesep. If newline is any other of its + default line separator, os.linesep. If newline is any other of its legal values, that newline becomes the newline when the file is read and it is returned untranslated. On output, '\n' is converted to the newline. Modified: python/branches/io-c/Lib/decimal.py ============================================================================== --- python/branches/io-c/Lib/decimal.py (original) +++ python/branches/io-c/Lib/decimal.py Wed Feb 25 13:53:37 2009 @@ -7,18 +7,14 @@ # and Aahz # and Tim Peters -# This module is currently Py2.3 compatible and should be kept that way -# unless a major compelling advantage arises. IOW, 2.3 compatibility is -# strongly preferred, but not guaranteed. - -# Also, this module should be kept in sync with the latest updates of -# the IBM specification as it evolves. Those updates will be treated +# This module should be kept in sync with the latest updates of the +# IBM specification as it evolves. Those updates will be treated # as bug fixes (deviation from the spec is a compatibility, usability # bug) and will be backported. At this point the spec is stabilizing # and the updates are becoming fewer, smaller, and less significant. """ -This is a Py2.3 implementation of decimal floating point arithmetic based on +This is an implementation of decimal floating point arithmetic based on the General Decimal Arithmetic Specification: www2.hursley.ibm.com/decimal/decarith.html Modified: python/branches/io-c/Lib/difflib.py ============================================================================== --- python/branches/io-c/Lib/difflib.py (original) +++ python/branches/io-c/Lib/difflib.py Wed Feb 25 13:53:37 2009 @@ -1329,7 +1329,7 @@ (from line tuple, to line tuple, boolean flag) from/to line tuple -- (line num, line text) - line num -- integer or None (to indicate a context seperation) + line num -- integer or None (to indicate a context separation) line text -- original line text with following markers inserted: '\0+' -- marks start of added text '\0-' -- marks start of deleted text Modified: python/branches/io-c/Lib/distutils/cmd.py ============================================================================== --- python/branches/io-c/Lib/distutils/cmd.py (original) +++ python/branches/io-c/Lib/distutils/cmd.py Wed Feb 25 13:53:37 2009 @@ -436,7 +436,3 @@ def get_outputs (self): return self.outfiles - - -if __name__ == "__main__": - print("ok") Modified: python/branches/io-c/Lib/distutils/command/sdist.py ============================================================================== --- python/branches/io-c/Lib/distutils/command/sdist.py (original) +++ python/branches/io-c/Lib/distutils/command/sdist.py Wed Feb 25 13:53:37 2009 @@ -15,7 +15,7 @@ from distutils.errors import * from distutils.filelist import FileList from distutils import log - +from distutils.util import convert_path def show_formats (): """Print all possible values for the 'formats' option (used by @@ -252,6 +252,9 @@ - setup.py - test/test*.py - all pure Python modules mentioned in setup script + - all files pointed by package_data (build_py) + - all files defined in data_files. + - all files defined as scripts. - all C sources listed as part of extensions or C libraries in the setup script (doesn't catch C headers!) Warns if (README or README.txt) or setup.py are missing; everything @@ -283,10 +286,35 @@ if files: self.filelist.extend(files) + # build_py is used to get: + # - python modules + # - files defined in package_data + build_py = self.get_finalized_command('build_py') + + # getting python files if self.distribution.has_pure_modules(): - build_py = self.get_finalized_command('build_py') self.filelist.extend(build_py.get_source_files()) + # getting package_data files + # (computed in build_py.data_files by build_py.finalize_options) + for pkg, src_dir, build_dir, filenames in build_py.data_files: + for filename in filenames: + self.filelist.append(os.path.join(src_dir, filename)) + + # getting distribution.data_files + if self.distribution.has_data_files(): + for item in self.distribution.data_files: + if isinstance(item, str): # plain file + item = convert_path(item) + if os.path.isfile(item): + self.filelist.append(item) + else: # a (dirname, filenames) tuple + dirname, filenames = item + for f in filenames: + f = convert_path(f) + if os.path.isfile(f): + self.filelist.append(f) + if self.distribution.has_ext_modules(): build_ext = self.get_finalized_command('build_ext') self.filelist.extend(build_ext.get_source_files()) Modified: python/branches/io-c/Lib/distutils/dist.py ============================================================================== --- python/branches/io-c/Lib/distutils/dist.py (original) +++ python/branches/io-c/Lib/distutils/dist.py Wed Feb 25 13:53:37 2009 @@ -1180,8 +1180,3 @@ for help_tuple in options: new_options.append(help_tuple[0:3]) return new_options - - -if __name__ == "__main__": - dist = Distribution() - print("ok") Modified: python/branches/io-c/Lib/distutils/tests/support.py ============================================================================== --- python/branches/io-c/Lib/distutils/tests/support.py (original) +++ python/branches/io-c/Lib/distutils/tests/support.py Wed Feb 25 13:53:37 2009 @@ -42,6 +42,19 @@ self.tempdirs.append(d) return d + def write_file(self, path, content): + """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/io-c/Lib/distutils/tests/test_core.py ============================================================================== --- python/branches/io-c/Lib/distutils/tests/test_core.py (original) +++ python/branches/io-c/Lib/distutils/tests/test_core.py Wed Feb 25 13:53:37 2009 @@ -57,7 +57,7 @@ def test_run_setup_uses_current_dir(self): # This tests that the setup script is run with the current directory - # as it's own current directory; this was temporarily broken by a + # as its own current directory; this was temporarily broken by a # previous patch when TESTFN did not use the current directory. sys.stdout = io.StringIO() cwd = os.getcwd() Modified: python/branches/io-c/Lib/distutils/tests/test_sdist.py ============================================================================== --- python/branches/io-c/Lib/distutils/tests/test_sdist.py (original) +++ python/branches/io-c/Lib/distutils/tests/test_sdist.py Wed Feb 25 13:53:37 2009 @@ -12,6 +12,7 @@ from distutils.tests.test_config import PyPIRCCommandTestCase from distutils.errors import DistutilsExecError from distutils.spawn import find_executable +from distutils.tests import support SETUP_PY = """ from distutils.core import setup @@ -20,13 +21,23 @@ setup(name='fake') """ -MANIFEST_IN = """ -recursive-include somecode * +MANIFEST = """\ +README +inroot.txt +setup.py +data%(sep)sdata.dt +scripts%(sep)sscript.py +some%(sep)sfile.txt +some%(sep)sother_file.txt +somecode%(sep)s__init__.py +somecode%(sep)sdoc.dat +somecode%(sep)sdoc.txt """ -class sdistTestCase(PyPIRCCommandTestCase): +class sdistTestCase(support.LoggingSilencer, PyPIRCCommandTestCase): def setUp(self): + support.LoggingSilencer.setUp(self) # PyPIRCCommandTestCase creates a temp dir already # and put it in self.tmp_dir PyPIRCCommandTestCase.setUp(self) @@ -34,24 +45,34 @@ self.old_path = os.getcwd() os.mkdir(join(self.tmp_dir, 'somecode')) os.mkdir(join(self.tmp_dir, 'dist')) - # creating a MANIFEST, a package, and a README - self._write(join(self.tmp_dir, 'MANIFEST.in'), MANIFEST_IN) - self._write(join(self.tmp_dir, 'README'), 'xxx') - self._write(join(self.tmp_dir, 'somecode', '__init__.py'), '#') - self._write(join(self.tmp_dir, 'setup.py'), SETUP_PY) + # a package, and a README + self.write_file((self.tmp_dir, 'README'), 'xxx') + self.write_file((self.tmp_dir, 'somecode', '__init__.py'), '#') + self.write_file((self.tmp_dir, 'setup.py'), SETUP_PY) os.chdir(self.tmp_dir) def tearDown(self): # back to normal os.chdir(self.old_path) PyPIRCCommandTestCase.tearDown(self) + support.LoggingSilencer.tearDown(self) - def _write(self, path, content): - f = open(path, 'w') - try: - f.write(content) - finally: - f.close() + def get_cmd(self, metadata=None): + """Returns a cmd""" + if metadata is None: + metadata = {'name': 'fake', 'version': '1.0', + 'url': 'xxx', 'author': 'xxx', + 'author_email': 'xxx'} + dist = Distribution(metadata) + dist.script_name = 'setup.py' + dist.packages = ['somecode'] + dist.include_package_data = True + cmd = sdist(dist) + cmd.dist_dir = 'dist' + def _warn(*args): + pass + cmd.warn = _warn + return dist, cmd def test_prune_file_list(self): # this test creates a package with some vcs dirs in it @@ -60,33 +81,24 @@ # creating VCS directories with some files in them os.mkdir(join(self.tmp_dir, 'somecode', '.svn')) - self._write(join(self.tmp_dir, 'somecode', '.svn', 'ok.py'), 'xxx') + self.write_file((self.tmp_dir, 'somecode', '.svn', 'ok.py'), 'xxx') os.mkdir(join(self.tmp_dir, 'somecode', '.hg')) - self._write(join(self.tmp_dir, 'somecode', '.hg', + self.write_file((self.tmp_dir, 'somecode', '.hg', 'ok'), 'xxx') os.mkdir(join(self.tmp_dir, 'somecode', '.git')) - self._write(join(self.tmp_dir, 'somecode', '.git', + self.write_file((self.tmp_dir, 'somecode', '.git', 'ok'), 'xxx') # now building a sdist - dist = Distribution() - dist.script_name = 'setup.py' - dist.metadata.name = 'fake' - dist.metadata.version = '1.0' - dist.metadata.url = 'http://xxx' - dist.metadata.author = dist.metadata.author_email = 'xxx' - dist.packages = ['somecode'] - dist.include_package_data = True - cmd = sdist(dist) - cmd.manifest = 'MANIFEST' - cmd.template = 'MANIFEST.in' - cmd.dist_dir = 'dist' + dist, cmd = self.get_cmd() # zip is available universally # (tar might not be installed under win32) cmd.formats = ['zip'] + + cmd.ensure_finalized() cmd.run() # now let's check what we have @@ -111,21 +123,11 @@ return # now building a sdist - dist = Distribution() - dist.script_name = 'setup.py' - dist.metadata.name = 'fake' - dist.metadata.version = '1.0' - dist.metadata.url = 'http://xxx' - dist.metadata.author = dist.metadata.author_email = 'xxx' - dist.packages = ['somecode'] - dist.include_package_data = True - cmd = sdist(dist) - cmd.manifest = 'MANIFEST' - cmd.template = 'MANIFEST.in' - cmd.dist_dir = 'dist' + dist, cmd = self.get_cmd() # creating a gztar then a tar cmd.formats = ['gztar', 'tar'] + cmd.ensure_finalized() cmd.run() # making sure we have two files @@ -140,6 +142,8 @@ # now trying a tar then a gztar cmd.formats = ['tar', 'gztar'] + + cmd.ensure_finalized() cmd.run() result = os.listdir(dist_folder) @@ -147,6 +151,67 @@ self.assertEquals(result, ['fake-1.0.tar', 'fake-1.0.tar.gz']) + def test_add_defaults(self): + + # http://bugs.python.org/issue2279 + + # add_default should also include + # data_files and package_data + dist, cmd = self.get_cmd() + + # filling data_files by pointing files + # in package_data + dist.package_data = {'': ['*.cfg', '*.dat'], + 'somecode': ['*.txt']} + self.write_file((self.tmp_dir, 'somecode', 'doc.txt'), '#') + self.write_file((self.tmp_dir, 'somecode', 'doc.dat'), '#') + + # adding some data in data_files + data_dir = join(self.tmp_dir, 'data') + os.mkdir(data_dir) + self.write_file((data_dir, 'data.dt'), '#') + some_dir = join(self.tmp_dir, 'some') + os.mkdir(some_dir) + self.write_file((self.tmp_dir, 'inroot.txt'), '#') + self.write_file((some_dir, 'file.txt'), '#') + self.write_file((some_dir, 'other_file.txt'), '#') + + dist.data_files = [('data', ['data/data.dt', + 'inroot.txt', + 'notexisting']), + 'some/file.txt', + 'some/other_file.txt'] + + # adding a script + script_dir = join(self.tmp_dir, 'scripts') + os.mkdir(script_dir) + self.write_file((script_dir, 'script.py'), '#') + dist.scripts = [join('scripts', 'script.py')] + + cmd.formats = ['zip'] + cmd.use_defaults = True + + cmd.ensure_finalized() + cmd.run() + + # now let's check what we have + dist_folder = join(self.tmp_dir, 'dist') + files = os.listdir(dist_folder) + self.assertEquals(files, ['fake-1.0.zip']) + + zip_file = zipfile.ZipFile(join(dist_folder, 'fake-1.0.zip')) + try: + content = zip_file.namelist() + finally: + zip_file.close() + + # making sure everything was added + self.assertEquals(len(content), 11) + + # checking the MANIFEST + manifest = open(join(self.tmp_dir, 'MANIFEST')).read() + self.assertEquals(manifest, MANIFEST % {'sep': os.sep}) + def test_suite(): return unittest.makeSuite(sdistTestCase) Modified: python/branches/io-c/Lib/distutils/text_file.py ============================================================================== --- python/branches/io-c/Lib/distutils/text_file.py (original) +++ python/branches/io-c/Lib/distutils/text_file.py Wed Feb 25 13:53:37 2009 @@ -282,80 +282,3 @@ checked by future 'readline()' calls. Handy for implementing a parser with line-at-a-time lookahead.""" self.linebuf.append(line) - - -if __name__ == "__main__": - test_data = """# test file - -line 3 \\ -# intervening comment - continues on next line -""" - # result 1: no fancy options - result1 = [x + "\n" for x in test_data.split("\n")[:-1]] - - # result 2: just strip comments - result2 = ["\n", - "line 3 \\\n", - " continues on next line\n"] - - # result 3: just strip blank lines - result3 = ["# test file\n", - "line 3 \\\n", - "# intervening comment\n", - " continues on next line\n"] - - # result 4: default, strip comments, blank lines, and trailing whitespace - result4 = ["line 3 \\", - " continues on next line"] - - # result 5: strip comments and blanks, plus join lines (but don't - # "collapse" joined lines - result5 = ["line 3 continues on next line"] - - # result 6: strip comments and blanks, plus join lines (and - # "collapse" joined lines - result6 = ["line 3 continues on next line"] - - def test_input(count, description, file, expected_result): - result = file.readlines() - if result == expected_result: - print("ok %d (%s)" % (count, description)) - else: - print("not ok %d (%s):" % (count, description)) - print("** expected:") - print(expected_result) - print("** received:") - print(result) - - - filename = "test.txt" - out_file = open(filename, "w") - out_file.write(test_data) - out_file.close() - - in_file = TextFile(filename, strip_comments=0, skip_blanks=0, - lstrip_ws=0, rstrip_ws=0) - test_input(1, "no processing", in_file, result1) - - in_file = TextFile(filename, strip_comments=1, skip_blanks=0, - lstrip_ws=0, rstrip_ws=0) - test_input(2, "strip comments", in_file, result2) - - in_file = TextFile(filename, strip_comments=0, skip_blanks=1, - lstrip_ws=0, rstrip_ws=0) - test_input(3, "strip blanks", in_file, result3) - - in_file = TextFile(filename) - test_input(4, "default processing", in_file, result4) - - in_file = TextFile(filename, strip_comments=1, skip_blanks=1, - join_lines=1, rstrip_ws=1) - test_input(5, "join lines without collapsing", in_file, result5) - - in_file = TextFile(filename, strip_comments=1, skip_blanks=1, - join_lines=1, rstrip_ws=1, collapse_join=1) - test_input(6, "join lines with collapsing", in_file, result6) - - del in_file - os.remove(filename) Modified: python/branches/io-c/Lib/distutils/version.py ============================================================================== --- python/branches/io-c/Lib/distutils/version.py (original) +++ python/branches/io-c/Lib/distutils/version.py Wed Feb 25 13:53:37 2009 @@ -338,7 +338,12 @@ if isinstance(other, str): other = LooseVersion(other) - return cmp(self.version, other.version) + if self.version == other.version: + return 0 + if self.version < other.version: + return -1 + if self.version > other.version: + return 1 # end class LooseVersion Modified: python/branches/io-c/Lib/email/message.py ============================================================================== --- python/branches/io-c/Lib/email/message.py (original) +++ python/branches/io-c/Lib/email/message.py Wed Feb 25 13:53:37 2009 @@ -21,7 +21,7 @@ SEMISPACE = '; ' # Regular expression that matches `special' characters in parameters, the -# existance of which force quoting of the parameter value. +# existence of which force quoting of the parameter value. tspecials = re.compile(r'[ \(\)<>@,;:\\"/\[\]\?=]') Modified: python/branches/io-c/Lib/heapq.py ============================================================================== --- python/branches/io-c/Lib/heapq.py (original) +++ python/branches/io-c/Lib/heapq.py Wed Feb 25 13:53:37 2009 @@ -130,7 +130,6 @@ 'nlargest', 'nsmallest', 'heappushpop'] from itertools import islice, repeat, count, tee, chain -from operator import itemgetter, neg import bisect def heappush(heap, item): @@ -377,13 +376,13 @@ if key is None: it = zip(iterable, count()) # decorate result = _nsmallest(n, it) - return list(map(itemgetter(0), result)) # undecorate + return [r[0] for r in result] # undecorate # General case, slowest method in1, in2 = tee(iterable) it = zip(map(key, in1), count(), in2) # decorate result = _nsmallest(n, it) - return list(map(itemgetter(2), result)) # undecorate + return [r[2] for r in result] # undecorate _nlargest = nlargest def nlargest(n, iterable, key=None): @@ -413,15 +412,15 @@ # When key is none, use simpler decoration if key is None: - it = zip(iterable, map(neg, count())) # decorate + it = zip(iterable, count(0,-1)) # decorate result = _nlargest(n, it) - return list(map(itemgetter(0), result)) # undecorate + return [r[0] for r in result] # undecorate # General case, slowest method in1, in2 = tee(iterable) - it = zip(map(key, in1), map(neg, count()), in2) # decorate + it = zip(map(key, in1), count(0,-1), in2) # decorate result = _nlargest(n, it) - return list(map(itemgetter(2), result)) # undecorate + return [r[2] for r in result] # undecorate if __name__ == "__main__": # Simple sanity test Modified: python/branches/io-c/Lib/idlelib/AutoComplete.py ============================================================================== --- python/branches/io-c/Lib/idlelib/AutoComplete.py (original) +++ python/branches/io-c/Lib/idlelib/AutoComplete.py Wed Feb 25 13:53:37 2009 @@ -67,7 +67,7 @@ def try_open_completions_event(self, event): """Happens when it would be nice to open a completion list, but not - really neccesary, for example after an dot, so function + really necessary, for example after an dot, so function calls won't be made. """ lastchar = self.text.get("insert-1c") @@ -79,7 +79,7 @@ COMPLETE_FILES) def autocomplete_event(self, event): - """Happens when the user wants to complete his word, and if neccesary, + """Happens when the user wants to complete his word, and if necessary, open a completion list after that (if there is more than one completion) """ Modified: python/branches/io-c/Lib/idlelib/NEWS.txt ============================================================================== --- python/branches/io-c/Lib/idlelib/NEWS.txt (original) +++ python/branches/io-c/Lib/idlelib/NEWS.txt Wed Feb 25 13:53:37 2009 @@ -339,7 +339,7 @@ window raising, especially in the Windows menu and in the debugger. IDLEfork 763524. -- If user passes a non-existant filename on the commandline, just +- If user passes a non-existent filename on the commandline, just open a new file, don't raise a dialog. IDLEfork 854928. Modified: python/branches/io-c/Lib/importlib/NOTES ============================================================================== --- python/branches/io-c/Lib/importlib/NOTES (original) +++ python/branches/io-c/Lib/importlib/NOTES Wed Feb 25 13:53:37 2009 @@ -1,67 +1,74 @@ to do ///// -* Refactor source/bytecode finder/loader code such that bytecode support is a - subclass of source support (makes it nicer for VMs that don't use CPython - bytecode). - * Implement PEP 302 protocol for loaders (should just be a matter of testing). - + Built-in. - + Frozen. - + Extension. + Source/bytecode. * Public API left to expose (w/ docs!) - + abc + + abc + + - Finder + + * find_module + + - Loader + + * load_module + + - ResourceLoader(Loader) + + * get_data - - Finder + - InspectLoader(Loader) - * find_module + * is_package + * get_code + * get_source - - Loader + - (?) SourceLoader(ResourceLoader) - * load_module + * source_path + * bytecode_path + * write_bytecode (not abstract) - - (?) Importer(Finder, Loader) + + util - - ResourceLoader(Loader) + - set___package__ decorator - * get_data + + machinery - - InspectLoader(Loader) + - Extensions importers - * is_package - * get_code - * get_source + * ExtensionFinder + * (?) Loader - - (?) SourceLoader(ResourceLoader) + - Source/bytecode importers - * source_path - * bytecode_path - * write_bytecode (not abstract) + * SourceFinder + * (?) Loader - + util + + test (Really want to worry about compatibility with future versions?) - - get_module decorator (rename: module_for_loader) - - set___package__ decorator + - abc - + machinery + * FinderTests [doc] + * LoaderTests [doc] - - (?) Chained path hook/finder - - (?) FileFinder - - Extensions importers +* Remove ``import *`` from importlib.__init__. - * ExtensionFinder - * (?) Loader +* Remove __all__ from importlib._bootstrap. - - Source/bytecode importers +* Add leading underscores to all objects in importlib._bootstrap that are not + publicly exposed. - * SourceFinder - * (?) Loader +* Reorder importlib/_bootstrap.py so definitions are not in inverted order. - - PathFinder +* Make sure that there is documentation *somewhere* fully explaining the +semantics of import that can be referenced from the package's documentation +(even if it is in the package documentation itself, although it might be best +in the language specification). * Write benchmark suite. Modified: python/branches/io-c/Lib/importlib/_bootstrap.py ============================================================================== --- python/branches/io-c/Lib/importlib/_bootstrap.py (original) +++ python/branches/io-c/Lib/importlib/_bootstrap.py Wed Feb 25 13:53:37 2009 @@ -136,8 +136,13 @@ """Load a built-in module.""" if fullname not in sys.builtin_module_names: raise ImportError("{0} is not a built-in module".format(fullname)) - module = imp.init_builtin(fullname) - return module + is_reload = fullname in sys.modules + try: + return imp.init_builtin(fullname) + except: + if not is_reload and fullname in sys.modules: + del sys.modules[fullname] + raise class FrozenImporter: @@ -160,55 +165,52 @@ """Load a frozen module.""" if cls.find_module(fullname) is None: raise ImportError("{0} is not a frozen module".format(fullname)) - module = imp.init_frozen(fullname) - return module + is_reload = fullname in sys.modules + try: + return imp.init_frozen(fullname) + except: + if not is_reload and fullname in sys.modules: + del sys.modules[fullname] + raise + + +def chained_path_hook(*path_hooks): + """Create a closure which sequentially checks path hooks to see which ones + (if any) can work with a path.""" + def path_hook(entry): + """Check to see if 'entry' matches any of the enclosed path hooks.""" + finders = [] + for hook in path_hooks: + try: + finder = hook(entry) + except ImportError: + continue + else: + finders.append(finder) + if not finders: + raise ImportError("no finder found") + else: + return ChainedFinder(*finders) + + return path_hook -class ChainedImporter(object): +class ChainedFinder: """Finder that sequentially calls other finders.""" - def __init__(self, *importers): - self._importers = importers + def __init__(self, *finders): + self._finders = finders def find_module(self, fullname, path=None): - for importer in self._importers: - result = importer.find_module(fullname, path) + for finder in self._finders: + result = finder.find_module(fullname, path) if result: return result else: return None -# XXX Don't make filesystem-specific and instead make generic for any path -# hooks. -def chaining_fs_path_hook(*path_hooks): - """Create a closure which calls the path hooks sequentially looking for - which path hooks can handle a path entry. - - - Passed-in path hooks work as any other path hooks, raising ImportError if - they cannot handle the path, otherwise returning a finder. - - """ - def chained_fs_path_hook(path_entry): - """Closure which sees which of the captured path hooks can handle the - path entry.""" - absolute_path = _path_absolute(path_entry) - if not _path_isdir(absolute_path): - raise ImportError("only directories are supported") - accepted = [] - for path_hook in path_hooks: - try: - accepted.append(path_hook(absolute_path)) - except ImportError: - continue - if not accepted: - raise ImportError("no path hooks could handle %s" % path_entry) - return ChainedImporter(*accepted) - return chained_fs_path_hook - - def check_name(method): """Decorator to verify that the module being requested matches the one the loader can handle. @@ -225,11 +227,11 @@ return inner -class _ExtensionFileLoader(object): +class _ExtensionFileLoader: """Loader for extension modules. - The constructor is designed to work with FileImporter. + The constructor is designed to work with FileFinder. """ @@ -249,14 +251,13 @@ @set___package__ def load_module(self, fullname): """Load an extension module.""" - assert self._name == fullname + is_reload = fullname in sys.modules try: module = imp.load_dynamic(fullname, self._path) module.__loader__ = self return module except: - # If an error occurred, don't leave a partially initialized module. - if fullname in sys.modules: + if not is_reload and fullname in sys.modules: del sys.modules[fullname] raise @@ -282,16 +283,17 @@ if suffix[2] == suffix_type] -# XXX Need a better name. -def get_module(fxn): - """Decorator to handle selecting the proper module for load_module - implementations. +def module_for_loader(fxn): + """Decorator to handle selecting the proper module for loaders. Decorated modules are passed the module to use instead of the module name. The module is either from sys.modules if it already exists (for reloading) or is a new module which has __name__ set. If any exception is raised by - the decorated method then __loader__, __name__, __file__, and __path__ are - all restored on the module to their original values. + the decorated method and the decorator added a module to sys.modules, then + the module is deleted from sys.modules. + + The decorator assumes that the decorated method takes self/cls as a first + argument and the module as the second argument. """ def decorated(self, fullname): @@ -302,89 +304,39 @@ # implicitly imports 'locale' and would otherwise trigger an # infinite loop. module = imp.new_module(fullname) - module.__name__ = fullname sys.modules[fullname] = module - else: - original_values = {} - modified_attrs = ['__loader__', '__name__', '__file__', '__path__'] - for attr in modified_attrs: - try: - original_values[attr] = getattr(module, attr) - except AttributeError: - pass try: return fxn(self, module) except: if not is_reload: del sys.modules[fullname] - else: - for attr in modified_attrs: - if attr in original_values: - setattr(module, attr, original_values[attr]) - elif hasattr(module, attr): - delattr(module, attr) raise wrap(decorated, fxn) return decorated -class _PyFileLoader(object): - # XXX Still smart to have this as a separate class? Or would it work - # better to integrate with PyFileImporter? Could cache _is_pkg info. - # FileImporter can be changed to return self instead of a specific loader - # call. Otherwise _base_path can be calculated on the fly without issue if - # it is known whether a module should be treated as a path or package to - # minimize stat calls. Could even go as far as to stat the directory the - # importer is in to detect changes and then cache all the info about what - # files were found (if stating directories is platform-dependent). +class PyLoader: - """Load a Python source or bytecode file.""" + """Loader base class for Python source. - def __init__(self, name, path, is_pkg): - self._name = name - self._is_pkg = is_pkg - # Figure out the base path based on whether it was source or bytecode - # that was found. - try: - self._base_path = _path_without_ext(path, imp.PY_SOURCE) - except ValueError: - self._base_path = _path_without_ext(path, imp.PY_COMPILED) - - def _find_path(self, ext_type): - """Find a path from the base path and the specified extension type that - exists, returning None if one is not found.""" - for suffix in suffix_list(ext_type): - path = self._base_path + suffix - if _path_exists(path): - return path - else: - return None - - @check_name - def source_path(self, fullname): - """Return the path to an existing source file for the module, or None - if one cannot be found.""" - # Not a property so that it is easy to override. - return self._find_path(imp.PY_SOURCE) + Requires implementing the optional PEP 302 protocols as well as + source_path. - @check_name - def bytecode_path(self, fullname): - """Return the path to a bytecode file, or None if one does not - exist.""" - # Not a property for easy overriding. - return self._find_path(imp.PY_COMPILED) + """ - @check_name - @get_module + @module_for_loader def load_module(self, module): - """Load a Python source or bytecode module.""" + """Load a source module.""" + return _load_module(module) + + def _load_module(self, module): + """Initialize a module from source.""" name = module.__name__ source_path = self.source_path(name) - bytecode_path = self.bytecode_path(name) code_object = self.get_code(module.__name__) - module.__file__ = source_path if source_path else bytecode_path - module.__loader__ = self - if self._is_pkg: + if not hasattr(module, '__file__'): + module.__file__ = source_path + if self.is_package(name): module.__path__ = [module.__file__.rsplit(path_sep, 1)[0]] module.__package__ = module.__name__ if not hasattr(module, '__path__'): @@ -392,64 +344,53 @@ exec(code_object, module.__dict__) return module - @check_name - def source_mtime(self, name): - """Return the modification time of the source for the specified - module.""" - source_path = self.source_path(name) - if not source_path: - return None - return int(_os.stat(source_path).st_mtime) + def get_code(self, fullname): + """Get a code object from source.""" + source_path = self.source_path(fullname) + source = self.get_data(source_path) + # Convert to universal newlines. + line_endings = b'\n' + for index, c in enumerate(source): + if c == ord(b'\n'): + break + elif c == ord(b'\r'): + line_endings = b'\r' + try: + if source[index+1] == ord(b'\n'): + line_endings += b'\n' + except IndexError: + pass + break + if line_endings != b'\n': + source = source.replace(line_endings, b'\n') + return compile(source, source_path, 'exec', dont_inherit=True) - @check_name - def get_source(self, fullname): - """Return the source for the module as a string. - Return None if the source is not available. Raise ImportError if the - laoder cannot handle the specified module. +class PyPycLoader(PyLoader): - """ - source_path = self._source_path(name) - if source_path is None: - return None - import tokenize - with closing(_io.FileIO(source_path, 'r')) as file: - encoding, lines = tokenize.detect_encoding(file.readline) - # XXX Will fail when passed to compile() if the encoding is - # anything other than UTF-8. - return open(source_path, encoding=encoding).read() + """Loader base class for Python source and bytecode. - @check_name - def write_bytecode(self, name, data): - """Write out 'data' for the specified module, returning a boolean - signifying if the write-out actually occurred. + Requires implementing the methods needed for PyLoader as well as + source_mtime, bytecode_path, and write_bytecode. - Raises ImportError (just like get_source) if the specified module - cannot be handled by the loader. + """ - """ + @module_for_loader + def load_module(self, module): + """Load a module from source or bytecode.""" + name = module.__name__ + source_path = self.source_path(name) bytecode_path = self.bytecode_path(name) - if not bytecode_path: - bytecode_path = self._base_path + suffix_list(imp.PY_COMPILED)[0] - file = _io.FileIO(bytecode_path, 'w') - try: - with closing(file) as bytecode_file: - bytecode_file.write(data) - return True - except IOError as exc: - if exc.errno == errno.EACCES: - return False - else: - raise + module.__file__ = source_path if source_path else bytecode_path + return self._load_module(module) - @check_name - def get_code(self, name): - """Return the code object for the module.""" + def get_code(self, fullname): + """Get a code object from source or bytecode.""" # XXX Care enough to make sure this call does not happen if the magic # number is bad? - source_timestamp = self.source_mtime(name) + source_timestamp = self.source_mtime(fullname) # Try to use bytecode if it is available. - bytecode_path = self.bytecode_path(name) + bytecode_path = self.bytecode_path(fullname) if bytecode_path: data = self.get_data(bytecode_path) magic = data[:4] @@ -463,7 +404,7 @@ # there is source to fall back on. if source_timestamp: if pyc_timestamp < source_timestamp: - raise ImportError("bytcode is stale") + raise ImportError("bytecode is stale") except ImportError: # If source is available give it a shot. if source_timestamp is not None: @@ -477,34 +418,68 @@ return marshal.loads(bytecode) elif source_timestamp is None: raise ImportError("no source or bytecode available to create code " - "object for {0!r}".format(name)) + "object for {0!r}".format(fullname)) # Use the source. - source_path = self.source_path(name) - source = self.get_data(source_path) - # Convert to universal newlines. - line_endings = b'\n' - for index, c in enumerate(source): - if c == ord(b'\n'): - break - elif c == ord(b'\r'): - line_endings = b'\r' - try: - if source[index+1] == ord(b'\n'): - line_endings += b'\n' - except IndexError: - pass - break - if line_endings != b'\n': - source = source.replace(line_endings, b'\n') - code_object = compile(source, source_path, 'exec', dont_inherit=True) + code_object = super().get_code(fullname) # Generate bytecode and write it out. if not sys.dont_write_bytecode: data = bytearray(imp.get_magic()) data.extend(marshal._w_long(source_timestamp)) data.extend(marshal.dumps(code_object)) - self.write_bytecode(name, data) + self.write_bytecode(fullname, data) return code_object + +class PyFileLoader(PyLoader): + + """Load a Python source file.""" + + def __init__(self, name, path, is_pkg): + self._name = name + self._is_pkg = is_pkg + # Figure out the base path based on whether it was source or bytecode + # that was found. + try: + self._base_path = _path_without_ext(path, imp.PY_SOURCE) + except ValueError: + self._base_path = _path_without_ext(path, imp.PY_COMPILED) + + def _find_path(self, ext_type): + """Find a path from the base path and the specified extension type that + exists, returning None if one is not found.""" + for suffix in suffix_list(ext_type): + path = self._base_path + suffix + if _path_exists(path): + return path + else: + return None + + @check_name + def source_path(self, fullname): + """Return the path to an existing source file for the module, or None + if one cannot be found.""" + # Not a property so that it is easy to override. + return self._find_path(imp.PY_SOURCE) + + @check_name + def get_source(self, fullname): + """Return the source for the module as a string. + + Return None if the source is not available. Raise ImportError if the + laoder cannot handle the specified module. + + """ + source_path = self._source_path(name) + if source_path is None: + return None + import tokenize + with closing(_io.FileIO(source_path, 'r')) as file: + encoding, lines = tokenize.detect_encoding(file.readline) + # XXX Will fail when passed to compile() if the encoding is + # anything other than UTF-8. + return open(source_path, encoding=encoding).read() + + def get_data(self, path): """Return the data from path as raw bytes.""" return _io.FileIO(path, 'r').read() @@ -520,9 +495,53 @@ return self._is_pkg -class FileImporter(object): +class PyPycFileLoader(PyPycLoader, PyFileLoader): - """Base class for file importers. + """Load a module from a source or bytecode file.""" + + @check_name + def source_mtime(self, name): + """Return the modification time of the source for the specified + module.""" + source_path = self.source_path(name) + if not source_path: + return None + return int(_os.stat(source_path).st_mtime) + + @check_name + def bytecode_path(self, fullname): + """Return the path to a bytecode file, or None if one does not + exist.""" + # Not a property for easy overriding. + return self._find_path(imp.PY_COMPILED) + + @check_name + def write_bytecode(self, name, data): + """Write out 'data' for the specified module, returning a boolean + signifying if the write-out actually occurred. + + Raises ImportError (just like get_source) if the specified module + cannot be handled by the loader. + + """ + bytecode_path = self.bytecode_path(name) + if not bytecode_path: + bytecode_path = self._base_path + suffix_list(imp.PY_COMPILED)[0] + file = _io.FileIO(bytecode_path, 'w') + try: + with closing(file) as bytecode_file: + bytecode_file.write(data) + return True + except IOError as exc: + if exc.errno == errno.EACCES: + return False + else: + raise + + +class FileFinder: + + """Base class for file finders. Subclasses are expected to define the following attributes: @@ -546,10 +565,13 @@ Can be used as an entry on sys.path_hook. """ - self._path_entry = path_entry + absolute_path = _path_absolute(path_entry) + if not _path_isdir(absolute_path): + raise ImportError("only directories are supported") + self._path_entry = absolute_path def find_module(self, fullname, path=None): - tail_module = fullname.rsplit('.', 1)[-1] + tail_module = fullname.rpartition('.')[2] package_directory = None if self._possible_package: for ext in self._suffixes: @@ -576,7 +598,7 @@ return None -class ExtensionFileImporter(FileImporter): +class ExtensionFileFinder(FileFinder): """Importer for extension files.""" @@ -587,59 +609,58 @@ # Assigning to _suffixes here instead of at the class level because # imp is not imported at the time of class creation. self._suffixes = suffix_list(imp.C_EXTENSION) - super(ExtensionFileImporter, self).__init__(path_entry) + super().__init__(path_entry) -class PyFileImporter(FileImporter): +class PyFileFinder(FileFinder): """Importer for source/bytecode files.""" _possible_package = True - _loader = _PyFileLoader + _loader = PyFileLoader def __init__(self, path_entry): # Lack of imp during class creation means _suffixes is set here. # Make sure that Python source files are listed first! Needed for an # optimization by the loader. self._suffixes = suffix_list(imp.PY_SOURCE) + super().__init__(path_entry) + + +class PyPycFileFinder(PyFileFinder): + + """Finder for source and bytecode files.""" + + _loader = PyPycFileLoader + + def __init__(self, path_entry): + super().__init__(path_entry) self._suffixes += suffix_list(imp.PY_COMPILED) - super(PyFileImporter, self).__init__(path_entry) class PathFinder: """Meta path finder for sys.(path|path_hooks|path_importer_cache).""" - _default_hook = staticmethod(chaining_fs_path_hook(ExtensionFileImporter, - PyFileImporter)) - - # The list of implicit hooks cannot be a class attribute because of - # bootstrapping issues for accessing imp. @classmethod - def _implicit_hooks(cls): - """Return a list of the implicit path hooks.""" - return [cls._default_hook, imp.NullImporter] + def _path_hooks(cls, path, hooks=None): + """Search sequence of hooks for a finder for 'path'. - @classmethod - def _path_hooks(cls, path): - """Search sys.path_hooks for a finder for 'path'. - - Guaranteed to return a finder for the path as NullImporter is the - default importer for any path that does not have an explicit finder. + If 'hooks' is false then use sys.path_hooks. """ - for hook in sys.path_hooks + cls._implicit_hooks(): + if not hooks: + hooks = sys.path_hooks + for hook in hooks: try: return hook(path) except ImportError: continue else: - # This point should never be reached thanks to NullImporter. - raise SystemError("no hook could find an importer for " - "{0}".format(path)) + raise ImportError("no path hook found for {0}".format(path)) @classmethod - def _path_importer_cache(cls, path): + def _path_importer_cache(cls, path, default=None): """Get the finder for the path from sys.path_importer_cache. If the path is not in the cache, find the appropriate finder and cache @@ -657,9 +678,9 @@ finder = cls._path_hooks(path) sys.path_importer_cache[path] = finder else: - if finder is None: + if finder is None and default: # Raises ImportError on failure. - finder = cls._default_hook(path) + finder = default(path) sys.path_importer_cache[path] = finder return finder @@ -680,7 +701,30 @@ return None -class ImportLockContext(object): +_DEFAULT_PATH_HOOK = chained_path_hook(ExtensionFileFinder, PyPycFileFinder) + +class _DefaultPathFinder(PathFinder): + + """Subclass of PathFinder that implements implicit semantics for + __import__.""" + + @classmethod + def _path_hooks(cls, path): + """Search sys.path_hooks as well as implicit path hooks.""" + try: + return super()._path_hooks(path) + except ImportError: + implicit_hooks = [_DEFAULT_PATH_HOOK, imp.NullImporter] + return super()._path_hooks(path, implicit_hooks) + + @classmethod + def _path_importer_cache(cls, path): + """Use the default path hook when None is stored in + sys.path_importer_cache.""" + return super()._path_importer_cache(path, _DEFAULT_PATH_HOOK) + + +class ImportLockContext: """Context manager for the import lock.""" @@ -693,6 +737,8 @@ imp.release_lock() +_IMPLICIT_META_PATH = [BuiltinImporter, FrozenImporter, _DefaultPathFinder] + def _gcd_import(name, package=None, level=0): """Import and return the module based on its name, the package the call is being made from, and the level adjustment. @@ -736,8 +782,7 @@ # Backwards-compatibility; be nicer to skip the dict lookup. parent_module = sys.modules[parent] path = parent_module.__path__ - meta_path = (sys.meta_path + - [BuiltinImporter, FrozenImporter, PathFinder]) + meta_path = sys.meta_path + _IMPLICIT_META_PATH for finder in meta_path: loader = finder.find_module(name, path) if loader is not None: Modified: python/branches/io-c/Lib/importlib/test/extension/test_case_sensitivity.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/extension/test_case_sensitivity.py (original) +++ python/branches/io-c/Lib/importlib/test/extension/test_case_sensitivity.py Wed Feb 25 13:53:37 2009 @@ -13,7 +13,7 @@ good_name = ext_util.NAME bad_name = good_name.upper() assert good_name != bad_name - finder = importlib.ExtensionFileImporter(ext_util.PATH) + finder = importlib.ExtensionFileFinder(ext_util.PATH) return finder.find_module(bad_name) def test_case_sensitive(self): Modified: python/branches/io-c/Lib/importlib/test/extension/test_finder.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/extension/test_finder.py (original) +++ python/branches/io-c/Lib/importlib/test/extension/test_finder.py Wed Feb 25 13:53:37 2009 @@ -9,7 +9,7 @@ """Test the finder for extension modules.""" def find_module(self, fullname): - importer = importlib.ExtensionFileImporter(util.PATH) + importer = importlib.ExtensionFileFinder(util.PATH) return importer.find_module(fullname) def test_module(self): Modified: python/branches/io-c/Lib/importlib/test/extension/test_path_hook.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/extension/test_path_hook.py (original) +++ python/branches/io-c/Lib/importlib/test/extension/test_path_hook.py Wed Feb 25 13:53:37 2009 @@ -14,7 +14,7 @@ # XXX Should it only work for directories containing an extension module? def hook(self, entry): - return importlib.ExtensionFileImporter(entry) + return importlib.ExtensionFileFinder(entry) def test_success(self): # Path hook should handle a directory where a known extension module Modified: python/branches/io-c/Lib/importlib/test/import_/test_path.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/import_/test_path.py (original) +++ python/branches/io-c/Lib/importlib/test/import_/test_path.py Wed Feb 25 13:53:37 2009 @@ -1,3 +1,4 @@ +from importlib import _bootstrap from importlib import machinery from .. import util from . import util as import_util @@ -12,20 +13,13 @@ class FinderTests(unittest.TestCase): - """Tests for SysPathImporter.""" + """Tests for PathFinder.""" def test_failure(self): # Test None returned upon not finding a suitable finder. - def mock_implicit_hooks(): - return [] - # XXX Not blackbox. - original_hooks = machinery.PathFinder._implicit_hooks - machinery.PathFinder._implicit_hooks = staticmethod(mock_implicit_hooks) - try: - with util.import_state(): - self.assert_(machinery.PathFinder.find_module('XXX') is None) - finally: - machinery.PathFinder._implicit_hooks = original_hooks + module = '' + with util.import_state(): + self.assert_(machinery.PathFinder.find_module(module) is None) def test_sys_path(self): # Test that sys.path is used when 'path' is None. @@ -48,23 +42,6 @@ loader = machinery.PathFinder.find_module(module, [path]) self.assert_(loader is importer) - def test_path_importer_cache_has_None(self): - # Test that the default hook is used when sys.path_importer_cache - # contains None for a path. - module = '' - importer = util.mock_modules(module) - path = '' - # XXX Not blackbox. - original_hook = machinery.PathFinder._default_hook - mock_hook = import_util.mock_path_hook(path, importer=importer) - machinery.PathFinder._default_hook = staticmethod(mock_hook) - try: - with util.import_state(path_importer_cache={path: None}): - loader = machinery.PathFinder.find_module(module, path=[path]) - self.assert_(loader is importer) - finally: - machinery.PathFinder._default_hook = original_hook - def test_path_hooks(self): # Test that sys.path_hooks is used. # Test that sys.path_importer_cache is set. @@ -78,6 +55,11 @@ self.assert_(path in sys.path_importer_cache) self.assert_(sys.path_importer_cache[path] is importer) + +class DefaultPathFinderTests(unittest.TestCase): + + """Test importlib._bootstrap._DefaultPathFinder.""" + def test_implicit_hooks(self): # Test that the implicit path hooks are used. existing_path = os.path.dirname(support.TESTFN) @@ -85,22 +67,41 @@ module = '' assert not os.path.exists(bad_path) with util.import_state(): - nothing = machinery.PathFinder.find_module(module, - path=[existing_path]) + nothing = _bootstrap._DefaultPathFinder.find_module(module, + path=[existing_path]) self.assert_(nothing is None) self.assert_(existing_path in sys.path_importer_cache) self.assert_(not isinstance(sys.path_importer_cache[existing_path], imp.NullImporter)) - nothing = machinery.PathFinder.find_module(module, path=[bad_path]) + nothing = _bootstrap._DefaultPathFinder.find_module(module, + path=[bad_path]) self.assert_(nothing is None) self.assert_(bad_path in sys.path_importer_cache) self.assert_(isinstance(sys.path_importer_cache[bad_path], imp.NullImporter)) + def test_path_importer_cache_has_None(self): + # Test that the default hook is used when sys.path_importer_cache + # contains None for a path. + module = '' + importer = util.mock_modules(module) + path = '' + # XXX Not blackbox. + original_hook = _bootstrap._DEFAULT_PATH_HOOK + mock_hook = import_util.mock_path_hook(path, importer=importer) + _bootstrap._DEFAULT_PATH_HOOK = mock_hook + try: + with util.import_state(path_importer_cache={path: None}): + loader = _bootstrap._DefaultPathFinder.find_module(module, + path=[path]) + self.assert_(loader is importer) + finally: + _bootstrap._DEFAULT_PATH_HOOK = original_hook + def test_main(): from test.support import run_unittest - run_unittest(PathTests, __path__Tests, FinderTests) + run_unittest(FinderTests, DefaultPathFinderTests) if __name__ == '__main__': test_main() Modified: python/branches/io-c/Lib/importlib/test/import_/util.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/import_/util.py (original) +++ python/branches/io-c/Lib/importlib/test/import_/util.py Wed Feb 25 13:53:37 2009 @@ -9,8 +9,8 @@ """Delegate to allow for injecting different implementations of import.""" if using___import__: return __import__(*args, **kwargs) - #return importlib.Import()(*args, **kwargs) - return importlib._bootstrap._import(*args, **kwargs) + else: + return importlib._bootstrap._import(*args, **kwargs) def importlib_only(fxn): Modified: python/branches/io-c/Lib/importlib/test/source/test_case_sensitivity.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/source/test_case_sensitivity.py (original) +++ python/branches/io-c/Lib/importlib/test/source/test_case_sensitivity.py Wed Feb 25 13:53:37 2009 @@ -19,7 +19,7 @@ assert name != name.lower() def find(self, path): - finder = importlib.PyFileImporter(path) + finder = importlib.PyPycFileFinder(path) return finder.find_module(self.name) def sensitivity_test(self): Modified: python/branches/io-c/Lib/importlib/test/source/test_finder.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/source/test_finder.py (original) +++ python/branches/io-c/Lib/importlib/test/source/test_finder.py Wed Feb 25 13:53:37 2009 @@ -32,7 +32,7 @@ """ def import_(self, root, module): - finder = importlib.PyFileImporter(root) + finder = importlib.PyPycFileFinder(root) return finder.find_module(module) def run_test(self, test, create=None, *, compile_=None, unlink=None): Modified: python/branches/io-c/Lib/importlib/test/source/test_loader.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/source/test_loader.py (original) +++ python/branches/io-c/Lib/importlib/test/source/test_loader.py Wed Feb 25 13:53:37 2009 @@ -19,7 +19,7 @@ # [basic] def test_module(self): with source_util.create_modules('_temp') as mapping: - loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + loader = importlib.PyPycFileLoader('_temp', mapping['_temp'], False) module = loader.load_module('_temp') self.assert_('_temp' in sys.modules) check = {'__name__': '_temp', '__file__': mapping['_temp'], @@ -29,7 +29,7 @@ def test_package(self): with source_util.create_modules('_pkg.__init__') as mapping: - loader = importlib._PyFileLoader('_pkg', mapping['_pkg.__init__'], + loader = importlib.PyPycFileLoader('_pkg', mapping['_pkg.__init__'], True) module = loader.load_module('_pkg') self.assert_('_pkg' in sys.modules) @@ -42,7 +42,7 @@ def test_lacking_parent(self): with source_util.create_modules('_pkg.__init__', '_pkg.mod')as mapping: - loader = importlib._PyFileLoader('_pkg.mod', mapping['_pkg.mod'], + loader = importlib.PyPycFileLoader('_pkg.mod', mapping['_pkg.mod'], False) module = loader.load_module('_pkg.mod') self.assert_('_pkg.mod' in sys.modules) @@ -57,7 +57,7 @@ def test_module_reuse(self): with source_util.create_modules('_temp') as mapping: - loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + loader = importlib.PyPycFileLoader('_temp', mapping['_temp'], False) module = loader.load_module('_temp') module_id = id(module) module_dict_id = id(module.__dict__) @@ -87,7 +87,7 @@ setattr(orig_module, attr, value) with open(mapping[name], 'w') as file: file.write('+++ bad syntax +++') - loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + loader = importlib.PyPycFileLoader('_temp', mapping['_temp'], False) self.assertRaises(SyntaxError, loader.load_module, name) for attr in attributes: self.assertEqual(getattr(orig_module, attr), value) @@ -97,7 +97,7 @@ with source_util.create_modules('_temp') as mapping: with open(mapping['_temp'], 'w') as file: file.write('=') - loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + loader = importlib.PyPycFileLoader('_temp', mapping['_temp'], False) self.assertRaises(SyntaxError, loader.load_module, '_temp') self.assert_('_temp' not in sys.modules) @@ -112,7 +112,7 @@ @source_util.writes_bytecode def run_test(self, assertion): with source_util.create_modules('_temp') as mapping: - loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + loader = importlib.PyPycFileLoader('_temp', mapping['_temp'], False) loader.load_module('_temp') bytecode_path = source_util.bytecode_path(mapping['_temp']) assertion(bytecode_path) @@ -144,7 +144,7 @@ with open(bytecode_path, 'r+b') as file: file.seek(0) file.write(b'\x00\x00\x00\x00') - loader = importlib._PyFileLoader('_temp', mapping['_temp'], False) + loader = importlib.PyPycFileLoader('_temp', mapping['_temp'], False) self.assertRaises(ImportError, loader.load_module, '_temp') self.assert_('_temp' not in sys.modules) @@ -159,7 +159,7 @@ """ def import_(self, file, module, *, pkg=False): - loader = importlib._PyFileLoader(module, file, pkg) + loader = importlib.PyPycFileLoader(module, file, pkg) return loader.load_module(module) def run_test(self, test, *create, pkg=False): @@ -171,7 +171,7 @@ import_name = test.rsplit('.', 1)[0] else: import_name = test - loader = importlib._PyFileLoader(import_name, mapping[test], pkg) + loader = importlib.PyPycFileLoader(import_name, mapping[test], pkg) # Because some platforms only have a granularity to the second for # atime you can't check the physical files. Instead just make it an # exception trigger if source was read. @@ -212,7 +212,7 @@ """ def import_(self, file, module_name): - loader = importlib._PyFileLoader(module_name, file, False) + loader = importlib.PyPycFileLoader(module_name, file, False) module = loader.load_module(module_name) self.assert_(module_name in sys.modules) Modified: python/branches/io-c/Lib/importlib/test/source/test_path_hook.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/source/test_path_hook.py (original) +++ python/branches/io-c/Lib/importlib/test/source/test_path_hook.py Wed Feb 25 13:53:37 2009 @@ -10,7 +10,7 @@ def test_success(self): # XXX Only work on existing directories? with source_util.create_modules('dummy') as mapping: - self.assert_(hasattr(importlib.FileImporter(mapping['.root']), + self.assert_(hasattr(importlib.FileFinder(mapping['.root']), 'find_module')) Modified: python/branches/io-c/Lib/importlib/test/source/test_source_encoding.py ============================================================================== --- python/branches/io-c/Lib/importlib/test/source/test_source_encoding.py (original) +++ python/branches/io-c/Lib/importlib/test/source/test_source_encoding.py Wed Feb 25 13:53:37 2009 @@ -35,7 +35,7 @@ with source_util.create_modules(self.module_name) as mapping: with open(mapping[self.module_name], 'wb')as file: file.write(source) - loader = importlib._PyFileLoader(self.module_name, + loader = importlib.PyPycFileLoader(self.module_name, mapping[self.module_name], False) return loader.load_module(self.module_name) @@ -96,7 +96,7 @@ with source_util.create_modules(module_name) as mapping: with open(mapping[module_name], 'wb') as file: file.write(source) - loader = importlib._PyFileLoader(module_name, mapping[module_name], + loader = importlib.PyPycFileLoader(module_name, mapping[module_name], False) return loader.load_module(module_name) Modified: python/branches/io-c/Lib/io.py ============================================================================== --- python/branches/io-c/Lib/io.py (original) +++ python/branches/io-c/Lib/io.py Wed Feb 25 13:53:37 2009 @@ -3,7 +3,7 @@ At the top of the I/O hierarchy is the abstract base class IOBase. It defines the basic interface to a stream. Note, however, that there is no -seperation between reading and writing to streams; implementations are +separation between reading and writing to streams; implementations are allowed to throw an IOError if they do not support a given operation. Extending IOBase is RawIOBase which deals simply with the reading and @@ -73,3 +73,5 @@ TextIOBase = _io.TextIOBase IncrementalNewlineDecoder = _io.IncrementalNewlineDecoder TextIOWrapper = _io.TextIOWrapper +# open() uses st_blksize whenever we can +DEFAULT_BUFFER_SIZE = 8 * 1024 # bytes Modified: python/branches/io-c/Lib/logging/__init__.py ============================================================================== --- python/branches/io-c/Lib/logging/__init__.py (original) +++ python/branches/io-c/Lib/logging/__init__.py Wed Feb 25 13:53:37 2009 @@ -1,4 +1,4 @@ -# Copyright 2001-2008 by Vinay Sajip. All Rights Reserved. +# Copyright 2001-2009 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, @@ -1127,7 +1127,12 @@ all the handlers of this logger to handle the record. """ if _srcfile: - fn, lno, func = self.findCaller() + #IronPython doesn't track Python frames, so findCaller throws an + #exception. We trap it here so that IronPython can use logging. + try: + fn, lno, func = self.findCaller() + except ValueError: + fn, lno, func = "(unknown file)", 0, "(unknown function)" else: fn, lno, func = "(unknown file)", 0, "(unknown function)" if exc_info: Modified: python/branches/io-c/Lib/modulefinder.py ============================================================================== --- python/branches/io-c/Lib/modulefinder.py (original) +++ python/branches/io-c/Lib/modulefinder.py Wed Feb 25 13:53:37 2009 @@ -1,5 +1,4 @@ """Find modules used by a script, using introspection.""" -# This module should be kept compatible with Python 2.2, see PEP 291. from __future__ import generators import dis @@ -10,11 +9,7 @@ import types import struct -if hasattr(sys.__stdout__, "newlines"): - READ_MODE = "U" # universal line endings -else: - # remain compatible with Python < 2.3 - READ_MODE = "r" +READ_MODE = "rU" # XXX Clean up once str8's cstor matches bytes. LOAD_CONST = bytes([dis.opname.index('LOAD_CONST')]) Modified: python/branches/io-c/Lib/opcode.py ============================================================================== --- python/branches/io-c/Lib/opcode.py (original) +++ python/branches/io-c/Lib/opcode.py Wed Feb 25 13:53:37 2009 @@ -131,9 +131,11 @@ name_op('IMPORT_FROM', 109) # Index in name list jrel_op('JUMP_FORWARD', 110) # Number of bytes to skip -jrel_op('JUMP_IF_FALSE', 111) # "" -jrel_op('JUMP_IF_TRUE', 112) # "" -jabs_op('JUMP_ABSOLUTE', 113) # Target byte offset from beginning of code +jabs_op('JUMP_IF_FALSE_OR_POP', 111) # Target byte offset from beginning of code +jabs_op('JUMP_IF_TRUE_OR_POP', 112) # "" +jabs_op('JUMP_ABSOLUTE', 113) # "" +jabs_op('POP_JUMP_IF_FALSE', 114) # "" +jabs_op('POP_JUMP_IF_TRUE', 115) # "" name_op('LOAD_GLOBAL', 116) # Index in name list Modified: python/branches/io-c/Lib/optparse.py ============================================================================== --- python/branches/io-c/Lib/optparse.py (original) +++ python/branches/io-c/Lib/optparse.py Wed Feb 25 13:53:37 2009 @@ -1563,7 +1563,7 @@ """print_usage(file : file = stdout) Print the usage message for the current program (self.usage) to - 'file' (default stdout). Any occurence of the string "%prog" in + 'file' (default stdout). Any occurrence of the string "%prog" in self.usage is replaced with the name of the current program (basename of sys.argv[0]). Does nothing if self.usage is empty or not defined. @@ -1581,7 +1581,7 @@ """print_version(file : file = stdout) Print the version message for this program (self.version) to - 'file' (default stdout). As with print_usage(), any occurence + 'file' (default stdout). As with print_usage(), any occurrence of "%prog" in self.version is replaced by the current program's name. Does nothing if self.version is empty or undefined. """ Modified: python/branches/io-c/Lib/os.py ============================================================================== --- python/branches/io-c/Lib/os.py (original) +++ python/branches/io-c/Lib/os.py Wed Feb 25 13:53:37 2009 @@ -372,8 +372,8 @@ saved_exc = e saved_tb = tb if saved_exc: - raise error(saved_exc).with_traceback(saved_tb) - raise error(last_exc).with_traceback(tb) + raise saved_exc.with_traceback(saved_tb) + raise last_exc.with_traceback(tb) # Change environ to automatically call putenv(), unsetenv if they exist. Modified: python/branches/io-c/Lib/pkgutil.py ============================================================================== --- python/branches/io-c/Lib/pkgutil.py (original) +++ python/branches/io-c/Lib/pkgutil.py Wed Feb 25 13:53:37 2009 @@ -1,8 +1,5 @@ """Utilities to support packages.""" -# NOTE: This module must remain compatible with Python 2.3, as it is shared -# by setuptools for distribution with Python 2.3 and up. - import os import sys import imp Modified: python/branches/io-c/Lib/random.py ============================================================================== --- python/branches/io-c/Lib/random.py (original) +++ python/branches/io-c/Lib/random.py Wed Feb 25 13:53:37 2009 @@ -43,6 +43,7 @@ from math import sqrt as _sqrt, acos as _acos, cos as _cos, sin as _sin from os import urandom as _urandom from binascii import hexlify as _hexlify +import collections as _collections __all__ = ["Random","seed","random","uniform","randint","choice","sample", "randrange","shuffle","normalvariate","lognormvariate", @@ -296,10 +297,10 @@ # preferred since the list takes less space than the # set and it doesn't suffer from frequent reselections. - if isinstance(population, (set, frozenset)): + if isinstance(population, _collections.Set): population = tuple(population) - if not hasattr(population, '__getitem__') or hasattr(population, 'keys'): - raise TypeError("Population must be a sequence or set. For dicts, use dict.keys().") + if not isinstance(population, _collections.Sequence): + raise TypeError("Population must be a sequence or Set. For dicts, use list(d).") random = self.random n = len(population) if not 0 <= k <= n: Modified: python/branches/io-c/Lib/shutil.py ============================================================================== --- python/branches/io-c/Lib/shutil.py (original) +++ python/branches/io-c/Lib/shutil.py Wed Feb 25 13:53:37 2009 @@ -256,7 +256,7 @@ os.rename(src, real_dst) except OSError: if os.path.isdir(src): - if destinsrc(src, dst): + if _destinsrc(src, dst): raise Error("Cannot move a directory '%s' into itself '%s'." % (src, dst)) copytree(src, real_dst, symlinks=True) rmtree(src) @@ -264,7 +264,7 @@ copy2(src, real_dst) os.unlink(src) -def destinsrc(src, dst): +def _destinsrc(src, dst): src = abspath(src) dst = abspath(dst) if not src.endswith(os.path.sep): Modified: python/branches/io-c/Lib/smtpd.py ============================================================================== --- python/branches/io-c/Lib/smtpd.py (original) +++ python/branches/io-c/Lib/smtpd.py Wed Feb 25 13:53:37 2009 @@ -419,7 +419,7 @@ s = StringIO(data) msg = Message.Message(s) # These headers are required for the proper execution of Mailman. All - # MTAs in existance seem to add these if the original message doesn't + # MTAs in existence seem to add these if the original message doesn't # have them. if not msg.get('from'): msg['From'] = mailfrom Modified: python/branches/io-c/Lib/subprocess.py ============================================================================== --- python/branches/io-c/Lib/subprocess.py (original) +++ python/branches/io-c/Lib/subprocess.py Wed Feb 25 13:53:37 2009 @@ -2,8 +2,6 @@ # # For more information about this module, see PEP 324. # -# This module should remain compatible with Python 2.2, see PEP 291. -# # Copyright (c) 2003-2005 by Peter Astrand # # Licensed to PSF under a Contributor Agreement. @@ -448,9 +446,9 @@ To capture standard error in the result, use stderr=subprocess.STDOUT. >>> check_output(["/bin/sh", "-c", - "ls -l non_existant_file ; exit 0"], + "ls -l non_existent_file ; exit 0"], stderr=subprocess.STDOUT) - 'ls: non_existant_file: No such file or directory\n' + 'ls: non_existent_file: No such file or directory\n' """ if 'stdout' in kwargs: raise ValueError('stdout argument not allowed, it will be overridden.') @@ -852,7 +850,7 @@ # cause random failures on win9x. Specifically a # dialog: "Your program accessed mem currently in # use at xxx" and a hopeful warning about the - # stability of your system. Cost is Ctrl+C wont + # stability of your system. Cost is Ctrl+C won't # kill children. creationflags |= CREATE_NEW_CONSOLE @@ -1141,6 +1139,9 @@ if data: os.waitpid(self.pid, 0) child_exception = pickle.loads(data) + for fd in (p2cwrite, c2pread, errread): + if fd is not None: + os.close(fd) raise child_exception Modified: python/branches/io-c/Lib/tarfile.py ============================================================================== --- python/branches/io-c/Lib/tarfile.py (original) +++ python/branches/io-c/Lib/tarfile.py Wed Feb 25 13:53:37 2009 @@ -1753,7 +1753,7 @@ def getmember(self, name): """Return a TarInfo object for member `name'. If `name' can not be found in the archive, KeyError is raised. If a member occurs more - than once in the archive, its last occurence is assumed to be the + than once in the archive, its last occurrence is assumed to be the most up-to-date version. """ tarinfo = self._getmember(name) Modified: python/branches/io-c/Lib/test/test_calendar.py ============================================================================== --- python/branches/io-c/Lib/test/test_calendar.py (original) +++ python/branches/io-c/Lib/test/test_calendar.py Wed Feb 25 13:53:37 2009 @@ -170,7 +170,7 @@ class OutputTestCase(unittest.TestCase): def normalize_calendar(self, s): - # Filters out locale dependant strings + # Filters out locale dependent strings def neitherspacenordigit(c): return not c.isspace() and not c.isdigit() Modified: python/branches/io-c/Lib/test/test_cfgparser.py ============================================================================== --- python/branches/io-c/Lib/test/test_cfgparser.py (original) +++ python/branches/io-c/Lib/test/test_cfgparser.py Wed Feb 25 13:53:37 2009 @@ -82,11 +82,11 @@ # Make sure the right things happen for remove_option(); # added to include check for SourceForge bug #123324: self.failUnless(cf.remove_option('Foo Bar', 'foo'), - "remove_option() failed to report existance of option") + "remove_option() failed to report existence of option") self.failIf(cf.has_option('Foo Bar', 'foo'), "remove_option() failed to remove option") self.failIf(cf.remove_option('Foo Bar', 'foo'), - "remove_option() failed to report non-existance of option" + "remove_option() failed to report non-existence of option" " that was removed") self.assertRaises(configparser.NoSectionError, @@ -254,7 +254,7 @@ file1 = support.findfile("cfgparser.1") # check when we pass a mix of readable and non-readable files: cf = self.newconfig() - parsed_files = cf.read([file1, "nonexistant-file"]) + parsed_files = cf.read([file1, "nonexistent-file"]) self.assertEqual(parsed_files, [file1]) self.assertEqual(cf.get("Foo Bar", "foo"), "newbar") # check when we pass only a filename: @@ -264,7 +264,7 @@ self.assertEqual(cf.get("Foo Bar", "foo"), "newbar") # check when we pass only missing files: cf = self.newconfig() - parsed_files = cf.read(["nonexistant-file"]) + parsed_files = cf.read(["nonexistent-file"]) self.assertEqual(parsed_files, []) # check when we pass no files: cf = self.newconfig() Modified: python/branches/io-c/Lib/test/test_codeccallbacks.py ============================================================================== --- python/branches/io-c/Lib/test/test_codeccallbacks.py (original) +++ python/branches/io-c/Lib/test/test_codeccallbacks.py Wed Feb 25 13:53:37 2009 @@ -109,7 +109,7 @@ # useful that the error handler is not called for every single # unencodable character, but for a complete sequence of # unencodable characters, otherwise we would output many - # unneccessary escape sequences. + # unnecessary escape sequences. def uninamereplace(exc): if not isinstance(exc, UnicodeEncodeError): Modified: python/branches/io-c/Lib/test/test_collections.py ============================================================================== --- python/branches/io-c/Lib/test/test_collections.py (original) +++ python/branches/io-c/Lib/test/test_collections.py Wed Feb 25 13:53:37 2009 @@ -406,6 +406,8 @@ for sample in [tuple, list, bytes, str]: self.failUnless(isinstance(sample(), Sequence)) self.failUnless(issubclass(sample, Sequence)) + self.failUnless(isinstance(range(10), Sequence)) + self.failUnless(issubclass(range, Sequence)) self.failUnless(issubclass(str, Sequence)) self.validate_abstract_methods(Sequence, '__contains__', '__iter__', '__len__', '__getitem__') Modified: python/branches/io-c/Lib/test/test_descrtut.py ============================================================================== --- python/branches/io-c/Lib/test/test_descrtut.py (original) +++ python/branches/io-c/Lib/test/test_descrtut.py Wed Feb 25 13:53:37 2009 @@ -54,7 +54,7 @@ {1: 3.25} >>> print(a[1]) # show the new item 3.25 - >>> print(a[0]) # a non-existant item + >>> print(a[0]) # a non-existent item 0.0 >>> a.merge({1:100, 2:200}) # use a dict method >>> print(sortdict(a)) # show the result Modified: python/branches/io-c/Lib/test/test_funcattrs.py ============================================================================== --- python/branches/io-c/Lib/test/test_funcattrs.py (original) +++ python/branches/io-c/Lib/test/test_funcattrs.py Wed Feb 25 13:53:37 2009 @@ -167,7 +167,7 @@ def test_unset_attr(self): for func in [self.b, self.fi.a]: - try: func.non_existant_attr + try: func.non_existent_attr except AttributeError: pass else: self.fail("using unknown attributes should raise " "AttributeError") Modified: python/branches/io-c/Lib/test/test_itertools.py ============================================================================== --- python/branches/io-c/Lib/test/test_itertools.py (original) +++ python/branches/io-c/Lib/test/test_itertools.py Wed Feb 25 13:53:37 2009 @@ -310,6 +310,7 @@ self.assertEqual(comb, sorted(set(cwr) & set(perm))) # comb: both a cwr and a perm def test_compress(self): + self.assertEqual(list(compress(data='ABCDEF', selectors=[1,0,1,0,1,1])), list('ACEF')) self.assertEqual(list(compress('ABCDEF', [1,0,1,0,1,1])), list('ACEF')) self.assertEqual(list(compress('ABCDEF', [0,0,0,0,0,0])), list('')) self.assertEqual(list(compress('ABCDEF', [1,1,1,1,1,1])), list('ABCDEF')) @@ -353,6 +354,10 @@ def test_count_with_stride(self): self.assertEqual(lzip('abc',count(2,3)), [('a', 2), ('b', 5), ('c', 8)]) + self.assertEqual(lzip('abc',count(start=2,step=3)), + [('a', 2), ('b', 5), ('c', 8)]) + self.assertEqual(lzip('abc',count(step=-1)), + [('a', 0), ('b', -1), ('c', -2)]) self.assertEqual(lzip('abc',count(2,0)), [('a', 2), ('b', 2), ('c', 2)]) self.assertEqual(lzip('abc',count(2,1)), [('a', 2), ('b', 3), ('c', 4)]) self.assertEqual(lzip('abc',count(2,3)), [('a', 2), ('b', 5), ('c', 8)]) @@ -639,6 +644,7 @@ self.assertNotEqual(len(set(map(id, list(product('abc', 'def'))))), 1) def test_repeat(self): + self.assertEqual(list(repeat(object='a', times=3)), ['a', 'a', 'a']) self.assertEqual(lzip(range(3),repeat('a')), [(0, 'a'), (1, 'a'), (2, 'a')]) self.assertEqual(list(repeat('a', 3)), ['a', 'a', 'a']) @@ -979,6 +985,11 @@ a = [] self.makecycle(compress('ABCDEF', [1,0,1,0,1,0]), a) + def test_count(self): + a = [] + Int = type('Int', (int,), dict(x=a)) + self.makecycle(count(Int(0), Int(1)), a) + def test_cycle(self): a = [] self.makecycle(cycle([a]*2), a) @@ -1412,9 +1423,9 @@ ... "Return function(0), function(1), ..." ... return map(function, count(start)) ->>> def nth(iterable, n): -... "Returns the nth item or None" -... return next(islice(iterable, n, None), None) +>>> def nth(iterable, n, default=None): +... "Returns the nth item or a default value" +... return next(islice(iterable, n, None), default) >>> def quantify(iterable, pred=bool): ... "Count how many times the predicate is true" Modified: python/branches/io-c/Lib/test/test_mmap.py ============================================================================== --- python/branches/io-c/Lib/test/test_mmap.py (original) +++ python/branches/io-c/Lib/test/test_mmap.py Wed Feb 25 13:53:37 2009 @@ -42,6 +42,10 @@ self.assertEqual(m[0], 0) self.assertEqual(m[0:3], b'\0\0\0') + # Shouldn't crash on boundary (Issue #5292) + self.assertRaises(IndexError, m.__getitem__, len(m)) + self.assertRaises(IndexError, m.__setitem__, len(m), b'\0') + # Modify the file's content m[0] = b'3'[0] m[PAGESIZE +3: PAGESIZE +3+3] = b'bar' @@ -412,6 +416,27 @@ m = mmap.mmap(f.fileno(), mapsize - halfsize, offset=halfsize) self.assertEqual(m[0:3], b'foo') f.close() + + # Try resizing map + try: + m.resize(512) + except SystemError: + pass + else: + # resize() is supported + self.assertEqual(len(m), 512) + # Check that we can no longer seek beyond the new size. + self.assertRaises(ValueError, m.seek, 513, 0) + # Check that the content is not changed + self.assertEqual(m[0:3], b'foo') + + # Check that the underlying file is truncated too + f = open(TESTFN) + f.seek(0, 2) + self.assertEqual(f.tell(), halfsize + 512) + f.close() + self.assertEqual(m.size(), halfsize + 512) + m.close() finally: Modified: python/branches/io-c/Lib/test/test_os.py ============================================================================== --- python/branches/io-c/Lib/test/test_os.py (original) +++ python/branches/io-c/Lib/test/test_os.py Wed Feb 25 13:53:37 2009 @@ -576,12 +576,12 @@ self.assertRaises(WindowsError, os.chdir, support.TESTFN) def test_mkdir(self): - f = open(test_support.TESTFN, "w") + f = open(support.TESTFN, "w") try: self.assertRaises(WindowsError, os.mkdir, support.TESTFN) finally: f.close() - os.unlink(test_support.TESTFN) + os.unlink(support.TESTFN) def test_utime(self): self.assertRaises(WindowsError, os.utime, support.TESTFN, None) Modified: python/branches/io-c/Lib/test/test_peepholer.py ============================================================================== --- python/branches/io-c/Lib/test/test_peepholer.py (original) +++ python/branches/io-c/Lib/test/test_peepholer.py Wed Feb 25 13:53:37 2009 @@ -19,14 +19,14 @@ class TestTranforms(unittest.TestCase): def test_unot(self): - # UNARY_NOT JUMP_IF_FALSE POP_TOP --> JUMP_IF_TRUE POP_TOP' + # UNARY_NOT POP_JUMP_IF_FALSE --> POP_JUMP_IF_TRUE' def unot(x): if not x == 2: del x asm = disassemble(unot) - for elem in ('UNARY_NOT', 'JUMP_IF_FALSE'): + for elem in ('UNARY_NOT', 'POP_JUMP_IF_FALSE'): self.assert_(elem not in asm) - for elem in ('JUMP_IF_TRUE', 'POP_TOP'): + for elem in ('POP_JUMP_IF_TRUE',): self.assert_(elem in asm) def test_elim_inversion_of_is_or_in(self): @@ -64,13 +64,13 @@ self.assert_('LOAD_GLOBAL' not in disassemble(f)) def test_while_one(self): - # Skip over: LOAD_CONST trueconst JUMP_IF_FALSE xx POP_TOP + # Skip over: LOAD_CONST trueconst POP_JUMP_IF_FALSE xx def f(): while 1: pass return list asm = disassemble(f) - for elem in ('LOAD_CONST', 'JUMP_IF_FALSE'): + for elem in ('LOAD_CONST', 'POP_JUMP_IF_FALSE'): self.assert_(elem not in asm) for elem in ('JUMP_ABSOLUTE',): self.assert_(elem in asm) Modified: python/branches/io-c/Lib/test/test_pep263.py ============================================================================== --- python/branches/io-c/Lib/test/test_pep263.py (original) +++ python/branches/io-c/Lib/test/test_pep263.py Wed Feb 25 13:53:37 2009 @@ -1,4 +1,4 @@ -#! -*- coding: koi8-r -*- +# -*- coding: koi8-r -*- import unittest from test import support Modified: python/branches/io-c/Lib/test/test_random.py ============================================================================== --- python/branches/io-c/Lib/test/test_random.py (original) +++ python/branches/io-c/Lib/test/test_random.py Wed Feb 25 13:53:37 2009 @@ -5,7 +5,7 @@ import time import pickle import warnings -from math import log, exp, sqrt, pi, fsum as msum +from math import log, exp, sqrt, pi, fsum, sin from test import support class TestBasicOps(unittest.TestCase): @@ -383,15 +383,23 @@ self.assert_(stop < x <= start) self.assertEqual((x+stop)%step, 0) -_gammacoeff = (0.9999999999995183, 676.5203681218835, -1259.139216722289, - 771.3234287757674, -176.6150291498386, 12.50734324009056, - -0.1385710331296526, 0.9934937113930748e-05, 0.1659470187408462e-06) - -def gamma(z, cof=_gammacoeff, g=7): - z -= 1.0 - s = msum([cof[0]] + [cof[i] / (z+i) for i in range(1,len(cof))]) - z += 0.5 - return (z+g)**z / exp(z+g) * sqrt(2.0*pi) * s +def gamma(z, sqrt2pi=(2.0*pi)**0.5): + # Reflection to right half of complex plane + if z < 0.5: + return pi / sin(pi*z) / gamma(1.0-z) + # Lanczos approximation with g=7 + az = z + (7.0 - 0.5) + return az ** (z-0.5) / exp(az) * sqrt2pi * fsum([ + 0.9999999999995183, + 676.5203681218835 / z, + -1259.139216722289 / (z+1.0), + 771.3234287757674 / (z+2.0), + -176.6150291498386 / (z+3.0), + 12.50734324009056 / (z+4.0), + -0.1385710331296526 / (z+5.0), + 0.9934937113930748e-05 / (z+6.0), + 0.1659470187408462e-06 / (z+7.0), + ]) class TestDistributions(unittest.TestCase): def test_zeroinputs(self): Modified: python/branches/io-c/Lib/test/test_shutil.py ============================================================================== --- python/branches/io-c/Lib/test/test_shutil.py (original) +++ python/branches/io-c/Lib/test/test_shutil.py Wed Feb 25 13:53:37 2009 @@ -346,8 +346,8 @@ for src, dst in [('srcdir', 'srcdir/dest')]: src = os.path.join(TESTFN, src) dst = os.path.join(TESTFN, dst) - self.assert_(shutil.destinsrc(src, dst), - msg='destinsrc() wrongly concluded that ' + self.assert_(shutil._destinsrc(src, dst), + msg='_destinsrc() wrongly concluded that ' 'dst (%s) is not in src (%s)' % (dst, src)) finally: shutil.rmtree(TESTFN, ignore_errors=True) @@ -358,8 +358,8 @@ for src, dst in [('srcdir', 'src/dest'), ('srcdir', 'srcdir.new')]: src = os.path.join(TESTFN, src) dst = os.path.join(TESTFN, dst) - self.failIf(shutil.destinsrc(src, dst), - msg='destinsrc() wrongly concluded that ' + self.failIf(shutil._destinsrc(src, dst), + msg='_destinsrc() wrongly concluded that ' 'dst (%s) is in src (%s)' % (dst, src)) finally: shutil.rmtree(TESTFN, ignore_errors=True) Modified: python/branches/io-c/Lib/test/test_subprocess.py ============================================================================== --- python/branches/io-c/Lib/test/test_subprocess.py (original) +++ python/branches/io-c/Lib/test/test_subprocess.py Wed Feb 25 13:53:37 2009 @@ -521,6 +521,22 @@ p = subprocess.Popen([sys.executable, "-c", "pass"], bufsize=None) self.assertEqual(p.wait(), 0) + def test_leaking_fds_on_error(self): + # see bug #5179: Popen leaks file descriptors to PIPEs if + # the child fails to execute; this will eventually exhaust + # the maximum number of open fds. 1024 seems a very common + # value for that limit, but Windows has 2048, so we loop + # 1024 times (each call leaked two fds). + for i in range(1024): + try: + subprocess.Popen(['nonexisting_i_hope'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + # Windows raises IOError + except (IOError, OSError) as err: + if err.errno != 2: # ignore "no such file" + raise + # # POSIX tests # Modified: python/branches/io-c/Lib/test/test_urllib2net.py ============================================================================== --- python/branches/io-c/Lib/test/test_urllib2net.py (original) +++ python/branches/io-c/Lib/test/test_urllib2net.py Wed Feb 25 13:53:37 2009 @@ -99,7 +99,7 @@ def test_ftp(self): urls = [ 'ftp://ftp.kernel.org/pub/linux/kernel/README', - 'ftp://ftp.kernel.org/pub/linux/kernel/non-existant-file', + 'ftp://ftp.kernel.org/pub/linux/kernel/non-existent-file', #'ftp://ftp.kernel.org/pub/leenox/kernel/test', 'ftp://gatekeeper.research.compaq.com/pub/DEC/SRC' '/research-reports/00README-Legal-Rules-Regs', Modified: python/branches/io-c/Lib/tkinter/__init__.py ============================================================================== --- python/branches/io-c/Lib/tkinter/__init__.py (original) +++ python/branches/io-c/Lib/tkinter/__init__.py Wed Feb 25 13:53:37 2009 @@ -3300,7 +3300,7 @@ """Return the color (red, green, blue) of the pixel at X,Y.""" return self.tk.call(self.name, 'get', x, y) def put(self, data, to=None): - """Put row formated colors to image starting from + """Put row formatted colors to image starting from position TO, e.g. image.put("{red green} {blue yellow}", to=(4,6))""" args = (self.name, 'put', data) if to: Modified: python/branches/io-c/Lib/tkinter/test/test_ttk/test_style.py ============================================================================== --- python/branches/io-c/Lib/tkinter/test/test_ttk/test_style.py (original) +++ python/branches/io-c/Lib/tkinter/test/test_ttk/test_style.py Wed Feb 25 13:53:37 2009 @@ -61,7 +61,7 @@ # correct layout, but "option" doesn't exist as option self.failUnlessRaises(tkinter.TclError, style.layout, 'Treeview', - [('name', {'option': 'inexistant'})]) + [('name', {'option': 'inexistent'})]) def test_theme_use(self): Modified: python/branches/io-c/Lib/tkinter/test/test_ttk/test_widgets.py ============================================================================== --- python/branches/io-c/Lib/tkinter/test/test_ttk/test_widgets.py (original) +++ python/branches/io-c/Lib/tkinter/test/test_ttk/test_widgets.py Wed Feb 25 13:53:37 2009 @@ -861,9 +861,9 @@ # bad values self.failUnlessRaises(tkinter.TclError, - self.tv.reattach, 'nonexistant', '', 'end') + self.tv.reattach, 'nonexistent', '', 'end') self.failUnlessRaises(tkinter.TclError, - self.tv.detach, 'nonexistant') + self.tv.detach, 'nonexistent') self.failUnlessRaises(tkinter.TclError, self.tv.reattach, item2, 'otherparent', 'end') self.failUnlessRaises(tkinter.TclError, @@ -897,7 +897,7 @@ self.tv.delete(item1) self.failUnlessEqual(self.tv.focus(), '') - # try focusing inexistant item + # try focusing inexistent item self.failUnlessRaises(tkinter.TclError, self.tv.focus, 'hi') @@ -1064,11 +1064,11 @@ self.failUnlessEqual(self.tv.item(item, values=None), (123, 'a')) self.failUnlessEqual(self.tv.set(item), {'B': 123}) - # inexistant column + # inexistent column self.failUnlessRaises(tkinter.TclError, self.tv.set, item, 'A') self.failUnlessRaises(tkinter.TclError, self.tv.set, item, 'A', 'b') - # inexistant item + # inexistent item self.failUnlessRaises(tkinter.TclError, self.tv.set, 'notme') Modified: python/branches/io-c/Lib/turtle.py ============================================================================== --- python/branches/io-c/Lib/turtle.py (original) +++ python/branches/io-c/Lib/turtle.py Wed Feb 25 13:53:37 2009 @@ -38,7 +38,7 @@ ----- turtle.py This module is an extended reimplementation of turtle.py from the -Python standard distribution up to Python 2.5. (See: http:\\www.python.org) +Python standard distribution up to Python 2.5. (See: http://www.python.org) It tries to keep the merits of turtle.py and to be (nearly) 100% compatible with it. This means in the first place to enable the @@ -54,8 +54,8 @@ - Different turtle shapes, gif-images as turtle shapes, user defined and user controllable turtle shapes, among them compound - (multicolored) shapes. Turtle shapes can be stgretched and tilted, which - makes turtles zu very versatile geometrical objects. + (multicolored) shapes. Turtle shapes can be stretched and tilted, which + makes turtles very versatile geometrical objects. - Fine control over turtle movement and screen updates via delay(), and enhanced tracer() and speed() methods. @@ -64,7 +64,7 @@ following the early Logo traditions. This reduces the boring work of typing long sequences of commands, which often occur in a natural way when kids try to program fancy pictures on their first encounter with - turtle graphcis. + turtle graphics. - Turtles now have an undo()-method with configurable undo-buffer. @@ -91,12 +91,12 @@ - If configured appropriately the module reads in docstrings from a docstring dictionary in some different language, supplied separately and replaces - the english ones by those read in. There is a utility function - write_docstringdict() to write a dictionary with the original (english) + the English ones by those read in. There is a utility function + write_docstringdict() to write a dictionary with the original (English) docstrings to disc, so it can serve as a template for translations. Behind the scenes there are some features included with possible -extensionsin in mind. These will be commented and documented elsewhere. +extensions in in mind. These will be commented and documented elsewhere. """ @@ -301,7 +301,7 @@ ############################################################################## ### From here up to line : Tkinter - Interface for turtle.py ### -### May be replaced by an interface to some different graphcis-toolkit ### +### May be replaced by an interface to some different graphics toolkit ### ############################################################################## ## helper functions for Scrolled Canvas, to forward Canvas-methods @@ -380,7 +380,7 @@ self._rootwindow.bind('', self.onResize) def reset(self, canvwidth=None, canvheight=None, bg = None): - """Ajust canvas and scrollbars according to given canvas size.""" + """Adjust canvas and scrollbars according to given canvas size.""" if canvwidth: self.canvwidth = canvwidth if canvheight: @@ -776,7 +776,7 @@ self.cv.coords(item, *newcoordlist) def _resize(self, canvwidth=None, canvheight=None, bg=None): - """Resize the canvas, the turtles are drawing on. Does + """Resize the canvas the turtles are drawing on. Does not alter the drawing window. """ # needs amendment @@ -951,7 +951,7 @@ def clear(self): """Delete all drawings and all turtles from the TurtleScreen. - Reset empty TurtleScreen to it's initial state: white background, + Reset empty TurtleScreen to its initial state: white background, no backgroundimage, no eventbindings and tracing on. No argument. @@ -1317,7 +1317,7 @@ fun -- a function with no arguments key -- a string: key (e.g. "a") or key-symbol (e.g. "space") - In order ro be able to register key-events, TurtleScreen + In order to be able to register key-events, TurtleScreen must have focus. (See method listen.) Example (for a TurtleScreen instance named screen @@ -1399,7 +1399,7 @@ self._bgpicname = picname def screensize(self, canvwidth=None, canvheight=None, bg=None): - """Resize the canvas, the turtles are drawing on. + """Resize the canvas the turtles are drawing on. Optional arguments: canvwidth -- positive integer, new width of canvas in pixels @@ -1692,8 +1692,8 @@ No arguments. - Move turtle to the origin - coordinates (0,0) and set it's - heading to it's start-orientation (which depends on mode). + Move turtle to the origin - coordinates (0,0) and set its + heading to its start-orientation (which depends on mode). Example (for a Turtle instance named turtle): >>> turtle.home() @@ -2265,7 +2265,7 @@ "outline" : positive number "tilt" : number - This dicionary can be used as argument for a subsequent + This dictionary can be used as argument for a subsequent pen()-call 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. @@ -2413,7 +2413,7 @@ class RawTurtle(TPen, TNavigator): """Animation part of the RawTurtle. Puts RawTurtle upon a TurtleScreen and provides tools for - it's animation. + its animation. """ screens = [] @@ -2458,7 +2458,7 @@ self._update() def reset(self): - """Delete the turtle's drawings and restore it's default values. + """Delete the turtle's drawings and restore its default values. No argument. , @@ -2748,7 +2748,7 @@ Return the current tilt-angle, i. e. the angle between the orientation of the turtleshape and the heading of the turtle - (it's direction of movement). + (its direction of movement). Examples (for a Turtle instance named turtle): >>> turtle.shape("circle") @@ -2793,7 +2793,7 @@ def _drawturtle(self): """Manages the correct rendering of the turtle with respect to - it's shape, resizemode, strech and tilt etc.""" + its shape, resizemode, stretch and tilt etc.""" screen = self.screen shape = screen._shapes[self.turtle.shapeIndex] ttype = shape._type @@ -2847,7 +2847,7 @@ ############################## stamp stuff ############################### def stamp(self): - """Stamp a copy of the turtleshape onto the canvas and return it's id. + """Stamp a copy of the turtleshape onto the canvas and return its id. No argument. Modified: python/branches/io-c/Lib/wsgiref/headers.py ============================================================================== --- python/branches/io-c/Lib/wsgiref/headers.py (original) +++ python/branches/io-c/Lib/wsgiref/headers.py Wed Feb 25 13:53:37 2009 @@ -6,7 +6,7 @@ """ # Regular expression that matches `special' characters in parameters, the -# existance of which force quoting of the parameter value. +# existence of which force quoting of the parameter value. import re tspecials = re.compile(r'[ \(\)<>@,;:\\"/\[\]\?=]') Modified: python/branches/io-c/Mac/Tools/bundlebuilder.py ============================================================================== --- python/branches/io-c/Mac/Tools/bundlebuilder.py (original) +++ python/branches/io-c/Mac/Tools/bundlebuilder.py Wed Feb 25 13:53:37 2009 @@ -658,7 +658,7 @@ if USE_ZIPIMPORT: if name != "zlib": # neatly pack all extension modules in a subdirectory, - # except zlib, since it's neccesary for bootstrapping. + # except zlib, since it's necessary for bootstrapping. dstpath = pathjoin("ExtensionModules", dstpath) # Python modules are stored in a Zip archive, but put # extensions in Contents/Resources/. Add a tiny "loader" Modified: python/branches/io-c/Makefile.pre.in ============================================================================== --- python/branches/io-c/Makefile.pre.in (original) +++ python/branches/io-c/Makefile.pre.in Wed Feb 25 13:53:37 2009 @@ -428,10 +428,10 @@ libpython$(VERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ - $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ $(LN) -f $(INSTSONAME) $@; \ else \ - $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ fi libpython$(VERSION).dylib: $(LIBRARY_OBJS) @@ -439,7 +439,7 @@ libpython$(VERSION).sl: $(LIBRARY_OBJS) - $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) + $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST) # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary # minimal framework (not including the Lib directory and such) in the current Modified: python/branches/io-c/Misc/ACKS ============================================================================== --- python/branches/io-c/Misc/ACKS (original) +++ python/branches/io-c/Misc/ACKS Wed Feb 25 13:53:37 2009 @@ -421,6 +421,7 @@ Mark Levinson William Lewis Robert van Liere +Ross Light Shawn Ligocki Martin Ligr Christopher Lindblad @@ -612,6 +613,7 @@ Mark Russell Nick Russo Hajime Saitou +George Sakkis Rich Salz Kevin Samborn Ilya Sandler Modified: python/branches/io-c/Misc/AIX-NOTES ============================================================================== --- python/branches/io-c/Misc/AIX-NOTES (original) +++ python/branches/io-c/Misc/AIX-NOTES Wed Feb 25 13:53:37 2009 @@ -22,7 +22,7 @@ (2) Stefan Esser (se at MI.Uni-Koeln.DE), in work done to compile Python 1.0.0 on AIX 3.2.4, reports that AIX compilers don't like the LANG environment varaiable set to European locales. This makes the compiler - generate floating point constants using "," as the decimal seperator, + generate floating point constants using "," as the decimal separator, which the assembler doesn't understand (or perhaps it is the other way around, with the assembler expecting, but not getting "," in float numbers). "LANG=C; export LANG" solves the problem, as does Modified: python/branches/io-c/Misc/HISTORY ============================================================================== --- python/branches/io-c/Misc/HISTORY (original) +++ python/branches/io-c/Misc/HISTORY Wed Feb 25 13:53:37 2009 @@ -11247,7 +11247,7 @@ Also (quite separately, but strangely related to the philosophical issue above) fix abspath() so that if win32api exists, it doesn't fail when the path doesn't actually exist -- if GetFullPathName() fails, - fall back on the old strategy (join with getcwd() if neccessary, and + fall back on the old strategy (join with getcwd() if necessary, and then use normpath()). * configure.in, configure, config.h.in, acconfig.h: Modified: python/branches/io-c/Misc/NEWS ============================================================================== --- python/branches/io-c/Misc/NEWS (original) +++ python/branches/io-c/Misc/NEWS Wed Feb 25 13:53:37 2009 @@ -12,6 +12,13 @@ Core and Builtins ----------------- +======= +- Issue #5247: Improve error message when unknown format codes are + used when using str.format() with str, int, and float arguments. + +- Issue #5249: time.strftime returned malformed string when format string + contained non ascii character on windows. + - Issue #5186: Reduce hash collisions for objects with no __hash__ method by rotating the object pointer by 4 bits to the right. @@ -166,7 +173,18 @@ Library ------- -- Issue #5257: refactored all tests in distutils, so they use +- Issue #5287: Add exception handling around findCaller() call to help out + IronPython. + +- Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0, + The file was resized to wrong size. + +- Issue #5292: Fixed mmap crash on its boundary access m[len(m)]. + +- Issue #2279: distutils.sdist.add_defaults now add files + from the package_data and the data_files metadata. + +- Issue #5257: refactored all tests in distutils, so they use support.TempdirManager, to avoid writing in the tests directory. - Issue #4524: distutils build_script command failed with --with-suffix=3. @@ -216,13 +234,13 @@ - Issue #4285: Change sys.version_info to be a named tuple. Patch by Ross Light. -- Issue #1520877: Now distutils.sysconfig reads $AR from the +- Issue #1520877: Now distutils.sysconfig reads $AR from the environment/Makefile. Patch by Douglas Greiman. - Issue #1276768: The verbose option was not used in the code of distutils.file_util and distutils.dir_util. -- Issue #5132: Fixed trouble building extensions under Solaris with +- Issue #5132: Fixed trouble building extensions under Solaris with --enabled-shared activated. Initial patch by Dave Peterson. - Issue #1581476: Always use the Tcl global namespace when calling into Tcl. @@ -272,7 +290,7 @@ - Issue #4710: Extract directories properly in the zipfile module; allow adding directories to a zipfile. -- Issue #3807: _multiprocessing build fails when configure is passed +- Issue #3807: _multiprocessing build fails when configure is passed --without-threads argument. When this occurs, _multiprocessing will be disabled, and not compiled. @@ -461,6 +479,8 @@ Build ----- +- Link the shared python library with $(MODLIBS). + - Issue #5134: Silence compiler warnings when compiling sqlite with VC++. - Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. Modified: python/branches/io-c/Misc/cheatsheet ============================================================================== --- python/branches/io-c/Misc/cheatsheet (original) +++ python/branches/io-c/Misc/cheatsheet Wed Feb 25 13:53:37 2009 @@ -476,7 +476,7 @@ s.isupper() return True if all characters in s are uppercase, False (6) otherwise. s.join(seq) return a concatenation of the strings in the sequence - seq, seperated by 's's. + seq, separated by 's's. s.ljust(width) return s left justified in a string of length width. (1), (8) s.lower() return a copy of s converted to lowercase. @@ -1509,10 +1509,10 @@ asctime( timeTuple), strftime( -format, return a formated string representing time. +format, return a formatted string representing time. timeTuple) mktime(tuple) inverse of localtime(). Return a float. -strptime( parse a formated string representing time, return tuple as in +strptime( parse a formatted string representing time, return tuple as in string[, gmtime(). format]) sleep(secs) Suspend execution for seconds. can be a float. Modified: python/branches/io-c/Misc/python.man ============================================================================== --- python/branches/io-c/Misc/python.man (original) +++ python/branches/io-c/Misc/python.man Wed Feb 25 13:53:37 2009 @@ -306,9 +306,6 @@ needed for developing Python extensions and embedding the interpreter. .RE -.IP \fI~/.pythonrc.py\fP -User-specific initialization file loaded by the \fIuser\fP module; -not used by default or by most applications. .SH ENVIRONMENT VARIABLES .IP PYTHONHOME Change the location of the standard Python libraries. By default, the Modified: python/branches/io-c/Modules/Setup.dist ============================================================================== --- python/branches/io-c/Modules/Setup.dist (original) +++ python/branches/io-c/Modules/Setup.dist Wed Feb 25 13:53:37 2009 @@ -168,6 +168,7 @@ #_pickle _pickle.c # pickle accelerator #datetime datetimemodule.c # date/time type #_bisect _bisectmodule.c # Bisection algorithms +#_heapq _heapqmodule.c # Heap queue algorithm #unicodedata unicodedata.c # static Unicode character database Modified: python/branches/io-c/Modules/_ctypes/_ctypes.c ============================================================================== --- python/branches/io-c/Modules/_ctypes/_ctypes.c (original) +++ python/branches/io-c/Modules/_ctypes/_ctypes.c Wed Feb 25 13:53:37 2009 @@ -566,13 +566,14 @@ #else address = (void *)ctypes_dlsym(handle, name); if (!address) { - PyErr_Format(PyExc_ValueError, #ifdef __CYGWIN__ /* dlerror() isn't very helpful on cygwin */ + PyErr_Format(PyExc_ValueError, "symbol '%s' not found (%s) ", - name, + name); +#else + PyErr_SetString(PyExc_ValueError, ctypes_dlerror()); #endif - ctypes_dlerror()); return NULL; } #endif @@ -3208,13 +3209,14 @@ #else address = (PPROC)ctypes_dlsym(handle, name); if (!address) { - PyErr_Format(PyExc_AttributeError, #ifdef __CYGWIN__ /* dlerror() isn't very helpful on cygwin */ + PyErr_Format(PyExc_AttributeError, "function '%s' not found (%s) ", - name, + name); +#else + PyErr_SetString(PyExc_AttributeError, ctypes_dlerror()); #endif - ctypes_dlerror()); return NULL; } #endif Modified: python/branches/io-c/Modules/_ctypes/libffi/aclocal.m4 ============================================================================== --- python/branches/io-c/Modules/_ctypes/libffi/aclocal.m4 (original) +++ python/branches/io-c/Modules/_ctypes/libffi/aclocal.m4 Wed Feb 25 13:53:37 2009 @@ -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 Modified: python/branches/io-c/Modules/_ctypes/libffi/configure ============================================================================== --- python/branches/io-c/Modules/_ctypes/libffi/configure (original) +++ python/branches/io-c/Modules/_ctypes/libffi/configure Wed Feb 25 13:53:37 2009 @@ -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 Modified: python/branches/io-c/Modules/_ctypes/libffi/src/x86/ffi64.c ============================================================================== --- python/branches/io-c/Modules/_ctypes/libffi/src/x86/ffi64.c (original) +++ python/branches/io-c/Modules/_ctypes/libffi/src/x86/ffi64.c Wed Feb 25 13:53:37 2009 @@ -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). */ Modified: python/branches/io-c/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c ============================================================================== --- python/branches/io-c/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c (original) +++ python/branches/io-c/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c Wed Feb 25 13:53:37 2009 @@ -55,7 +55,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). */ Modified: python/branches/io-c/Modules/_sqlite/connection.c ============================================================================== --- python/branches/io-c/Modules/_sqlite/connection.c (original) +++ python/branches/io-c/Modules/_sqlite/connection.c Wed Feb 25 13:53:37 2009 @@ -770,7 +770,7 @@ PyErr_Clear(); } - /* abort query if error occured */ + /* abort query if error occurred */ rc = 1; } else { rc = (int)PyObject_IsTrue(ret); Modified: python/branches/io-c/Modules/arraymodule.c ============================================================================== --- python/branches/io-c/Modules/arraymodule.c (original) +++ python/branches/io-c/Modules/arraymodule.c Wed Feb 25 13:53:37 2009 @@ -904,7 +904,7 @@ PyDoc_STRVAR(count_doc, "count(x)\n\ \n\ -Return number of occurences of x in the array."); +Return number of occurrences of x in the array."); static PyObject * array_index(arrayobject *self, PyObject *v) @@ -928,7 +928,7 @@ PyDoc_STRVAR(index_doc, "index(x)\n\ \n\ -Return index of first occurence of x in the array."); +Return index of first occurrence of x in the array."); static int array_contains(arrayobject *self, PyObject *v) @@ -970,7 +970,7 @@ PyDoc_STRVAR(remove_doc, "remove(x)\n\ \n\ -Remove the first occurence of x in the array."); +Remove the first occurrence of x in the array."); static PyObject * array_pop(arrayobject *self, PyObject *args) @@ -1982,15 +1982,15 @@ append() -- append a new item to the end of the array\n\ buffer_info() -- return information giving the current memory info\n\ byteswap() -- byteswap all the items of the array\n\ -count() -- return number of occurences of an object\n\ +count() -- return number of occurrences of an object\n\ extend() -- extend array by appending multiple elements from an iterable\n\ fromfile() -- read items from a file object\n\ fromlist() -- append items from the list\n\ fromstring() -- append items from the string\n\ -index() -- return index of first occurence of an object\n\ +index() -- return index of first occurrence of an object\n\ insert() -- insert a new item into the array at a provided position\n\ pop() -- remove and return item (default last)\n\ -remove() -- remove first occurence of an object\n\ +remove() -- remove first occurrence of an object\n\ reverse() -- reverse the order of the items in the array\n\ tofile() -- write all items to a file object\n\ tolist() -- return the array converted to an ordinary list\n\ Modified: python/branches/io-c/Modules/itertoolsmodule.c ============================================================================== --- python/branches/io-c/Modules/itertoolsmodule.c (original) +++ python/branches/io-c/Modules/itertoolsmodule.c Wed Feb 25 13:53:37 2009 @@ -745,8 +745,10 @@ while (1) { item = PyIter_Next(lz->it); if (item != NULL) { - if (!lz->firstpass) - PyList_Append(lz->saved, item); + if (!lz->firstpass && PyList_Append(lz->saved, item)) { + Py_DECREF(item); + return NULL; + } return item; } if (PyErr_Occurred()) { @@ -2605,11 +2607,9 @@ PyObject *seq1, *seq2; PyObject *data=NULL, *selectors=NULL; compressobject *lz; - - if (type == &compress_type && !_PyArg_NoKeywords("compress()", kwds)) - return NULL; - - if (!PyArg_UnpackTuple(args, "compress", 2, 2, &seq1, &seq2)) + static char *kwargs[] = {"data", "selectors", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO:compress", kwargs, &seq1, &seq2)) return NULL; data = PyObject_GetIter(seq1); @@ -2687,7 +2687,7 @@ } PyDoc_STRVAR(compress_doc, -"compress(data sequence, selector sequence) --> iterator over selected data\n\ +"compress(data, selectors) --> iterator over selected data\n\ \n\ Return data elements corresponding to true selector elements.\n\ Forms a shorter iterator from selected data elements using the\n\ @@ -2892,19 +2892,19 @@ /* Counting logic and invariants: -C_add_mode: when cnt an integer < PY_SSIZE_T_MAX and no step is specified. +fast_mode: when cnt an integer < PY_SSIZE_T_MAX and no step is specified. assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL && long_step==PyInt(1)); Advances with: cnt += 1 - When count hits Y_SSIZE_T_MAX, switch to Py_add_mode. + When count hits Y_SSIZE_T_MAX, switch to slow_mode. -Py_add_mode: when cnt == PY_SSIZE_T_MAX, step is not int(1), or cnt is a float. +slow_mode: when cnt == PY_SSIZE_T_MAX, step is not int(1), or cnt is a float. assert(cnt == PY_SSIZE_T_MAX && long_cnt != NULL && long_step != NULL); All counting is done with python objects (no overflows or underflows). Advances with: long_cnt += long_step Step may be zero -- effectively a slow version of repeat(cnt). - Either long_cnt or long_step may be a float. + Either long_cnt or long_step may be a float, Fraction, or Decimal. */ static PyTypeObject count_type; @@ -2913,6 +2913,7 @@ count_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { countobject *lz; + int slow_mode = 0; Py_ssize_t cnt = 0; PyObject *long_cnt = NULL; PyObject *long_step = NULL; @@ -2922,39 +2923,54 @@ kwlist, &long_cnt, &long_step)) return NULL; - if (long_cnt != NULL && !PyNumber_Check(long_cnt) || - long_step != NULL && !PyNumber_Check(long_step)) { + if ((long_cnt != NULL && !PyNumber_Check(long_cnt)) || + (long_step != NULL && !PyNumber_Check(long_step))) { PyErr_SetString(PyExc_TypeError, "a number is required"); return NULL; } + if (long_cnt != NULL) { + cnt = PyLong_AsSsize_t(long_cnt); + if ((cnt == -1 && PyErr_Occurred()) || !PyLong_Check(long_cnt)) { + PyErr_Clear(); + slow_mode = 1; + } + Py_INCREF(long_cnt); + } else { + cnt = 0; + long_cnt = PyLong_FromLong(0); + } + + /* If not specified, step defaults to 1 */ if (long_step == NULL) { - /* If not specified, step defaults to 1 */ long_step = PyLong_FromLong(1); - if (long_step == NULL) + if (long_step == NULL) { + Py_DECREF(long_cnt); return NULL; + } } else Py_INCREF(long_step); - assert(long_step != NULL); - if (long_cnt != NULL) { - cnt = PyLong_AsSsize_t(long_cnt); - if ((cnt == -1 && PyErr_Occurred()) || - !PyIndex_Check(long_cnt) || - !PyLong_Check(long_step) || - PyLong_AS_LONG(long_step) != 1) { - /* Switch to Py_add_mode */ - PyErr_Clear(); - Py_INCREF(long_cnt); - cnt = PY_SSIZE_T_MAX; - } else - long_cnt = NULL; + assert(long_cnt != NULL && long_step != NULL); + + /* Fast mode only works when the step is 1 */ + if (!PyLong_Check(long_step) || + PyLong_AS_LONG(long_step) != 1) { + slow_mode = 1; } - assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL || - cnt == PY_SSIZE_T_MAX && long_cnt != NULL); + + if (slow_mode) + cnt = PY_SSIZE_T_MAX; + else + Py_CLEAR(long_cnt); + + assert((cnt != PY_SSIZE_T_MAX && long_cnt == NULL && !slow_mode) || + (cnt == PY_SSIZE_T_MAX && long_cnt != NULL && slow_mode)); + assert(slow_mode || + (PyLong_Check(long_step) && PyLong_AS_LONG(long_step) == 1)); /* create countobject structure */ - lz = (countobject *)PyObject_New(countobject, &count_type); + lz = (countobject *)type->tp_alloc(type, 0); if (lz == NULL) { Py_XDECREF(long_cnt); return NULL; @@ -2969,21 +2985,29 @@ static void count_dealloc(countobject *lz) { + PyObject_GC_UnTrack(lz); Py_XDECREF(lz->long_cnt); Py_XDECREF(lz->long_step); - PyObject_Del(lz); + Py_TYPE(lz)->tp_free(lz); +} + +static int +count_traverse(countobject *lz, visitproc visit, void *arg) +{ + Py_VISIT(lz->long_cnt); + Py_VISIT(lz->long_step); + return 0; } static PyObject * count_nextlong(countobject *lz) { - static PyObject *one = NULL; PyObject *long_cnt; PyObject *stepped_up; long_cnt = lz->long_cnt; if (long_cnt == NULL) { - /* Switch to Py_add_mode */ + /* Switch to slow_mode */ long_cnt = PyLong_FromSsize_t(PY_SSIZE_T_MAX); if (long_cnt == NULL) return NULL; @@ -3026,11 +3050,10 @@ } PyDoc_STRVAR(count_doc, - "count([start[, step]]) --> count object\n\ + "count(start=0, step=1]) --> count object\n\ \n\ -Return a count object whose .__next__() method returns consecutive\n\ -integers starting from zero or, if specified, from start.\n\ -If step is specified, counts by that interval. Equivalent to:\n\n\ +Return a count object whose .__next__() method returns consecutive values.\n\ +Equivalent to:\n\n\ def count(firstval=0, step=1):\n\ x = firstval\n\ while 1:\n\ @@ -3058,9 +3081,10 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | + Py_TPFLAGS_BASETYPE, /* tp_flags */ count_doc, /* tp_doc */ - 0, /* tp_traverse */ + (traverseproc)count_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ @@ -3077,6 +3101,7 @@ 0, /* tp_init */ 0, /* tp_alloc */ count_new, /* tp_new */ + PyObject_GC_Del, /* tp_free */ }; @@ -3096,11 +3121,10 @@ repeatobject *ro; PyObject *element; Py_ssize_t cnt = -1; - - if (type == &repeat_type && !_PyArg_NoKeywords("repeat()", kwds)) - return NULL; - - if (!PyArg_ParseTuple(args, "O|n:repeat", &element, &cnt)) + static char *kwargs[] = {"object", "times", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|n:repeat", kwargs, + &element, &cnt)) return NULL; if (PyTuple_Size(args) == 2 && cnt < 0) @@ -3168,8 +3192,8 @@ }; PyDoc_STRVAR(repeat_doc, -"repeat(element [,times]) -> create an iterator which returns the element\n\ -for the specified number of times. If not specified, returns the element\n\ +"repeat(object [,times]) -> create an iterator which returns the object\n\ +for the specified number of times. If not specified, returns the object\n\ endlessly."); static PyTypeObject repeat_type = { Modified: python/branches/io-c/Modules/mmapmodule.c ============================================================================== --- python/branches/io-c/Modules/mmapmodule.c (original) +++ python/branches/io-c/Modules/mmapmodule.c Wed Feb 25 13:53:37 2009 @@ -455,7 +455,7 @@ off_lo = (DWORD)(self->offset & 0xFFFFFFFF); #else newSizeHigh = 0; - newSizeLow = (DWORD)new_size; + newSizeLow = (DWORD)(self->offset + new_size); off_hi = 0; off_lo = (DWORD)self->offset; #endif @@ -501,7 +501,7 @@ } else { void *newmap; - if (ftruncate(self->fd, new_size) == -1) { + if (ftruncate(self->fd, self->offset + new_size) == -1) { PyErr_SetFromErrno(mmap_module_error); return NULL; } @@ -692,7 +692,7 @@ return NULL; if (i < 0) i += self->size; - if (i < 0 || (size_t)i > self->size) { + if (i < 0 || (size_t)i >= self->size) { PyErr_SetString(PyExc_IndexError, "mmap index out of range"); return NULL; @@ -797,7 +797,7 @@ return -1; if (i < 0) i += self->size; - if (i < 0 || (size_t)i > self->size) { + if (i < 0 || (size_t)i >= self->size) { PyErr_SetString(PyExc_IndexError, "mmap index out of range"); return -1; Modified: python/branches/io-c/Modules/posixmodule.c ============================================================================== --- python/branches/io-c/Modules/posixmodule.c (original) +++ python/branches/io-c/Modules/posixmodule.c Wed Feb 25 13:53:37 2009 @@ -331,6 +331,109 @@ #endif #endif +#if defined _MSC_VER && _MSC_VER >= 1400 +/* Microsoft CRT in VS2005 and higher will verify that a filehandle is + * valid and throw an assertion if it isn't. + * Normally, an invalid fd is likely to be a C program error and therefore + * an assertion can be useful, but it does contradict the POSIX standard + * which for write(2) states: + * "Otherwise, -1 shall be returned and errno set to indicate the error." + * "[EBADF] The fildes argument is not a valid file descriptor open for + * writing." + * Furthermore, python allows the user to enter any old integer + * as a fd and should merely raise a python exception on error. + * The Microsoft CRT doesn't provide an official way to check for the + * validity of a file descriptor, but we can emulate its internal behaviour + * by using the exported __pinfo data member and knowledge of the + * internal structures involved. + * The structures below must be updated for each version of visual studio + * according to the file internal.h in the CRT source, until MS comes + * up with a less hacky way to do this. + * (all of this is to avoid globally modifying the CRT behaviour using + * _set_invalid_parameter_handler() and _CrtSetReportMode()) + */ +#if _MSC_VER >= 1500 /* VS 2008 */ +typedef struct { + intptr_t osfhnd; + char osfile; + char pipech; + int lockinitflag; + CRITICAL_SECTION lock; +#ifndef _SAFECRT_IMPL + char textmode : 7; + char unicode : 1; + char pipech2[2]; + __int64 startpos; + BOOL utf8translations; + char dbcsBuffer; + BOOL dbcsBufferUsed; +#endif /* _SAFECRT_IMPL */ + } ioinfo; +#elif _MSC_VER >= 1400 /* VS 2005 */ +typedef struct { + intptr_t osfhnd; + char osfile; + char pipech; + int lockinitflag; + CRITICAL_SECTION lock; +#ifndef _SAFECRT_IMPL + char textmode : 7; + char unicode : 1; + char pipech2[2]; + __int64 startpos; + BOOL utf8translations; +#endif /* _SAFECRT_IMPL */ + } ioinfo; +#endif + +extern __declspec(dllimport) ioinfo * __pioinfo[]; +#define IOINFO_L2E 5 +#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) +#define IOINFO_ARRAYS 64 +#define _NHANDLE_ (IOINFO_ARRAYS * IOINFO_ARRAY_ELTS) +#define FOPEN 0x01 +#define _NO_CONSOLE_FILENO (intptr_t)-2 + +/* This function emulates what the windows CRT does to validate file handles */ +int +_PyVerify_fd(int fd) +{ + const int i1 = fd >> IOINFO_L2E; + const int i2 = fd & ((1 << IOINFO_L2E) - 1); + + /* See that it isn't a special CLEAR fileno */ + if (fd != _NO_CONSOLE_FILENO) { + /* Microsoft CRT would check that 0<=fd<_nhandle but we can't do that. Instead + * we check pointer validity and other info + */ + if (0 <= i1 && i1 < IOINFO_ARRAYS && __pioinfo[i1] != NULL) { + /* finally, check that the file is open */ + if (__pioinfo[i1][i2].osfile & FOPEN) + return 1; + } + } + errno = EBADF; + return 0; +} + +/* the special case of checking dup2. The target fd must be in a sensible range */ +static int +_PyVerify_fd_dup2(int fd1, int fd2) +{ + if (!_PyVerify_fd(fd1)) + return 0; + if (fd2 == _NO_CONSOLE_FILENO) + return 0; + if ((unsigned)fd2 < _NHANDLE_) + return 1; + else + return 0; +} +#else +/* dummy version. _PyVerify_fd() is already defined in fileobject.h */ +#define _PyVerify_fd_dup2(A, B) (1) +#endif + /* Return a dictionary corresponding to the POSIX environment table */ #ifdef WITH_NEXT_FRAMEWORK /* On Darwin/MacOSX a shared library or framework has no access to @@ -606,6 +709,8 @@ fd = PyObject_AsFileDescriptor(fdobj); if (fd < 0) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS res = (*func)(fd); Py_END_ALLOW_THREADS @@ -2385,7 +2490,7 @@ static PyObject * posix__getfullpathname(PyObject *self, PyObject *args) { - /* assume encoded strings wont more than double no of chars */ + /* 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); @@ -4725,6 +4830,8 @@ int fd, res; if (!PyArg_ParseTuple(args, "i:close", &fd)) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS res = close(fd); Py_END_ALLOW_THREADS @@ -4747,7 +4854,8 @@ return NULL; Py_BEGIN_ALLOW_THREADS for (i = fd_from; i < fd_to; i++) - close(i); + if (_PyVerify_fd(i)) + close(i); Py_END_ALLOW_THREADS Py_RETURN_NONE; } @@ -4763,6 +4871,8 @@ int fd; if (!PyArg_ParseTuple(args, "i:dup", &fd)) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS fd = dup(fd); Py_END_ALLOW_THREADS @@ -4782,6 +4892,8 @@ int fd, fd2, res; if (!PyArg_ParseTuple(args, "ii:dup2", &fd, &fd2)) return NULL; + if (!_PyVerify_fd_dup2(fd, fd2)) + return posix_error(); Py_BEGIN_ALLOW_THREADS res = dup2(fd, fd2); Py_END_ALLOW_THREADS @@ -4826,6 +4938,8 @@ if (PyErr_Occurred()) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS #if defined(MS_WIN64) || defined(MS_WINDOWS) res = _lseeki64(fd, pos, how); @@ -4863,6 +4977,8 @@ buffer = PyBytes_FromStringAndSize((char *)NULL, size); if (buffer == NULL) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS n = read(fd, PyBytes_AS_STRING(buffer), size); Py_END_ALLOW_THREADS @@ -4889,6 +5005,8 @@ if (!PyArg_ParseTuple(args, "iy*:write", &fd, &pbuf)) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS size = write(fd, pbuf.buf, (size_t)pbuf.len); Py_END_ALLOW_THREADS @@ -4915,6 +5033,8 @@ /* on OpenVMS we must ensure that all bytes are written to the file */ fsync(fd); #endif + if (!_PyVerify_fd(fd)) + return posix_error(); Py_BEGIN_ALLOW_THREADS res = FSTAT(fd, &st); Py_END_ALLOW_THREADS @@ -4940,6 +5060,8 @@ int fd; if (!PyArg_ParseTuple(args, "i:isatty", &fd)) return NULL; + if (!_PyVerify_fd(fd)) + return PyBool_FromLong(0); return PyBool_FromLong(isatty(fd)); } @@ -6702,6 +6824,8 @@ int fd; if (!PyArg_ParseTuple(args, "i:device_encoding", &fd)) return NULL; + if (!_PyVerify_fd(fd)) + return posix_error(); if (!isatty(fd)) { Py_INCREF(Py_None); return Py_None; Modified: python/branches/io-c/Modules/timemodule.c ============================================================================== --- python/branches/io-c/Modules/timemodule.c (original) +++ python/branches/io-c/Modules/timemodule.c Wed Feb 25 13:53:37 2009 @@ -508,9 +508,11 @@ return NULL; } - /* Convert the unicode string to an ascii one */ - fmt = _PyUnicode_AsString(format); - + /* 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); fmtlen = strlen(fmt); /* I hate these functions that presume you know how big the output @@ -519,6 +521,7 @@ for (i = 1024; ; i += i) { outbuf = (char *)PyMem_Malloc(i); if (outbuf == NULL) { + Py_DECREF(format); return PyErr_NoMemory(); } buflen = strftime(outbuf, i, fmt, &buf); @@ -532,6 +535,7 @@ ret = PyUnicode_Decode(outbuf, buflen, TZNAME_ENCODING, NULL); PyMem_Free(outbuf); + Py_DECREF(format); return ret; } PyMem_Free(outbuf); @@ -539,6 +543,7 @@ /* VisualStudio .NET 2005 does this properly */ if (buflen == 0 && errno == EINVAL) { PyErr_SetString(PyExc_ValueError, "Invalid format string"); + Py_DECREF(format); return 0; } #endif Modified: python/branches/io-c/Objects/abstract.c ============================================================================== --- python/branches/io-c/Objects/abstract.c (original) +++ python/branches/io-c/Objects/abstract.c Wed Feb 25 13:53:37 2009 @@ -1872,7 +1872,7 @@ /* Iterate over seq. Result depends on the operation: PY_ITERSEARCH_COUNT: -1 if error, else # of times obj appears in seq. - PY_ITERSEARCH_INDEX: 0-based index of first occurence of obj in seq; + PY_ITERSEARCH_INDEX: 0-based index of first occurrence of obj in seq; set ValueError and return -1 if none found; also return -1 on error. Py_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on error. */ Modified: python/branches/io-c/Objects/listsort.txt ============================================================================== --- python/branches/io-c/Objects/listsort.txt (original) +++ python/branches/io-c/Objects/listsort.txt Wed Feb 25 13:53:37 2009 @@ -309,7 +309,7 @@ A:10000 B:20000 C:10000 we dare not merge A with C first, because if A, B and C happen to contain -a common element, it would get out of order wrt its occurence(s) in B. The +a common element, it would get out of order wrt its occurrence(s) in B. The merging must be done as (A+B)+C or A+(B+C) instead. So merging is always done on two consecutive runs at a time, and in-place, Modified: python/branches/io-c/Objects/longobject.c ============================================================================== --- python/branches/io-c/Objects/longobject.c (original) +++ python/branches/io-c/Objects/longobject.c Wed Feb 25 13:53:37 2009 @@ -6,6 +6,7 @@ #include "longintrepr.h" #include +#include #ifndef NSMALLPOSINTS #define NSMALLPOSINTS 257 @@ -14,8 +15,10 @@ #define NSMALLNEGINTS 5 #endif -#define MEDIUM_VALUE(x) (Py_SIZE(x) < 0 ? -(x)->ob_digit[0] : \ - (Py_SIZE(x) == 0 ? 0 : (x)->ob_digit[0])) +/* convert a PyLong of size 1, 0 or -1 to an sdigit */ +#define MEDIUM_VALUE(x) (Py_SIZE(x) < 0 ? -(sdigit)(x)->ob_digit[0] : \ + (Py_SIZE(x) == 0 ? (sdigit)0 : \ + (sdigit)(x)->ob_digit[0])) #define ABS(x) ((x) < 0 ? -(x) : (x)) #if NSMALLNEGINTS + NSMALLPOSINTS > 0 @@ -30,7 +33,7 @@ #endif static PyObject * -get_small_int(int ival) +get_small_int(sdigit ival) { PyObject *v = (PyObject*)(small_ints + ival + NSMALLNEGINTS); Py_INCREF(v); @@ -44,14 +47,14 @@ } #define CHECK_SMALL_INT(ival) \ do if (-NSMALLNEGINTS <= ival && ival < NSMALLPOSINTS) { \ - return get_small_int((int)ival); \ + return get_small_int((sdigit)ival); \ } while(0) static PyLongObject * maybe_small_long(PyLongObject *v) { if (v && ABS(Py_SIZE(v)) <= 1) { - int ival = MEDIUM_VALUE(v); + sdigit ival = MEDIUM_VALUE(v); if (-NSMALLNEGINTS <= ival && ival < NSMALLPOSINTS) { Py_DECREF(v); return (PyLongObject *)get_small_int(ival); @@ -90,12 +93,6 @@ #define MAX(x, y) ((x) < (y) ? (y) : (x)) #define MIN(x, y) ((x) > (y) ? (y) : (x)) -/* Forward */ -static PyLongObject *long_normalize(PyLongObject *); -static PyLongObject *mul1(PyLongObject *, wdigit); -static PyLongObject *muladd1(PyLongObject *, wdigit, wdigit); -static PyLongObject *divrem1(PyLongObject *, digit, digit *); - #define SIGCHECK(PyTryBlock) \ if (--_Py_Ticker < 0) { \ _Py_Ticker = _Py_CheckInterval; \ @@ -122,25 +119,29 @@ /* Allocate a new long int object with size digits. Return NULL and set exception if we run out of memory. */ +#define MAX_LONG_DIGITS \ + ((PY_SSIZE_T_MAX - offsetof(PyLongObject, ob_digit))/sizeof(digit)) + PyLongObject * _PyLong_New(Py_ssize_t size) { PyLongObject *result; - /* Can't use sizeof(PyLongObject) here, since the - compiler takes padding at the end into account. - As the consequence, this would waste 2 bytes on - a 32-bit system, and 6 bytes on a 64-bit system. - This computation would be incorrect on systems - which have padding before the digits; with 16-bit - digits this should not happen. */ - result = PyObject_MALLOC(sizeof(PyVarObject) + + /* Number of bytes needed is: offsetof(PyLongObject, ob_digit) + + sizeof(digit)*size. Previous incarnations of this code used + sizeof(PyVarObject) instead of the offsetof, but this risks being + incorrect in the presence of padding between the PyVarObject header + and the digits. */ + if (size > (Py_ssize_t)MAX_LONG_DIGITS) { + PyErr_SetString(PyExc_OverflowError, + "too many digits in integer"); + return NULL; + } + result = PyObject_MALLOC(offsetof(PyLongObject, ob_digit) + size*sizeof(digit)); if (!result) { PyErr_NoMemory(); return NULL; } - /* XXX(nnorwitz): This can overflow -- - PyObject_NEW_VAR / _PyObject_VAR_SIZE need to detect overflow */ return (PyLongObject*)PyObject_INIT_VAR(result, &PyLong_Type, size); } @@ -155,7 +156,7 @@ if (i < 0) i = -(i); if (i < 2) { - int ival = src->ob_digit[0]; + sdigit ival = src->ob_digit[0]; if (Py_SIZE(src) < 0) ival = -ival; CHECK_SMALL_INT(ival); @@ -297,8 +298,8 @@ return NULL; frac = ldexp(frac, (expo-1) % PyLong_SHIFT + 1); for (i = ndig; --i >= 0; ) { - long bits = (long)frac; - v->ob_digit[i] = (digit) bits; + digit bits = (digit)frac; + v->ob_digit[i] = bits; frac = frac - (double)bits; frac = ldexp(frac, PyLong_SHIFT); } @@ -364,7 +365,7 @@ switch (i) { case -1: - res = -v->ob_digit[0]; + res = -(sdigit)v->ob_digit[0]; break; case 0: res = 0; @@ -439,7 +440,7 @@ v = (PyLongObject *)vv; i = Py_SIZE(v); switch (i) { - case -1: return -v->ob_digit[0]; + case -1: return -(sdigit)v->ob_digit[0]; case 0: return 0; case 1: return v->ob_digit[0]; } @@ -667,9 +668,9 @@ int incr; /* direction to move pstartbyte */ const unsigned char* pendbyte; /* MSB of bytes */ size_t numsignificantbytes; /* number of bytes that matter */ - size_t ndigits; /* number of Python long digits */ + Py_ssize_t ndigits; /* number of Python long digits */ PyLongObject* v; /* result */ - int idigit = 0; /* next free index in v->ob_digit */ + Py_ssize_t idigit = 0; /* next free index in v->ob_digit */ if (n == 0) return PyLong_FromLong(0L); @@ -712,12 +713,16 @@ } /* How many Python long digits do we need? We have - 8*numsignificantbytes bits, and each Python long digit has PyLong_SHIFT - bits, so it's the ceiling of the quotient. */ + 8*numsignificantbytes bits, and each Python long digit has + PyLong_SHIFT bits, so it's the ceiling of the quotient. */ + /* catch overflow before it happens */ + if (numsignificantbytes > (PY_SSIZE_T_MAX - PyLong_SHIFT) / 8) { + PyErr_SetString(PyExc_OverflowError, + "byte array too long to convert to int"); + return NULL; + } ndigits = (numsignificantbytes * 8 + PyLong_SHIFT - 1) / PyLong_SHIFT; - if (ndigits > (size_t)INT_MAX) - return PyErr_NoMemory(); - v = _PyLong_New((int)ndigits); + v = _PyLong_New(ndigits); if (v == NULL) return NULL; @@ -746,8 +751,9 @@ accumbits += 8; if (accumbits >= PyLong_SHIFT) { /* There's enough to fill a Python digit. */ - assert(idigit < (int)ndigits); - v->ob_digit[idigit] = (digit)(accum & PyLong_MASK); + assert(idigit < ndigits); + v->ob_digit[idigit] = (digit)(accum & + PyLong_MASK); ++idigit; accum >>= PyLong_SHIFT; accumbits -= PyLong_SHIFT; @@ -756,7 +762,7 @@ } assert(accumbits < PyLong_SHIFT); if (accumbits) { - assert(idigit < (int)ndigits); + assert(idigit < ndigits); v->ob_digit[idigit] = (digit)accum; ++idigit; } @@ -1229,7 +1235,7 @@ v = (PyLongObject*)vv; switch(Py_SIZE(v)) { - case -1: return -v->ob_digit[0]; + case -1: return -(sdigit)v->ob_digit[0]; case 0: return 0; case 1: return v->ob_digit[0]; } @@ -1409,19 +1415,11 @@ /* Multiply by a single digit, ignoring the sign. */ static PyLongObject * -mul1(PyLongObject *a, wdigit n) -{ - return muladd1(a, n, (digit)0); -} - -/* Multiply by a single digit and add a single digit, ignoring the sign. */ - -static PyLongObject * -muladd1(PyLongObject *a, wdigit n, wdigit extra) +mul1(PyLongObject *a, digit n) { Py_ssize_t size_a = ABS(Py_SIZE(a)); PyLongObject *z = _PyLong_New(size_a+1); - twodigits carry = extra; + twodigits carry = 0; Py_ssize_t i; if (z == NULL) @@ -2034,8 +2032,6 @@ static PyLongObject *x_divrem (PyLongObject *, PyLongObject *, PyLongObject **); static PyObject *long_long(PyObject *v); -static int long_divrem(PyLongObject *, PyLongObject *, - PyLongObject **, PyLongObject **); /* Long division with remainder, top-level routine */ @@ -2148,7 +2144,7 @@ carry += v->ob_digit[i+k] - z + ((twodigits)zz << PyLong_SHIFT); v->ob_digit[i+k] = (digit)(carry & PyLong_MASK); - carry = Py_ARITHMETIC_RIGHT_SHIFT(BASE_TWODIGITS_TYPE, + carry = Py_ARITHMETIC_RIGHT_SHIFT(stwodigits, carry, PyLong_SHIFT); carry -= zz; } @@ -2168,7 +2164,7 @@ carry += v->ob_digit[i+k] + w->ob_digit[i]; v->ob_digit[i+k] = (digit)(carry & PyLong_MASK); carry = Py_ARITHMETIC_RIGHT_SHIFT( - BASE_TWODIGITS_TYPE, + stwodigits, carry, PyLong_SHIFT); } } @@ -2222,7 +2218,7 @@ if (i < 0) sign = 0; else { - sign = (int)a->ob_digit[i] - (int)b->ob_digit[i]; + sign = (sdigit)a->ob_digit[i] - (sdigit)b->ob_digit[i]; if (Py_SIZE(a) < 0) sign = -sign; } @@ -2283,7 +2279,7 @@ of mapping keys will turn out weird */ i = Py_SIZE(v); switch(i) { - case -1: return v->ob_digit[0]==1 ? -2 : -v->ob_digit[0]; + case -1: return v->ob_digit[0]==1 ? -2 : -(sdigit)v->ob_digit[0]; case 0: return 0; case 1: return v->ob_digit[0]; } @@ -2293,14 +2289,12 @@ sign = -1; i = -(i); } -#define LONG_BIT_PyLong_SHIFT (8*sizeof(long) - PyLong_SHIFT) /* The following loop produces a C unsigned long x such that x is congruent to the absolute value of v modulo ULONG_MAX. The resulting x is nonzero if and only if v is. */ while (--i >= 0) { /* Force a native long #-bits (32 or 64) circular shift */ - x = ((x << PyLong_SHIFT) & ~PyLong_MASK) | - ((x >> LONG_BIT_PyLong_SHIFT) & PyLong_MASK); + x = (x >> (8*SIZEOF_LONG-PyLong_SHIFT)) | (x << PyLong_SHIFT); x += v->ob_digit[i]; /* If the addition above overflowed we compensate by incrementing. This preserves the value modulo @@ -2308,11 +2302,10 @@ if (x < v->ob_digit[i]) x++; } -#undef LONG_BIT_PyLong_SHIFT x = x * sign; - if (x == -1) - x = -2; - return x; + if (x == (unsigned long)-1) + x = (unsigned long)-2; + return (long)x; } @@ -3168,7 +3161,7 @@ for (i = Py_SIZE(b) - 1; i >= 0; --i) { digit bi = b->ob_digit[i]; - for (j = 1 << (PyLong_SHIFT-1); j != 0; j >>= 1) { + for (j = (digit)1 << (PyLong_SHIFT-1); j != 0; j >>= 1) { MULT(z, z, z) if (bi & j) MULT(z, a, z) @@ -3393,9 +3386,8 @@ { digit maska, maskb; /* 0 or PyLong_MASK */ int negz; - Py_ssize_t size_a, size_b, size_z; + Py_ssize_t size_a, size_b, size_z, i; PyLongObject *z; - int i; digit diga, digb; PyObject *v; @@ -3566,12 +3558,12 @@ /* Since PyLong_FromString doesn't have a length parameter, * check here for possible NULs in the string. */ char *string; - int size = Py_SIZE(x); + Py_ssize_t size = Py_SIZE(x); if (PyByteArray_Check(x)) string = PyByteArray_AS_STRING(x); else string = PyBytes_AS_STRING(x); - if (strlen(string) != size) { + if (strlen(string) != (size_t)size) { /* We only see this if there's a null byte in x, x is a bytes or buffer, *and* a base is given. */ PyErr_Format(PyExc_ValueError, @@ -3784,7 +3776,7 @@ { Py_ssize_t res; - res = sizeof(PyVarObject) + abs(Py_SIZE(v))*sizeof(digit); + res = offsetof(PyLongObject, ob_digit) + ABS(Py_SIZE(v))*sizeof(digit); return PyLong_FromSsize_t(res); } @@ -3959,9 +3951,7 @@ PyTypeObject PyLong_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "int", /* tp_name */ - /* See _PyLong_New for why this isn't - sizeof(PyLongObject) - sizeof(digit) */ - sizeof(PyVarObject), /* tp_basicsize */ + offsetof(PyLongObject, ob_digit), /* tp_basicsize */ sizeof(digit), /* tp_itemsize */ long_dealloc, /* tp_dealloc */ 0, /* tp_print */ @@ -3973,8 +3963,8 @@ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ (hashfunc)long_hash, /* tp_hash */ - 0, /* tp_call */ - long_repr, /* tp_str */ + 0, /* tp_call */ + long_repr, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -3998,7 +3988,7 @@ 0, /* tp_init */ 0, /* tp_alloc */ long_new, /* tp_new */ - PyObject_Del, /* tp_free */ + PyObject_Del, /* tp_free */ }; int Modified: python/branches/io-c/Objects/object.c ============================================================================== --- python/branches/io-c/Objects/object.c (original) +++ python/branches/io-c/Objects/object.c Wed Feb 25 13:53:37 2009 @@ -1410,7 +1410,7 @@ none_dealloc(PyObject* ignore) { /* This should never get called, but we also don't want to SEGV if - * we accidently decref None out of existance. + * we accidentally decref None out of existence. */ Py_FatalError("deallocating None"); } Modified: python/branches/io-c/Objects/stringlib/formatter.h ============================================================================== --- python/branches/io-c/Objects/stringlib/formatter.h (original) +++ python/branches/io-c/Objects/stringlib/formatter.h Wed Feb 25 13:53:37 2009 @@ -15,6 +15,34 @@ #define ALLOW_PARENS_FOR_SIGN 0 +/* Raises an exception about an unknown presentation type for this + * type. */ + +static void +unknown_presentation_type(STRINGLIB_CHAR presentation_type, + const char* type_name) +{ +#if STRINGLIB_IS_UNICODE + /* If STRINGLIB_CHAR is Py_UNICODE, %c might be out-of-range, + hence the two cases. If it is char, gcc complains that the + condition below is always true, hence the ifdef. */ + if (presentation_type > 32 && presentation_type < 128) +#endif + PyErr_Format(PyExc_ValueError, + "Unknown format code '%c' " + "for object of type '%.200s'", + presentation_type, + type_name); +#if STRINGLIB_IS_UNICODE + else + PyErr_Format(PyExc_ValueError, + "Unknown format code '\\x%x' " + "for object of type '%.200s'", + (unsigned int)presentation_type, + type_name); +#endif +} + /* get_integer consumes 0 or more decimal digit characters from an input string, updates *result with the corresponding positive @@ -854,19 +882,7 @@ break; default: /* unknown */ - #if STRINGLIB_IS_UNICODE - /* If STRINGLIB_CHAR is Py_UNICODE, %c might be out-of-range, - hence the two cases. If it is char, gcc complains that the - condition below is always true, hence the ifdef. */ - if (format.type > 32 && format.type <128) - #endif - PyErr_Format(PyExc_ValueError, "Unknown conversion type %c", - (char)format.type); - #if STRINGLIB_IS_UNICODE - else - PyErr_Format(PyExc_ValueError, "Unknown conversion type '\\x%x'", - (unsigned int)format.type); - #endif + unknown_presentation_type(format.type, obj->ob_type->tp_name); goto done; } @@ -928,8 +944,7 @@ default: /* unknown */ - PyErr_Format(PyExc_ValueError, "Unknown conversion type %c", - format.type); + unknown_presentation_type(format.type, obj->ob_type->tp_name); goto done; } @@ -1031,8 +1046,7 @@ default: /* unknown */ - PyErr_Format(PyExc_ValueError, "Unknown conversion type %c", - format.type); + unknown_presentation_type(format.type, obj->ob_type->tp_name); goto done; } Modified: python/branches/io-c/Objects/unicodeobject.c ============================================================================== --- python/branches/io-c/Objects/unicodeobject.c (original) +++ python/branches/io-c/Objects/unicodeobject.c Wed Feb 25 13:53:37 2009 @@ -1591,7 +1591,7 @@ if (restuple == NULL) goto onError; if (!PyTuple_Check(restuple)) { - PyErr_Format(PyExc_TypeError, &argparse[4]); + PyErr_SetString(PyExc_TypeError, &argparse[4]); goto onError; } if (!PyArg_ParseTuple(restuple, argparse, &PyUnicode_Type, &repunicode, &newpos)) @@ -1927,7 +1927,7 @@ charsleft = (charsleft << 16) | ch; /* out, charsleft, bitsleft = */ ENCODE(out, charsleft, bitsleft); - /* If the next character is special then we dont' need to terminate + /* 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 '-'. */ @@ -3854,7 +3854,7 @@ if (restuple == NULL) return NULL; if (!PyTuple_Check(restuple)) { - PyErr_Format(PyExc_TypeError, &argparse[4]); + PyErr_SetString(PyExc_TypeError, &argparse[4]); Py_DECREF(restuple); return NULL; } @@ -5128,7 +5128,7 @@ if (restuple == NULL) return NULL; if (!PyTuple_Check(restuple)) { - PyErr_Format(PyExc_TypeError, &argparse[4]); + PyErr_SetString(PyExc_TypeError, &argparse[4]); Py_DECREF(restuple); return NULL; } Modified: python/branches/io-c/PCbuild/build_tkinter.py ============================================================================== --- python/branches/io-c/PCbuild/build_tkinter.py (original) +++ python/branches/io-c/PCbuild/build_tkinter.py Wed Feb 25 13:53:37 2009 @@ -52,18 +52,18 @@ if 1: os.chdir(os.path.join(ROOT, TK, "win")) if clean: - nmake("makefile.vc", "clean", TCLDIR=tcldir) - nmake("makefile.vc", TCLDIR=tcldir, MACHINE=machine) - nmake("makefile.vc", "install", TCLDIR=tcldir, INSTALLDIR=dest, MACHINE=machine) + nmake("makefile.vc", "clean", DEBUG=0, TCLDIR=tcldir) + nmake("makefile.vc", DEBUG=0, MACHINE=machine) + nmake("makefile.vc", "install", DEBUG=0, INSTALLDIR=dest, MACHINE=machine) # TIX if 1: # python9.mak is available at http://svn.python.org os.chdir(os.path.join(ROOT, TIX, "win")) if clean: - nmake("python9.mak", "clean") - nmake("python9.mak", MACHINE=machine, INSTALL_DIR=dest) - nmake("python9.mak", "install", INSTALL_DIR=dest) + nmake("python.mak", "clean") + nmake("python.mak", MACHINE=machine, INSTALL_DIR=dest) + nmake("python.mak", "install", INSTALL_DIR=dest) def main(): if len(sys.argv) < 2 or sys.argv[1] not in ("Win32", "AMD64"): Modified: python/branches/io-c/PCbuild/sqlite3.vcproj ============================================================================== --- python/branches/io-c/PCbuild/sqlite3.vcproj (original) +++ python/branches/io-c/PCbuild/sqlite3.vcproj Wed Feb 25 13:53:37 2009 @@ -82,7 +82,7 @@ @@ -327,7 +327,7 @@ @@ -449,7 +449,7 @@ Modified: python/branches/io-c/Python/ceval.c ============================================================================== --- python/branches/io-c/Python/ceval.c (original) +++ python/branches/io-c/Python/ceval.c Wed Feb 25 13:53:37 2009 @@ -1295,7 +1295,6 @@ SETLOCAL(oparg, v); FAST_DISPATCH(); - PREDICTED(POP_TOP); TARGET(POP_TOP) v = POP(); Py_DECREF(v); @@ -2204,8 +2203,8 @@ Py_DECREF(w); SET_TOP(x); if (x == NULL) break; - PREDICT(JUMP_IF_FALSE); - PREDICT(JUMP_IF_TRUE); + PREDICT(POP_JUMP_IF_FALSE); + PREDICT(POP_JUMP_IF_TRUE); DISPATCH(); TARGET(IMPORT_NAME) @@ -2282,41 +2281,45 @@ JUMPBY(oparg); FAST_DISPATCH(); - PREDICTED_WITH_ARG(JUMP_IF_FALSE); - TARGET(JUMP_IF_FALSE) - w = TOP(); + PREDICTED_WITH_ARG(POP_JUMP_IF_FALSE); + TARGET(POP_JUMP_IF_FALSE) + w = POP(); if (w == Py_True) { - PREDICT(POP_TOP); + Py_DECREF(w); FAST_DISPATCH(); } if (w == Py_False) { - JUMPBY(oparg); + Py_DECREF(w); + JUMPTO(oparg); FAST_DISPATCH(); } err = PyObject_IsTrue(w); + Py_DECREF(w); if (err > 0) err = 0; else if (err == 0) - JUMPBY(oparg); + JUMPTO(oparg); else break; DISPATCH(); - PREDICTED_WITH_ARG(JUMP_IF_TRUE); - TARGET(JUMP_IF_TRUE) - w = TOP(); + PREDICTED_WITH_ARG(POP_JUMP_IF_TRUE); + TARGET(POP_JUMP_IF_TRUE) + w = POP(); if (w == Py_False) { - PREDICT(POP_TOP); + Py_DECREF(w); FAST_DISPATCH(); } if (w == Py_True) { - JUMPBY(oparg); + Py_DECREF(w); + JUMPTO(oparg); FAST_DISPATCH(); } err = PyObject_IsTrue(w); + Py_DECREF(w); if (err > 0) { err = 0; - JUMPBY(oparg); + JUMPTO(oparg); } else if (err == 0) ; @@ -2324,6 +2327,53 @@ break; DISPATCH(); + TARGET(JUMP_IF_FALSE_OR_POP) + w = TOP(); + if (w == Py_True) { + STACKADJ(-1); + Py_DECREF(w); + FAST_DISPATCH(); + } + if (w == Py_False) { + JUMPTO(oparg); + FAST_DISPATCH(); + } + err = PyObject_IsTrue(w); + if (err > 0) { + STACKADJ(-1); + Py_DECREF(w); + err = 0; + } + else if (err == 0) + JUMPTO(oparg); + else + break; + DISPATCH(); + + TARGET(JUMP_IF_TRUE_OR_POP) + w = TOP(); + if (w == Py_False) { + STACKADJ(-1); + Py_DECREF(w); + FAST_DISPATCH(); + } + if (w == Py_True) { + JUMPTO(oparg); + FAST_DISPATCH(); + } + err = PyObject_IsTrue(w); + if (err > 0) { + err = 0; + JUMPTO(oparg); + } + else if (err == 0) { + STACKADJ(-1); + Py_DECREF(w); + } + else + break; + DISPATCH(); + PREDICTED_WITH_ARG(JUMP_ABSOLUTE); TARGET(JUMP_ABSOLUTE) JUMPTO(oparg); Modified: python/branches/io-c/Python/compile.c ============================================================================== --- python/branches/io-c/Python/compile.c (original) +++ python/branches/io-c/Python/compile.c Wed Feb 25 13:53:37 2009 @@ -818,11 +818,15 @@ return 1; case JUMP_FORWARD: - case JUMP_IF_FALSE: - case JUMP_IF_TRUE: + case JUMP_IF_TRUE_OR_POP: /* -1 if jump not taken */ + case JUMP_IF_FALSE_OR_POP: /* "" */ case JUMP_ABSOLUTE: return 0; + case POP_JUMP_IF_FALSE: + case POP_JUMP_IF_TRUE: + return -1; + case LOAD_GLOBAL: return 1; @@ -1664,12 +1668,10 @@ if (next == NULL) return 0; VISIT(c, expr, e->v.IfExp.test); - ADDOP_JREL(c, JUMP_IF_FALSE, next); - ADDOP(c, POP_TOP); + ADDOP_JABS(c, POP_JUMP_IF_FALSE, next); VISIT(c, expr, e->v.IfExp.body); ADDOP_JREL(c, JUMP_FORWARD, end); compiler_use_next_block(c, next); - ADDOP(c, POP_TOP); VISIT(c, expr, e->v.IfExp.orelse); compiler_use_next_block(c, end); return 1; @@ -1732,9 +1734,6 @@ end = compiler_new_block(c); if (end == NULL) return 0; - next = compiler_new_block(c); - if (next == NULL) - return 0; constant = expr_constant(s->v.If.test); /* constant = 0: "if 0" @@ -1746,15 +1745,21 @@ } else if (constant == 1) { VISIT_SEQ(c, stmt, s->v.If.body); } else { + if (s->v.If.orelse) { + next = compiler_new_block(c); + if (next == NULL) + return 0; + } + else + next = end; VISIT(c, expr, s->v.If.test); - ADDOP_JREL(c, JUMP_IF_FALSE, next); - ADDOP(c, POP_TOP); + ADDOP_JABS(c, POP_JUMP_IF_FALSE, next); VISIT_SEQ(c, stmt, s->v.If.body); ADDOP_JREL(c, JUMP_FORWARD, end); - compiler_use_next_block(c, next); - ADDOP(c, POP_TOP); - if (s->v.If.orelse) + if (s->v.If.orelse) { + compiler_use_next_block(c, next); VISIT_SEQ(c, stmt, s->v.If.orelse); + } } compiler_use_next_block(c, end); return 1; @@ -1828,8 +1833,7 @@ so we need to set an extra line number. */ c->u->u_lineno_set = 0; VISIT(c, expr, s->v.While.test); - ADDOP_JREL(c, JUMP_IF_FALSE, anchor); - ADDOP(c, POP_TOP); + ADDOP_JABS(c, POP_JUMP_IF_FALSE, anchor); } VISIT_SEQ(c, stmt, s->v.While.body); ADDOP_JABS(c, JUMP_ABSOLUTE, loop); @@ -1840,7 +1844,6 @@ if (constant == -1) { compiler_use_next_block(c, anchor); - ADDOP(c, POP_TOP); ADDOP(c, POP_BLOCK); } compiler_pop_fblock(c, LOOP, loop); @@ -1947,7 +1950,7 @@ } /* - Code generated for "try: S except E1, V1: S1 except E2, V2: S2 ...": + Code generated for "try: S except E1 as V1: S1 except E2 as V2: S2 ...": (The contents of the value stack is shown in [], with the top at the right; 'tb' is trace-back info, 'val' the exception's associated value, and 'exc' the exception.) @@ -1961,20 +1964,17 @@ [tb, val, exc] L1: DUP ) [tb, val, exc, exc] ) [tb, val, exc, exc, E1] COMPARE_OP EXC_MATCH ) only if E1 - [tb, val, exc, 1-or-0] JUMP_IF_FALSE L2 ) - [tb, val, exc, 1] POP ) + [tb, val, exc, 1-or-0] POP_JUMP_IF_FALSE L2 ) [tb, val, exc] POP [tb, val] (or POP if no V1) [tb] POP [] JUMP_FORWARD L0 - [tb, val, exc, 0] L2: POP - [tb, val, exc] DUP + [tb, val, exc] L2: DUP .............................etc....................... - [tb, val, exc, 0] Ln+1: POP - [tb, val, exc] END_FINALLY # re-raise exception + [tb, val, exc] Ln+1: END_FINALLY # re-raise exception [] L0: @@ -2016,8 +2016,7 @@ ADDOP(c, DUP_TOP); VISIT(c, expr, handler->v.ExceptHandler.type); ADDOP_I(c, COMPARE_OP, PyCmp_EXC_MATCH); - ADDOP_JREL(c, JUMP_IF_FALSE, except); - ADDOP(c, POP_TOP); + ADDOP_JABS(c, POP_JUMP_IF_FALSE, except); } ADDOP(c, POP_TOP); if (handler->v.ExceptHandler.name) { @@ -2088,8 +2087,6 @@ } ADDOP_JREL(c, JUMP_FORWARD, end); compiler_use_next_block(c, except); - if (handler->v.ExceptHandler.type) - ADDOP(c, POP_TOP); } ADDOP(c, END_FINALLY); compiler_use_next_block(c, orelse); @@ -2268,8 +2265,7 @@ end = compiler_new_block(c); if (end == NULL) return 0; - ADDOP_JREL(c, JUMP_IF_TRUE, end); - ADDOP(c, POP_TOP); + ADDOP_JABS(c, POP_JUMP_IF_TRUE, end); ADDOP_O(c, LOAD_GLOBAL, assertion_error, names); if (s->v.Assert.msg) { VISIT(c, expr, s->v.Assert.msg); @@ -2277,7 +2273,6 @@ } ADDOP_I(c, RAISE_VARARGS, 1); compiler_use_next_block(c, end); - ADDOP(c, POP_TOP); return 1; } @@ -2629,9 +2624,9 @@ assert(e->kind == BoolOp_kind); if (e->v.BoolOp.op == And) - jumpi = JUMP_IF_FALSE; + jumpi = JUMP_IF_FALSE_OR_POP; else - jumpi = JUMP_IF_TRUE; + jumpi = JUMP_IF_TRUE_OR_POP; end = compiler_new_block(c); if (end == NULL) return 0; @@ -2640,8 +2635,7 @@ assert(n >= 0); for (i = 0; i < n; ++i) { VISIT(c, expr, (expr_ty)asdl_seq_GET(s, i)); - ADDOP_JREL(c, jumpi, end); - ADDOP(c, POP_TOP) + ADDOP_JABS(c, jumpi, end); } VISIT(c, expr, (expr_ty)asdl_seq_GET(s, n)); compiler_use_next_block(c, end); @@ -2737,9 +2731,8 @@ ADDOP_I(c, COMPARE_OP, cmpop((cmpop_ty)(asdl_seq_GET( e->v.Compare.ops, i - 1)))); - ADDOP_JREL(c, JUMP_IF_FALSE, cleanup); + ADDOP_JABS(c, JUMP_IF_FALSE_OR_POP, cleanup); NEXT_BLOCK(c); - ADDOP(c, POP_TOP); if (i < (n - 1)) VISIT(c, expr, (expr_ty)asdl_seq_GET(e->v.Compare.comparators, i)); @@ -2872,10 +2865,9 @@ for (i = 0; i < n; i++) { expr_ty e = (expr_ty)asdl_seq_GET(gen->ifs, i); VISIT(c, expr, e); - ADDOP_JREL(c, JUMP_IF_FALSE, if_cleanup); + ADDOP_JABS(c, POP_JUMP_IF_FALSE, if_cleanup); NEXT_BLOCK(c); - ADDOP(c, POP_TOP); - } + } if (++gen_index < asdl_seq_LEN(generators)) if (!compiler_comprehension_generator(c, @@ -2913,13 +2905,7 @@ compiler_use_next_block(c, skip); } - for (i = 0; i < n; i++) { - ADDOP_I(c, JUMP_FORWARD, 1); - if (i == 0) - compiler_use_next_block(c, if_cleanup); - - ADDOP(c, POP_TOP); - } + compiler_use_next_block(c, if_cleanup); ADDOP_JABS(c, JUMP_ABSOLUTE, start); compiler_use_next_block(c, anchor); Modified: python/branches/io-c/Python/import.c ============================================================================== --- python/branches/io-c/Python/import.c (original) +++ python/branches/io-c/Python/import.c Wed Feb 25 13:53:37 2009 @@ -87,8 +87,10 @@ Python 3.0a5: 3130 (lexical exception stacking, including POP_EXCEPT) Python 3.1a0: 3140 (optimize list, set and dict comprehensions: change LIST_APPEND and SET_ADD, add MAP_ADD) + Python 3.1a0: 3150 (optimize conditional branches: + introduce POP_JUMP_IF_FALSE and POP_JUMP_IF_TRUE) */ -#define MAGIC (3140 | ((long)'\r'<<16) | ((long)'\n'<<24)) +#define MAGIC (3150 | ((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 Modified: python/branches/io-c/Python/opcode_targets.h ============================================================================== --- python/branches/io-c/Python/opcode_targets.h (original) +++ python/branches/io-c/Python/opcode_targets.h Wed Feb 25 13:53:37 2009 @@ -110,11 +110,11 @@ &&TARGET_IMPORT_NAME, &&TARGET_IMPORT_FROM, &&TARGET_JUMP_FORWARD, - &&TARGET_JUMP_IF_FALSE, - &&TARGET_JUMP_IF_TRUE, + &&TARGET_JUMP_IF_FALSE_OR_POP, + &&TARGET_JUMP_IF_TRUE_OR_POP, &&TARGET_JUMP_ABSOLUTE, - &&_unknown_opcode, - &&_unknown_opcode, + &&TARGET_POP_JUMP_IF_FALSE, + &&TARGET_POP_JUMP_IF_TRUE, &&TARGET_LOAD_GLOBAL, &&_unknown_opcode, &&_unknown_opcode, Modified: python/branches/io-c/Python/peephole.c ============================================================================== --- python/branches/io-c/Python/peephole.c (original) +++ python/branches/io-c/Python/peephole.c Wed Feb 25 13:53:37 2009 @@ -13,7 +13,12 @@ #define GETARG(arr, i) ((int)((arr[i+2]<<8) + arr[i+1])) #define UNCONDITIONAL_JUMP(op) (op==JUMP_ABSOLUTE || op==JUMP_FORWARD) -#define ABSOLUTE_JUMP(op) (op==JUMP_ABSOLUTE || op==CONTINUE_LOOP) +#define CONDITIONAL_JUMP(op) (op==POP_JUMP_IF_FALSE || op==POP_JUMP_IF_TRUE \ + || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP) +#define ABSOLUTE_JUMP(op) (op==JUMP_ABSOLUTE || op==CONTINUE_LOOP \ + || op==POP_JUMP_IF_FALSE || op==POP_JUMP_IF_TRUE \ + || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP) +#define JUMPS_ON_TRUE(op) (op==POP_JUMP_IF_TRUE || op==JUMP_IF_TRUE_OR_POP) #define GETJUMPTGT(arr, i) (GETARG(arr,i) + (ABSOLUTE_JUMP(arr[i]) ? 0 : i+3)) #define SETARG(arr, i, val) arr[i+2] = val>>8; arr[i+1] = val & 255 #define CODESIZE(op) (HAS_ARG(op) ? 3 : 1) @@ -237,8 +242,10 @@ switch (opcode) { case FOR_ITER: case JUMP_FORWARD: - case JUMP_IF_FALSE: - case JUMP_IF_TRUE: + case JUMP_IF_FALSE_OR_POP: + case JUMP_IF_TRUE_OR_POP: + case POP_JUMP_IF_FALSE: + case POP_JUMP_IF_TRUE: case JUMP_ABSOLUTE: case CONTINUE_LOOP: case SETUP_LOOP: @@ -363,29 +370,24 @@ assert(PyList_Check(consts)); for (i=0 ; i a is not b not a in b --> a not in b @@ -417,29 +419,19 @@ break; /* Skip over LOAD_CONST trueconst - JUMP_IF_FALSE xx POP_TOP */ + POP_JUMP_IF_FALSE xx. This improves + "while 1" performance. */ case LOAD_CONST: cumlc = lastlc + 1; j = GETARG(codestr, i); - if (codestr[i+3] != JUMP_IF_FALSE || - codestr[i+6] != POP_TOP || + if (codestr[i+3] != POP_JUMP_IF_FALSE || !ISBASICBLOCK(blocks,i,7) || !PyObject_IsTrue(PyList_GET_ITEM(consts, j))) continue; - memset(codestr+i, NOP, 7); + memset(codestr+i, NOP, 6); cumlc = 0; break; - /* Replace POP_TOP JUMP_FORWARD 1 POP_TOP - with NOP NOP NOP NOP POP_TOP. */ - case POP_TOP: - if (UNCONDITIONAL_JUMP(codestr[i+1]) && - GETJUMPTGT(codestr, i+1) == i+5 && - codestr[i+4] == POP_TOP && - ISBASICBLOCK(blocks,i,4)) - memset(codestr+i, NOP, 4); - break; - /* Try to fold tuples of constants (includes a case for lists which are only used for "in" and "not in" tests). Skip over BUILD_SEQN 1 UNPACK_SEQN 1. @@ -524,27 +516,47 @@ "if a or b:" "a and b or c" "(a and b) and c" - x:JUMP_IF_FALSE y y:JUMP_IF_FALSE z --> x:JUMP_IF_FALSE z - x:JUMP_IF_FALSE y y:JUMP_IF_TRUE z --> x:JUMP_IF_FALSE y+3 + x:POP_OR_JUMP y y:POP_OR_JUMP z --> x:POP_OR_JUMP z + x:POP_OR_JUMP y y:JUMP_OR_POP z --> x:POP_JUMP_IF_FALSE y+3 where y+3 is the instruction following the second test. */ - case JUMP_IF_FALSE: - case JUMP_IF_TRUE: + case JUMP_IF_FALSE_OR_POP: + case JUMP_IF_TRUE_OR_POP: tgt = GETJUMPTGT(codestr, i); j = codestr[tgt]; - if (j == JUMP_IF_FALSE || j == JUMP_IF_TRUE) { - if (j == opcode) { - tgttgt = GETJUMPTGT(codestr, tgt) - i - 3; + if (CONDITIONAL_JUMP(j)) { + /* NOTE: all possible jumps here are + absolute! */ + if (JUMPS_ON_TRUE(j) == JUMPS_ON_TRUE(opcode)) { + /* The second jump will be + taken iff the first is. */ + tgttgt = GETJUMPTGT(codestr, tgt); + /* The current opcode inherits + its target's stack behaviour */ + codestr[i] = j; SETARG(codestr, i, tgttgt); + goto reoptimize_current; } else { - tgt -= i; - SETARG(codestr, i, tgt); + /* The second jump is not taken + if the first is (so jump past + it), and all conditional + jumps pop their argument when + they're not taken (so change + the first jump to pop its + argument when it's taken). */ + if (JUMPS_ON_TRUE(opcode)) + codestr[i] = POP_JUMP_IF_TRUE; + else + codestr[i] = POP_JUMP_IF_FALSE; + SETARG(codestr, i, (tgt + 3)); + goto reoptimize_current; } - break; } - /* Intentional fallthrough */ + /* Intentional fallthrough */ /* Replace jumps to unconditional jumps */ + case POP_JUMP_IF_FALSE: + case POP_JUMP_IF_TRUE: case FOR_ITER: case JUMP_FORWARD: case JUMP_ABSOLUTE: @@ -621,14 +633,16 @@ case JUMP_ABSOLUTE: case CONTINUE_LOOP: + case POP_JUMP_IF_FALSE: + case POP_JUMP_IF_TRUE: + case JUMP_IF_FALSE_OR_POP: + case JUMP_IF_TRUE_OR_POP: j = addrmap[GETARG(codestr, i)]; SETARG(codestr, i, j); break; case FOR_ITER: case JUMP_FORWARD: - case JUMP_IF_FALSE: - case JUMP_IF_TRUE: case SETUP_LOOP: case SETUP_EXCEPT: case SETUP_FINALLY: Modified: python/branches/io-c/Tools/msi/merge.py ============================================================================== --- python/branches/io-c/Tools/msi/merge.py (original) +++ python/branches/io-c/Tools/msi/merge.py Wed Feb 25 13:53:37 2009 @@ -1,5 +1,6 @@ import msilib,os,win32com,tempfile,sys PCBUILD="PCBuild" +certname = None from config import * Win64 = "amd64" in PCBUILD @@ -76,3 +77,8 @@ db.Commit() merge(msi, "SharedCRT", "TARGETDIR", modules) + +# certname (from config.py) should be (a substring of) +# the certificate subject, e.g. "Python Software Foundation" +if certname: + os.system('signtool sign /n "%s" /t http://timestamp.verisign.com/scripts/timestamp.dll %s' % (certname, msi)) Modified: python/branches/io-c/Tools/scripts/texi2html.py ============================================================================== --- python/branches/io-c/Tools/scripts/texi2html.py (original) +++ python/branches/io-c/Tools/scripts/texi2html.py Wed Feb 25 13:53:37 2009 @@ -38,7 +38,7 @@ # rpyron 2002-05-07 # Robert Pyron # 1. BUGFIX: In function makefile(), strip blanks from the nodename. -# This is necesary to match the behavior of parser.makeref() and +# This is necessary to match the behavior of parser.makeref() and # parser.do_node(). # 2. BUGFIX fixed KeyError in end_ifset (well, I may have just made # it go away, rather than fix it) Modified: python/branches/io-c/configure ============================================================================== --- python/branches/io-c/configure (original) +++ python/branches/io-c/configure Wed Feb 25 13:53:37 2009 @@ -1,12 +1,12 @@ #! /bin/sh -# From configure.in Revision: 68440 . +# From configure.in Revision: 68924 . # 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,153 +616,123 @@ # 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 -AR -RANLIB -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 +RANLIB +AR +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_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 -with_wide_unicode -with_computed_gotos -' ac_precious_vars='build_alias host_alias target_alias @@ -799,8 +747,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 @@ -899,21 +845,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 ;; @@ -926,21 +864,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- \ @@ -1131,38 +1061,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. @@ -1182,7 +1096,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; }; } ;; @@ -1191,16 +1105,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} ;; @@ -1209,38 +1123,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 @@ -1255,7 +1153,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 @@ -1271,10 +1169,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; }; } @@ -1282,12 +1180,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 @@ -1314,12 +1212,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=. @@ -1368,9 +1266,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 @@ -1380,25 +1278,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 @@ -1412,7 +1310,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] @@ -1480,17 +1377,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/ ;; @@ -1526,7 +1421,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 @@ -1536,10 +1431,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 @@ -1550,7 +1445,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 $@ @@ -1586,7 +1481,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 @@ -1621,7 +1516,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'" ;; @@ -1673,12 +1568,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 @@ -1708,9 +1602,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 @@ -1725,9 +1619,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 @@ -1743,8 +1637,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 && @@ -1786,24 +1680,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 @@ -1813,16 +1704,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 @@ -1836,38 +1727,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 @@ -1877,12 +1759,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 @@ -2019,20 +1899,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 @@ -2152,8 +2032,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` @@ -2316,8 +2196,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 @@ -2327,11 +2207,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 @@ -2343,8 +2223,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 @@ -2369,15 +2249,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 @@ -2390,10 +2270,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. @@ -2406,7 +2286,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 @@ -2417,11 +2297,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 @@ -2430,10 +2310,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. @@ -2446,7 +2326,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 @@ -2457,11 +2337,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 @@ -2469,8 +2349,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 @@ -2483,10 +2367,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. @@ -2499,7 +2383,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 @@ -2510,11 +2394,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 @@ -2523,10 +2407,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. @@ -2544,7 +2428,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 @@ -2567,11 +2451,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 @@ -2582,10 +2466,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. @@ -2598,7 +2482,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 @@ -2609,11 +2493,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 @@ -2626,10 +2510,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. @@ -2642,7 +2526,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 @@ -2653,11 +2537,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 @@ -2669,8 +2553,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 @@ -2680,50 +2568,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 @@ -2742,22 +2624,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 @@ -2768,11 +2655,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' @@ -2783,7 +2669,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 @@ -2810,27 +2696,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 @@ -2839,53 +2723,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 @@ -2894,33 +2774,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. */ @@ -2943,43 +2821,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. */ @@ -3005,21 +2880,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 @@ -3029,19 +2903,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 @@ -3068,21 +2938,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="" @@ -3107,21 +2976,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 @@ -3147,21 +3015,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 @@ -3176,8 +3043,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 @@ -3193,10 +3060,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 @@ -3267,21 +3134,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 @@ -3297,15 +3163,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 @@ -3318,8 +3184,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 @@ -3344,8 +3210,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" @@ -3353,10 +3219,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 [\\/]* | ?:[\\/]*) @@ -3371,7 +3237,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 @@ -3384,20 +3250,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 [\\/]* | ?:[\\/]*) @@ -3412,7 +3278,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 @@ -3425,11 +3291,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 ;; @@ -3445,10 +3311,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. @@ -3461,7 +3327,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 @@ -3472,11 +3338,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 @@ -3491,12 +3357,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. @@ -3511,15 +3377,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" @@ -3551,21 +3417,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. @@ -3589,14 +3454,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 @@ -3604,7 +3468,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. @@ -3629,8 +3493,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 @@ -3658,21 +3522,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. @@ -3696,14 +3559,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 @@ -3711,7 +3573,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. @@ -3727,13 +3589,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 @@ -3743,37 +3603,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` @@ -3788,60 +3653,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` @@ -3856,510 +3735,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://www.python.org/python-bugs ## -## ------------------------------------------------ ## -_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 +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 "$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 +else + ac_cv_path_EGREP=$EGREP fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + fi 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 +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" - cat >>confdefs.h <<\_ACEOF -#define _ALL_SOURCE 1 -_ACEOF - cat >>confdefs.h <<\_ACEOF -#define _GNU_SOURCE 1 -_ACEOF - cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 +{ 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* @@ -4372,8 +3804,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 @@ -4385,26 +3817,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 @@ -4437,14 +3869,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 @@ -4479,8 +3911,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)' @@ -4500,11 +3932,11 @@ 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; } -{ $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; @@ -4520,11 +3952,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" @@ -4546,32 +3978,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 @@ -4579,8 +4008,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") @@ -4589,8 +4018,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 @@ -4674,16 +4103,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. @@ -4696,7 +4125,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 @@ -4707,11 +4136,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 @@ -4720,10 +4149,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. @@ -4736,7 +4165,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 @@ -4747,11 +4176,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 @@ -4759,8 +4188,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 @@ -4774,10 +4207,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. @@ -4790,7 +4223,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 @@ -4801,11 +4234,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 @@ -4817,10 +4250,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. @@ -4833,7 +4266,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 @@ -4845,11 +4278,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 @@ -4885,8 +4318,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 @@ -4912,12 +4345,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 @@ -4946,29 +4378,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 @@ -4981,8 +4401,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. @@ -5004,8 +4424,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 @@ -5017,15 +4437,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 @@ -5103,8 +4523,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 @@ -5124,39 +4544,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" @@ -5195,8 +4612,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 @@ -5270,10 +4687,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" @@ -5294,32 +4711,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 @@ -5327,8 +4741,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 @@ -5341,10 +4755,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" @@ -5365,32 +4779,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 @@ -5398,8 +4809,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 @@ -5408,8 +4819,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 @@ -5435,14 +4846,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 @@ -5452,14 +4862,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 @@ -5472,10 +4882,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 @@ -5506,21 +4916,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 @@ -5528,14 +4936,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 @@ -5543,8 +4950,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 @@ -5556,10 +4963,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" @@ -5592,32 +4999,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 @@ -5625,8 +5029,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 @@ -5636,10 +5040,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" @@ -5672,32 +5076,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 @@ -5705,8 +5106,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 @@ -5716,10 +5117,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" @@ -5752,32 +5153,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 @@ -5785,8 +5183,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 @@ -5794,8 +5192,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" @@ -5825,17 +5223,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. */ @@ -5862,21 +5260,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 @@ -5968,40 +5365,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 @@ -6010,6 +5404,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 + + @@ -6077,21 +5540,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 @@ -6107,33 +5569,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 @@ -6147,52 +5608,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://www.python.org/python-bugs ## @@ -6201,24 +5661,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 @@ -6232,11 +5689,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. */ @@ -6262,21 +5719,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" @@ -6284,15 +5740,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 @@ -6301,10 +5754,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 @@ -6342,30 +5795,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 @@ -6380,8 +5829,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" @@ -6389,10 +5838,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 @@ -6430,30 +5879,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 @@ -6468,8 +5913,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" @@ -6478,10 +5923,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. */ @@ -6504,50 +5949,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 @@ -6563,33 +6004,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 @@ -6603,52 +6043,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://www.python.org/python-bugs ## @@ -6657,18 +6096,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 @@ -6680,17 +6119,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 @@ -6706,33 +6145,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 @@ -6746,52 +6184,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://www.python.org/python-bugs ## @@ -6800,18 +6237,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 @@ -6828,11 +6265,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. */ @@ -6854,21 +6291,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" @@ -6876,15 +6312,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 @@ -6896,11 +6329,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. */ @@ -6925,21 +6358,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" @@ -6947,15 +6379,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 @@ -6965,8 +6394,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 @@ -6990,12 +6419,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 @@ -7017,30 +6446,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 @@ -7069,30 +6494,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 @@ -7103,8 +6524,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 @@ -7121,8 +6542,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 @@ -7148,29 +6569,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 @@ -7198,46 +6618,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 @@ -7245,11 +6630,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; } @@ -7260,39 +6648,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 @@ -7302,46 +6681,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 @@ -7349,11 +6693,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; } @@ -7364,39 +6711,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 @@ -7406,46 +6744,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 @@ -7453,11 +6756,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; } @@ -7468,39 +6774,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 - : + 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=yes + ac_cv_type_pid_t=no 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 - -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 @@ -7510,10 +6807,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. */ @@ -7538,76 +6835,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 + +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; } + +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 @@ -7615,11 +6876,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; } @@ -7630,39 +6894,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 @@ -7672,10 +6927,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. */ @@ -7695,8 +6950,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 @@ -7710,24 +6965,26 @@ fi -{ $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; } @@ -7738,18 +6995,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 @@ -7757,11 +7041,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; } @@ -7772,57 +7059,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. @@ -7833,10 +7101,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 ; @@ -7849,14 +7118,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 @@ -7870,10 +7138,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 ; @@ -7886,21 +7155,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` @@ -7914,7 +7182,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 @@ -7924,10 +7192,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 ; @@ -7940,14 +7209,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 @@ -7961,10 +7229,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 ; @@ -7977,21 +7246,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` @@ -8005,7 +7273,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= @@ -8025,10 +7293,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 ; @@ -8041,21 +7310,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` @@ -8066,13 +7334,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 ;; @@ -8085,8 +7351,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 @@ -8096,22 +7363,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; ; @@ -8124,48 +7389,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; } @@ -8174,14 +7434,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. @@ -8192,10 +7506,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 ; @@ -8208,14 +7523,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 @@ -8229,10 +7543,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 ; @@ -8245,21 +7560,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` @@ -8273,7 +7587,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 @@ -8283,10 +7597,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 ; @@ -8299,14 +7614,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 @@ -8320,10 +7634,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 ; @@ -8336,21 +7651,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` @@ -8364,7 +7678,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= @@ -8384,10 +7698,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 ; @@ -8400,21 +7715,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` @@ -8425,13 +7739,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 ;; @@ -8444,8 +7756,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 @@ -8455,22 +7768,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; ; @@ -8483,48 +7794,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; } @@ -8533,14 +7839,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. @@ -8551,10 +7911,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 ; @@ -8567,14 +7928,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 @@ -8588,10 +7948,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 ; @@ -8604,21 +7965,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` @@ -8632,7 +7992,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 @@ -8642,10 +8002,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 ; @@ -8658,14 +8019,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 @@ -8679,10 +8039,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 ; @@ -8695,21 +8056,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` @@ -8723,7 +8083,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= @@ -8743,10 +8103,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 ; @@ -8759,21 +8120,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` @@ -8784,13 +8144,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 ;; @@ -8803,8 +8161,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 @@ -8814,22 +8173,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; ; @@ -8842,48 +8199,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; } @@ -8892,14 +8244,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. @@ -8910,10 +8316,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 ; @@ -8926,14 +8333,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 @@ -8947,10 +8353,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 ; @@ -8963,21 +8370,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` @@ -8991,7 +8397,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 @@ -9001,10 +8407,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 ; @@ -9017,14 +8424,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 @@ -9038,10 +8444,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 ; @@ -9054,21 +8461,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` @@ -9082,7 +8488,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= @@ -9102,10 +8508,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 ; @@ -9118,21 +8525,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` @@ -9143,13 +8549,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 ;; @@ -9162,8 +8566,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 @@ -9173,22 +8578,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; ; @@ -9201,48 +8604,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; } @@ -9251,14 +8649,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. @@ -9269,10 +8721,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 ; @@ -9285,14 +8738,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 @@ -9306,10 +8758,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 ; @@ -9322,21 +8775,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` @@ -9350,7 +8802,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 @@ -9360,10 +8812,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 ; @@ -9376,14 +8829,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 @@ -9397,10 +8849,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 ; @@ -9413,21 +8866,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` @@ -9441,7 +8893,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= @@ -9461,10 +8913,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 ; @@ -9477,21 +8930,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` @@ -9502,13 +8954,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 ;; @@ -9521,8 +8971,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 @@ -9532,22 +8983,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; ; @@ -9560,64 +9009,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. @@ -9628,10 +9126,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 ; @@ -9644,14 +9143,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 @@ -9665,10 +9163,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 ; @@ -9681,21 +9180,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` @@ -9709,7 +9207,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 @@ -9719,10 +9217,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 ; @@ -9735,14 +9234,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 @@ -9756,10 +9254,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 ; @@ -9772,21 +9271,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` @@ -9800,7 +9298,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= @@ -9820,10 +9318,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 ; @@ -9836,21 +9335,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` @@ -9861,13 +9359,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 ;; @@ -9880,8 +9376,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 @@ -9891,22 +9388,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; ; @@ -9919,48 +9414,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; } @@ -9969,14 +9459,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. @@ -9987,10 +9531,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 ; @@ -10003,14 +9548,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 @@ -10024,10 +9568,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 ; @@ -10040,21 +9585,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` @@ -10068,7 +9612,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 @@ -10078,10 +9622,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 ; @@ -10094,14 +9639,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 @@ -10115,10 +9659,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 ; @@ -10131,21 +9676,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` @@ -10159,7 +9703,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= @@ -10179,10 +9723,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 ; @@ -10195,21 +9740,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` @@ -10220,13 +9764,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 ;; @@ -10239,8 +9781,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 @@ -10250,22 +9793,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; ; @@ -10278,48 +9819,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; } @@ -10328,14 +9864,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. @@ -10346,10 +9936,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 ; @@ -10362,14 +9953,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 @@ -10383,10 +9973,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 ; @@ -10399,21 +9990,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` @@ -10427,7 +10017,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 @@ -10437,10 +10027,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 ; @@ -10453,14 +10044,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 @@ -10474,10 +10064,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 ; @@ -10490,21 +10081,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` @@ -10518,7 +10108,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= @@ -10538,10 +10128,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 ; @@ -10554,21 +10145,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` @@ -10579,13 +10169,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 ;; @@ -10598,8 +10186,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 @@ -10609,22 +10198,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; ; @@ -10637,48 +10224,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; } @@ -10687,14 +10269,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. @@ -10705,10 +10341,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 ; @@ -10721,14 +10358,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 @@ -10742,10 +10378,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 ; @@ -10758,21 +10395,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` @@ -10786,7 +10422,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 @@ -10796,10 +10432,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 ; @@ -10812,14 +10449,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 @@ -10833,10 +10469,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 ; @@ -10849,21 +10486,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` @@ -10877,7 +10513,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= @@ -10897,10 +10533,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 ; @@ -10913,21 +10550,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` @@ -10938,13 +10574,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 ;; @@ -10957,8 +10591,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 @@ -10968,22 +10603,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; ; @@ -10996,48 +10629,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; } @@ -11047,8 +10675,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. */ @@ -11071,14 +10699,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 @@ -11092,24 +10719,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. @@ -11120,10 +10801,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 ; @@ -11136,14 +10818,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 @@ -11157,10 +10838,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 ; @@ -11173,21 +10855,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` @@ -11201,7 +10882,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 @@ -11211,10 +10892,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 ; @@ -11227,14 +10909,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 @@ -11248,10 +10929,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 ; @@ -11264,21 +10946,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` @@ -11292,7 +10973,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= @@ -11312,10 +10993,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 ; @@ -11328,21 +11010,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` @@ -11353,13 +11034,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 ;; @@ -11372,8 +11051,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 @@ -11383,22 +11063,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; ; @@ -11411,48 +11089,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; } @@ -11463,8 +11136,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. */ @@ -11487,14 +11160,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 @@ -11508,24 +11180,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. @@ -11536,10 +11262,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 ; @@ -11552,14 +11279,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 @@ -11573,10 +11299,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 ; @@ -11589,21 +11316,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` @@ -11617,7 +11343,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 @@ -11627,10 +11353,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 ; @@ -11643,14 +11370,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 @@ -11664,10 +11390,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 ; @@ -11680,21 +11407,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` @@ -11708,7 +11434,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= @@ -11728,10 +11454,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 ; @@ -11744,21 +11471,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` @@ -11769,13 +11495,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 ;; @@ -11788,8 +11512,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 @@ -11799,22 +11524,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; ; @@ -11827,48 +11550,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; } @@ -11877,23 +11595,83 @@ _ACEOF -fi +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 + + +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 -{ $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 +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; } @@ -11904,45 +11682,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. @@ -11953,10 +11724,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 ; @@ -11969,14 +11741,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 @@ -11990,10 +11761,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 ; @@ -12006,21 +11778,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` @@ -12034,7 +11805,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 @@ -12044,10 +11815,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 ; @@ -12060,14 +11832,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 @@ -12081,10 +11852,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 ; @@ -12097,21 +11869,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` @@ -12125,7 +11896,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= @@ -12145,10 +11916,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 ; @@ -12161,21 +11933,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` @@ -12186,13 +11957,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 ;; @@ -12205,8 +11974,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 @@ -12216,22 +11986,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; ; @@ -12244,48 +12012,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; } @@ -12296,13 +12059,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 @@ -12312,11 +12074,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; } @@ -12327,33 +12092,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; } @@ -12364,52 +12151,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. @@ -12420,10 +12193,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 ; @@ -12436,14 +12210,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 @@ -12457,10 +12230,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 ; @@ -12473,21 +12247,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` @@ -12501,7 +12274,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 @@ -12511,10 +12284,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 ; @@ -12527,14 +12301,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 @@ -12548,10 +12321,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 ; @@ -12564,21 +12338,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` @@ -12592,7 +12365,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= @@ -12612,10 +12385,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 ; @@ -12628,21 +12402,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` @@ -12653,13 +12426,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 ;; @@ -12672,8 +12443,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 @@ -12683,22 +12455,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; ; @@ -12711,48 +12481,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; } @@ -12766,10 +12531,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 @@ -12796,32 +12561,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 @@ -12829,16 +12591,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 @@ -12847,18 +12609,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 @@ -12885,32 +12647,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 @@ -12918,8 +12677,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 @@ -12936,8 +12695,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. */ @@ -12960,35 +12719,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 @@ -13015,32 +12773,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 @@ -13048,8 +12803,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 @@ -13094,8 +12849,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" @@ -13106,15 +12861,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/*) @@ -13122,12 +12877,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 @@ -13139,8 +12894,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 @@ -13165,8 +12920,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 @@ -13177,8 +12932,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 @@ -13280,13 +13035,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 @@ -13321,12 +13076,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 @@ -13381,13 +13136,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 @@ -13399,8 +13154,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). @@ -13411,22 +13166,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" @@ -13458,37 +13213,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 @@ -13498,10 +13249,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" @@ -13533,37 +13284,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 @@ -13575,10 +13322,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 @@ -13616,30 +13363,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 @@ -13654,8 +13397,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" @@ -13667,10 +13410,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" @@ -13702,37 +13445,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 @@ -13743,8 +13482,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 @@ -13766,47 +13505,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" @@ -13838,44 +13573,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" @@ -13907,60 +13638,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 @@ -13968,14 +13695,14 @@ 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; } # 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 @@ -13986,8 +13713,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="" @@ -14001,22 +13728,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 @@ -14029,8 +13756,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 @@ -14049,8 +13776,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" @@ -14116,8 +13843,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 @@ -14139,25 +13866,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 @@ -14173,33 +13900,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 @@ -14213,52 +13939,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://www.python.org/python-bugs ## @@ -14267,18 +13992,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 @@ -14297,17 +14022,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 @@ -14323,33 +14048,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 @@ -14363,52 +14087,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://www.python.org/python-bugs ## @@ -14417,18 +14140,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 @@ -14445,13 +14168,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 @@ -14464,16 +14187,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 @@ -14498,24 +14221,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 @@ -14523,15 +14243,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. */ @@ -14584,36 +14304,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 @@ -14623,17 +14339,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 @@ -14649,33 +14365,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 @@ -14689,52 +14404,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://www.python.org/python-bugs ## @@ -14743,18 +14457,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 @@ -14767,10 +14481,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" @@ -14802,37 +14516,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 @@ -14842,10 +14552,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" @@ -14877,37 +14587,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 @@ -14917,10 +14623,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" @@ -14952,37 +14658,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 @@ -14992,10 +14694,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" @@ -15027,37 +14729,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 @@ -15084,7 +14782,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 @@ -15096,10 +14793,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" @@ -15131,37 +14828,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 @@ -15173,10 +14866,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" @@ -15208,37 +14901,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 @@ -15291,10 +14980,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 @@ -15324,32 +15013,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 @@ -15357,8 +15043,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 @@ -15369,11 +15055,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. */ @@ -15426,42 +15112,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*) @@ -15481,18 +15160,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 @@ -15503,8 +15182,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 @@ -15532,44 +15211,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 @@ -15593,27 +15269,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 @@ -15635,8 +15310,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 @@ -15792,8 +15467,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 @@ -15812,8 +15487,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 @@ -15835,14 +15510,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 @@ -15852,22 +15526,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 @@ -15886,12 +15560,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 @@ -15903,20 +15577,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 @@ -15935,12 +15609,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 @@ -15952,14 +15626,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 @@ -15972,11 +15646,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. */ @@ -16029,42 +15703,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 @@ -16074,8 +15741,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 @@ -16099,8 +15766,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 @@ -16113,16 +15780,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 @@ -16221,11 +15888,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=`$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. */ @@ -16278,42 +15945,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 @@ -16322,8 +15982,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 @@ -16345,14 +16005,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 @@ -16362,20 +16021,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 @@ -16397,14 +16056,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 @@ -16414,20 +16072,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 @@ -16449,14 +16107,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 @@ -16466,20 +16123,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 @@ -16501,14 +16158,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 @@ -16518,20 +16174,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 @@ -16553,14 +16209,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 @@ -16570,20 +16225,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 @@ -16605,14 +16260,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 @@ -16622,20 +16276,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 @@ -16657,14 +16311,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 @@ -16674,20 +16327,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 @@ -16712,14 +16365,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 @@ -16729,14 +16381,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 @@ -16747,8 +16399,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 @@ -16773,14 +16425,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 @@ -16790,21 +16441,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 @@ -16829,14 +16480,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 @@ -16846,21 +16496,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 @@ -16885,14 +16535,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 @@ -16902,14 +16551,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 @@ -16919,10 +16568,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. @@ -16935,7 +16584,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 @@ -16946,11 +16595,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 @@ -16959,10 +16608,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" @@ -16994,44 +16643,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" @@ -17063,37 +16708,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 @@ -17108,16 +16749,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. */ @@ -17142,55 +16781,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. */ @@ -17215,40 +16849,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 @@ -17263,10 +16894,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" @@ -17298,37 +16929,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 @@ -17344,8 +16971,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 @@ -17370,43 +16997,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 @@ -17434,43 +17057,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 @@ -17498,14 +17117,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 @@ -17515,22 +17133,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 @@ -17558,14 +17176,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 @@ -17575,14 +17192,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 @@ -17593,11 +17210,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. */ @@ -17650,49 +17267,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" @@ -17724,46 +17334,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" @@ -17795,37 +17401,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 @@ -17842,11 +17444,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. */ @@ -17899,49 +17501,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" @@ -17973,46 +17568,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" @@ -18044,37 +17635,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 @@ -18093,11 +17680,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. */ @@ -18150,42 +17737,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 @@ -18201,11 +17781,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. */ @@ -18258,42 +17838,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 @@ -18305,11 +17878,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. */ @@ -18362,42 +17935,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 @@ -18414,11 +17980,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. */ @@ -18471,42 +18037,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. */ @@ -18529,14 +18088,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 @@ -18548,7 +18106,7 @@ else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -18562,11 +18120,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. */ @@ -18619,42 +18177,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. */ @@ -18677,14 +18228,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 @@ -18696,7 +18246,7 @@ else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -18710,11 +18260,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. */ @@ -18767,42 +18317,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. */ @@ -18825,21 +18368,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 @@ -18856,8 +18398,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 @@ -18889,48 +18431,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 @@ -18959,29 +18497,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 @@ -19084,52 +18619,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 @@ -19149,11 +18680,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. */ @@ -19206,42 +18737,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 @@ -19249,10 +18773,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. */ @@ -19279,21 +18803,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 @@ -19301,8 +18824,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 @@ -19311,10 +18834,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. */ @@ -19330,7 +18853,7 @@ { struct tm tm; int *p = &tm.tm_sec; - return !p; + return !p; ; return 0; } @@ -19341,21 +18864,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 @@ -19363,8 +18885,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 @@ -19373,10 +18895,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. */ @@ -19404,21 +18926,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 @@ -19447,21 +18968,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 @@ -19472,9 +18992,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 @@ -19490,10 +19010,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. */ @@ -19520,21 +19040,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 @@ -19542,9 +19061,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 @@ -19560,10 +19079,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. */ @@ -19590,35 +19109,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 @@ -19628,10 +19143,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. */ @@ -19656,21 +19171,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 @@ -19696,21 +19210,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 @@ -19721,9 +19234,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 @@ -19732,10 +19245,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. */ @@ -19760,21 +19273,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 @@ -19800,21 +19312,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 @@ -19825,9 +19336,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 @@ -19836,10 +19347,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. */ @@ -19864,21 +19375,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 @@ -19904,21 +19414,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 @@ -19929,9 +19438,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 @@ -19940,10 +19449,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. */ @@ -19968,21 +19477,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 @@ -20008,21 +19516,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 @@ -20033,9 +19540,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 @@ -20044,10 +19551,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. */ @@ -20072,21 +19579,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 @@ -20112,21 +19618,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 @@ -20137,9 +19642,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 @@ -20148,10 +19653,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. */ @@ -20176,21 +19681,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 @@ -20216,21 +19720,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 @@ -20241,9 +19744,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 @@ -20265,10 +19768,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. */ @@ -20291,21 +19794,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 @@ -20314,8 +19816,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 @@ -20325,8 +19827,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 @@ -20352,14 +19854,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 @@ -20373,20 +19874,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. */ @@ -20410,21 +19911,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 @@ -20433,8 +19933,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 @@ -20443,10 +19943,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. */ @@ -20471,21 +19971,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 @@ -20494,8 +19993,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 @@ -20507,10 +20006,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. */ @@ -20535,21 +20034,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 @@ -20557,8 +20055,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 @@ -20566,10 +20064,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. */ @@ -20641,21 +20139,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 @@ -20663,20 +20160,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 @@ -20698,38 +20195,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 @@ -20751,38 +20247,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 @@ -20804,14 +20299,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 @@ -20825,19 +20319,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 @@ -20869,14 +20363,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 @@ -20890,19 +20383,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 @@ -20927,14 +20420,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 @@ -20944,22 +20436,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 @@ -20983,38 +20475,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 @@ -21042,21 +20533,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 @@ -21070,17 +20560,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. */ @@ -21133,43 +20623,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 @@ -21203,14 +20689,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 @@ -21225,18 +20710,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 @@ -21268,14 +20753,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 @@ -21290,18 +20774,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 @@ -21331,14 +20815,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 @@ -21353,16 +20836,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 @@ -21382,11 +20865,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. */ @@ -21439,42 +20922,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 @@ -21493,10 +20969,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. */ @@ -21549,43 +21025,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" @@ -21617,37 +21089,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 @@ -21661,8 +21129,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 @@ -21674,14 +21142,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 @@ -21691,53 +21159,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 @@ -21753,10 +21221,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. -{ $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; } if test "${ac_cv_x87_double_rounding+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then @@ -21795,40 +21263,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_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 fi -{ $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 @@ -21841,10 +21306,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 @@ -21875,40 +21340,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 @@ -21928,11 +21390,11 @@ for ac_func in acosh asinh atanh copysign expm1 finite hypot log1p 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. */ @@ -21985,51 +21447,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. */ @@ -22056,21 +21511,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 @@ -22078,9 +21532,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 @@ -22094,10 +21548,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. */ @@ -22124,21 +21578,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 @@ -22146,9 +21599,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 @@ -22162,10 +21615,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. */ @@ -22192,21 +21645,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 @@ -22214,9 +21666,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 @@ -22237,17 +21689,17 @@ # 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 @@ -22263,33 +21715,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 @@ -22303,52 +21754,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://www.python.org/python-bugs ## @@ -22357,18 +21807,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 @@ -22387,14 +21837,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. @@ -22406,10 +21911,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 ; @@ -22422,14 +21928,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 @@ -22444,10 +21949,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 ; @@ -22460,21 +21966,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` @@ -22488,7 +21993,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 @@ -22499,10 +22004,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 ; @@ -22515,14 +22021,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 @@ -22537,10 +22042,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 ; @@ -22553,21 +22059,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` @@ -22581,7 +22086,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= @@ -22602,10 +22107,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 ; @@ -22618,21 +22124,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` @@ -22643,13 +22148,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 ;; @@ -22663,8 +22166,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 @@ -22674,22 +22178,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; ; @@ -22702,48 +22204,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; } @@ -22754,8 +22251,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. */ @@ -22782,14 +22279,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 @@ -22803,24 +22299,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 @@ -22847,44 +22343,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 @@ -22934,195 +22427,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; @@ -23134,33 +22481,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; @@ -23172,21 +22519,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 @@ -23194,44 +22540,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; } @@ -23242,31 +22573,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 @@ -23285,14 +22615,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; @@ -23304,70 +22634,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 @@ -23392,40 +22715,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 @@ -23436,10 +22756,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 @@ -23468,36 +22788,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 @@ -23515,8 +22831,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" @@ -23552,30 +22868,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 @@ -23585,11 +22897,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 @@ -23598,10 +22910,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" @@ -23633,37 +22945,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 @@ -23686,21 +22994,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 @@ -23731,10 +23038,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" @@ -23766,37 +23073,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 @@ -23806,10 +23109,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" @@ -23841,37 +23144,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 @@ -23881,10 +23180,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" @@ -23916,37 +23215,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 @@ -23969,21 +23264,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 @@ -24016,10 +23310,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 @@ -24047,40 +23341,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 @@ -24090,8 +23381,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 @@ -24133,38 +23424,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 @@ -24177,10 +23465,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. */ @@ -24208,21 +23496,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 @@ -24251,21 +23538,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 @@ -24276,9 +23562,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 @@ -24294,10 +23580,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. */ @@ -24324,21 +23610,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 @@ -24346,9 +23631,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 @@ -24364,10 +23649,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. */ @@ -24394,35 +23679,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 @@ -24434,10 +23715,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 @@ -24520,40 +23801,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 @@ -24564,10 +23842,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. */ @@ -24593,21 +23871,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 @@ -24616,8 +23893,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 @@ -24628,10 +23905,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. */ @@ -24657,21 +23934,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 @@ -24680,8 +23956,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 @@ -24692,10 +23968,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. */ @@ -24721,21 +23997,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 @@ -24744,8 +24019,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 @@ -24756,10 +24031,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. */ @@ -24785,21 +24060,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 @@ -24808,8 +24082,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 @@ -24821,8 +24095,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 @@ -24844,14 +24118,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 @@ -24861,21 +24134,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 @@ -24897,14 +24170,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 @@ -24914,21 +24186,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 @@ -24950,14 +24222,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 @@ -24967,63 +24238,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. */ @@ -25072,92 +24341,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 @@ -25173,11 +24396,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; } @@ -25188,39 +24414,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 @@ -25231,8 +24448,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 @@ -25258,38 +24475,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 @@ -25300,8 +24514,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 @@ -25313,14 +24527,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 @@ -25334,15 +24548,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" @@ -25374,12 +24588,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 @@ -25412,12 +24625,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 @@ -25433,7 +24646,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" @@ -25445,14 +24658,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. @@ -25465,7 +24676,7 @@ SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -25475,7 +24686,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 @@ -25497,45 +24708,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. @@ -25551,6 +24734,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. @@ -25573,7 +24758,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 @@ -25586,10 +24771,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 && @@ -25611,7 +24803,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 @@ -25662,7 +24854,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 @@ -25690,6 +24882,7 @@ *) ECHO_N='-n';; esac + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -25702,22 +24895,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 @@ -25742,10 +24932,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 @@ -25768,7 +24958,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 @@ -25781,39 +24971,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 @@ -25824,24 +25004,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 @@ -25863,36 +25043,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; }; } ;; @@ -25911,32 +25085,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 @@ -25950,8 +25122,8 @@ "Makefile.pre") CONFIG_FILES="$CONFIG_FILES Makefile.pre" ;; "Modules/Setup.config") CONFIG_FILES="$CONFIG_FILES Modules/Setup.config" ;; - *) { { $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 @@ -25991,145 +25163,222 @@ (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 +RANLIB!$RANLIB$ac_delim +AR!$AR$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 +SHLIBS!$SHLIBS$ac_delim +USE_SIGNAL_MODULE!$USE_SIGNAL_MODULE$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 +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` = 19; 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 @@ -26145,133 +25394,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;; @@ -26300,38 +25435,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 @@ -26341,7 +25464,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 @@ -26367,7 +25490,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" @@ -26376,7 +25499,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 @@ -26397,17 +25520,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/ ;; @@ -26447,13 +25570,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 } @@ -26462,14 +25584,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 @@ -26483,16 +25604,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 @@ -26502,58 +25622,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" ;; @@ -26567,11 +25748,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. @@ -26593,10 +25769,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/io-c/pyconfig.h.in ============================================================================== --- python/branches/io-c/pyconfig.h.in (original) +++ python/branches/io-c/pyconfig.h.in Wed Feb 25 13:53:37 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 @@ -955,28 +952,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 @@ -1014,21 +989,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 @@ -1047,25 +1021,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 From python-checkins at python.org Wed Feb 25 16:42:59 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 25 Feb 2009 16:42:59 +0100 (CET) Subject: [Python-checkins] r69963 - python/branches/io-c/Lib/test/test_io.py Message-ID: <20090225154259.4CDF21E4002@bag.python.org> Author: antoine.pitrou Date: Wed Feb 25 16:42:59 2009 New Revision: 69963 Log: Add a test of ABC inheritance Modified: python/branches/io-c/Lib/test/test_io.py Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Wed Feb 25 16:42:59 2009 @@ -2043,6 +2043,24 @@ gc.collect() self.assert_(wr() is None, wr) + def test_abc_inheritance(self): + # Test implementations inherit (even virtually) from their respective ABCs + f = self.open(support.TESTFN, "wb", buffering=0) + self.assertTrue(isinstance(f, self.IOBase)) + self.assertTrue(isinstance(f, self.RawIOBase)) + self.assertFalse(isinstance(f, self.BufferedIOBase)) + self.assertFalse(isinstance(f, self.TextIOBase)) + f = self.open(support.TESTFN, "wb") + self.assertTrue(isinstance(f, self.IOBase)) + self.assertFalse(isinstance(f, self.RawIOBase)) + self.assertTrue(isinstance(f, self.BufferedIOBase)) + self.assertFalse(isinstance(f, self.TextIOBase)) + f = self.open(support.TESTFN, "w") + self.assertTrue(isinstance(f, self.IOBase)) + self.assertFalse(isinstance(f, self.RawIOBase)) + self.assertFalse(isinstance(f, self.BufferedIOBase)) + self.assertTrue(isinstance(f, self.TextIOBase)) + class CMiscIOTest(MiscIOTest): io = io From python-checkins at python.org Wed Feb 25 18:04:55 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 25 Feb 2009 18:04:55 +0100 (CET) Subject: [Python-checkins] r69964 - distutils/tags/Distutils-2.6.1/README.txt Message-ID: <20090225170455.F15FC1E4002@bag.python.org> Author: tarek.ziade Date: Wed Feb 25 18:04:55 2009 New Revision: 69964 Log: typo Modified: distutils/tags/Distutils-2.6.1/README.txt Modified: distutils/tags/Distutils-2.6.1/README.txt ============================================================================== --- distutils/tags/Distutils-2.6.1/README.txt (original) +++ distutils/tags/Distutils-2.6.1/README.txt Wed Feb 25 18:04:55 2009 @@ -4,7 +4,7 @@ This is the standalone distribution of Distutils. -..contents :: +.. contents:: Installation ============ From python-checkins at python.org Wed Feb 25 18:05:24 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 25 Feb 2009 18:05:24 +0100 (CET) Subject: [Python-checkins] r69965 - distutils/trunk/README.txt Message-ID: <20090225170524.88D2B1E4034@bag.python.org> Author: tarek.ziade Date: Wed Feb 25 18:05:24 2009 New Revision: 69965 Log: typo Modified: distutils/trunk/README.txt Modified: distutils/trunk/README.txt ============================================================================== --- distutils/trunk/README.txt (original) +++ distutils/trunk/README.txt Wed Feb 25 18:05:24 2009 @@ -4,7 +4,7 @@ This is the standalone distribution of Distutils. -..contents :: +.. contents:: Installation ============ From python-checkins at python.org Wed Feb 25 18:08:46 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 25 Feb 2009 18:08:46 +0100 (CET) Subject: [Python-checkins] r69966 - distutils/tags/Distutils-2.6.1/setup.py Message-ID: <20090225170846.7E8571E4002@bag.python.org> Author: tarek.ziade Date: Wed Feb 25 18:08:46 2009 New Revision: 69966 Log: Distutils 2.6 doesn't handle non-ascii characters in maintainer field Modified: distutils/tags/Distutils-2.6.1/setup.py Modified: distutils/tags/Distutils-2.6.1/setup.py ============================================================================== --- distutils/tags/Distutils-2.6.1/setup.py (original) +++ distutils/tags/Distutils-2.6.1/setup.py Wed Feb 25 18:08:46 2009 @@ -66,7 +66,7 @@ description="Python Distribution Utilities", author="Greg Ward", author_email="gward at python.net", - maintainer="Tarek Ziad?", + maintainer="Tarek Ziade", maintainer_email="tarek at ziade.org", url="http://www.python.org/sigs/distutils-sig", license="Python", From python-checkins at python.org Wed Feb 25 18:17:09 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 25 Feb 2009 18:17:09 +0100 (CET) Subject: [Python-checkins] r69967 - distutils/tags/Distutils-2.6.1/setup.py Message-ID: <20090225171709.8BE821E400C@bag.python.org> Author: tarek.ziade Date: Wed Feb 25 18:17:09 2009 New Revision: 69967 Log: distutils -> Distutils (to keep the existing registered version at Pypi) Modified: distutils/tags/Distutils-2.6.1/setup.py Modified: distutils/tags/Distutils-2.6.1/setup.py ============================================================================== --- distutils/tags/Distutils-2.6.1/setup.py (original) +++ distutils/tags/Distutils-2.6.1/setup.py Wed Feb 25 18:17:09 2009 @@ -61,7 +61,7 @@ else: version = sys.version.split()[0] -setup (name="distutils", +setup (name="Distutils", version=version, description="Python Distribution Utilities", author="Greg Ward", From python-checkins at python.org Wed Feb 25 18:19:30 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 25 Feb 2009 18:19:30 +0100 (CET) Subject: [Python-checkins] r69968 - distutils/tags/Distutils-2.6.1/README.txt Message-ID: <20090225171930.C44901E4002@bag.python.org> Author: tarek.ziade Date: Wed Feb 25 18:19:30 2009 New Revision: 69968 Log: removing the contents flag for PyPI Modified: distutils/tags/Distutils-2.6.1/README.txt Modified: distutils/tags/Distutils-2.6.1/README.txt ============================================================================== --- distutils/tags/Distutils-2.6.1/README.txt (original) +++ distutils/tags/Distutils-2.6.1/README.txt Wed Feb 25 18:19:30 2009 @@ -4,8 +4,6 @@ This is the standalone distribution of Distutils. -.. contents:: - Installation ============ From python-checkins at python.org Wed Feb 25 18:21:28 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 25 Feb 2009 18:21:28 +0100 (CET) Subject: [Python-checkins] r69969 - in distutils/trunk: README.txt setup.py Message-ID: <20090225172128.A98B91E4002@bag.python.org> Author: tarek.ziade Date: Wed Feb 25 18:21:28 2009 New Revision: 69969 Log: backported PyPI fixes Modified: distutils/trunk/README.txt distutils/trunk/setup.py Modified: distutils/trunk/README.txt ============================================================================== --- distutils/trunk/README.txt (original) +++ distutils/trunk/README.txt Wed Feb 25 18:21:28 2009 @@ -4,8 +4,6 @@ This is the standalone distribution of Distutils. -.. contents:: - Installation ============ Modified: distutils/trunk/setup.py ============================================================================== --- distutils/trunk/setup.py (original) +++ distutils/trunk/setup.py Wed Feb 25 18:21:28 2009 @@ -61,7 +61,7 @@ else: version = sys.version.split()[0] -setup (name="distutils", +setup (name="Distutils", version=version, description="Python Distribution Utilities", author="Greg Ward", From python-checkins at python.org Wed Feb 25 18:22:39 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 25 Feb 2009 18:22:39 +0100 (CET) Subject: [Python-checkins] r69970 - in distutils/tags/Distutils-2.5.4: README.txt setup.py Message-ID: <20090225172239.789AA1E4002@bag.python.org> Author: tarek.ziade Date: Wed Feb 25 18:22:39 2009 New Revision: 69970 Log: preparing for 2.5.4 release Modified: distutils/tags/Distutils-2.5.4/README.txt distutils/tags/Distutils-2.5.4/setup.py Modified: distutils/tags/Distutils-2.5.4/README.txt ============================================================================== --- distutils/tags/Distutils-2.5.4/README.txt (original) +++ distutils/tags/Distutils-2.5.4/README.txt Wed Feb 25 18:22:39 2009 @@ -4,8 +4,6 @@ This is the standalone distribution of Distutils. -..contents :: - Installation ============ Modified: distutils/tags/Distutils-2.5.4/setup.py ============================================================================== --- distutils/tags/Distutils-2.5.4/setup.py (original) +++ distutils/tags/Distutils-2.5.4/setup.py Wed Feb 25 18:22:39 2009 @@ -61,7 +61,7 @@ else: version = sys.version.split()[0] -setup (name="distutils", +setup (name="Distutils", version=version, description="Python Distribution Utilities", author="Greg Ward", From python-checkins at python.org Wed Feb 25 18:39:14 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 25 Feb 2009 18:39:14 +0100 (CET) Subject: [Python-checkins] r69971 - distutils/trunk/MANIFEST.in Message-ID: <20090225173914.794311E4002@bag.python.org> Author: tarek.ziade Date: Wed Feb 25 18:39:14 2009 New Revision: 69971 Log: adding an explicit MANIFEST that will work for all releases Added: distutils/trunk/MANIFEST.in (contents, props changed) Added: distutils/trunk/MANIFEST.in ============================================================================== --- (empty file) +++ distutils/trunk/MANIFEST.in Wed Feb 25 18:39:14 2009 @@ -0,0 +1,3 @@ +include README.txt +include distutils/README +recursive-include distutils *.py From python-checkins at python.org Wed Feb 25 18:59:55 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 25 Feb 2009 18:59:55 +0100 (CET) Subject: [Python-checkins] r69972 - in distutils/tags: Distutils-2.4.5 Distutils-2.5.4 Distutils-2.6.1 Message-ID: <20090225175955.B993A1E4002@bag.python.org> Author: tarek.ziade Date: Wed Feb 25 18:59:55 2009 New Revision: 69972 Log: changing strategy: Distutils is not compatible anymore with 2.3 or 2.4 since a long time. So it doesn't make sense to release tagged versions. Will make it work with 2.3 in trunk first of all Removed: distutils/tags/Distutils-2.4.5/ distutils/tags/Distutils-2.5.4/ distutils/tags/Distutils-2.6.1/ From buildbot at python.org Wed Feb 25 19:27:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 25 Feb 2009 18:27:22 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian 3.x Message-ID: <20090225182722.7E9B31E4002@bag.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/67 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: jeffrey.yasskin,raymond.hettinger BUILD FAILED: failed configure sincerely, -The Buildbot From python-checkins at python.org Wed Feb 25 20:24:37 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Wed, 25 Feb 2009 20:24:37 +0100 (CET) Subject: [Python-checkins] r69973 - sandbox/trunk/mmap/Modules/mmapmodule.c Message-ID: <20090225192437.C530B1E4002@bag.python.org> Author: hirokazu.yamamoto Date: Wed Feb 25 20:24:37 2009 New Revision: 69973 Log: Refactored code by using ULARGE_INTEGER. Modified: sandbox/trunk/mmap/Modules/mmapmodule.c Modified: sandbox/trunk/mmap/Modules/mmapmodule.c ============================================================================== --- sandbox/trunk/mmap/Modules/mmapmodule.c (original) +++ sandbox/trunk/mmap/Modules/mmapmodule.c Wed Feb 25 20:24:37 2009 @@ -384,20 +384,18 @@ #ifdef MS_WINDOWS if (self->file_handle != INVALID_HANDLE_VALUE) { - DWORD low,high; - PY_LONG_LONG size; - low = GetFileSize(self->file_handle, &high); - if (low == INVALID_FILE_SIZE) { + ULARGE_INTEGER size; + size.LowPart = GetFileSize(self->file_handle, &size.HighPart); + if (size.LowPart == INVALID_FILE_SIZE) { /* It might be that the function appears to have failed, when indeed its size equals INVALID_FILE_SIZE */ DWORD error = GetLastError(); if (error != NO_ERROR) return PyErr_SetFromWindowsErr(error); } - if (!high && low < LONG_MAX) - return PyInt_FromLong((long)low); - size = (((PY_LONG_LONG)high)<<32) + low; - return PyLong_FromLongLong(size); + if (!size.HighPart && size.LowPart < LONG_MAX) + return PyInt_FromLong((long)size.LowPart); + return PyLong_FromUnsignedLongLong(size.QuadPart); } else { return PyInt_FromSsize_t(self->size); } @@ -436,7 +434,7 @@ #ifdef MS_WINDOWS } else { DWORD dwErrCode = 0; - DWORD off_hi, off_lo, newSizeLow, newSizeHigh; + ULARGE_INTEGER off, newSize; HANDLE map_handle; /* First, unmap the file view */ UnmapViewOfFile(self->data); @@ -445,22 +443,13 @@ CloseHandle(self->map_handle); self->map_handle = INVALID_HANDLE_VALUE; /* Move to the desired EOF position */ -#if SIZEOF_SIZE_T > 4 - newSizeHigh = (DWORD)((self->offset + new_size) >> 32); - newSizeLow = (DWORD)((self->offset + new_size) & 0xFFFFFFFF); - off_hi = (DWORD)(self->offset >> 32); - off_lo = (DWORD)(self->offset & 0xFFFFFFFF); -#else - newSizeHigh = 0; - newSizeLow = (DWORD)(self->offset + new_size); - off_hi = 0; - off_lo = (DWORD)self->offset; -#endif + newSize.QuadPart = ((ULONGLONG)self->offset) + new_size; + off.QuadPart = self->offset; /* XXX: Is anonymous map really resizable? */ if (self->file_handle != INVALID_HANDLE_VALUE) { - DWORD copySizeHigh = newSizeHigh; + DWORD copySizeHigh = newSize.HighPart; SetFilePointer(self->file_handle, - newSizeLow, ©SizeHigh, FILE_BEGIN); + newSize.LowPart, ©SizeHigh, FILE_BEGIN); /* Change the size of the file */ SetEndOfFile(self->file_handle); } @@ -469,14 +458,14 @@ self->file_handle, NULL, PAGE_READWRITE, - newSizeHigh, - newSizeLow, + newSize.HighPart, + newSize.LowPart, self->tagname); if (map_handle != NULL) { self->data = (char *) MapViewOfFile(map_handle, FILE_MAP_WRITE, - off_hi, - off_lo, + off.HighPart, + off.LowPart, new_size); if (self->data != NULL) { self->map_handle = map_handle; @@ -1214,10 +1203,7 @@ mmap_object *m_obj; PyObject *map_size_obj = NULL, *offset_obj = NULL; Py_ssize_t map_size, offset; - DWORD off_hi; /* upper 32 bits of offset */ - DWORD off_lo; /* lower 32 bits of offset */ - DWORD size_hi; /* upper 32 bits of size */ - DWORD size_lo; /* lower 32 bits of size */ + ULARGE_INTEGER off, size; char *tagname = ""; DWORD dwErr = 0; int fileno; @@ -1306,24 +1292,25 @@ return NULL; } if (!map_size) { - DWORD low,high; - low = GetFileSize(fh, &high); + ULARGE_INTEGER size; + size.LowPart = GetFileSize(fh, &size.HighPart); /* low might just happen to have the value INVALID_FILE_SIZE; so we need to check the last error also. */ - if (low == INVALID_FILE_SIZE && + if (size.LowPart == INVALID_FILE_SIZE && (dwErr = GetLastError()) != NO_ERROR) { Py_DECREF(m_obj); return PyErr_SetFromWindowsErr(dwErr); - } - -#if SIZEOF_SIZE_T > 4 - m_obj->size = (((size_t)high)<<32) + low; + } + +#if SIZEOF_SIZE_T >= SIZEOF_LONG_LONG + m_obj->size = size.QuadPart; #else - if (high) + if (size.QuadPart > (ULONGLONG)(size_t)-1) /* File is too large to map completely */ + /* XXX: shouldn't raise error? */ m_obj->size = (size_t)-1; else - m_obj->size = low; + m_obj->size = Py_SAFE_DOWNCAST(size.QuadPart, ULONGLONG, size_t); #endif } else { m_obj->size = map_size; @@ -1350,35 +1337,22 @@ m_obj->tagname = NULL; m_obj->access = (access_mode)access; - /* DWORD is a 4-byte int. If we're on a box where size_t consumes - * more than 4 bytes, we need to break it apart. Else (size_t - * consumes 4 bytes), C doesn't define what happens if we shift - * right by 32, so we need different code. - */ -#if SIZEOF_SIZE_T > 4 - size_hi = (DWORD)((offset + m_obj->size) >> 32); - size_lo = (DWORD)((offset + m_obj->size) & 0xFFFFFFFF); - off_hi = (DWORD)(offset >> 32); - off_lo = (DWORD)(offset & 0xFFFFFFFF); -#else - size_hi = 0; - size_lo = (DWORD)(offset + m_obj->size); - off_hi = 0; - off_lo = (DWORD)offset; -#endif + + size.QuadPart = ((ULONGLONG)offset) + m_obj->size; + off.QuadPart = offset; /* For files, it would be sufficient to pass 0 as size. For anonymous maps, we have to pass the size explicitly. */ map_handle = CreateFileMapping(m_obj->file_handle, NULL, flProtect, - size_hi, - size_lo, + size.HighPart, + size.LowPart, m_obj->tagname); if (map_handle != NULL) { m_obj->data = (char *) MapViewOfFile(map_handle, dwDesiredAccess, - off_hi, - off_lo, + off.HighPart, + off.LowPart, m_obj->size); if (m_obj->data != NULL) { m_obj->map_handle = map_handle; From python-checkins at python.org Wed Feb 25 21:29:50 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 25 Feb 2009 21:29:50 +0100 (CET) Subject: [Python-checkins] r69974 - python/trunk/Objects/longobject.c Message-ID: <20090225202950.D9A601E4002@bag.python.org> Author: mark.dickinson Date: Wed Feb 25 21:29:50 2009 New Revision: 69974 Log: Replace long with twodigits, to avoid depending on sizeof(digit) < sizeof(long) Modified: python/trunk/Objects/longobject.c Modified: python/trunk/Objects/longobject.c ============================================================================== --- python/trunk/Objects/longobject.c (original) +++ python/trunk/Objects/longobject.c Wed Feb 25 21:29:50 2009 @@ -1273,7 +1273,7 @@ digit powbase = base; /* powbase == base ** power */ int power = 1; for (;;) { - unsigned long newpow = powbase * (unsigned long)base; + twodigits newpow = powbase * (twodigits)base; if (newpow >> PyLong_SHIFT) /* doesn't fit in a digit */ break; powbase = (digit)newpow; From python-checkins at python.org Wed Feb 25 21:33:49 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 25 Feb 2009 21:33:49 +0100 (CET) Subject: [Python-checkins] r69975 - in python/branches/py3k: Objects/longobject.c Message-ID: <20090225203349.D2F5B1E4002@bag.python.org> Author: mark.dickinson Date: Wed Feb 25 21:33:49 2009 New Revision: 69975 Log: Merged revisions 69974 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69974 | mark.dickinson | 2009-02-25 20:29:50 +0000 (Wed, 25 Feb 2009) | 3 lines Replace long with twodigits, to avoid depending on sizeof(digit) < sizeof(long) ........ 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 Wed Feb 25 21:33:49 2009 @@ -1557,7 +1557,7 @@ digit powbase = base; /* powbase == base ** power */ int power = 1; for (;;) { - unsigned long newpow = powbase * (unsigned long)base; + twodigits newpow = powbase * (twodigits)base; if (newpow >> PyLong_SHIFT) /* doesn't fit in a digit */ break; powbase = (digit)newpow; From buildbot at python.org Wed Feb 25 21:47:59 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 25 Feb 2009 20:47:59 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian trunk Message-ID: <20090225204759.712991E4002@bag.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/125 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: brett.cannon,jeffrey.yasskin,mark.dickinson,raymond.hettinger BUILD FAILED: failed configure sincerely, -The Buildbot From buildbot at python.org Wed Feb 25 22:18:46 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 25 Feb 2009 21:18:46 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090225211846.8B1E81E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/682 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: mark.dickinson,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From nnorwitz at gmail.com Wed Feb 25 22:18:51 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 25 Feb 2009 16:18:51 -0500 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090225211851.GA20738@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 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 [13025 refs] [13025 refs] [22579 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14680 refs] [14680 refs] test_plistlib test_poll test_popen [13030 refs] [13030 refs] [13030 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 [18075 refs] test_pyexpat test_queue test_quopri [15550 refs] [15550 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 [13025 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 106, in test_s_option % (usersite, rc)) AssertionError: '/home/neal/.local/lib/python2.7/site-packages' is not in sys.path (sys.exit returned 0) 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [14925 refs] [13240 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] . [13025 refs] [13025 refs] this bit of output is from a test of stdout in a different process ... [13025 refs] [13025 refs] [13240 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [13025 refs] [13025 refs] [13254 refs] [13048 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [13028 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16521 refs] [18025 refs] [17000 refs] [17000 refs] [17000 refs] [17000 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [664503 refs] From nnorwitz at gmail.com Wed Feb 25 22:26:09 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 25 Feb 2009 16:26:09 -0500 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090225212609.GA23137@python.psfb.org> 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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 [17205 refs] [17205 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 [13025 refs] [13025 refs] [22579 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14680 refs] [14680 refs] test_plistlib test_poll test_popen [13030 refs] [13030 refs] [13030 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 [18075 refs] test_pyexpat test_queue test_quopri [15550 refs] [15550 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 [13025 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 106, in test_s_option % (usersite, rc)) AssertionError: '/home/neal/.local/lib/python2.7/site-packages' is not in sys.path (sys.exit returned 0) 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 -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [14925 refs] [13240 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] . [13025 refs] [13025 refs] this bit of output is from a test of stdout in a different process ... [13025 refs] [13025 refs] [13240 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [13025 refs] [13025 refs] [13254 refs] [13048 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [13028 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16521 refs] [17184 refs] [17000 refs] [17000 refs] [17000 refs] [17000 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 runtktests 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 test_xmlrpc test_xpickle 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 330 tests OK. 1 test failed: test_site 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [663773 refs] From buildbot at python.org Wed Feb 25 22:51:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 25 Feb 2009 21:51:11 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090225215112.13BDB1E4040@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/345 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_posix test_subprocess ====================================================================== 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Wed Feb 25 23:29:27 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 25 Feb 2009 23:29:27 +0100 (CET) Subject: [Python-checkins] r69976 - in python/trunk: Lib/distutils/tests/test_config.py Lib/distutils/tests/test_sdist.py Misc/NEWS Message-ID: <20090225222927.EBF7A1E400C@bag.python.org> Author: tarek.ziade Date: Wed Feb 25 23:29:27 2009 New Revision: 69976 Log: Fixed #5316 : test failure in test_site Modified: python/trunk/Lib/distutils/tests/test_config.py python/trunk/Lib/distutils/tests/test_sdist.py python/trunk/Misc/NEWS 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 Wed Feb 25 23:29:27 2009 @@ -51,7 +51,7 @@ def setUp(self): """Patches the environment.""" - support.TempdirManager.setUp(self) + super(PyPIRCCommandTestCase, self).setUp() if os.environ.has_key('HOME'): self._old_home = os.environ['HOME'] @@ -79,7 +79,7 @@ else: os.environ['HOME'] = self._old_home set_threshold(self.old_threshold) - support.TempdirManager.tearDown(self) + super(PyPIRCCommandTestCase, self).tearDown() def test_server_registration(self): # This test makes sure PyPIRCCommand knows how to: 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 Wed Feb 25 23:29:27 2009 @@ -37,10 +37,9 @@ class sdistTestCase(support.LoggingSilencer, PyPIRCCommandTestCase): def setUp(self): - support.LoggingSilencer.setUp(self) # PyPIRCCommandTestCase creates a temp dir already # and put it in self.tmp_dir - PyPIRCCommandTestCase.setUp(self) + super(sdistTestCase, self).setUp() # setting up an environment self.old_path = os.getcwd() os.mkdir(join(self.tmp_dir, 'somecode')) @@ -54,8 +53,7 @@ def tearDown(self): # back to normal os.chdir(self.old_path) - PyPIRCCommandTestCase.tearDown(self) - support.LoggingSilencer.tearDown(self) + super(sdistTestCase, self).tearDown() def get_cmd(self, metadata=None): """Returns a cmd""" Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Feb 25 23:29:27 2009 @@ -165,6 +165,9 @@ Library ------- +- Issue #5316: Fixed buildbot failures introduced by multiple inheritance + in Distutils tests. + - Issue #5287: Add exception handling around findCaller() call to help out IronPython. From python-checkins at python.org Wed Feb 25 23:31:38 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 25 Feb 2009 23:31:38 +0100 (CET) Subject: [Python-checkins] r69977 - in python/branches/py3k: Lib/distutils/tests/test_config.py Lib/distutils/tests/test_sdist.py Misc/NEWS Message-ID: <20090225223138.3CF781E4002@bag.python.org> Author: tarek.ziade Date: Wed Feb 25 23:31:38 2009 New Revision: 69977 Log: Merged revisions 69976 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69976 | tarek.ziade | 2009-02-25 23:29:27 +0100 (Wed, 25 Feb 2009) | 1 line Fixed #5316 : test failure in test_site ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_config.py python/branches/py3k/Lib/distutils/tests/test_sdist.py python/branches/py3k/Misc/NEWS 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 Wed Feb 25 23:31:38 2009 @@ -50,7 +50,7 @@ def setUp(self): """Patches the environment.""" - support.TempdirManager.setUp(self) + super(PyPIRCCommandTestCase, self).setUp() if 'HOME' in os.environ: self._old_home = os.environ['HOME'] @@ -78,7 +78,7 @@ else: os.environ['HOME'] = self._old_home set_threshold(self.old_threshold) - support.TempdirManager.tearDown(self) + super(PyPIRCCommandTestCase, self).tearDown() def test_server_registration(self): # This test makes sure PyPIRCCommand knows how to: 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 Wed Feb 25 23:31:38 2009 @@ -37,10 +37,9 @@ class sdistTestCase(support.LoggingSilencer, PyPIRCCommandTestCase): def setUp(self): - support.LoggingSilencer.setUp(self) # PyPIRCCommandTestCase creates a temp dir already # and put it in self.tmp_dir - PyPIRCCommandTestCase.setUp(self) + super(sdistTestCase, self).setUp() # setting up an environment self.old_path = os.getcwd() os.mkdir(join(self.tmp_dir, 'somecode')) @@ -54,8 +53,7 @@ def tearDown(self): # back to normal os.chdir(self.old_path) - PyPIRCCommandTestCase.tearDown(self) - support.LoggingSilencer.tearDown(self) + super(sdistTestCase, self).tearDown() def get_cmd(self, metadata=None): """Returns a cmd""" Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed Feb 25 23:31:38 2009 @@ -172,6 +172,8 @@ Library ------- +- Issue #5316: Fixed buildbot failures introduced by multiple inheritance + in Distutils tests. - Issue #5287: Add exception handling around findCaller() call to help out IronPython. From python-checkins at python.org Wed Feb 25 23:34:26 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 25 Feb 2009 23:34:26 +0100 (CET) Subject: [Python-checkins] r69978 - python/branches/release30-maint Message-ID: <20090225223426.2FD891E4002@bag.python.org> Author: tarek.ziade Date: Wed Feb 25 23:34:26 2009 New Revision: 69978 Log: Blocked revisions 69904 via svnmerge ................ r69904 | tarek.ziade | 2009-02-23 13:47:55 +0100 (Mon, 23 Feb 2009) | 9 lines Merged revisions 69902 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69902 | tarek.ziade | 2009-02-23 13:41:29 +0100 (Mon, 23 Feb 2009) | 1 line more test coverage ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Wed Feb 25 23:35:21 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 25 Feb 2009 23:35:21 +0100 (CET) Subject: [Python-checkins] r69979 - python/branches/release26-maint Message-ID: <20090225223521.2BE171E4002@bag.python.org> Author: tarek.ziade Date: Wed Feb 25 23:35:20 2009 New Revision: 69979 Log: Blocked revisions 69976 via svnmerge ........ r69976 | tarek.ziade | 2009-02-25 23:29:27 +0100 (Wed, 25 Feb 2009) | 1 line Fixed #5316 : test failure in test_site ........ Modified: python/branches/release26-maint/ (props changed) From buildbot at python.org Wed Feb 25 23:39:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 25 Feb 2009 22:39:34 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian 3.0 Message-ID: <20090225223935.44C081E4002@bag.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/67 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: raymond.hettinger,tarek.ziade BUILD FAILED: failed configure sincerely, -The Buildbot From python-checkins at python.org Wed Feb 25 23:42:29 2009 From: python-checkins at python.org (brett.cannon) Date: Wed, 25 Feb 2009 23:42:29 +0100 (CET) Subject: [Python-checkins] r69980 - peps/trunk/pep-0374.txt Message-ID: <20090225224229.36F8D1E4002@bag.python.org> Author: brett.cannon Date: Wed Feb 25 23:42:28 2009 New Revision: 69980 Log: Update bzr timings now that code.python.org is running a newer version of bzr. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Wed Feb 25 23:42:28 2009 @@ -1364,16 +1364,11 @@ DVCS San Francisco Vancouver Space ------- ---------------- --------- ----- svn 1:04 2:59 139 M -bzr 10:45 23:51 276 M +bzr 10:45 19:35 276 M hg 2:30 5:24 171 M git 2:54 5:28 134 M ======= ================ ========= ===== -.. note:: - The version of bzr running on code.python.org is 1.5. Changes were - made in bzr 1.9 that should bring down the time to be 80% of what is - reported. - 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 From python-checkins at python.org Wed Feb 25 23:48:25 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 25 Feb 2009 23:48:25 +0100 (CET) Subject: [Python-checkins] r69981 - python/trunk/Doc/library/collections.rst Message-ID: <20090225224825.8B1C71E4002@bag.python.org> Author: raymond.hettinger Date: Wed Feb 25 23:48:24 2009 New Revision: 69981 Log: Clarify Counter() docs. 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 Wed Feb 25 23:48:24 2009 @@ -251,14 +251,12 @@ c.most_common()[:-n:-1] # n least common elements c += Counter() # remove zero and negative counts -Several multiset mathematical operations are provided for combining -:class:`Counter` objects. Multisets are counters with the restriction -that all counts are at least one. They are like regular sets but are -allowed to contain repeated elements. Addition and subtraction combine -counters by adding or subtracting the counts of corresponding elements. -Intersection and union return the minimum and maximum of corresponding -counts. Each operation can accept inputs with signed counts, -but the output excludes results with counts less than one. +Several mathematical operations are provided for combining :class:`Counter` +objects to produce multisets (counters that have counts greater than zero). +Addition and subtraction combine counters by adding or subtracting the counts +of corresponding elements. Intersection and union return the minimum and +maximum of corresponding counts. Each operation can accept inputs with signed +counts, but the output will exclude results with counts of zero or less. >>> c = Counter(a=3, b=1) >>> d = Counter(a=1, b=2) From python-checkins at python.org Wed Feb 25 23:51:40 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 25 Feb 2009 23:51:40 +0100 (CET) Subject: [Python-checkins] r69982 - python/branches/py3k/Doc/library/collections.rst Message-ID: <20090225225140.C59171E400C@bag.python.org> Author: raymond.hettinger Date: Wed Feb 25 23:51:40 2009 New Revision: 69982 Log: Sync-up 3.1 docs with 2.7 for collections.Counter(). 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 Wed Feb 25 23:51:40 2009 @@ -236,13 +236,12 @@ c.most_common()[:-n:-1] # n least common elements c += Counter() # remove zero and negative counts -Several multiset mathematical operations are provided for combining -:class:`Counter` objects. Multisets are like regular sets but are allowed to -contain repeated elements (with counts of one or more). Addition and -subtraction combine counters by adding or subtracting the counts of -corresponding elements. Intersection and union return the minimum and maximum -of corresponding counts. Each operation can accept inputs with signed counts, -but the output excludes results with counts less than one. +Several mathematical operations are provided for combining :class:`Counter` +objects to produce multisets (counters that have counts greater than zero). +Addition and subtraction combine counters by adding or subtracting the counts +of corresponding elements. Intersection and union return the minimum and +maximum of corresponding counts. Each operation can accept inputs with signed +counts, but the output will exclude results with counts of zero or less. >>> c = Counter(a=3, b=1) >>> d = Counter(a=1, b=2) From nnorwitz at gmail.com Wed Feb 25 23:54:35 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 25 Feb 2009 17:54:35 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090225225435.GA25694@python.psfb.org> 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 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 aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array 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-9265 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 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 [13025 refs] [13025 refs] [22579 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_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_lib2to3 skipped -- No module named myfixes 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 macostools test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio 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_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [14680 refs] [14680 refs] test_plistlib test_poll test_popen [13030 refs] [13030 refs] [13030 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 [18075 refs] test_pyexpat test_queue test_quopri [15550 refs] [15550 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 [13025 refs] test test_site failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_site.py", line 106, in test_s_option % (usersite, rc)) AssertionError: '/home/neal/.local/lib/python2.7/site-packages' is not in sys.path (sys.exit returned 0) test_slice test_smtplib test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [14925 refs] [13240 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] [13025 refs] . [13025 refs] [13025 refs] this bit of output is from a test of stdout in a different process ... [13025 refs] [13025 refs] [13240 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry /tmp/python-test/local/lib/python2.7/test/test_sundry.py:66: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking import posixfile test_symtable test_syntax test_sys [13025 refs] [13025 refs] [13254 refs] [13048 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [13028 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [16521 refs] [18025 refs] [17000 refs] [17000 refs] [17000 refs] [17000 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 runtktests 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 test_xmlrpc test_xpickle 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 335 tests OK. 1 test failed: test_site 28 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_lib2to3 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 7 skips unexpected on linux2: test_multiprocessing test_lib2to3 test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [678201 refs] From buildbot at python.org Thu Feb 26 00:58:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 25 Feb 2009 23:58:34 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 2.6 Message-ID: <20090225235834.E612E1E4002@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/148 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: raymond.hettinger,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Thu Feb 26 01:05:24 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 26 Feb 2009 01:05:24 +0100 (CET) Subject: [Python-checkins] r69983 - python/trunk/Doc/library/functions.rst Message-ID: <20090226000524.3E2681E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 26 01:05:24 2009 New Revision: 69983 Log: Fix typo. 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 Thu Feb 26 01:05:24 2009 @@ -1218,7 +1218,7 @@ The second use case is to support cooperative multiple inheritance in a dynamic execution environment. This use case is unique to Python and is not found in statically compiled languages or languages that only support - single inheritance. This makes in possible to implement "diamond diagrams" + single inheritance. This makes it possible to implement "diamond diagrams" where multiple base classes implement the same method. Good design dictates that this method have the same calling signature in every case (because the order of calls is determined at runtime, because that order adapts From python-checkins at python.org Thu Feb 26 01:20:22 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 26 Feb 2009 01:20:22 +0100 (CET) Subject: [Python-checkins] r69984 - python/branches/release26-maint/Doc/library/functions.rst Message-ID: <20090226002022.E0DC51E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 26 01:20:22 2009 New Revision: 69984 Log: Fix typo. Modified: python/branches/release26-maint/Doc/library/functions.rst 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 Thu Feb 26 01:20:22 2009 @@ -1218,7 +1218,7 @@ The second use case is to support cooperative multiple inheritance in a dynamic execution environment. This use case is unique to Python and is not found in statically compiled languages or languages that only support - single inheritance. This makes in possible to implement "diamond diagrams" + single inheritance. This makes it possible to implement "diamond diagrams" where multiple base classes implement the same method. Good design dictates that this method have the same calling signature in every case (because the order of calls is determined at runtime, because that order adapts From buildbot at python.org Thu Feb 26 01:21:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 26 Feb 2009 00:21:35 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.6 Message-ID: <20090226002136.246E51E4002@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/111 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: raymond.hettinger,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_subprocess sincerely, -The Buildbot From python-checkins at python.org Thu Feb 26 01:23:37 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 26 Feb 2009 01:23:37 +0100 (CET) Subject: [Python-checkins] r69985 - python/branches/release30-maint/Doc/library/functions.rst Message-ID: <20090226002337.31C761E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 26 01:23:35 2009 New Revision: 69985 Log: Fix typo. Modified: python/branches/release30-maint/Doc/library/functions.rst Modified: python/branches/release30-maint/Doc/library/functions.rst ============================================================================== --- python/branches/release30-maint/Doc/library/functions.rst (original) +++ python/branches/release30-maint/Doc/library/functions.rst Thu Feb 26 01:23:35 2009 @@ -1061,7 +1061,7 @@ The second use case is to support cooperative multiple inheritance in a dynamic execution environment. This use case is unique to Python and is not found in statically compiled languages or languages that only support - single inheritance. This makes in possible to implement "diamond diagrams" + single inheritance. This makes it possible to implement "diamond diagrams" where multiple base classes implement the same method. Good design dictates that this method have the same calling signature in every case (because the order of calls is determined at runtime, because that order adapts From python-checkins at python.org Thu Feb 26 01:27:18 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 26 Feb 2009 01:27:18 +0100 (CET) Subject: [Python-checkins] r69986 - python/branches/py3k/Doc/library/functions.rst Message-ID: <20090226002718.B97BF1E4002@bag.python.org> Author: raymond.hettinger Date: Thu Feb 26 01:27:18 2009 New Revision: 69986 Log: Fix typo. Modified: python/branches/py3k/Doc/library/functions.rst Modified: python/branches/py3k/Doc/library/functions.rst ============================================================================== --- python/branches/py3k/Doc/library/functions.rst (original) +++ python/branches/py3k/Doc/library/functions.rst Thu Feb 26 01:27:18 2009 @@ -1067,7 +1067,7 @@ The second use case is to support cooperative multiple inheritance in a dynamic execution environment. This use case is unique to Python and is not found in statically compiled languages or languages that only support - single inheritance. This makes in possible to implement "diamond diagrams" + single inheritance. This makes it possible to implement "diamond diagrams" where multiple base classes implement the same method. Good design dictates that this method have the same calling signature in every case (because the order of calls is determined at runtime, because that order adapts From python-checkins at python.org Thu Feb 26 01:30:12 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 26 Feb 2009 01:30:12 +0100 (CET) Subject: [Python-checkins] r69987 - python/trunk/Doc/library/stdtypes.rst Message-ID: <20090226003012.98FB31E4002@bag.python.org> Author: benjamin.peterson Date: Thu Feb 26 01:30:11 2009 New Revision: 69987 Log: fix str.format()'s first arg #5371 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 Thu Feb 26 01:30:11 2009 @@ -892,7 +892,7 @@ found. -.. method:: str.format(format_string, *args, **kwargs) +.. method:: str.format(*args, **kwargs) Perform a string formatting operation. The *format_string* argument can contain literal text or replacement fields delimited by braces ``{}``. Each From buildbot at python.org Thu Feb 26 01:38:08 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 26 Feb 2009 00:38:08 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090226003808.69DEF1E4002@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/178 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: raymond.hettinger,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 Thu Feb 26 02:22:36 2009 From: python-checkins at python.org (brett.cannon) Date: Thu, 26 Feb 2009 02:22:36 +0100 (CET) Subject: [Python-checkins] r69988 - peps/trunk/pep-0374.txt Message-ID: <20090226012236.960D21E4002@bag.python.org> Author: brett.cannon Date: Thu Feb 26 02:22:36 2009 New Revision: 69988 Log: Update bzr timings based on some fixes made recently. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Thu Feb 26 02:22:36 2009 @@ -1364,7 +1364,7 @@ DVCS San Francisco Vancouver Space ------- ---------------- --------- ----- svn 1:04 2:59 139 M -bzr 10:45 19:35 276 M +bzr 10:45 16:04 276 M hg 2:30 5:24 171 M git 2:54 5:28 134 M ======= ================ ========= ===== From buildbot at python.org Thu Feb 26 02:46:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 26 Feb 2009 01:46:29 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090226014629.DF4501E4002@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/146 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: raymond.hettinger,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Thu Feb 26 03:44:26 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 26 Feb 2009 03:44:26 +0100 (CET) Subject: [Python-checkins] r69989 - python/branches/py3k Message-ID: <20090226024426.48F531E4002@bag.python.org> Author: benjamin.peterson Date: Thu Feb 26 03:44:26 2009 New Revision: 69989 Log: Blocked revisions 69937,69946,69952-69953,69955,69959,69981,69983 via svnmerge ........ r69937 | raymond.hettinger | 2009-02-24 06:23:23 -0600 (Tue, 24 Feb 2009) | 3 lines Backport 69934: Register xrange() as a Sequence. ........ r69946 | brett.cannon | 2009-02-24 16:01:02 -0600 (Tue, 24 Feb 2009) | 2 lines Expand upon test_site.test_s_option to try to debug its failure. ........ r69952 | raymond.hettinger | 2009-02-24 18:37:57 -0600 (Tue, 24 Feb 2009) | 1 line Sync-up py3.1 doc updates for super(). ........ r69953 | raymond.hettinger | 2009-02-24 18:39:47 -0600 (Tue, 24 Feb 2009) | 1 line Restore Py2.x version of sample call to super(). ........ r69955 | raymond.hettinger | 2009-02-24 18:52:37 -0600 (Tue, 24 Feb 2009) | 1 line More markup and spelling fixes. ........ r69959 | raymond.hettinger | 2009-02-24 19:06:52 -0600 (Tue, 24 Feb 2009) | 1 line Remove reference to zero argument form of super() in 2.x docs. ........ r69981 | raymond.hettinger | 2009-02-25 16:48:24 -0600 (Wed, 25 Feb 2009) | 1 line Clarify Counter() docs. ........ r69983 | raymond.hettinger | 2009-02-25 18:05:24 -0600 (Wed, 25 Feb 2009) | 1 line Fix typo. ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Thu Feb 26 04:27:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 26 Feb 2009 03:27:37 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090226032738.15D071E4002@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/370 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,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Thu Feb 26 04:31:32 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 26 Feb 2009 03:31:32 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090226033132.9D11A1E4002@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/334 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,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_pipes make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Feb 26 04:38:59 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 26 Feb 2009 04:38:59 +0100 (CET) Subject: [Python-checkins] r69990 - in python/branches/py3k: Doc/c-api/intro.rst Doc/c-api/veryhigh.rst Doc/howto/webservers.rst Doc/library/2to3.rst Doc/library/abc.rst Doc/library/cgi.rst Doc/library/cgitb.rst Doc/library/stdtypes.rst Doc/library/xml.etree.elementtree.rst Doc/whatsnew/2.5.rst Lib/socketserver.py README Message-ID: <20090226033859.96D1C1E4002@bag.python.org> Author: benjamin.peterson Date: Thu Feb 26 04:38:59 2009 New Revision: 69990 Log: Merged revisions 69803-69805,69840,69901,69905,69907,69924,69927,69987 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69803 | georg.brandl | 2009-02-20 01:48:21 -0600 (Fri, 20 Feb 2009) | 1 line #5327: fix a broken link by joining it. ........ r69804 | georg.brandl | 2009-02-20 02:22:21 -0600 (Fri, 20 Feb 2009) | 1 line At least separate imports from other statements. ........ r69805 | georg.brandl | 2009-02-20 02:45:47 -0600 (Fri, 20 Feb 2009) | 2 lines Fix punctuation. ........ r69840 | georg.brandl | 2009-02-21 13:09:40 -0600 (Sat, 21 Feb 2009) | 1 line #5338, #5339: two types in the API manual. ........ r69901 | georg.brandl | 2009-02-23 05:24:46 -0600 (Mon, 23 Feb 2009) | 2 lines #5349: C++ pure virtuals can also have an implementation. ........ r69905 | georg.brandl | 2009-02-23 09:51:27 -0600 (Mon, 23 Feb 2009) | 2 lines #5352: str.count() counts non-overlapping instances. ........ r69907 | georg.brandl | 2009-02-23 12:33:48 -0600 (Mon, 23 Feb 2009) | 1 line Fix grammar. ........ r69924 | benjamin.peterson | 2009-02-23 20:45:35 -0600 (Mon, 23 Feb 2009) | 1 line update README on running tests ........ r69927 | neil.schemenauer | 2009-02-23 22:23:25 -0600 (Mon, 23 Feb 2009) | 1 line Fix call to os.waitpid, it does not take keyword args. ........ r69987 | benjamin.peterson | 2009-02-25 18:30:11 -0600 (Wed, 25 Feb 2009) | 1 line fix str.format()'s first arg #5371 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/c-api/intro.rst python/branches/py3k/Doc/c-api/veryhigh.rst python/branches/py3k/Doc/howto/webservers.rst python/branches/py3k/Doc/library/2to3.rst python/branches/py3k/Doc/library/abc.rst python/branches/py3k/Doc/library/cgi.rst python/branches/py3k/Doc/library/cgitb.rst python/branches/py3k/Doc/library/stdtypes.rst python/branches/py3k/Doc/library/xml.etree.elementtree.rst python/branches/py3k/Doc/whatsnew/2.5.rst python/branches/py3k/Lib/socketserver.py python/branches/py3k/README Modified: python/branches/py3k/Doc/c-api/intro.rst ============================================================================== --- python/branches/py3k/Doc/c-api/intro.rst (original) +++ python/branches/py3k/Doc/c-api/intro.rst Thu Feb 26 04:38:59 2009 @@ -187,7 +187,7 @@ the caller is said to *borrow* the reference. Nothing needs to be done for a borrowed reference. -Conversely, when a calling function passes it a reference to an object, there +Conversely, when a calling function passes in a reference to an object, there are two possibilities: the function *steals* a reference to the object, or it does not. *Stealing a reference* means that when you pass a reference to a function, that function assumes that it now owns that reference, and you are not Modified: python/branches/py3k/Doc/c-api/veryhigh.rst ============================================================================== --- python/branches/py3k/Doc/c-api/veryhigh.rst (original) +++ python/branches/py3k/Doc/c-api/veryhigh.rst Thu Feb 26 04:38:59 2009 @@ -16,7 +16,7 @@ :const:`Py_file_input`, and :const:`Py_single_input`. These are described following the functions which accept them as parameters. -Note also that several of these functions take :ctype:`FILE\*` parameters. On +Note also that several of these functions take :ctype:`FILE\*` parameters. One particular issue which needs to be handled carefully is that the :ctype:`FILE` structure for different C libraries can be different and incompatible. Under Windows (at least), it is possible for dynamically linked extensions to actually Modified: python/branches/py3k/Doc/howto/webservers.rst ============================================================================== --- python/branches/py3k/Doc/howto/webservers.rst (original) +++ python/branches/py3k/Doc/howto/webservers.rst Thu Feb 26 04:38:59 2009 @@ -99,7 +99,8 @@ # -*- coding: UTF-8 -*- # enable debugging - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() print("Content-Type: text/plain;charset=utf-8") print() Modified: python/branches/py3k/Doc/library/2to3.rst ============================================================================== --- python/branches/py3k/Doc/library/2to3.rst (original) +++ python/branches/py3k/Doc/library/2to3.rst Thu Feb 26 04:38:59 2009 @@ -38,9 +38,9 @@ $ 2to3 example.py A diff against the original source file is printed. 2to3 can also write the -needed modifications right back to the source file. (Of course, a backup of the -original is also be made unless :option:`-n` is also given.) Writing the -changes back is enabled with the :option:`-w` flag:: +needed modifications right back to the source file. (A backup of the original +file is made unless :option:`-n` is also given.) Writing the changes back is +enabled with the :option:`-w` flag:: $ 2to3 -w example.py Modified: python/branches/py3k/Doc/library/abc.rst ============================================================================== --- python/branches/py3k/Doc/library/abc.rst (original) +++ python/branches/py3k/Doc/library/abc.rst Thu Feb 26 04:38:59 2009 @@ -150,7 +150,7 @@ .. note:: - Unlike C++'s pure virtual functions, or Java abstract methods, these abstract + Unlike Java abstract methods, these abstract methods may have an implementation. This implementation can be called via the :func:`super` mechanism from the class that overrides it. This could be useful as an end-point for a Modified: python/branches/py3k/Doc/library/cgi.rst ============================================================================== --- python/branches/py3k/Doc/library/cgi.rst (original) +++ python/branches/py3k/Doc/library/cgi.rst Thu Feb 26 04:38:59 2009 @@ -65,16 +65,18 @@ Begin by writing ``import cgi``. -When you write a new script, consider adding the line:: +When you write a new script, consider adding these lines:: - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() This activates a special exception handler that will display detailed reports in the Web browser if any errors occur. If you'd rather not show the guts of your program to users of your script, you can have the reports saved to files -instead, with a line like this:: +instead, with code like this:: - import cgitb; cgitb.enable(display=0, logdir="/tmp") + import cgitb + cgitb.enable(display=0, logdir="/tmp") It's very helpful to use this feature during script development. The reports produced by :mod:`cgitb` provide information that can save you a lot of time in @@ -445,9 +447,10 @@ Fortunately, once you have managed to get your script to execute *some* code, you can easily send tracebacks to the Web browser using the :mod:`cgitb` module. -If you haven't done so already, just add the line:: +If you haven't done so already, just add the lines:: - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() to the top of your script. Then try running it again; when a problem occurs, you should see a detailed report that will likely make apparent the cause of the Modified: python/branches/py3k/Doc/library/cgitb.rst ============================================================================== --- python/branches/py3k/Doc/library/cgitb.rst (original) +++ python/branches/py3k/Doc/library/cgitb.rst Thu Feb 26 04:38:59 2009 @@ -24,9 +24,10 @@ functions, to help you debug the problem. Optionally, you can save this information to a file instead of sending it to the browser. -To enable this feature, simply add one line to the top of your CGI script:: +To enable this feature, simply add this to the top of your CGI script:: - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() The options to the :func:`enable` function control whether the report is displayed in the browser and whether the report is logged to a file for later Modified: python/branches/py3k/Doc/library/stdtypes.rst ============================================================================== --- python/branches/py3k/Doc/library/stdtypes.rst (original) +++ python/branches/py3k/Doc/library/stdtypes.rst Thu Feb 26 04:38:59 2009 @@ -793,9 +793,9 @@ .. method:: str.count(sub[, start[, end]]) - Return the number of occurrences of substring *sub* in the range [*start*, - *end*]. Optional arguments *start* and *end* are interpreted as in slice - notation. + Return the number of non-overlapping occurrences of substring *sub* in the + range [*start*, *end*]. Optional arguments *start* and *end* are + interpreted as in slice notation. .. method:: str.encode([encoding[, errors]]) @@ -835,7 +835,7 @@ found. -.. method:: str.format(format_string, *args, **kwargs) +.. method:: str.format(*args, **kwargs) Perform a string formatting operation. The *format_string* argument can contain literal text or replacement fields delimited by braces ``{}``. Each Modified: python/branches/py3k/Doc/library/xml.etree.elementtree.rst ============================================================================== --- python/branches/py3k/Doc/library/xml.etree.elementtree.rst (original) +++ python/branches/py3k/Doc/library/xml.etree.elementtree.rst Thu Feb 26 04:38:59 2009 @@ -529,5 +529,5 @@ .. [#] The encoding string included in XML output should conform to the appropriate standards. For example, "UTF-8" is valid, but "UTF8" is not. See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl - and http://www.iana.org/assignments/character-sets . + and http://www.iana.org/assignments/character-sets. Modified: python/branches/py3k/Doc/whatsnew/2.5.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/2.5.rst (original) +++ python/branches/py3k/Doc/whatsnew/2.5.rst Thu Feb 26 04:38:59 2009 @@ -1761,8 +1761,8 @@ included. The rest of this section will provide a brief overview of using ElementTree. -Full documentation for ElementTree is available at http://effbot.org/zone -/element-index.htm. +Full documentation for ElementTree is available at +http://effbot.org/zone/element-index.htm. ElementTree represents an XML document as a tree of element nodes. The text content of the document is stored as the :attr:`.text` and :attr:`.tail` Modified: python/branches/py3k/Lib/socketserver.py ============================================================================== --- python/branches/py3k/Lib/socketserver.py (original) +++ python/branches/py3k/Lib/socketserver.py Thu Feb 26 04:38:59 2009 @@ -487,7 +487,7 @@ # libraries that expect to be able to wait for their own # children. try: - pid, status = os.waitpid(0, options=0) + pid, status = os.waitpid(0, 0) except os.error: pid = None if pid not in self.active_children: continue Modified: python/branches/py3k/README ============================================================================== --- python/branches/py3k/README (original) +++ python/branches/py3k/README Thu Feb 26 04:38:59 2009 @@ -88,6 +88,33 @@ used, and backported versions of certain key Python 3.x features. +Testing +------- + +To test the interpreter, type "make test" in the top-level directory. +This runs the test set twice (once with no compiled files, once with +the compiled files left by the previous test run). The test set +produces some output. You can generally ignore the messages about +skipped tests due to optional features which can't be imported. +If a message is printed about a failed test or a traceback or core +dump is produced, something is wrong. On some Linux systems (those +that are not yet using glibc 6), test_strftime fails due to a +non-standard implementation of strftime() in the C library. Please +ignore this, or upgrade to glibc version 6. + +By default, tests are prevented from overusing resources like disk space and +memory. To enable these tests, run "make testall". + +IMPORTANT: If the tests fail and you decide to mail a bug report, +*don't* include the output of "make test". It is useless. Run the +failing test manually, as follows: + + ./python Lib/test/regrtest.py -v test_whatever + +(substituting the top of the source tree for '.' if you built in a +different directory). This runs the test in verbose mode. + + Installing multiple versions ---------------------------- From buildbot at python.org Thu Feb 26 04:40:36 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 26 Feb 2009 03:40:36 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090226034036.9E6751E4025@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/347 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,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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 Thu Feb 26 04:58:04 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 26 Feb 2009 04:58:04 +0100 (CET) Subject: [Python-checkins] r69991 - in python/branches/release30-maint: Doc/c-api/intro.rst Doc/c-api/veryhigh.rst Doc/howto/webservers.rst Doc/library/2to3.rst Doc/library/abc.rst Doc/library/cgi.rst Doc/library/cgitb.rst Doc/library/stdtypes.rst Doc/library/xml.etree.elementtree.rst Doc/whatsnew/2.5.rst Lib/socketserver.py Message-ID: <20090226035804.5CAA11E4002@bag.python.org> Author: benjamin.peterson Date: Thu Feb 26 04:58:04 2009 New Revision: 69991 Log: Merged revisions 69990 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69990 | benjamin.peterson | 2009-02-25 21:38:59 -0600 (Wed, 25 Feb 2009) | 45 lines Merged revisions 69803-69805,69840,69901,69905,69907,69924,69927,69987 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69803 | georg.brandl | 2009-02-20 01:48:21 -0600 (Fri, 20 Feb 2009) | 1 line #5327: fix a broken link by joining it. ........ r69804 | georg.brandl | 2009-02-20 02:22:21 -0600 (Fri, 20 Feb 2009) | 1 line At least separate imports from other statements. ........ r69805 | georg.brandl | 2009-02-20 02:45:47 -0600 (Fri, 20 Feb 2009) | 2 lines Fix punctuation. ........ r69840 | georg.brandl | 2009-02-21 13:09:40 -0600 (Sat, 21 Feb 2009) | 1 line #5338, #5339: two types in the API manual. ........ r69901 | georg.brandl | 2009-02-23 05:24:46 -0600 (Mon, 23 Feb 2009) | 2 lines #5349: C++ pure virtuals can also have an implementation. ........ r69905 | georg.brandl | 2009-02-23 09:51:27 -0600 (Mon, 23 Feb 2009) | 2 lines #5352: str.count() counts non-overlapping instances. ........ r69907 | georg.brandl | 2009-02-23 12:33:48 -0600 (Mon, 23 Feb 2009) | 1 line Fix grammar. ........ r69924 | benjamin.peterson | 2009-02-23 20:45:35 -0600 (Mon, 23 Feb 2009) | 1 line update README on running tests ........ r69927 | neil.schemenauer | 2009-02-23 22:23:25 -0600 (Mon, 23 Feb 2009) | 1 line Fix call to os.waitpid, it does not take keyword args. ........ r69987 | benjamin.peterson | 2009-02-25 18:30:11 -0600 (Wed, 25 Feb 2009) | 1 line fix str.format()'s first arg #5371 ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/c-api/intro.rst python/branches/release30-maint/Doc/c-api/veryhigh.rst python/branches/release30-maint/Doc/howto/webservers.rst python/branches/release30-maint/Doc/library/2to3.rst python/branches/release30-maint/Doc/library/abc.rst python/branches/release30-maint/Doc/library/cgi.rst python/branches/release30-maint/Doc/library/cgitb.rst python/branches/release30-maint/Doc/library/stdtypes.rst python/branches/release30-maint/Doc/library/xml.etree.elementtree.rst python/branches/release30-maint/Doc/whatsnew/2.5.rst python/branches/release30-maint/Lib/socketserver.py Modified: python/branches/release30-maint/Doc/c-api/intro.rst ============================================================================== --- python/branches/release30-maint/Doc/c-api/intro.rst (original) +++ python/branches/release30-maint/Doc/c-api/intro.rst Thu Feb 26 04:58:04 2009 @@ -187,7 +187,7 @@ the caller is said to *borrow* the reference. Nothing needs to be done for a borrowed reference. -Conversely, when a calling function passes it a reference to an object, there +Conversely, when a calling function passes in a reference to an object, there are two possibilities: the function *steals* a reference to the object, or it does not. *Stealing a reference* means that when you pass a reference to a function, that function assumes that it now owns that reference, and you are not Modified: python/branches/release30-maint/Doc/c-api/veryhigh.rst ============================================================================== --- python/branches/release30-maint/Doc/c-api/veryhigh.rst (original) +++ python/branches/release30-maint/Doc/c-api/veryhigh.rst Thu Feb 26 04:58:04 2009 @@ -16,7 +16,7 @@ :const:`Py_file_input`, and :const:`Py_single_input`. These are described following the functions which accept them as parameters. -Note also that several of these functions take :ctype:`FILE\*` parameters. On +Note also that several of these functions take :ctype:`FILE\*` parameters. One particular issue which needs to be handled carefully is that the :ctype:`FILE` structure for different C libraries can be different and incompatible. Under Windows (at least), it is possible for dynamically linked extensions to actually Modified: python/branches/release30-maint/Doc/howto/webservers.rst ============================================================================== --- python/branches/release30-maint/Doc/howto/webservers.rst (original) +++ python/branches/release30-maint/Doc/howto/webservers.rst Thu Feb 26 04:58:04 2009 @@ -99,7 +99,8 @@ # -*- coding: UTF-8 -*- # enable debugging - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() print("Content-Type: text/plain;charset=utf-8") print() Modified: python/branches/release30-maint/Doc/library/2to3.rst ============================================================================== --- python/branches/release30-maint/Doc/library/2to3.rst (original) +++ python/branches/release30-maint/Doc/library/2to3.rst Thu Feb 26 04:58:04 2009 @@ -36,9 +36,9 @@ $ 2to3 example.py A diff against the original source file is printed. 2to3 can also write the -needed modifications right back to the source file. (Of course, a backup of the -original is also be made unless :option:`-n` is also given.) Writing the -changes back is enabled with the :option:`-w` flag:: +needed modifications right back to the source file. (A backup of the original +file is made unless :option:`-n` is also given.) Writing the changes back is +enabled with the :option:`-w` flag:: $ 2to3 -w example.py Modified: python/branches/release30-maint/Doc/library/abc.rst ============================================================================== --- python/branches/release30-maint/Doc/library/abc.rst (original) +++ python/branches/release30-maint/Doc/library/abc.rst Thu Feb 26 04:58:04 2009 @@ -150,7 +150,7 @@ .. note:: - Unlike C++'s pure virtual functions, or Java abstract methods, these abstract + Unlike Java abstract methods, these abstract methods may have an implementation. This implementation can be called via the :func:`super` mechanism from the class that overrides it. This could be useful as an end-point for a Modified: python/branches/release30-maint/Doc/library/cgi.rst ============================================================================== --- python/branches/release30-maint/Doc/library/cgi.rst (original) +++ python/branches/release30-maint/Doc/library/cgi.rst Thu Feb 26 04:58:04 2009 @@ -65,16 +65,18 @@ Begin by writing ``import cgi``. -When you write a new script, consider adding the line:: +When you write a new script, consider adding these lines:: - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() This activates a special exception handler that will display detailed reports in the Web browser if any errors occur. If you'd rather not show the guts of your program to users of your script, you can have the reports saved to files -instead, with a line like this:: +instead, with code like this:: - import cgitb; cgitb.enable(display=0, logdir="/tmp") + import cgitb + cgitb.enable(display=0, logdir="/tmp") It's very helpful to use this feature during script development. The reports produced by :mod:`cgitb` provide information that can save you a lot of time in @@ -445,9 +447,10 @@ Fortunately, once you have managed to get your script to execute *some* code, you can easily send tracebacks to the Web browser using the :mod:`cgitb` module. -If you haven't done so already, just add the line:: +If you haven't done so already, just add the lines:: - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() to the top of your script. Then try running it again; when a problem occurs, you should see a detailed report that will likely make apparent the cause of the Modified: python/branches/release30-maint/Doc/library/cgitb.rst ============================================================================== --- python/branches/release30-maint/Doc/library/cgitb.rst (original) +++ python/branches/release30-maint/Doc/library/cgitb.rst Thu Feb 26 04:58:04 2009 @@ -24,9 +24,10 @@ functions, to help you debug the problem. Optionally, you can save this information to a file instead of sending it to the browser. -To enable this feature, simply add one line to the top of your CGI script:: +To enable this feature, simply add this to the top of your CGI script:: - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() The options to the :func:`enable` function control whether the report is displayed in the browser and whether the report is logged to a file for later Modified: python/branches/release30-maint/Doc/library/stdtypes.rst ============================================================================== --- python/branches/release30-maint/Doc/library/stdtypes.rst (original) +++ python/branches/release30-maint/Doc/library/stdtypes.rst Thu Feb 26 04:58:04 2009 @@ -793,9 +793,9 @@ .. method:: str.count(sub[, start[, end]]) - Return the number of occurrences of substring *sub* in the range [*start*, - *end*]. Optional arguments *start* and *end* are interpreted as in slice - notation. + Return the number of non-overlapping occurrences of substring *sub* in the + range [*start*, *end*]. Optional arguments *start* and *end* are + interpreted as in slice notation. .. method:: str.encode([encoding[, errors]]) @@ -835,7 +835,7 @@ found. -.. method:: str.format(format_string, *args, **kwargs) +.. method:: str.format(*args, **kwargs) Perform a string formatting operation. The *format_string* argument can contain literal text or replacement fields delimited by braces ``{}``. Each Modified: python/branches/release30-maint/Doc/library/xml.etree.elementtree.rst ============================================================================== --- python/branches/release30-maint/Doc/library/xml.etree.elementtree.rst (original) +++ python/branches/release30-maint/Doc/library/xml.etree.elementtree.rst Thu Feb 26 04:58:04 2009 @@ -529,5 +529,5 @@ .. [#] The encoding string included in XML output should conform to the appropriate standards. For example, "UTF-8" is valid, but "UTF8" is not. See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl - and http://www.iana.org/assignments/character-sets . + and http://www.iana.org/assignments/character-sets. Modified: python/branches/release30-maint/Doc/whatsnew/2.5.rst ============================================================================== --- python/branches/release30-maint/Doc/whatsnew/2.5.rst (original) +++ python/branches/release30-maint/Doc/whatsnew/2.5.rst Thu Feb 26 04:58:04 2009 @@ -1761,8 +1761,8 @@ included. The rest of this section will provide a brief overview of using ElementTree. -Full documentation for ElementTree is available at http://effbot.org/zone -/element-index.htm. +Full documentation for ElementTree is available at +http://effbot.org/zone/element-index.htm. ElementTree represents an XML document as a tree of element nodes. The text content of the document is stored as the :attr:`.text` and :attr:`.tail` Modified: python/branches/release30-maint/Lib/socketserver.py ============================================================================== --- python/branches/release30-maint/Lib/socketserver.py (original) +++ python/branches/release30-maint/Lib/socketserver.py Thu Feb 26 04:58:04 2009 @@ -487,7 +487,7 @@ # libraries that expect to be able to wait for their own # children. try: - pid, status = os.waitpid(0, options=0) + pid, status = os.waitpid(0, 0) except os.error: pid = None if pid not in self.active_children: continue From buildbot at python.org Thu Feb 26 05:44:46 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 26 Feb 2009 04:44:46 +0000 Subject: [Python-checkins] buildbot failure in x86 OpenBSD 3.0 Message-ID: <20090226044446.92D621E400C@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20OpenBSD%203.0/builds/131 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: cortesi Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: benjamin.peterson,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From g.brandl at gmx.net Thu Feb 26 09:19:08 2009 From: g.brandl at gmx.net (Georg Brandl) Date: Thu, 26 Feb 2009 09:19:08 +0100 Subject: [Python-checkins] r69988 - peps/trunk/pep-0374.txt In-Reply-To: <20090226012236.960D21E4002@bag.python.org> References: <20090226012236.960D21E4002@bag.python.org> Message-ID: brett.cannon schrieb: > Author: brett.cannon > Date: Thu Feb 26 02:22:36 2009 > New Revision: 69988 > > Log: > Update bzr timings based on some fixes made recently. I.e., an unreleased version of bzr? 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 Thu Feb 26 13:38:35 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 26 Feb 2009 13:38:35 +0100 (CET) Subject: [Python-checkins] r69992 - peps/trunk/pep-0372.txt Message-ID: <20090226123835.7CDD51E404A@bag.python.org> Author: raymond.hettinger Date: Thu Feb 26 13:38:29 2009 New Revision: 69992 Log: Join this PEP (with Armin's blessing) and move it forward from where it's been sitting for a while. Update the text for Py2.7 and Py3.1. Link to a new implementation that sticks with the basic dict API and no new methods. Modified: peps/trunk/pep-0372.txt Modified: peps/trunk/pep-0372.txt ============================================================================== --- peps/trunk/pep-0372.txt (original) +++ peps/trunk/pep-0372.txt Thu Feb 26 13:38:29 2009 @@ -3,11 +3,12 @@ Version: $Revision$ Last-Modified: $Date$ Author: Armin Ronacher + Raymond Hettinger Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 15-Jun-2008 -Python-Version: 2.6, 3.0 +Python-Version: 2.7, 3.1 Post-History: @@ -73,7 +74,7 @@ provide an ordered dictionary. [1]_ - Code ported from other programming languages such as PHP often - depends on a ordered dict. Having an implementation of an + depends on an ordered dict. Having an implementation of an ordering-preserving dictionary in the standard library could ease the transition and improve the compatibility of different libraries. @@ -82,12 +83,12 @@ ================ The ordered dict API would be mostly compatible with dict and existing -ordered dicts. (Note: this PEP refers to the Python 2.x dictionary -API; the transfer to the 3.x API is trivial.) +ordered dicts. Note: this PEP refers to the 2.7 and 3.0 dictionary +API as described in collections.Mapping abstract base class. The constructor and ``update()`` both accept iterables of tuples as -well as mappings like a dict does. The ordering however is preserved -for the first case: +well as mappings like a dict does. Unlike a regular dictionary, +the insertion order is preserved. >>> d = odict([('a', 'b'), ('c', 'd')]) >>> d.update({'foo': 'bar'}) @@ -95,11 +96,11 @@ collections.odict([('a', 'b'), ('c', 'd'), ('foo', 'bar')]) If ordered dicts are updated from regular dicts, the ordering of new -keys is of course undefined again unless ``sort()`` is called. +keys is of course undefined. All iteration methods as well as ``keys()``, ``values()`` and -``items()`` return the values ordered by the time the key-value pair -was inserted: +``items()`` return the values ordered by the time the key was +first inserted: >>> d['spam'] = 'eggs' >>> d.keys() @@ -111,80 +112,9 @@ New methods not available on dict: -``odict.byindex(index)`` - Returns the key/value pair for an index, that is, the "position" of a key in - the ordered dict. 0 is the first key/value pair, -1 the last. - - >>> d.byindex(2) - ('foo', 'bar') - - If there is no key for index an `IndexError` is raised. Slices are not - supported. - -``odict.index(key)`` - Returns the index of a key. If the key does not exist, a `ValueError` is - raised. - -``odict.sort(cmp=None, key=None, reverse=False)`` - Sorts the odict in place by cmp or key. This works exactly like - ``list.sort()``, but the comparison functions are passed a key/value tuple, - not only the value. - - >>> d = odict([(42, 1), (1, 4), (23, 7)]) d.sort() d - collections.odict([(1, 4), (23, 7), (42, 1)]) - -``odict.reverse()`` - Reverses the odict in place. - ``odict.__reversed__()`` Supports reverse iteration by key. -``odict.__eq__()`` / ``odict.__ne__()`` - Compares the odict to another object. If it's compared to another - odict the ordering of items is taken into account, otherwise only - the keys and values. - -``odict.__cmp__()`` - Ordered dicts are sorted by their items. ``cmp(od1, od2)`` is - equivalent to ``cmp(od1.items(), od2.items())`` if both ``od1`` - and ``od2`` are ordered dicts. Otherwise the regular dict comparison - kicks in. - - -Python 3 Version -================ - -The Python 3 version of the ``odict`` returns dictionary views rather -than lists for ``odict.keys()``, ``odict.values()`` and -``odict.items()``. The keys view is equivalent to a regular keys view -but supports the following extra or changed operations: - -``odict_keys.__getitem__(index)`` - - Returns the key for an index. This is equivalent to - ``odict.byindex(index)``. - -``odict_keys.index(key)`` - - Returns the index for a key. This exists for compatibility with - the ``Sequence`` abstract base class and is equivalent to - ``odict.index(key)``. - -``odict_keys.__iter__()`` - - Has the same semantics as ``odict.__iter__()``. - -``odict_keys.__reversed__()`` - - Has the same semantics as ``odict.__reversed__()``. - -``odict_keys.__cmp__()`` / ``odict_keys.__eq__()`` / -``odict_keys.__ne__()`` - - Same semantics as the equivalent ``odict`` operation. E.g.: when - compared to another odict keys view the ordering is taken into - account. - Questions and Answers ===================== @@ -205,7 +135,7 @@ The same as for regular dicts: The latter item overrides the former. This has the side-effect that the position of the first - key is used because the key is actually overwritten: + key is used because only the value is actually overwritten: >>> odict([('a', 1), ('b', 2), ('a', 3)]) collections.odict([('a', 3), ('b', 2)]) @@ -216,7 +146,7 @@ Why is there no ``odict.insert()``? There are few situations where you really want to insert a key at - an specified index. To avoid API complication, the proposed + a specified index. To avoid API complication, the proposed solution for this situation is creating a list of items, manipulating that and converting it back into an odict: @@ -230,31 +160,60 @@ Yes. Like ``defaultdict``, ``odict`` subclasses ``dict``. -Does ``odict.pop()`` support list-like popping of items? +Does ``odict.popitem()`` return a particular key/value pair? - No. Neither ``odict.__getitem__()`` nor ``odict.pop()`` support - retrieving or deleting items by index. Slices are not supported - either. This would introduce ambiguities if integers or slice - objects are used as dict keys. + Yes. It pops-off the most recently inserted new key and its + corresponding value. This corresponds to the usual LIFO behavior + exhibited by traditional push/pop pairs. It is semantically + equivalent to ``k=list(od)[-1]; v=od[k]; del od[k]; return (k,v)``. + The actual implementation is more efficient. It is O(n log n) + on the first call, any successive calls are O(1). + +Does odict support indexing, slicing, and whatnot? As a matter of fact, ``odict`` does not implement the ``Sequence`` - interface. + interface. Rather, it is a ``MutableMapping`` that remembers + the order of key insertion. The only sequence-like addition is + automatic support for ``reversed``. +Does odict support alternate sort orders such as alphabetical? -Example Implementation -====================== + No. Those wanting different sort orders really need to be using another + technique. The odict is all about recording insertion order. If any + other order is of interest, then another structure (like an in-memory + dbm) is likely a better fit. It would be a mistake to try to be all + things to all users. -A poorly performing example implementation of the odict written in -Python is available: +Reference Implementation +======================== - `odict.py `_ +A proposed version is at: -The version for ``collections`` should be implemented in C and use a -linked list internally. + `OrderedDict recipe `_ + +The proposed version has several merits: + +* Strict compliance with the MutableMapping API and no new methods + so that the learning curve is near zero. It is simply a dictionary + that remembers insertion order. + +* Generally good performance. The big-oh times are the same as regular + dictionaries except for the cost of a single sort prior to the + first ordered retrieval (via *__iter__* or somesuch). + +* Key insertion and deletion is O(1). The work of organizing keys into + correct order is deferred to the end (instead of trying to maintain + sorted list, linked list, or btree as the dict is built-up). This + corresponds to typical use patterns (read-in ordered key/value pairs, + make modifications, and then write them back out in insertion order) + and it takes advantage of Python's highly efficient built-in sort. + +* The code runs without modification on Py2.6, Py2.7, Py3.0, and Py3.1. Other implementations of ordered dicts in various Python projects or standalone libraries, that inspired the API proposed here, are: +- `odict in Python`_ - `odict in Babel`_ - `OrderedDict in Django`_ - `The odict module`_ @@ -262,7 +221,7 @@ - `StableDict`_ - `Armin Rigo's OrderedDict`_ - +.. _odict in Python: http://dev.pocoo.org/hg/sandbox/raw-file/tip/odict.py .. _odict in Babel: http://babel.edgewall.org/browser/trunk/babel/util.py?rev=374#L178 .. _OrderedDict in Django: http://code.djangoproject.com/browser/django/trunk/django/utils/datastructures.py?rev=7140#L53 From python-checkins at python.org Thu Feb 26 16:10:24 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 26 Feb 2009 16:10:24 +0100 (CET) Subject: [Python-checkins] r69993 - peps/trunk/pep-0372.txt Message-ID: <20090226151024.B881A1E400C@bag.python.org> Author: raymond.hettinger Date: Thu Feb 26 16:10:24 2009 New Revision: 69993 Log: Update performance data based on latest recipe. Modified: peps/trunk/pep-0372.txt Modified: peps/trunk/pep-0372.txt ============================================================================== --- peps/trunk/pep-0372.txt (original) +++ peps/trunk/pep-0372.txt Thu Feb 26 16:10:24 2009 @@ -198,15 +198,7 @@ that remembers insertion order. * Generally good performance. The big-oh times are the same as regular - dictionaries except for the cost of a single sort prior to the - first ordered retrieval (via *__iter__* or somesuch). - -* Key insertion and deletion is O(1). The work of organizing keys into - correct order is deferred to the end (instead of trying to maintain - sorted list, linked list, or btree as the dict is built-up). This - corresponds to typical use patterns (read-in ordered key/value pairs, - make modifications, and then write them back out in insertion order) - and it takes advantage of Python's highly efficient built-in sort. + dictionaries except that key deletion is O(n). * The code runs without modification on Py2.6, Py2.7, Py3.0, and Py3.1. From python-checkins at python.org Thu Feb 26 18:36:27 2009 From: python-checkins at python.org (georg.brandl) Date: Thu, 26 Feb 2009 18:36:27 +0100 (CET) Subject: [Python-checkins] r69994 - python/trunk/Doc/library/sys.rst Message-ID: <20090226173627.190771E4002@bag.python.org> Author: georg.brandl Date: Thu Feb 26 18:36:26 2009 New Revision: 69994 Log: Document that setting sys.py3kwarning wont do anything. Modified: python/trunk/Doc/library/sys.rst Modified: python/trunk/Doc/library/sys.rst ============================================================================== --- python/trunk/Doc/library/sys.rst (original) +++ python/trunk/Doc/library/sys.rst Thu Feb 26 18:36:26 2009 @@ -624,7 +624,9 @@ .. data:: py3kwarning Bool containing the status of the Python 3.0 warning flag. It's ``True`` - when Python is started with the -3 option. + when Python is started with the -3 option. (This should be considered + read-only; setting it to a different value doesn't have an effect on + Python 3.0 warnings.) .. versionadded:: 2.6 From python-checkins at python.org Thu Feb 26 19:39:03 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 26 Feb 2009 19:39:03 +0100 (CET) Subject: [Python-checkins] r69995 - python/branches/py3k Message-ID: <20090226183903.CCE751E4002@bag.python.org> Author: benjamin.peterson Date: Thu Feb 26 19:39:03 2009 New Revision: 69995 Log: Blocked revisions 69994 via svnmerge ........ r69994 | georg.brandl | 2009-02-26 11:36:26 -0600 (Thu, 26 Feb 2009) | 1 line Document that setting sys.py3kwarning wont do anything. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Thu Feb 26 19:55:48 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 26 Feb 2009 19:55:48 +0100 (CET) Subject: [Python-checkins] r69996 - in python/branches/py3k: Lib/test/test_opcodes.py Python/ceval.c Tools/scripts/README Tools/scripts/analyze_dxp.py Message-ID: <20090226185548.8AFA71E4002@bag.python.org> Author: benjamin.peterson Date: Thu Feb 26 19:55:48 2009 New Revision: 69996 Log: Merged revisions 69811,69947 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69811 | collin.winter | 2009-02-20 13:30:41 -0600 (Fri, 20 Feb 2009) | 2 lines Issue 5176: special-case string formatting in BINARY_MODULO implementation. This shows a modest (1-3%) speed-up in templating systems, for example. ........ r69947 | jeffrey.yasskin | 2009-02-24 16:48:34 -0600 (Tue, 24 Feb 2009) | 3 lines Tools/scripts/analyze_dxp.py, a module with some helper functions to analyze the output of sys.getdxp(). ........ Added: python/branches/py3k/Tools/scripts/analyze_dxp.py - copied unchanged from r69947, /python/trunk/Tools/scripts/analyze_dxp.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_opcodes.py python/branches/py3k/Python/ceval.c python/branches/py3k/Tools/scripts/README Modified: python/branches/py3k/Lib/test/test_opcodes.py ============================================================================== --- python/branches/py3k/Lib/test/test_opcodes.py (original) +++ python/branches/py3k/Lib/test/test_opcodes.py Thu Feb 26 19:55:48 2009 @@ -98,6 +98,12 @@ g = eval('lambda a=1: None') self.assertNotEquals(f, g) + def test_modulo_of_string_subclasses(self): + class MyString(str): + def __mod__(self, value): + return 42 + self.assertEqual(MyString() % 3, 42) + def test_main(): run_unittest(OpcodeTest) Modified: python/branches/py3k/Python/ceval.c ============================================================================== --- python/branches/py3k/Python/ceval.c (original) +++ python/branches/py3k/Python/ceval.c Thu Feb 26 19:55:48 2009 @@ -1446,7 +1446,10 @@ TARGET(BINARY_MODULO) w = POP(); v = TOP(); - x = PyNumber_Remainder(v, w); + if (PyUnicode_CheckExact(v)) + x = PyUnicode_Format(v, w); + else + x = PyNumber_Remainder(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); Modified: python/branches/py3k/Tools/scripts/README ============================================================================== --- python/branches/py3k/Tools/scripts/README (original) +++ python/branches/py3k/Tools/scripts/README Thu Feb 26 19:55:48 2009 @@ -4,6 +4,7 @@ See also the Demo/scripts directory! +analyze_dxp.py Analyzes the result of sys.getdxp() byext.py Print lines/words/chars stats of files by extension byteyears.py Print product of a file's size and age checkappend.py Search for multi-argument .append() calls From python-checkins at python.org Thu Feb 26 19:58:14 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 26 Feb 2009 19:58:14 +0100 (CET) Subject: [Python-checkins] r69997 - python/branches/release30-maint Message-ID: <20090226185814.6CC2E1E4002@bag.python.org> Author: benjamin.peterson Date: Thu Feb 26 19:58:14 2009 New Revision: 69997 Log: Blocked revisions 69996 via svnmerge ................ r69996 | benjamin.peterson | 2009-02-26 12:55:48 -0600 (Thu, 26 Feb 2009) | 14 lines Merged revisions 69811,69947 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69811 | collin.winter | 2009-02-20 13:30:41 -0600 (Fri, 20 Feb 2009) | 2 lines Issue 5176: special-case string formatting in BINARY_MODULO implementation. This shows a modest (1-3%) speed-up in templating systems, for example. ........ r69947 | jeffrey.yasskin | 2009-02-24 16:48:34 -0600 (Tue, 24 Feb 2009) | 3 lines Tools/scripts/analyze_dxp.py, a module with some helper functions to analyze the output of sys.getdxp(). ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Thu Feb 26 20:04:40 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 26 Feb 2009 20:04:40 +0100 (CET) Subject: [Python-checkins] r69998 - python/trunk/README Message-ID: <20090226190440.74E3E1E4002@bag.python.org> Author: benjamin.peterson Date: Thu Feb 26 20:04:40 2009 New Revision: 69998 Log: the startship is rather outdated now Modified: python/trunk/README Modified: python/trunk/README ============================================================================== --- python/trunk/README (original) +++ python/trunk/README Thu Feb 26 20:04:40 2009 @@ -97,9 +97,6 @@ New Python releases and related technologies are published at http://www.python.org/. Come visit us! -There's also a Python community web site at -http://starship.python.net/. - Newsgroups and Mailing Lists ---------------------------- From python-checkins at python.org Thu Feb 26 20:05:59 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 26 Feb 2009 20:05:59 +0100 (CET) Subject: [Python-checkins] r69999 - python/trunk/README Message-ID: <20090226190559.DA8AE1E4002@bag.python.org> Author: benjamin.peterson Date: Thu Feb 26 20:05:59 2009 New Revision: 69999 Log: comma Modified: python/trunk/README Modified: python/trunk/README ============================================================================== --- python/trunk/README (original) +++ python/trunk/README Thu Feb 26 20:05:59 2009 @@ -163,7 +163,7 @@ To build Python, you normally type "make" in the toplevel directory. If you have changed the configuration, the Makefile may have to be -rebuilt. In this case you may have to run make again to correctly +rebuilt. In this case, you may have to run make again to correctly build your desired target. The interpreter executable is built in the top level directory. From python-checkins at python.org Thu Feb 26 20:07:18 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 26 Feb 2009 20:07:18 +0100 (CET) Subject: [Python-checkins] r70000 - in python/trunk: Lib/symtable.py Lib/test/test_symtable.py Misc/NEWS Message-ID: <20090226190718.D95701E4002@bag.python.org> Author: benjamin.peterson Date: Thu Feb 26 20:07:18 2009 New Revision: 70000 Log: remove deprecated symtable.Symbol methods Modified: python/trunk/Lib/symtable.py python/trunk/Lib/test/test_symtable.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/symtable.py ============================================================================== --- python/trunk/Lib/symtable.py (original) +++ python/trunk/Lib/symtable.py Thu Feb 26 20:07:18 2009 @@ -5,7 +5,6 @@ DEF_IMPORT, DEF_BOUND, OPT_IMPORT_STAR, OPT_EXEC, OPT_BARE_EXEC, SCOPE_OFF, SCOPE_MASK, FREE, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT) -import warnings import weakref __all__ = ["symtable", "SymbolTable", "Class", "Function", "Symbol"] @@ -191,16 +190,6 @@ def is_global(self): return bool(self.__scope in (GLOBAL_IMPLICIT, GLOBAL_EXPLICIT)) - def is_vararg(self): - warnings.warn("is_vararg() is obsolete and will be removed", - DeprecationWarning, 2) - return False - - def is_keywordarg(self): - warnings.warn("is_keywordarg() is obsolete and will be removed", - DeprecationWarning, 2) - return False - def is_local(self): return bool(self.__flags & DEF_BOUND) @@ -213,10 +202,6 @@ def is_assigned(self): return bool(self.__flags & DEF_LOCAL) - def is_in_tuple(self): - warnings.warn("is_in_tuple() is obsolete and will be removed", - DeprecationWarning, 2) - def is_namespace(self): """Returns true if name binding introduces new namespace. Modified: python/trunk/Lib/test/test_symtable.py ============================================================================== --- python/trunk/Lib/test/test_symtable.py (original) +++ python/trunk/Lib/test/test_symtable.py Thu Feb 26 20:07:18 2009 @@ -55,22 +55,6 @@ internal = find_block(spam, "internal") foo = find_block(top, "foo") - def test_noops(self): - # Check methods that don't work. They should warn and return False. - def check(w, msg): - self.assertEqual(str(w.message), msg) - sym = self.top.lookup("glob") - with test_support.check_warnings() as w: - warnings.simplefilter("always", DeprecationWarning) - self.assertFalse(sym.is_vararg()) - check(w, "is_vararg() is obsolete and will be removed") - w.reset() - self.assertFalse(sym.is_keywordarg()) - check(w, "is_keywordarg() is obsolete and will be removed") - w.reset() - self.assertFalse(sym.is_in_tuple()) - check(w, "is_in_tuple() is obsolete and will be removed") - def test_type(self): self.assertEqual(self.top.get_type(), "module") self.assertEqual(self.Mine.get_type(), "class") Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Feb 26 20:07:18 2009 @@ -165,6 +165,10 @@ Library ------- + +- Deprecated methods of symtable.Symbol have been removed: is_keywordarg(), + is_vararg(), and is_in_tuple(). + - Issue #5316: Fixed buildbot failures introduced by multiple inheritance in Distutils tests. From buildbot at python.org Thu Feb 26 20:12:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 26 Feb 2009 19:12:28 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090226191228.B3D771E4002@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/426 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_pipes make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Feb 26 20:17:13 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 26 Feb 2009 20:17:13 +0100 (CET) Subject: [Python-checkins] r70001 - python/branches/py3k Message-ID: <20090226191713.2511E1E400C@bag.python.org> Author: benjamin.peterson Date: Thu Feb 26 20:17:12 2009 New Revision: 70001 Log: Blocked revisions 70000 via svnmerge ........ r70000 | benjamin.peterson | 2009-02-26 13:07:18 -0600 (Thu, 26 Feb 2009) | 1 line remove deprecated symtable.Symbol methods ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Thu Feb 26 20:20:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 26 Feb 2009 19:20:45 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090226192045.B85371E4002@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/336 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: sincerely, -The Buildbot From brett at python.org Thu Feb 26 20:28:27 2009 From: brett at python.org (Brett Cannon) Date: Thu, 26 Feb 2009 11:28:27 -0800 Subject: [Python-checkins] r69988 - peps/trunk/pep-0374.txt In-Reply-To: References: <20090226012236.960D21E4002@bag.python.org> Message-ID: On Thu, Feb 26, 2009 at 00:19, Georg Brandl wrote: > brett.cannon schrieb: > > Author: brett.cannon > > Date: Thu Feb 26 02:22:36 2009 > > New Revision: 69988 > > > > Log: > > Update bzr timings based on some fixes made recently. > > I.e., an unreleased version of bzr? > The development branch, so what 1.13 will become within a month. -Brett -------------- next part -------------- An HTML attachment was scrubbed... URL: From buildbot at python.org Thu Feb 26 20:32:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 26 Feb 2009 19:32:19 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090226193219.B5B701E4002@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/349 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 buildbot at python.org Thu Feb 26 21:38:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 26 Feb 2009 20:38:19 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090226203820.1C3811E4002@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/180 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 buildbot at python.org Thu Feb 26 21:40:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 26 Feb 2009 20:40:19 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090226204019.BA73A1E4002@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/373 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: 1 test failed: test_pipes make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu Feb 26 23:34:31 2009 From: python-checkins at python.org (andrew.kuchling) Date: Thu, 26 Feb 2009 23:34:31 +0100 (CET) Subject: [Python-checkins] r70002 - python/trunk/Doc/howto/curses.rst Message-ID: <20090226223431.0D3861E4058@bag.python.org> Author: andrew.kuchling Date: Thu Feb 26 23:34:30 2009 New Revision: 70002 Log: The curses panel library is now supported Modified: python/trunk/Doc/howto/curses.rst Modified: python/trunk/Doc/howto/curses.rst ============================================================================== --- python/trunk/Doc/howto/curses.rst (original) +++ python/trunk/Doc/howto/curses.rst Thu Feb 26 23:34:30 2009 @@ -426,7 +426,7 @@ Because the curses API is so large, some functions aren't supported in the Python interface, not because they're difficult to implement, but because no one has needed them yet. Feel free to add them and then submit a patch. Also, we -don't yet have support for the menus or panels libraries associated with +don't yet have support for the menu library associated with ncurses; feel free to add that. If you write an interesting little program, feel free to contribute it as From python-checkins at python.org Fri Feb 27 00:44:00 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 27 Feb 2009 00:44:00 +0100 (CET) Subject: [Python-checkins] r70003 - python/trunk/Lib/distutils/command/build_ext.py Message-ID: <20090226234400.DC7851E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 27 00:44:00 2009 New Revision: 70003 Log: removed unused import 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 Fri Feb 27 00:44:00 2009 @@ -8,7 +8,7 @@ import sys, os, string, re from types import * -from site import USER_BASE, USER_SITE +from site import USER_BASE from distutils.core import Command from distutils.errors import * from distutils.sysconfig import customize_compiler, get_python_version From python-checkins at python.org Fri Feb 27 00:45:55 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 27 Feb 2009 00:45:55 +0100 (CET) Subject: [Python-checkins] r70004 - python/branches/release26-maint Message-ID: <20090226234555.AF04F1E403D@bag.python.org> Author: tarek.ziade Date: Fri Feb 27 00:45:55 2009 New Revision: 70004 Log: Blocked revisions 70003 via svnmerge ........ r70003 | tarek.ziade | 2009-02-27 00:44:00 +0100 (Fri, 27 Feb 2009) | 1 line removed unused import ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri Feb 27 00:47:00 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 27 Feb 2009 00:47:00 +0100 (CET) Subject: [Python-checkins] r70005 - in python/branches/py3k: Lib/distutils/command/build_ext.py Message-ID: <20090226234700.B63F71E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 27 00:47:00 2009 New Revision: 70005 Log: Merged revisions 70003 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70003 | tarek.ziade | 2009-02-27 00:44:00 +0100 (Fri, 27 Feb 2009) | 1 line removed unused import ........ 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 Fri Feb 27 00:47:00 2009 @@ -7,7 +7,7 @@ __revision__ = "$Id$" import sys, os, re -from site import USER_BASE, USER_SITE +from site import USER_BASE from distutils.core import Command from distutils.errors import * from distutils.sysconfig import customize_compiler, get_python_version From python-checkins at python.org Fri Feb 27 00:48:01 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 27 Feb 2009 00:48:01 +0100 (CET) Subject: [Python-checkins] r70006 - python/branches/release30-maint Message-ID: <20090226234801.9B9FA1E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 27 00:48:01 2009 New Revision: 70006 Log: Blocked revisions 70005 via svnmerge ................ r70005 | tarek.ziade | 2009-02-27 00:47:00 +0100 (Fri, 27 Feb 2009) | 9 lines Merged revisions 70003 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70003 | tarek.ziade | 2009-02-27 00:44:00 +0100 (Fri, 27 Feb 2009) | 1 line removed unused import ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Fri Feb 27 01:11:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 27 Feb 2009 00:11:35 +0000 Subject: [Python-checkins] buildbot failure in x86 OpenBSD 2.6 Message-ID: <20090227001135.5BFEF1E403D@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20OpenBSD%202.6/builds/108 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: cortesi Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: raymond.hettinger,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Fri Feb 27 01:31:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 27 Feb 2009 00:31:40 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090227003140.C48391E4014@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/685 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/test/test_smtplib.py", line 108, in debugging_server poll_fun(0.01, asyncore.socket_map) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 185, in poll2 readwrite(obj, flags) File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 109, in readwrite obj.handle_error() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 103, in readwrite obj.handle_expt_event() File "/Users/buildbot/buildarea/trunk.heller-x86-osx5/build/Lib/asyncore.py", line 447, in handle_expt_event err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR) File "", line 1, in getsockopt error: [Errno 9] Bad file descriptor sincerely, -The Buildbot From buildbot at python.org Fri Feb 27 02:09:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 27 Feb 2009 01:09:57 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090227010957.774281E4002@bag.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/333 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 failed slave lost sincerely, -The Buildbot From buildbot at python.org Fri Feb 27 02:32:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 27 Feb 2009 01:32:11 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090227013211.8DB331E4002@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/351 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 Feb 27 03:14:36 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 27 Feb 2009 03:14:36 +0100 (CET) Subject: [Python-checkins] r70007 - in python/trunk/Doc/distutils: setupscript.rst uploading.rst Message-ID: <20090227021436.408CE1E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 27 03:14:35 2009 New Revision: 70007 Log: more info on long_description Modified: python/trunk/Doc/distutils/setupscript.rst python/trunk/Doc/distutils/uploading.rst Modified: python/trunk/Doc/distutils/setupscript.rst ============================================================================== --- python/trunk/Doc/distutils/setupscript.rst (original) +++ python/trunk/Doc/distutils/setupscript.rst Fri Feb 27 03:14:35 2009 @@ -19,18 +19,18 @@ distributions. The Distutils' own setup script, shown here, is used to install the package into Python 1.5.2.) :: - #!/usr/bin/env python + #!/usr/bin/env python - from distutils.core import setup + from distutils.core import setup - setup(name='Distutils', - version='1.0', - description='Python Distribution Utilities', - author='Greg Ward', - author_email='gward at python.net', - url='http://www.python.org/sigs/distutils-sig/', - packages=['distutils', 'distutils.command'], - ) + setup(name='Distutils', + version='1.0', + description='Python Distribution Utilities', + author='Greg Ward', + author_email='gward at python.net', + url='http://www.python.org/sigs/distutils-sig/', + packages=['distutils', 'distutils.command'], + ) There are only two differences between this and the trivial one-file distribution presented in section :ref:`distutils-simple-example`: more metadata, and the @@ -53,8 +53,8 @@ :func:`os.listdir` to specify files, you should be careful to write portable code instead of hardcoding path separators:: - glob.glob(os.path.join('mydir', 'subdir', '*.html')) - os.listdir(os.path.join('mydir', 'subdir')) + glob.glob(os.path.join('mydir', 'subdir', '*.html')) + os.listdir(os.path.join('mydir', 'subdir')) .. _listing-packages: @@ -81,7 +81,7 @@ package at all) are in :file:`lib`, modules in the :mod:`foo` package are in :file:`lib/foo`, and so forth. Then you would put :: - package_dir = {'': 'lib'} + package_dir = {'': 'lib'} in your setup script. The keys to this dictionary are package names, and an empty package name stands for the root package. The values are directory names @@ -92,7 +92,7 @@ :file:`lib`, the :mod:`foo.bar` package in :file:`lib/bar`, etc. This would be written in the setup script as :: - package_dir = {'foo': 'lib'} + package_dir = {'foo': 'lib'} A ``package: dir`` entry in the :option:`package_dir` dictionary implicitly applies to all packages below *package*, so the :mod:`foo.bar` case is @@ -114,7 +114,7 @@ "root package" (i.e., no package at all). This simplest case was shown in section :ref:`distutils-simple-example`; here is a slightly more involved example:: - py_modules = ['mod1', 'pkg.mod2'] + py_modules = ['mod1', 'pkg.mod2'] This describes two modules, one of them in the "root" package, the other in the :mod:`pkg` package. Again, the default package/directory layout implies that @@ -144,17 +144,17 @@ implemented by :file:`foo.c`. If no additional instructions to the compiler/linker are needed, describing this extension is quite simple:: - Extension('foo', ['foo.c']) + Extension('foo', ['foo.c']) The :class:`Extension` class can be imported from :mod:`distutils.core` along with :func:`setup`. Thus, the setup script for a module distribution that contains only this one extension and nothing else might be:: - from distutils.core import setup, Extension - setup(name='foo', - version='1.0', - ext_modules=[Extension('foo', ['foo.c'])], - ) + from distutils.core import setup, Extension + setup(name='foo', + version='1.0', + ext_modules=[Extension('foo', ['foo.c'])], + ) The :class:`Extension` class (actually, the underlying extension-building machinery implemented by the :command:`build_ext` command) supports a great deal @@ -168,11 +168,11 @@ The first argument to the :class:`Extension` constructor is always the name of the extension, including any package names. For example, :: - Extension('foo', ['src/foo1.c', 'src/foo2.c']) + Extension('foo', ['src/foo1.c', 'src/foo2.c']) describes an extension that lives in the root package, while :: - Extension('pkg.foo', ['src/foo1.c', 'src/foo2.c']) + Extension('pkg.foo', ['src/foo1.c', 'src/foo2.c']) describes the same extension in the :mod:`pkg` package. The source files and resulting object code are identical in both cases; the only difference is where @@ -183,11 +183,11 @@ same base package), use the :option:`ext_package` keyword argument to :func:`setup`. For example, :: - setup(..., - ext_package='pkg', - ext_modules=[Extension('foo', ['foo.c']), - Extension('subpkg.bar', ['bar.c'])], - ) + setup(..., + ext_package='pkg', + ext_modules=[Extension('foo', ['foo.c']), + Extension('subpkg.bar', ['bar.c'])], + ) will compile :file:`foo.c` to the extension :mod:`pkg.foo`, and :file:`bar.c` to :mod:`pkg.subpkg.bar`. @@ -212,15 +212,15 @@ This warning notwithstanding, options to SWIG can be currently passed like this:: - setup(..., - ext_modules=[Extension('_foo', ['foo.i'], - swig_opts=['-modern', '-I../include'])], - py_modules=['foo'], - ) + setup(..., + ext_modules=[Extension('_foo', ['foo.i'], + swig_opts=['-modern', '-I../include'])], + py_modules=['foo'], + ) Or on the commandline like this:: - > python setup.py build_ext --swig-opts="-modern -I../include" + > python setup.py build_ext --swig-opts="-modern -I../include" On some platforms, you can include non-source files that are processed by the compiler and included in your extension. Currently, this just means Windows @@ -239,18 +239,18 @@ For example, if your extension requires header files in the :file:`include` directory under your distribution root, use the ``include_dirs`` option:: - Extension('foo', ['foo.c'], include_dirs=['include']) + Extension('foo', ['foo.c'], include_dirs=['include']) You can specify absolute directories there; if you know that your extension will only be built on Unix systems with X11R6 installed to :file:`/usr`, you can get away with :: - Extension('foo', ['foo.c'], include_dirs=['/usr/include/X11']) + Extension('foo', ['foo.c'], include_dirs=['/usr/include/X11']) You should avoid this sort of non-portable usage if you plan to distribute your code: it's probably better to write C code like :: - #include + #include If you need to include header files from some other Python extension, you can take advantage of the fact that header files are installed in a consistent way @@ -262,17 +262,17 @@ included in the search path when building Python extensions, the best approach is to write C code like :: - #include + #include If you must put the :file:`Numerical` include directory right into your header search path, though, you can find that directory using the Distutils :mod:`distutils.sysconfig` module:: - from distutils.sysconfig import get_python_inc - incdir = os.path.join(get_python_inc(plat_specific=1), 'Numerical') - setup(..., - Extension(..., include_dirs=[incdir]), - ) + from distutils.sysconfig import get_python_inc + incdir = os.path.join(get_python_inc(plat_specific=1), 'Numerical') + setup(..., + Extension(..., include_dirs=[incdir]), + ) Even though this is quite portable---it will work on any Python installation, regardless of platform---it's probably easier to just write your C code in the @@ -288,17 +288,17 @@ For example:: - Extension(..., - define_macros=[('NDEBUG', '1'), - ('HAVE_STRFTIME', None)], - undef_macros=['HAVE_FOO', 'HAVE_BAR']) + Extension(..., + define_macros=[('NDEBUG', '1'), + ('HAVE_STRFTIME', None)], + undef_macros=['HAVE_FOO', 'HAVE_BAR']) is the equivalent of having this at the top of every C source file:: - #define NDEBUG 1 - #define HAVE_STRFTIME - #undef HAVE_FOO - #undef HAVE_BAR + #define NDEBUG 1 + #define HAVE_STRFTIME + #undef HAVE_FOO + #undef HAVE_BAR Library options @@ -313,15 +313,15 @@ For example, if you need to link against libraries known to be in the standard library search path on target systems :: - Extension(..., - libraries=['gdbm', 'readline']) + Extension(..., + libraries=['gdbm', 'readline']) If you need to link with libraries in a non-standard location, you'll have to include the location in ``library_dirs``:: - Extension(..., - library_dirs=['/usr/X11R6/lib'], - libraries=['X11', 'Xt']) + Extension(..., + library_dirs=['/usr/X11R6/lib'], + libraries=['X11', 'Xt']) (Again, this sort of non-portable construct should be avoided if you intend to distribute your code.) @@ -379,8 +379,8 @@ parentheses. Each qualifier may consist of a comparison operator and a version number. The accepted comparison operators are:: - < > == - <= >= != + < > == + <= >= != These can be combined by using multiple qualifiers separated by commas (and optional whitespace). In this case, all of the qualifiers must be matched; a @@ -446,13 +446,13 @@ The :option:`scripts` option simply is a list of files to be handled in this way. From the PyXML setup script:: - setup(..., - scripts=['scripts/xmlproc_parse', 'scripts/xmlproc_val'] - ) + setup(..., + scripts=['scripts/xmlproc_parse', 'scripts/xmlproc_val'] + ) .. versionchanged:: 2.7 - All the scripts will also be added to the ``MANIFEST`` - file if no template is provided. See :ref:`manifest`. + All the scripts will also be added to the ``MANIFEST`` + file if no template is provided. See :ref:`manifest`. .. _distutils-installing-package-data: @@ -478,29 +478,29 @@ For example, if a package should contain a subdirectory with several data files, the files can be arranged like this in the source tree:: - setup.py - src/ - mypkg/ - __init__.py - module.py - data/ - tables.dat - spoons.dat - forks.dat + setup.py + src/ + mypkg/ + __init__.py + module.py + data/ + tables.dat + spoons.dat + forks.dat The corresponding call to :func:`setup` might be:: - setup(..., - packages=['mypkg'], - package_dir={'mypkg': 'src/mypkg'}, - package_data={'mypkg': ['data/*.dat']}, - ) + setup(..., + packages=['mypkg'], + package_dir={'mypkg': 'src/mypkg'}, + package_data={'mypkg': ['data/*.dat']}, + ) .. versionadded:: 2.4 .. versionchanged:: 2.7 - All the files that match ``package_data`` will be added to the ``MANIFEST`` - file if no template is provided. See :ref:`manifest`. + All the files that match ``package_data`` will be added to the ``MANIFEST`` + file if no template is provided. See :ref:`manifest`. .. _distutils-additional-files: @@ -515,11 +515,11 @@ :option:`data_files` specifies a sequence of (*directory*, *files*) pairs in the following way:: - setup(..., - data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']), - ('config', ['cfg/data.cfg']), - ('/etc/init.d', ['init-script'])] - ) + setup(..., + data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']), + ('config', ['cfg/data.cfg']), + ('/etc/init.d', ['init-script'])] + ) Note that you can specify the directory names where the data files will be installed, but you cannot rename the data files themselves. @@ -540,8 +540,8 @@ directory. .. versionchanged:: 2.7 - All the files that match ``data_files`` will be added to the ``MANIFEST`` - file if no template is provided. See :ref:`manifest`. + All the files that match ``data_files`` will be added to the ``MANIFEST`` + file if no template is provided. See :ref:`manifest`. @@ -576,7 +576,7 @@ | | description of the | | | | | package | | | +----------------------+---------------------------+-----------------+--------+ -| ``long_description`` | longer description of the | long string | | +| ``long_description`` | longer description of the | long string | \(5) | | | package | | | +----------------------+---------------------------+-----------------+--------+ | ``download_url`` | location where the | URL | \(4) | @@ -590,28 +590,32 @@ Notes: (1) - These fields are required. + These fields are required. (2) - It is recommended that versions take the form *major.minor[.patch[.sub]]*. + It is recommended that versions take the form *major.minor[.patch[.sub]]*. (3) - Either the author or the maintainer must be identified. + Either the author or the maintainer must be identified. (4) - These fields should not be used if your package is to be compatible with Python - versions prior to 2.2.3 or 2.3. The list is available from the `PyPI website - `_. + These fields should not be used if your package is to be compatible with Python + versions prior to 2.2.3 or 2.3. The list is available from the `PyPI website + `_. + +(5) + The ``long_description`` field is used by PyPI when you are registering a + package, to build its home page. 'short string' - A single line of text, not more than 200 characters. + A single line of text, not more than 200 characters. 'long string' - Multiple lines of plain text in reStructuredText format (see - http://docutils.sf.net/). + Multiple lines of plain text in reStructuredText format (see + http://docutils.sf.net/). 'list of strings' - See below. + See below. None of the string values may be Unicode. @@ -627,44 +631,44 @@ (for final pre-release release testing). Some examples: 0.1.0 - the first, experimental release of a package + the first, experimental release of a package 1.0.1a2 - the second alpha release of the first patch version of 1.0 + the second alpha release of the first patch version of 1.0 :option:`classifiers` are specified in a python list:: - setup(..., - classifiers=[ - 'Development Status :: 4 - Beta', - 'Environment :: Console', - 'Environment :: Web Environment', - 'Intended Audience :: End Users/Desktop', - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'License :: OSI Approved :: Python Software Foundation License', - 'Operating System :: MacOS :: MacOS X', - 'Operating System :: Microsoft :: Windows', - 'Operating System :: POSIX', - 'Programming Language :: Python', - 'Topic :: Communications :: Email', - 'Topic :: Office/Business', - 'Topic :: Software Development :: Bug Tracking', - ], - ) + setup(..., + classifiers=[ + 'Development Status :: 4 - Beta', + 'Environment :: Console', + 'Environment :: Web Environment', + 'Intended Audience :: End Users/Desktop', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Python Software Foundation License', + 'Operating System :: MacOS :: MacOS X', + 'Operating System :: Microsoft :: Windows', + 'Operating System :: POSIX', + 'Programming Language :: Python', + 'Topic :: Communications :: Email', + 'Topic :: Office/Business', + 'Topic :: Software Development :: Bug Tracking', + ], + ) If you wish to include classifiers in your :file:`setup.py` file and also wish to remain backwards-compatible with Python releases prior to 2.2.3, then you can include the following code fragment in your :file:`setup.py` before the :func:`setup` call. :: - # patch distutils if it can't cope with the "classifiers" or - # "download_url" keywords - from sys import version - if version < '2.2.3': - from distutils.dist import DistributionMetadata - DistributionMetadata.classifiers = None - DistributionMetadata.download_url = None + # patch distutils if it can't cope with the "classifiers" or + # "download_url" keywords + from sys import version + if version < '2.2.3': + from distutils.dist import DistributionMetadata + DistributionMetadata.classifiers = None + DistributionMetadata.download_url = None Debugging the setup script @@ -686,5 +690,3 @@ to anything except an empty string, and distutils will now print detailed information what it is doing, and prints the full traceback in case an exception occurs. - - Modified: python/trunk/Doc/distutils/uploading.rst ============================================================================== --- python/trunk/Doc/distutils/uploading.rst (original) +++ python/trunk/Doc/distutils/uploading.rst Fri Feb 27 03:14:35 2009 @@ -43,3 +43,32 @@ *section* the name of the section in :file:`$HOME/.pypirc`, and :option:`--show-response` (which displays the full response text from the PyPI server for help in debugging upload problems). + +PyPI package display +==================== + +The ``long_description`` field plays a special role at PyPI. It is used by +the server to display a home page for the registered package. + +If you use the `reStructuredText `_ +syntax for this field, PyPI will parse it and display an HTML output for +the package home page. + +The ``long_description`` field can be attached to a text file located +in the package:: + + from distutils.core import setup + + setup(name='Distutils', + long_description=open('README.txt')) + +In that case, `README.txt` is a regular reStructuredText text file located +in the root of the package besides `setup.py`. + +To prevent registering broken reStructuredText content, you can use the +:program:`rst2html` program that is provided by the `docutils` package +and check the ``long_description`` from the command line:: + + $ python setup.py --long-description | rst2html.py > output.html + +`docutils` will display a warning if there's something wrong with your syntax. From python-checkins at python.org Fri Feb 27 03:19:33 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 27 Feb 2009 03:19:33 +0100 (CET) Subject: [Python-checkins] r70008 - python/branches/release26-maint Message-ID: <20090227021933.1B3B51E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 27 03:19:32 2009 New Revision: 70008 Log: Blocked revisions 70007 via svnmerge ........ r70007 | tarek.ziade | 2009-02-27 03:14:35 +0100 (Fri, 27 Feb 2009) | 1 line more info on long_description ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri Feb 27 03:22:25 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 27 Feb 2009 03:22:25 +0100 (CET) Subject: [Python-checkins] r70009 - in python/branches/py3k: Doc/distutils/setupscript.rst Doc/distutils/uploading.rst Message-ID: <20090227022225.8B6E31E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 27 03:22:25 2009 New Revision: 70009 Log: Merged revisions 70007 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70007 | tarek.ziade | 2009-02-27 03:14:35 +0100 (Fri, 27 Feb 2009) | 1 line more info on long_description ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/distutils/setupscript.rst python/branches/py3k/Doc/distutils/uploading.rst Modified: python/branches/py3k/Doc/distutils/setupscript.rst ============================================================================== --- python/branches/py3k/Doc/distutils/setupscript.rst (original) +++ python/branches/py3k/Doc/distutils/setupscript.rst Fri Feb 27 03:22:25 2009 @@ -19,18 +19,18 @@ distributions. The Distutils' own setup script, shown here, is used to install the package into Python 1.5.2.) :: - #!/usr/bin/env python + #!/usr/bin/env python - from distutils.core import setup + from distutils.core import setup - setup(name='Distutils', - version='1.0', - description='Python Distribution Utilities', - author='Greg Ward', - author_email='gward at python.net', - url='http://www.python.org/sigs/distutils-sig/', - packages=['distutils', 'distutils.command'], - ) + setup(name='Distutils', + version='1.0', + description='Python Distribution Utilities', + author='Greg Ward', + author_email='gward at python.net', + url='http://www.python.org/sigs/distutils-sig/', + packages=['distutils', 'distutils.command'], + ) There are only two differences between this and the trivial one-file distribution presented in section :ref:`distutils-simple-example`: more metadata, and the @@ -53,8 +53,8 @@ :func:`os.listdir` to specify files, you should be careful to write portable code instead of hardcoding path separators:: - glob.glob(os.path.join('mydir', 'subdir', '*.html')) - os.listdir(os.path.join('mydir', 'subdir')) + glob.glob(os.path.join('mydir', 'subdir', '*.html')) + os.listdir(os.path.join('mydir', 'subdir')) .. _listing-packages: @@ -81,7 +81,7 @@ package at all) are in :file:`lib`, modules in the :mod:`foo` package are in :file:`lib/foo`, and so forth. Then you would put :: - package_dir = {'': 'lib'} + package_dir = {'': 'lib'} in your setup script. The keys to this dictionary are package names, and an empty package name stands for the root package. The values are directory names @@ -92,7 +92,7 @@ :file:`lib`, the :mod:`foo.bar` package in :file:`lib/bar`, etc. This would be written in the setup script as :: - package_dir = {'foo': 'lib'} + package_dir = {'foo': 'lib'} A ``package: dir`` entry in the :option:`package_dir` dictionary implicitly applies to all packages below *package*, so the :mod:`foo.bar` case is @@ -114,7 +114,7 @@ "root package" (i.e., no package at all). This simplest case was shown in section :ref:`distutils-simple-example`; here is a slightly more involved example:: - py_modules = ['mod1', 'pkg.mod2'] + py_modules = ['mod1', 'pkg.mod2'] This describes two modules, one of them in the "root" package, the other in the :mod:`pkg` package. Again, the default package/directory layout implies that @@ -144,17 +144,17 @@ implemented by :file:`foo.c`. If no additional instructions to the compiler/linker are needed, describing this extension is quite simple:: - Extension('foo', ['foo.c']) + Extension('foo', ['foo.c']) The :class:`Extension` class can be imported from :mod:`distutils.core` along with :func:`setup`. Thus, the setup script for a module distribution that contains only this one extension and nothing else might be:: - from distutils.core import setup, Extension - setup(name='foo', - version='1.0', - ext_modules=[Extension('foo', ['foo.c'])], - ) + from distutils.core import setup, Extension + setup(name='foo', + version='1.0', + ext_modules=[Extension('foo', ['foo.c'])], + ) The :class:`Extension` class (actually, the underlying extension-building machinery implemented by the :command:`build_ext` command) supports a great deal @@ -168,11 +168,11 @@ The first argument to the :class:`Extension` constructor is always the name of the extension, including any package names. For example, :: - Extension('foo', ['src/foo1.c', 'src/foo2.c']) + Extension('foo', ['src/foo1.c', 'src/foo2.c']) describes an extension that lives in the root package, while :: - Extension('pkg.foo', ['src/foo1.c', 'src/foo2.c']) + Extension('pkg.foo', ['src/foo1.c', 'src/foo2.c']) describes the same extension in the :mod:`pkg` package. The source files and resulting object code are identical in both cases; the only difference is where @@ -183,11 +183,11 @@ same base package), use the :option:`ext_package` keyword argument to :func:`setup`. For example, :: - setup(..., - ext_package='pkg', - ext_modules=[Extension('foo', ['foo.c']), - Extension('subpkg.bar', ['bar.c'])], - ) + setup(..., + ext_package='pkg', + ext_modules=[Extension('foo', ['foo.c']), + Extension('subpkg.bar', ['bar.c'])], + ) will compile :file:`foo.c` to the extension :mod:`pkg.foo`, and :file:`bar.c` to :mod:`pkg.subpkg.bar`. @@ -212,15 +212,15 @@ This warning notwithstanding, options to SWIG can be currently passed like this:: - setup(..., - ext_modules=[Extension('_foo', ['foo.i'], - swig_opts=['-modern', '-I../include'])], - py_modules=['foo'], - ) + setup(..., + ext_modules=[Extension('_foo', ['foo.i'], + swig_opts=['-modern', '-I../include'])], + py_modules=['foo'], + ) Or on the commandline like this:: - > python setup.py build_ext --swig-opts="-modern -I../include" + > python setup.py build_ext --swig-opts="-modern -I../include" On some platforms, you can include non-source files that are processed by the compiler and included in your extension. Currently, this just means Windows @@ -239,18 +239,18 @@ For example, if your extension requires header files in the :file:`include` directory under your distribution root, use the ``include_dirs`` option:: - Extension('foo', ['foo.c'], include_dirs=['include']) + Extension('foo', ['foo.c'], include_dirs=['include']) You can specify absolute directories there; if you know that your extension will only be built on Unix systems with X11R6 installed to :file:`/usr`, you can get away with :: - Extension('foo', ['foo.c'], include_dirs=['/usr/include/X11']) + Extension('foo', ['foo.c'], include_dirs=['/usr/include/X11']) You should avoid this sort of non-portable usage if you plan to distribute your code: it's probably better to write C code like :: - #include + #include If you need to include header files from some other Python extension, you can take advantage of the fact that header files are installed in a consistent way @@ -262,17 +262,17 @@ included in the search path when building Python extensions, the best approach is to write C code like :: - #include + #include If you must put the :file:`Numerical` include directory right into your header search path, though, you can find that directory using the Distutils :mod:`distutils.sysconfig` module:: - from distutils.sysconfig import get_python_inc - incdir = os.path.join(get_python_inc(plat_specific=1), 'Numerical') - setup(..., - Extension(..., include_dirs=[incdir]), - ) + from distutils.sysconfig import get_python_inc + incdir = os.path.join(get_python_inc(plat_specific=1), 'Numerical') + setup(..., + Extension(..., include_dirs=[incdir]), + ) Even though this is quite portable---it will work on any Python installation, regardless of platform---it's probably easier to just write your C code in the @@ -288,17 +288,17 @@ For example:: - Extension(..., - define_macros=[('NDEBUG', '1'), - ('HAVE_STRFTIME', None)], - undef_macros=['HAVE_FOO', 'HAVE_BAR']) + Extension(..., + define_macros=[('NDEBUG', '1'), + ('HAVE_STRFTIME', None)], + undef_macros=['HAVE_FOO', 'HAVE_BAR']) is the equivalent of having this at the top of every C source file:: - #define NDEBUG 1 - #define HAVE_STRFTIME - #undef HAVE_FOO - #undef HAVE_BAR + #define NDEBUG 1 + #define HAVE_STRFTIME + #undef HAVE_FOO + #undef HAVE_BAR Library options @@ -313,15 +313,15 @@ For example, if you need to link against libraries known to be in the standard library search path on target systems :: - Extension(..., - libraries=['_gdbm', 'readline']) + Extension(..., + libraries=['gdbm', 'readline']) If you need to link with libraries in a non-standard location, you'll have to include the location in ``library_dirs``:: - Extension(..., - library_dirs=['/usr/X11R6/lib'], - libraries=['X11', 'Xt']) + Extension(..., + library_dirs=['/usr/X11R6/lib'], + libraries=['X11', 'Xt']) (Again, this sort of non-portable construct should be avoided if you intend to distribute your code.) @@ -379,8 +379,8 @@ parentheses. Each qualifier may consist of a comparison operator and a version number. The accepted comparison operators are:: - < > == - <= >= != + < > == + <= >= != These can be combined by using multiple qualifiers separated by commas (and optional whitespace). In this case, all of the qualifiers must be matched; a @@ -446,13 +446,13 @@ The :option:`scripts` option simply is a list of files to be handled in this way. From the PyXML setup script:: - setup(..., - scripts=['scripts/xmlproc_parse', 'scripts/xmlproc_val'] - ) + setup(..., + scripts=['scripts/xmlproc_parse', 'scripts/xmlproc_val'] + ) .. versionchanged:: 2.7 - All the scripts will also be added to the ``MANIFEST`` - file if no template is provided. See :ref:`manifest`. + All the scripts will also be added to the ``MANIFEST`` + file if no template is provided. See :ref:`manifest`. .. _distutils-installing-package-data: @@ -478,28 +478,28 @@ For example, if a package should contain a subdirectory with several data files, the files can be arranged like this in the source tree:: - setup.py - src/ - mypkg/ - __init__.py - module.py - data/ - tables.dat - spoons.dat - forks.dat + setup.py + src/ + mypkg/ + __init__.py + module.py + data/ + tables.dat + spoons.dat + forks.dat The corresponding call to :func:`setup` might be:: - setup(..., - packages=['mypkg'], - package_dir={'mypkg': 'src/mypkg'}, - package_data={'mypkg': ['data/*.dat']}, - ) + setup(..., + packages=['mypkg'], + package_dir={'mypkg': 'src/mypkg'}, + package_data={'mypkg': ['data/*.dat']}, + ) .. versionchanged:: 2.7 - All the files that match ``package_data`` will be added to the ``MANIFEST`` - file if no template is provided. See :ref:`manifest`. + All the files that match ``package_data`` will be added to the ``MANIFEST`` + file if no template is provided. See :ref:`manifest`. .. _distutils-additional-files: @@ -514,11 +514,11 @@ :option:`data_files` specifies a sequence of (*directory*, *files*) pairs in the following way:: - setup(..., - data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']), - ('config', ['cfg/data.cfg']), - ('/etc/init.d', ['init-script'])] - ) + setup(..., + data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']), + ('config', ['cfg/data.cfg']), + ('/etc/init.d', ['init-script'])] + ) Note that you can specify the directory names where the data files will be installed, but you cannot rename the data files themselves. @@ -539,8 +539,8 @@ directory. .. versionchanged:: 2.7 - All the files that match ``data_files`` will be added to the ``MANIFEST`` - file if no template is provided. See :ref:`manifest`. + All the files that match ``data_files`` will be added to the ``MANIFEST`` + file if no template is provided. See :ref:`manifest`. @@ -575,7 +575,7 @@ | | description of the | | | | | package | | | +----------------------+---------------------------+-----------------+--------+ -| ``long_description`` | longer description of the | long string | | +| ``long_description`` | longer description of the | long string | \(5) | | | package | | | +----------------------+---------------------------+-----------------+--------+ | ``download_url`` | location where the | URL | \(4) | @@ -589,28 +589,32 @@ Notes: (1) - These fields are required. + These fields are required. (2) - It is recommended that versions take the form *major.minor[.patch[.sub]]*. + It is recommended that versions take the form *major.minor[.patch[.sub]]*. (3) - Either the author or the maintainer must be identified. + Either the author or the maintainer must be identified. (4) - These fields should not be used if your package is to be compatible with Python - versions prior to 2.2.3 or 2.3. The list is available from the `PyPI website - `_. + These fields should not be used if your package is to be compatible with Python + versions prior to 2.2.3 or 2.3. The list is available from the `PyPI website + `_. + +(5) + The ``long_description`` field is used by PyPI when you are registering a + package, to build its home page. 'short string' - A single line of text, not more than 200 characters. + A single line of text, not more than 200 characters. 'long string' - Multiple lines of plain text in reStructuredText format (see - http://docutils.sf.net/). + Multiple lines of plain text in reStructuredText format (see + http://docutils.sf.net/). 'list of strings' - See below. + See below. Encoding the version information is an art in itself. Python packages generally adhere to the version format *major.minor[.patch][sub]*. The major number is 0 @@ -624,44 +628,44 @@ (for final pre-release release testing). Some examples: 0.1.0 - the first, experimental release of a package + the first, experimental release of a package 1.0.1a2 - the second alpha release of the first patch version of 1.0 + the second alpha release of the first patch version of 1.0 :option:`classifiers` are specified in a python list:: - setup(..., - classifiers=[ - 'Development Status :: 4 - Beta', - 'Environment :: Console', - 'Environment :: Web Environment', - 'Intended Audience :: End Users/Desktop', - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'License :: OSI Approved :: Python Software Foundation License', - 'Operating System :: MacOS :: MacOS X', - 'Operating System :: Microsoft :: Windows', - 'Operating System :: POSIX', - 'Programming Language :: Python', - 'Topic :: Communications :: Email', - 'Topic :: Office/Business', - 'Topic :: Software Development :: Bug Tracking', - ], - ) + setup(..., + classifiers=[ + 'Development Status :: 4 - Beta', + 'Environment :: Console', + 'Environment :: Web Environment', + 'Intended Audience :: End Users/Desktop', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Python Software Foundation License', + 'Operating System :: MacOS :: MacOS X', + 'Operating System :: Microsoft :: Windows', + 'Operating System :: POSIX', + 'Programming Language :: Python', + 'Topic :: Communications :: Email', + 'Topic :: Office/Business', + 'Topic :: Software Development :: Bug Tracking', + ], + ) If you wish to include classifiers in your :file:`setup.py` file and also wish to remain backwards-compatible with Python releases prior to 2.2.3, then you can include the following code fragment in your :file:`setup.py` before the :func:`setup` call. :: - # patch distutils if it can't cope with the "classifiers" or - # "download_url" keywords - from sys import version - if version < '2.2.3': - from distutils.dist import DistributionMetadata - DistributionMetadata.classifiers = None - DistributionMetadata.download_url = None + # patch distutils if it can't cope with the "classifiers" or + # "download_url" keywords + from sys import version + if version < '2.2.3': + from distutils.dist import DistributionMetadata + DistributionMetadata.classifiers = None + DistributionMetadata.download_url = None Debugging the setup script @@ -683,5 +687,3 @@ to anything except an empty string, and distutils will now print detailed information what it is doing, and prints the full traceback in case an exception occurs. - - Modified: python/branches/py3k/Doc/distutils/uploading.rst ============================================================================== --- python/branches/py3k/Doc/distutils/uploading.rst (original) +++ python/branches/py3k/Doc/distutils/uploading.rst Fri Feb 27 03:22:25 2009 @@ -41,3 +41,32 @@ *section* the name of the section in :file:`$HOME/.pypirc`, and :option:`--show-response` (which displays the full response text from the PyPI server for help in debugging upload problems). + +PyPI package display +==================== + +The ``long_description`` field plays a special role at PyPI. It is used by +the server to display a home page for the registered package. + +If you use the `reStructuredText `_ +syntax for this field, PyPI will parse it and display an HTML output for +the package home page. + +The ``long_description`` field can be attached to a text file located +in the package:: + + from distutils.core import setup + + setup(name='Distutils', + long_description=open('README.txt')) + +In that case, `README.txt` is a regular reStructuredText text file located +in the root of the package besides `setup.py`. + +To prevent registering broken reStructuredText content, you can use the +:program:`rst2html` program that is provided by the `docutils` package +and check the ``long_description`` from the command line:: + + $ python setup.py --long-description | rst2html.py > output.html + +`docutils` will display a warning if there's something wrong with your syntax. From python-checkins at python.org Fri Feb 27 03:23:18 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 27 Feb 2009 03:23:18 +0100 (CET) Subject: [Python-checkins] r70010 - python/branches/release30-maint Message-ID: <20090227022318.580611E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 27 03:23:18 2009 New Revision: 70010 Log: Blocked revisions 70009 via svnmerge ................ r70009 | tarek.ziade | 2009-02-27 03:22:25 +0100 (Fri, 27 Feb 2009) | 9 lines Merged revisions 70007 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70007 | tarek.ziade | 2009-02-27 03:14:35 +0100 (Fri, 27 Feb 2009) | 1 line more info on long_description ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Fri Feb 27 04:38:28 2009 From: python-checkins at python.org (brett.cannon) Date: Fri, 27 Feb 2009 04:38:28 +0100 (CET) Subject: [Python-checkins] r70011 - in python/trunk/Lib: importlib/__init__.py test/test_importlib.py Message-ID: <20090227033828.4C4391E4002@bag.python.org> Author: brett.cannon Date: Fri Feb 27 04:38:28 2009 New Revision: 70011 Log: Fix a bug where code was trying to index an int. Left over from the situation from using str.rpartition to str.rindex. Closes Issue5213. Modified: python/trunk/Lib/importlib/__init__.py python/trunk/Lib/test/test_importlib.py Modified: python/trunk/Lib/importlib/__init__.py ============================================================================== --- python/trunk/Lib/importlib/__init__.py (original) +++ python/trunk/Lib/importlib/__init__.py Fri Feb 27 04:38:28 2009 @@ -15,7 +15,7 @@ try: # rpartition is more "correct" and rfind is just as easy to use, but # neither are in Python 2.3. - dot_rindex = package.rindex('.', level)[0] + dot_rindex = package.rindex('.', level) base = package[:dot_rindex] except ValueError: base = package Modified: python/trunk/Lib/test/test_importlib.py ============================================================================== --- python/trunk/Lib/test/test_importlib.py (original) +++ python/trunk/Lib/test/test_importlib.py Fri Feb 27 04:38:28 2009 @@ -140,11 +140,14 @@ pkg_name = 'pkg' pkg_long_name = '{0}.__init__'.format(pkg_name) module_name = 'mod' + subpkg_name = '{0}.subpkg'.format(pkg_name) + subpkg_long_name = '{0}.__init__'.format(subpkg_name) absolute_name = '{0}.{1}'.format(pkg_name, module_name) - relative_name = '.{0}'.format(module_name) - with mock_modules(pkg_long_name, absolute_name) as mock: + relative_name = '..{0}'.format(module_name) + with mock_modules(pkg_long_name, subpkg_long_name, + absolute_name) as mock: with import_state(meta_path=[mock]): - module = importlib.import_module(relative_name, pkg_name) + module = importlib.import_module(relative_name, subpkg_name) self.assertEqual(module.__name__, absolute_name) def test_absolute_import_with_package(self): From buildbot at python.org Fri Feb 27 05:04:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 27 Feb 2009 04:04:11 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090227040412.1A21E1E4002@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/918 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: brett.cannon,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_urllib2 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Feb 27 05:32:12 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 27 Feb 2009 05:32:12 +0100 (CET) Subject: [Python-checkins] r70012 - peps/trunk/pep-0372.txt Message-ID: <20090227043212.84EF71E4027@bag.python.org> Author: raymond.hettinger Date: Fri Feb 27 05:32:11 2009 New Revision: 70012 Log: Update PEP based on latest version of recipe, based on integration testing, and based on newsgroup feedback. Modified: peps/trunk/pep-0372.txt Modified: peps/trunk/pep-0372.txt ============================================================================== --- peps/trunk/pep-0372.txt (original) +++ peps/trunk/pep-0372.txt Fri Feb 27 05:32:11 2009 @@ -143,22 +143,19 @@ This behavior is consistent with existing implementations in Python, the PHP array and the hashmap in Ruby 1.9. -Why is there no ``odict.insert()``? - - There are few situations where you really want to insert a key at - a specified index. To avoid API complication, the proposed - solution for this situation is creating a list of items, - manipulating that and converting it back into an odict: - - >>> d = odict([('a', 42), ('b', 23), ('c', 19)]) - >>> l = d.items() - >>> l.insert(1, ('x', 0)) - >>> odict(l) - collections.odict([('a', 42), ('x', 0), ('b', 23), ('c', 19)]) - -Is the ordered dict a dict subclass? +Is the ordered dict a dict subclass? Why? Yes. Like ``defaultdict``, ``odict`` subclasses ``dict``. + Being a dict subclass confers speed upon methods that aren't overridden + like ``__getitem__`` and ``__len__``. Also, being a dict gives the + most utility with tools that were expecting regular dicts (like the + json module). + +Do any limitations arise from subclassing dict? + + Yes. Since the API for dicts is different in Py2.x and Py3.x, the + odict API must also be different (i.e. Py2.6 needs to override + iterkeys, itervalues, and iteritems). Does ``odict.popitem()`` return a particular key/value pair? @@ -166,8 +163,8 @@ corresponding value. This corresponds to the usual LIFO behavior exhibited by traditional push/pop pairs. It is semantically equivalent to ``k=list(od)[-1]; v=od[k]; del od[k]; return (k,v)``. - The actual implementation is more efficient. It is O(n log n) - on the first call, any successive calls are O(1). + The actual implementation is more efficient and pops directly + off of a sorted list of keys. Does odict support indexing, slicing, and whatnot? @@ -184,6 +181,50 @@ dbm) is likely a better fit. It would be a mistake to try to be all things to all users. +How well does odict work with the json module and PyYAML? + + For json, the good news is that json's encoder respects odict's iteration order: + + >>> items = [('one', 1), ('two', 2), ('three',3), ('four',4), ('five',5)] + >>> json.dumps(OrderedDict(items)) + '{"one": 1, "two": 2, "three": 3, "four": 4, "five": 5}' + + The bad news is that the object_hook for json decoders will pass in an + already built dictionary so that the order is lost before the object + hook sees it: + + >>> jtext = '{"one": 1, "two": 2, "three": 3, "four": 4, "five": 5}' + >>> json.loads(jtext, object_hook=OrderedDict) + OrderedDict({u'four': 4, u'three': 3, u'five': 5, u'two': 2, u'one': 1}) + + For PyYAML, a full round-trip is problem free: + + >>> ytext = yaml.dump(OrderedDict(items)) + >>> print ytext + !!python/object/apply:collections.OrderedDict + - - [one, 1] + - [two, 2] + - [three, 3] + - [four, 4] + - [five, 5] + + >>> yaml.load(ytext) + OrderedDict({'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5}) + +How does odict handle equality testing? + + Being a dict, one might expect equality tests to not care about order. For + an odict to dict comparison, this would be a necessity and it's probably + not wise to silently switch comparison modes based on the input types. + Also, some third-party tools that expect dict inputs may also expect the + comparison to not care about order. Accordingly, we decided to punt and + let the usual dict equality testing run without reference to internal + ordering. This should be documented clearly since different people will + have different expectations. If a use case does arise, it's not hard to + explicitly craft an order based comparison: + ``list(od1.items())==list(od2.items())``. + + Reference Implementation ======================== From python-checkins at python.org Fri Feb 27 05:33:20 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 27 Feb 2009 05:33:20 +0100 (CET) Subject: [Python-checkins] r70013 - peps/trunk/pep-0372.txt Message-ID: <20090227043320.987301E400C@bag.python.org> Author: raymond.hettinger Date: Fri Feb 27 05:33:19 2009 New Revision: 70013 Log: Indent code fragments. Modified: peps/trunk/pep-0372.txt Modified: peps/trunk/pep-0372.txt ============================================================================== --- peps/trunk/pep-0372.txt (original) +++ peps/trunk/pep-0372.txt Fri Feb 27 05:33:19 2009 @@ -37,11 +37,11 @@ The following example shows the behavior for simple assignments: ->>> d = odict() ->>> d['parrot'] = 'dead' ->>> d['penguin'] = 'exploded' ->>> d.items() -[('parrot', 'dead'), ('penguin', 'exploded')] + >>> d = odict() + >>> d['parrot'] = 'dead' + >>> d['penguin'] = 'exploded' + >>> d.items() + [('parrot', 'dead'), ('penguin', 'exploded')] That the ordering is preserved makes an odict useful for a couple of situations: @@ -90,10 +90,10 @@ well as mappings like a dict does. Unlike a regular dictionary, the insertion order is preserved. ->>> d = odict([('a', 'b'), ('c', 'd')]) ->>> d.update({'foo': 'bar'}) ->>> d -collections.odict([('a', 'b'), ('c', 'd'), ('foo', 'bar')]) + >>> d = odict([('a', 'b'), ('c', 'd')]) + >>> d.update({'foo': 'bar'}) + >>> d + collections.odict([('a', 'b'), ('c', 'd'), ('foo', 'bar')]) If ordered dicts are updated from regular dicts, the ordering of new keys is of course undefined. @@ -102,13 +102,13 @@ ``items()`` return the values ordered by the time the key was first inserted: ->>> d['spam'] = 'eggs' ->>> d.keys() -['a', 'c', 'foo', 'spam'] ->>> d.values() -['b', 'd', 'bar', 'eggs'] ->>> d.items() -[('a', 'b'), ('c', 'd'), ('foo', 'bar'), ('spam', 'eggs')] + >>> d['spam'] = 'eggs' + >>> d.keys() + ['a', 'c', 'foo', 'spam'] + >>> d.values() + ['b', 'd', 'bar', 'eggs'] + >>> d.items() + [('a', 'b'), ('c', 'd'), ('foo', 'bar'), ('spam', 'eggs')] New methods not available on dict: From buildbot at python.org Fri Feb 27 05:41:10 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 27 Feb 2009 04:41:10 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090227044111.0728E1E4002@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/340 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_xmlrpc make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Feb 27 06:04:47 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 27 Feb 2009 06:04:47 +0100 (CET) Subject: [Python-checkins] r70014 - peps/trunk/pep-0372.txt Message-ID: <20090227050447.EA19D1E4012@bag.python.org> Author: raymond.hettinger Date: Fri Feb 27 06:04:47 2009 New Revision: 70014 Log: Note performance trade-offs of various design strategies. Modified: peps/trunk/pep-0372.txt Modified: peps/trunk/pep-0372.txt ============================================================================== --- peps/trunk/pep-0372.txt (original) +++ peps/trunk/pep-0372.txt Fri Feb 27 06:04:47 2009 @@ -224,6 +224,24 @@ explicitly craft an order based comparison: ``list(od1.items())==list(od2.items())``. +What are the trade-offs of the possible underlying data structures? + + * Keeping a sorted list of keys is very fast for all operations except + __delitem__() which becomes an O(n) exercise. This structure leads to + very simple code and little wasted space. + + * Keeping a separate dictionary to record insertion sequence numbers makes + the code a little bit more complex. All of the basic operations are O(1) + but the constant factor is increased for __setitem__() and __delitem__() + meaning that every use case will have to pay for this speedup (since all + buildup go through __setitem__). Also, the first traveral incurs a + one-time ``O(n log n)`` sorting cost. The storage costs are double that + for the sorted-list-of-keys approach. + + * A version written in C could use a linked list. The code would be more + complex than the other two approaches but it would conserve space and + would keep the same big-oh performance as regular dictionaries. It is + the fastest and most space efficient. Reference Implementation ======================== From buildbot at python.org Fri Feb 27 06:13:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 27 Feb 2009 05:13:17 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090227051317.9A6E01E4002@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/182 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 Fri Feb 27 08:47:32 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 27 Feb 2009 08:47:32 +0100 (CET) Subject: [Python-checkins] r70015 - python/branches/py3k/Lib/_abcoll.py Message-ID: <20090227074732.8A3DC1E4002@bag.python.org> Author: raymond.hettinger Date: Fri Feb 27 08:47:32 2009 New Revision: 70015 Log: Give mapping views a usable repr. 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 Fri Feb 27 08:47:32 2009 @@ -392,6 +392,9 @@ def __len__(self): return len(self._mapping) + def __repr__(self): + return '{0.__class__.__name__}({0._mapping!r})'.format(self) + class KeysView(MappingView, Set): From python-checkins at python.org Fri Feb 27 09:09:47 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 27 Feb 2009 09:09:47 +0100 (CET) Subject: [Python-checkins] r70016 - python/trunk/Lib/_abcoll.py Message-ID: <20090227080947.875981E4002@bag.python.org> Author: raymond.hettinger Date: Fri Feb 27 09:09:47 2009 New Revision: 70016 Log: Give mapping views a usable repr. Modified: python/trunk/Lib/_abcoll.py Modified: python/trunk/Lib/_abcoll.py ============================================================================== --- python/trunk/Lib/_abcoll.py (original) +++ python/trunk/Lib/_abcoll.py Fri Feb 27 09:09:47 2009 @@ -371,6 +371,9 @@ def __len__(self): return len(self._mapping) + def __repr__(self): + return '{0.__class__.__name__}({0._mapping!r})'.format(self) + class KeysView(MappingView, Set): From buildbot at python.org Fri Feb 27 09:37:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 27 Feb 2009 08:37:53 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090227083753.84C651E4002@bag.python.org> The Buildbot has detected a new failure of OS X x86 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/189 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/bsddb/test/test_thread.py", line 306, in readerThread rec = dbutils.DeadlockWrap(c.next, max_retries=10) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/bsddb/dbutils.py", line 68, in DeadlockWrap return function(*_args, **_kwargs) DBLockDeadlockError: (-30995, 'DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock') 1 test failed: test_runpy make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 27 09:59:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 27 Feb 2009 08:59:31 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090227085931.20E351E4002@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/353 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: 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.x.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py", line 149, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From nnorwitz at gmail.com Fri Feb 27 11:22:01 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 27 Feb 2009 05:22:01 -0500 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090227102201.GA658@python.psfb.org> More important issues: ---------------------- test_poplib leaked [0, 0, 213] references, sum=213 Less important issues: ---------------------- test_cmd_line leaked [25, -25, 25] references, sum=25 test_smtplib leaked [-103, 20, -19] references, sum=-102 test_socketserver leaked [-84, 0, 0] references, sum=-84 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 From python-checkins at python.org Fri Feb 27 13:53:35 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 27 Feb 2009 13:53:35 +0100 (CET) Subject: [Python-checkins] r70017 - in python/trunk: Lib/distutils/README Lib/distutils/command/build_ext.py Lib/distutils/command/install.py Lib/distutils/command/upload.py Lib/distutils/tests/test_build_ext.py Lib/distutils/tests/test_install.py Misc/NEWS Message-ID: <20090227125335.862241E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 27 13:53:34 2009 New Revision: 70017 Log: Issue #5052: make Distutils compatible with 2.3 again. Modified: python/trunk/Lib/distutils/README python/trunk/Lib/distutils/command/build_ext.py python/trunk/Lib/distutils/command/install.py python/trunk/Lib/distutils/command/upload.py python/trunk/Lib/distutils/tests/test_build_ext.py python/trunk/Lib/distutils/tests/test_install.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/README ============================================================================== --- python/trunk/Lib/distutils/README (original) +++ python/trunk/Lib/distutils/README Fri Feb 27 13:53:34 2009 @@ -8,4 +8,6 @@ http://www.python.org/sigs/distutils-sig/ +WARNING : Distutils must remain compatible with 2.3 + $Id$ 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 Fri Feb 27 13:53:34 2009 @@ -8,7 +8,6 @@ import sys, os, string, re from types import * -from site import USER_BASE from distutils.core import Command from distutils.errors import * from distutils.sysconfig import customize_compiler, get_python_version @@ -17,6 +16,14 @@ from distutils.util import get_platform from distutils import log +# this keeps compatibility from 2.3 to 2.5 +if sys.version < "2.6": + USER_BASE = None + HAS_USER_SITE = False +else: + from site import USER_BASE + HAS_USER_SITE = True + if os.name == 'nt': from distutils.msvccompiler import get_build_version MSVC_VERSION = int(get_build_version()) @@ -92,11 +99,14 @@ "list of SWIG command line options"), ('swig=', None, "path to the SWIG executable"), - ('user', None, - "add user include, library and rpath"), ] - boolean_options = ['inplace', 'debug', 'force', 'swig-cpp', 'user'] + boolean_options = ['inplace', 'debug', 'force', 'swig-cpp'] + + if HAS_USER_SITE: + user_options.append(('user', None, + "add user include, library and rpath")) + boolean_options.append('user') help_options = [ ('help-compiler', None, Modified: python/trunk/Lib/distutils/command/install.py ============================================================================== --- python/trunk/Lib/distutils/command/install.py (original) +++ python/trunk/Lib/distutils/command/install.py Fri Feb 27 13:53:34 2009 @@ -16,9 +16,16 @@ from distutils.util import convert_path, subst_vars, change_root from distutils.util import get_platform from distutils.errors import DistutilsOptionError -from site import USER_BASE -from site import USER_SITE +# this keeps compatibility from 2.3 to 2.5 +if sys.version < "2.6": + USER_BASE = None + USER_SITE = None + HAS_USER_SITE = False +else: + from site import USER_BASE + from site import USER_SITE + HAS_USER_SITE = True if sys.version < "2.2": WINDOWS_SCHEME = { @@ -52,21 +59,7 @@ 'scripts': '$base/bin', 'data' : '$base', }, - 'unix_user': { - 'purelib': '$usersite', - 'platlib': '$usersite', - 'headers': '$userbase/include/python$py_version_short/$dist_name', - 'scripts': '$userbase/bin', - 'data' : '$userbase', - }, 'nt': WINDOWS_SCHEME, - 'nt_user': { - 'purelib': '$usersite', - 'platlib': '$usersite', - 'headers': '$userbase/Python$py_version_nodot/Include/$dist_name', - 'scripts': '$userbase/Scripts', - 'data' : '$userbase', - }, 'mac': { 'purelib': '$base/Lib/site-packages', 'platlib': '$base/Lib/site-packages', @@ -74,13 +67,7 @@ 'scripts': '$base/Scripts', 'data' : '$base', }, - 'mac_user': { - 'purelib': '$usersite', - 'platlib': '$usersite', - 'headers': '$userbase/$py_version_short/include/$dist_name', - 'scripts': '$userbase/bin', - 'data' : '$userbase', - }, + 'os2': { 'purelib': '$base/Lib/site-packages', 'platlib': '$base/Lib/site-packages', @@ -88,14 +75,41 @@ 'scripts': '$base/Scripts', 'data' : '$base', }, - 'os2_home': { + } + +# user site schemes +if HAS_USER_SITE: + INSTALL_SCHEMES['nt_user'] = { + 'purelib': '$usersite', + 'platlib': '$usersite', + 'headers': '$userbase/Python$py_version_nodot/Include/$dist_name', + 'scripts': '$userbase/Scripts', + 'data' : '$userbase', + } + + INSTALL_SCHEMES['unix_user'] = { 'purelib': '$usersite', 'platlib': '$usersite', 'headers': '$userbase/include/python$py_version_short/$dist_name', 'scripts': '$userbase/bin', 'data' : '$userbase', - }, - } + } + + INSTALL_SCHEMES['mac_user'] = { + 'purelib': '$usersite', + 'platlib': '$usersite', + 'headers': '$userbase/$py_version_short/include/$dist_name', + 'scripts': '$userbase/bin', + 'data' : '$userbase', + } + + INSTALL_SCHEMES['os2_home'] = { + 'purelib': '$usersite', + 'platlib': '$usersite', + 'headers': '$userbase/include/python$py_version_short/$dist_name', + 'scripts': '$userbase/bin', + 'data' : '$userbase', + } # The keys to an installation scheme; if any new types of files are to be # installed, be sure to add an entry to every installation scheme above, @@ -115,8 +129,6 @@ "(Unix only) prefix for platform-specific files"), ('home=', None, "(Unix only) home directory to install under"), - ('user', None, - "install in user site-package '%s'" % USER_SITE), # Or, just set the base director(y|ies) ('install-base=', None, @@ -168,7 +180,13 @@ "filename in which to record list of installed files"), ] - boolean_options = ['compile', 'force', 'skip-build', 'user'] + boolean_options = ['compile', 'force', 'skip-build'] + + if HAS_USER_SITE: + user_options.append(('user', None, + "install in user site-package '%s'" % USER_SITE)) + boolean_options.append('user') + negative_opt = {'no-compile' : 'compile'} @@ -320,9 +338,12 @@ 'prefix': prefix, 'sys_exec_prefix': exec_prefix, 'exec_prefix': exec_prefix, - 'userbase': self.install_userbase, - 'usersite': self.install_usersite, } + + if HAS_USER_SITE: + self.config_vars['userbase'] = self.install_userbase + self.config_vars['usersite'] = self.install_usersite + self.expand_basedirs() self.dump_dirs("post-expand_basedirs()") Modified: python/trunk/Lib/distutils/command/upload.py ============================================================================== --- python/trunk/Lib/distutils/command/upload.py (original) +++ python/trunk/Lib/distutils/command/upload.py Fri Feb 27 13:53:34 2009 @@ -6,7 +6,7 @@ from distutils.core import PyPIRCCommand from distutils.spawn import spawn from distutils import log -from hashlib import md5 +import sys import os import socket import platform @@ -16,6 +16,11 @@ import cStringIO as StringIO from ConfigParser import ConfigParser +# this keeps compatibility for 2.3 and 2.4 +if sys.version < "2.5": + from md5 import md5 +else: + from hashlib import md5 class upload(PyPIRCCommand): 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 Fri Feb 27 13:53:34 2009 @@ -24,11 +24,17 @@ def setUp(self): # Create a simple test environment # Note that we're making changes to sys.path - support.TempdirManager.setUp(self) + super(BuildExtTestCase, self).setUp() self.tmp_dir = self.mkdtemp() self.sys_path = sys.path[:] sys.path.append(self.tmp_dir) shutil.copy(_get_source_filename(), self.tmp_dir) + if sys.version > "2.6": + import site + self.old_user_base = site.USER_BASE + site.USER_BASE = self.mkdtemp() + from distutils.command import build_ext + build_ext.USER_BASE = site.USER_BASE def test_build_ext(self): global ALREADY_TESTED @@ -76,7 +82,13 @@ # Get everything back to normal test_support.unload('xx') sys.path = self.sys_path - support.TempdirManager.tearDown(self) + if sys.version > "2.6": + import site + site.USER_BASE = self.old_user_base + from distutils.command import build_ext + build_ext.USER_BASE = self.old_user_base + + super(BuildExtTestCase, self).tearDown() def test_solaris_enable_shared(self): dist = Distribution({'name': 'xx'}) @@ -99,6 +111,37 @@ # make sur we get some lobrary dirs under solaris self.assert_(len(cmd.library_dirs) > 0) + def test_user_site(self): + # site.USER_SITE was introduced in 2.6 + if sys.version < '2.6': + return + + import site + dist = Distribution({'name': 'xx'}) + cmd = build_ext(dist) + + # making sure the suer option is there + options = [name for name, short, lable in + cmd.user_options] + self.assert_('user' in options) + + # setting a value + cmd.user = 1 + + # setting user based lib and include + lib = os.path.join(site.USER_BASE, 'lib') + incl = os.path.join(site.USER_BASE, 'include') + os.mkdir(lib) + os.mkdir(incl) + + # let's run finalize + cmd.ensure_finalized() + + # see if include_dirs and library_dirs + # were set + self.assert_(lib in cmd.library_dirs) + self.assert_(incl in cmd.include_dirs) + def test_suite(): src = _get_source_filename() if not os.path.exists(src): Modified: python/trunk/Lib/distutils/tests/test_install.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_install.py (original) +++ python/trunk/Lib/distutils/tests/test_install.py Fri Feb 27 13:53:34 2009 @@ -1,9 +1,14 @@ """Tests for distutils.command.install.""" import os +import os.path +import sys import unittest +import site from distutils.command.install import install +from distutils.command import install as install_module +from distutils.command.install import INSTALL_SCHEMES from distutils.core import Distribution from distutils.tests import support @@ -47,6 +52,65 @@ check_path(cmd.install_scripts, os.path.join(destination, "bin")) check_path(cmd.install_data, destination) + def test_user_site(self): + # site.USER_SITE was introduced in 2.6 + if sys.version < '2.6': + return + + # preparing the environement for the test + self.old_user_base = site.USER_BASE + self.old_user_site = site.USER_SITE + self.tmpdir = self.mkdtemp() + self.user_base = os.path.join(self.tmpdir, 'B') + self.user_site = os.path.join(self.tmpdir, 'S') + site.USER_BASE = self.user_base + site.USER_SITE = self.user_site + install_module.USER_BASE = self.user_base + install_module.USER_SITE = self.user_site + + def _expanduser(path): + return self.tmpdir + self.old_expand = os.path.expanduser + os.path.expanduser = _expanduser + + try: + # this is the actual test + self._test_user_site() + finally: + site.USER_BASE = self.old_user_base + site.USER_SITE = self.old_user_site + install_module.USER_BASE = self.old_user_base + install_module.USER_SITE = self.old_user_site + os.path.expanduser = self.old_expand + + def _test_user_site(self): + for key in ('nt_user', 'unix_user', 'os2_home'): + self.assert_(key in INSTALL_SCHEMES) + + dist = Distribution({'name': 'xx'}) + cmd = install(dist) + + # making sure the user option is there + options = [name for name, short, lable in + cmd.user_options] + self.assert_('user' in options) + + # setting a value + cmd.user = 1 + + # user base and site shouldn't be created yet + self.assert_(not os.path.exists(self.user_base)) + self.assert_(not os.path.exists(self.user_site)) + + # let's run finalize + cmd.ensure_finalized() + + # now they should + self.assert_(os.path.exists(self.user_base)) + self.assert_(os.path.exists(self.user_site)) + + self.assert_('userbase' in cmd.config_vars) + self.assert_('usersite' in cmd.config_vars) def test_suite(): return unittest.makeSuite(InstallTestCase) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Feb 27 13:53:34 2009 @@ -166,6 +166,8 @@ Library ------- +- Issue #5052: make Distutils compatible with 2.3 again. + - Deprecated methods of symtable.Symbol have been removed: is_keywordarg(), is_vararg(), and is_in_tuple(). From python-checkins at python.org Fri Feb 27 13:54:30 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 27 Feb 2009 13:54:30 +0100 (CET) Subject: [Python-checkins] r70018 - python/branches/release26-maint Message-ID: <20090227125430.2A7211E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 27 13:54:29 2009 New Revision: 70018 Log: Blocked revisions 70017 via svnmerge ........ r70017 | tarek.ziade | 2009-02-27 13:53:34 +0100 (Fri, 27 Feb 2009) | 1 line Issue #5052: make Distutils compatible with 2.3 again. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri Feb 27 13:58:57 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 27 Feb 2009 13:58:57 +0100 (CET) Subject: [Python-checkins] r70019 - in python/branches/py3k: Lib/distutils/README Lib/distutils/command/build_ext.py Lib/distutils/command/install.py Lib/distutils/command/upload.py Lib/distutils/tests/test_build_ext.py Lib/distutils/tests/test_install.py Misc/NEWS Message-ID: <20090227125857.A9ED91E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 27 13:58:56 2009 New Revision: 70019 Log: Merged revisions 70017 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70017 | tarek.ziade | 2009-02-27 13:53:34 +0100 (Fri, 27 Feb 2009) | 1 line Issue #5052: make Distutils compatible with 2.3 again. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/README python/branches/py3k/Lib/distutils/command/build_ext.py python/branches/py3k/Lib/distutils/command/install.py python/branches/py3k/Lib/distutils/command/upload.py python/branches/py3k/Lib/distutils/tests/test_build_ext.py python/branches/py3k/Lib/distutils/tests/test_install.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/distutils/README ============================================================================== --- python/branches/py3k/Lib/distutils/README (original) +++ python/branches/py3k/Lib/distutils/README Fri Feb 27 13:58:56 2009 @@ -8,4 +8,6 @@ http://www.python.org/sigs/distutils-sig/ +WARNING : Distutils must remain compatible with 2.3 + $Id$ 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 Fri Feb 27 13:58:56 2009 @@ -7,7 +7,6 @@ __revision__ = "$Id$" import sys, os, re -from site import USER_BASE from distutils.core import Command from distutils.errors import * from distutils.sysconfig import customize_compiler, get_python_version @@ -16,6 +15,14 @@ from distutils.util import get_platform from distutils import log +# this keeps compatibility from 2.3 to 2.5 +if sys.version < "2.6": + USER_BASE = None + HAS_USER_SITE = False +else: + from site import USER_BASE + HAS_USER_SITE = True + if os.name == 'nt': from distutils.msvccompiler import get_build_version MSVC_VERSION = int(get_build_version()) @@ -91,11 +98,14 @@ "list of SWIG command line options"), ('swig=', None, "path to the SWIG executable"), - ('user', None, - "add user include, library and rpath"), ] - boolean_options = ['inplace', 'debug', 'force', 'swig-cpp', 'user'] + boolean_options = ['inplace', 'debug', 'force', 'swig-cpp'] + + if HAS_USER_SITE: + user_options.append(('user', None, + "add user include, library and rpath")) + boolean_options.append('user') help_options = [ ('help-compiler', None, Modified: python/branches/py3k/Lib/distutils/command/install.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/install.py (original) +++ python/branches/py3k/Lib/distutils/command/install.py Fri Feb 27 13:58:56 2009 @@ -15,9 +15,16 @@ from distutils.util import convert_path, subst_vars, change_root from distutils.util import get_platform from distutils.errors import DistutilsOptionError -from site import USER_BASE -from site import USER_SITE +# this keeps compatibility from 2.3 to 2.5 +if sys.version < "2.6": + USER_BASE = None + USER_SITE = None + HAS_USER_SITE = False +else: + from site import USER_BASE + from site import USER_SITE + HAS_USER_SITE = True if sys.version < "2.2": WINDOWS_SCHEME = { @@ -51,21 +58,7 @@ 'scripts': '$base/bin', 'data' : '$base', }, - 'unix_user': { - 'purelib': '$usersite', - 'platlib': '$usersite', - 'headers': '$userbase/include/python$py_version_short/$dist_name', - 'scripts': '$userbase/bin', - 'data' : '$userbase', - }, 'nt': WINDOWS_SCHEME, - 'nt_user': { - 'purelib': '$usersite', - 'platlib': '$usersite', - 'headers': '$userbase/Python$py_version_nodot/Include/$dist_name', - 'scripts': '$userbase/Scripts', - 'data' : '$userbase', - }, 'mac': { 'purelib': '$base/Lib/site-packages', 'platlib': '$base/Lib/site-packages', @@ -73,13 +66,7 @@ 'scripts': '$base/Scripts', 'data' : '$base', }, - 'mac_user': { - 'purelib': '$usersite', - 'platlib': '$usersite', - 'headers': '$userbase/$py_version_short/include/$dist_name', - 'scripts': '$userbase/bin', - 'data' : '$userbase', - }, + 'os2': { 'purelib': '$base/Lib/site-packages', 'platlib': '$base/Lib/site-packages', @@ -87,14 +74,41 @@ 'scripts': '$base/Scripts', 'data' : '$base', }, - 'os2_home': { + } + +# user site schemes +if HAS_USER_SITE: + INSTALL_SCHEMES['nt_user'] = { + 'purelib': '$usersite', + 'platlib': '$usersite', + 'headers': '$userbase/Python$py_version_nodot/Include/$dist_name', + 'scripts': '$userbase/Scripts', + 'data' : '$userbase', + } + + INSTALL_SCHEMES['unix_user'] = { 'purelib': '$usersite', 'platlib': '$usersite', 'headers': '$userbase/include/python$py_version_short/$dist_name', 'scripts': '$userbase/bin', 'data' : '$userbase', - }, - } + } + + INSTALL_SCHEMES['mac_user'] = { + 'purelib': '$usersite', + 'platlib': '$usersite', + 'headers': '$userbase/$py_version_short/include/$dist_name', + 'scripts': '$userbase/bin', + 'data' : '$userbase', + } + + INSTALL_SCHEMES['os2_home'] = { + 'purelib': '$usersite', + 'platlib': '$usersite', + 'headers': '$userbase/include/python$py_version_short/$dist_name', + 'scripts': '$userbase/bin', + 'data' : '$userbase', + } # The keys to an installation scheme; if any new types of files are to be # installed, be sure to add an entry to every installation scheme above, @@ -114,8 +128,6 @@ "(Unix only) prefix for platform-specific files"), ('home=', None, "(Unix only) home directory to install under"), - ('user', None, - "install in user site-package '%s'" % USER_SITE), # Or, just set the base director(y|ies) ('install-base=', None, @@ -167,7 +179,13 @@ "filename in which to record list of installed files"), ] - boolean_options = ['compile', 'force', 'skip-build', 'user'] + boolean_options = ['compile', 'force', 'skip-build'] + + if HAS_USER_SITE: + user_options.append(('user', None, + "install in user site-package '%s'" % USER_SITE)) + boolean_options.append('user') + negative_opt = {'no-compile' : 'compile'} @@ -319,9 +337,12 @@ 'prefix': prefix, 'sys_exec_prefix': exec_prefix, 'exec_prefix': exec_prefix, - 'userbase': self.install_userbase, - 'usersite': self.install_usersite, } + + if HAS_USER_SITE: + self.config_vars['userbase'] = self.install_userbase + self.config_vars['usersite'] = self.install_usersite + self.expand_basedirs() self.dump_dirs("post-expand_basedirs()") Modified: python/branches/py3k/Lib/distutils/command/upload.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/upload.py (original) +++ python/branches/py3k/Lib/distutils/command/upload.py Fri Feb 27 13:58:56 2009 @@ -6,7 +6,7 @@ from distutils.core import PyPIRCCommand from distutils.spawn import spawn from distutils import log -from hashlib import md5 +import sys import os, io import socket import platform @@ -15,6 +15,12 @@ import base64 import urllib.parse +# this keeps compatibility for 2.3 and 2.4 +if sys.version < "2.5": + from md5 import md5 +else: + from hashlib import md5 + class upload(PyPIRCCommand): description = "upload binary package to PyPI" 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 Fri Feb 27 13:58:56 2009 @@ -24,11 +24,17 @@ def setUp(self): # Create a simple test environment # Note that we're making changes to sys.path - TempdirManager.setUp(self) + super(BuildExtTestCase, self).setUp() self.tmp_dir = self.mkdtemp() self.sys_path = sys.path[:] sys.path.append(self.tmp_dir) shutil.copy(_get_source_filename(), self.tmp_dir) + if sys.version > "2.6": + import site + self.old_user_base = site.USER_BASE + site.USER_BASE = self.mkdtemp() + from distutils.command import build_ext + build_ext.USER_BASE = site.USER_BASE def test_build_ext(self): global ALREADY_TESTED @@ -76,7 +82,12 @@ # Get everything back to normal support.unload('xx') sys.path = self.sys_path - TempdirManager.tearDown(self) + if sys.version > "2.6": + import site + site.USER_BASE = self.old_user_base + from distutils.command import build_ext + build_ext.USER_BASE = self.old_user_base + super(BuildExtTestCase, self).tearDown() def test_solaris_enable_shared(self): dist = Distribution({'name': 'xx'}) @@ -99,6 +110,37 @@ # make sur we get some lobrary dirs under solaris self.assert_(len(cmd.library_dirs) > 0) + def test_user_site(self): + # site.USER_SITE was introduced in 2.6 + if sys.version < '2.6': + return + + import site + dist = Distribution({'name': 'xx'}) + cmd = build_ext(dist) + + # making sure the suer option is there + options = [name for name, short, lable in + cmd.user_options] + self.assert_('user' in options) + + # setting a value + cmd.user = 1 + + # setting user based lib and include + lib = os.path.join(site.USER_BASE, 'lib') + incl = os.path.join(site.USER_BASE, 'include') + os.mkdir(lib) + os.mkdir(incl) + + # let's run finalize + cmd.ensure_finalized() + + # see if include_dirs and library_dirs + # were set + self.assert_(lib in cmd.library_dirs) + self.assert_(incl in cmd.include_dirs) + def test_suite(): src = _get_source_filename() if not os.path.exists(src): Modified: python/branches/py3k/Lib/distutils/tests/test_install.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_install.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_install.py Fri Feb 27 13:58:56 2009 @@ -1,9 +1,14 @@ """Tests for distutils.command.install.""" import os +import os.path +import sys import unittest +import site from distutils.command.install import install +from distutils.command import install as install_module +from distutils.command.install import INSTALL_SCHEMES from distutils.core import Distribution from distutils.tests import support @@ -47,6 +52,65 @@ check_path(cmd.install_scripts, os.path.join(destination, "bin")) check_path(cmd.install_data, destination) + def test_user_site(self): + # site.USER_SITE was introduced in 2.6 + if sys.version < '2.6': + return + + # preparing the environement for the test + self.old_user_base = site.USER_BASE + self.old_user_site = site.USER_SITE + self.tmpdir = self.mkdtemp() + self.user_base = os.path.join(self.tmpdir, 'B') + self.user_site = os.path.join(self.tmpdir, 'S') + site.USER_BASE = self.user_base + site.USER_SITE = self.user_site + install_module.USER_BASE = self.user_base + install_module.USER_SITE = self.user_site + + def _expanduser(path): + return self.tmpdir + self.old_expand = os.path.expanduser + os.path.expanduser = _expanduser + + try: + # this is the actual test + self._test_user_site() + finally: + site.USER_BASE = self.old_user_base + site.USER_SITE = self.old_user_site + install_module.USER_BASE = self.old_user_base + install_module.USER_SITE = self.old_user_site + os.path.expanduser = self.old_expand + + def _test_user_site(self): + for key in ('nt_user', 'unix_user', 'os2_home'): + self.assert_(key in INSTALL_SCHEMES) + + dist = Distribution({'name': 'xx'}) + cmd = install(dist) + + # making sure the user option is there + options = [name for name, short, lable in + cmd.user_options] + self.assert_('user' in options) + + # setting a value + cmd.user = 1 + + # user base and site shouldn't be created yet + self.assert_(not os.path.exists(self.user_base)) + self.assert_(not os.path.exists(self.user_site)) + + # let's run finalize + cmd.ensure_finalized() + + # now they should + self.assert_(os.path.exists(self.user_base)) + self.assert_(os.path.exists(self.user_site)) + + self.assert_('userbase' in cmd.config_vars) + self.assert_('usersite' in cmd.config_vars) def test_suite(): return unittest.makeSuite(InstallTestCase) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri Feb 27 13:58:56 2009 @@ -172,6 +172,9 @@ Library ------- + +- Issue #5052: make Distutils compatible with 2.3 again. + - Issue #5316: Fixed buildbot failures introduced by multiple inheritance in Distutils tests. From python-checkins at python.org Fri Feb 27 14:00:45 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 27 Feb 2009 14:00:45 +0100 (CET) Subject: [Python-checkins] r70020 - python/branches/release30-maint Message-ID: <20090227130045.5AC941E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 27 14:00:45 2009 New Revision: 70020 Log: Blocked revisions 70019 via svnmerge ................ r70019 | tarek.ziade | 2009-02-27 13:58:56 +0100 (Fri, 27 Feb 2009) | 9 lines Merged revisions 70017 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70017 | tarek.ziade | 2009-02-27 13:53:34 +0100 (Fri, 27 Feb 2009) | 1 line Issue #5052: make Distutils compatible with 2.3 again. ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Fri Feb 27 14:05:47 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 27 Feb 2009 14:05:47 +0100 (CET) Subject: [Python-checkins] r70021 - peps/trunk/pep-0291.txt Message-ID: <20090227130547.8EF621E4002@bag.python.org> Author: tarek.ziade Date: Fri Feb 27 14:05:47 2009 New Revision: 70021 Log: distutils is back into PEP 291 Modified: peps/trunk/pep-0291.txt Modified: peps/trunk/pep-0291.txt ============================================================================== --- peps/trunk/pep-0291.txt (original) +++ peps/trunk/pep-0291.txt Fri Feb 27 14:05:47 2009 @@ -96,6 +96,7 @@ compiler Jeremy Hylton 2.1 ctypes Thomas Heller 2.3 decimal Raymond Hettinger 2.3 [2] + distutils Tarek Ziade 2.3 email Barry Warsaw 2.1 / 2.3 [1] logging Vinay Sajip 1.5.2 modulefinder Thomas Heller 2.2 From buildbot at python.org Fri Feb 27 15:34:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 27 Feb 2009 14:34:56 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090227143457.1742E1E4002@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/143 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_unicodedata make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Feb 27 17:23:19 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 27 Feb 2009 17:23:19 +0100 (CET) Subject: [Python-checkins] r70022 - python/trunk/Doc/library/stdtypes.rst Message-ID: <20090227162319.46A491E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 27 17:23:18 2009 New Revision: 70022 Log: #5361: fix typo. 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 Fri Feb 27 17:23:18 2009 @@ -1327,7 +1327,7 @@ +------------+-----------------------------------------------------+-------+ | ``'o'`` | Signed octal value. | \(1) | +------------+-----------------------------------------------------+-------+ -| ``'u'`` | Obselete type -- it is identical to ``'d'``. | \(7) | +| ``'u'`` | Obsolete type -- it is identical to ``'d'``. | \(7) | +------------+-----------------------------------------------------+-------+ | ``'x'`` | Signed hexadecimal (lowercase). | \(2) | +------------+-----------------------------------------------------+-------+ From python-checkins at python.org Fri Feb 27 17:39:27 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 27 Feb 2009 17:39:27 +0100 (CET) Subject: [Python-checkins] r70023 - python/trunk/Doc/library/filecmp.rst Message-ID: <20090227163927.95A8A1E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 27 17:39:26 2009 New Revision: 70023 Log: #5363: fix cmpfiles() docs. Another instance where a prose description is twice as long as the code. Modified: python/trunk/Doc/library/filecmp.rst Modified: python/trunk/Doc/library/filecmp.rst ============================================================================== --- python/trunk/Doc/library/filecmp.rst (original) +++ python/trunk/Doc/library/filecmp.rst Fri Feb 27 17:39:26 2009 @@ -31,17 +31,24 @@ .. function:: cmpfiles(dir1, dir2, common[, shallow]) - Returns three lists of file names: *match*, *mismatch*, *errors*. *match* - contains the list of files match in both directories, *mismatch* includes the - names of those that don't, and *errros* lists the names of files which could not - be compared. Files may be listed in *errors* because the user may lack - permission to read them or many other reasons, but always that the comparison - could not be done for some reason. + Compare the files in the two directories *dir1* and *dir2* whose names are + given by *common*. - The *common* parameter is a list of file names found in both directories. The - *shallow* parameter has the same meaning and default value as for + Returns three lists of file names: *match*, *mismatch*, + *errors*. *match* contains the list of files that match, *mismatch* contains + the names of those that don't, and *errors* lists the names of files which + could not be compared. Files are listed in *errors* if they don't exist in + one of the directories, the user lacks permission to read them or if the + comparison could not be done for some other reason. + + The *shallow* parameter has the same meaning and default value as for :func:`filecmp.cmp`. + For example, ``cmpfiles('a', 'b', ['c', 'd/e'])`` will compare ``a/c`` with + ``b/c`` and ``a/d/e`` with ``b/d/e``. ``'c'`` and ``'d/e'`` will each be in + one of the three returned lists. + + Example:: >>> import filecmp From python-checkins at python.org Fri Feb 27 17:46:46 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 27 Feb 2009 17:46:46 +0100 (CET) Subject: [Python-checkins] r70024 - python/branches/py3k/Doc/library/urllib.request.rst Message-ID: <20090227164646.E9BA21E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 27 17:46:46 2009 New Revision: 70024 Log: #5357: fix incomprehensible paragraph in urlopen() doc. Modified: python/branches/py3k/Doc/library/urllib.request.rst Modified: python/branches/py3k/Doc/library/urllib.request.rst ============================================================================== --- python/branches/py3k/Doc/library/urllib.request.rst (original) +++ python/branches/py3k/Doc/library/urllib.request.rst Fri Feb 27 17:46:46 2009 @@ -37,20 +37,20 @@ * :meth:`geturl` --- return the URL of the resource retrieved, commonly used to determine if a redirect was followed - * :meth:`info` --- return the meta-information of the page, such as headers, in - the form of an ``http.client.HTTPMessage`` instance - (see `Quick Reference to HTTP Headers `_) + * :meth:`info` --- return the meta-information of the page, such as headers, + in the form of an ``http.client.HTTPMessage`` instance (see `Quick + Reference to HTTP Headers `_) Raises :exc:`URLError` on errors. - Note that ``None`` may be returned if no handler handles the request (though the - default installed global :class:`OpenerDirector` uses :class:`UnknownHandler` to - ensure this never happens). - The urlopen function from the previous version, Python 2.6 and earlier, of - the module urllib has been discontinued as urlopen can return the - file-object as the previous. The proxy handling, which in earlier was passed - as a dict parameter to urlopen can be availed by the use of - :class:`ProxyHandler` objects. + Note that ``None`` may be returned if no handler handles the request (though + the default installed global :class:`OpenerDirector` uses + :class:`UnknownHandler` to ensure this never happens). + + The legacy ``urllib.urlopen`` function from Python 2.6 and earlier has been + discontinued; :func:`urlopen` corresponds to the old ``urllib2.urlopen``. + Proxy handling, which was done by passing a dictionary parameter to + ``urllib.urlopen``, can be obtained by using :class:`ProxyHandler` objects. .. function:: install_opener(opener) From python-checkins at python.org Fri Feb 27 17:52:55 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 27 Feb 2009 17:52:55 +0100 (CET) Subject: [Python-checkins] r70025 - python/trunk/Doc/whatsnew/2.6.rst Message-ID: <20090227165255.572A61E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 27 17:52:55 2009 New Revision: 70025 Log: #5344: fix punctuation. Modified: python/trunk/Doc/whatsnew/2.6.rst Modified: python/trunk/Doc/whatsnew/2.6.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.6.rst (original) +++ python/trunk/Doc/whatsnew/2.6.rst Fri Feb 27 17:52:55 2009 @@ -270,7 +270,7 @@ The expression is evaluated, and it should result in an object that supports the context management protocol (that is, has :meth:`__enter__` and :meth:`__exit__` -methods. +methods). The object's :meth:`__enter__` is called before *with-block* is executed and therefore can run set-up code. It also may return a value that is bound to the From python-checkins at python.org Fri Feb 27 17:59:03 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 27 Feb 2009 17:59:03 +0100 (CET) Subject: [Python-checkins] r70026 - python/trunk/Doc/library/time.rst Message-ID: <20090227165903.C0BEB1E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 27 17:59:03 2009 New Revision: 70026 Log: #5365: add quick look conversion table for different time representations. Modified: python/trunk/Doc/library/time.rst Modified: python/trunk/Doc/library/time.rst ============================================================================== --- python/trunk/Doc/library/time.rst (original) +++ python/trunk/Doc/library/time.rst Fri Feb 27 17:59:03 2009 @@ -118,6 +118,24 @@ The time value sequence was changed from a tuple to a :class:`struct_time`, with the addition of attribute names for the fields. +* Use the following functions to convert between time representations: + + +-------------------------+-------------------------+-------------------------+ + | From | To | Use | + +=========================+=========================+=========================+ + | seconds since the epoch | :class:`struct_time` in | :func:`gmtime` | + | | UTC | | + +-------------------------+-------------------------+-------------------------+ + | seconds since the epoch | :class:`struct_time` in | :func:`localtime` | + | | local time | | + +-------------------------+-------------------------+-------------------------+ + | :class:`struct_time` in | seconds since the epoch | :func:`calendar.timegm` | + | UTC | | | + +-------------------------+-------------------------+-------------------------+ + | :class:`struct_time` in | seconds since the epoch | :func:`mktime` | + | local time | | | + +-------------------------+-------------------------+-------------------------+ + The module defines the following functions and data items: From python-checkins at python.org Fri Feb 27 18:03:38 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 27 Feb 2009 18:03:38 +0100 (CET) Subject: [Python-checkins] r70027 - python/branches/py3k/Doc/extending/newtypes.rst Message-ID: <20090227170338.808581E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 27 18:03:38 2009 New Revision: 70027 Log: #5360: remove RO which has been kicked from 3k. Modified: python/branches/py3k/Doc/extending/newtypes.rst Modified: python/branches/py3k/Doc/extending/newtypes.rst ============================================================================== --- python/branches/py3k/Doc/extending/newtypes.rst (original) +++ python/branches/py3k/Doc/extending/newtypes.rst Fri Feb 27 18:03:38 2009 @@ -1154,8 +1154,6 @@ +===========================+==============================================+ | :const:`READONLY` | Never writable. | +---------------------------+----------------------------------------------+ -| :const:`RO` | Shorthand for :const:`READONLY`. | -+---------------------------+----------------------------------------------+ | :const:`READ_RESTRICTED` | Not readable in restricted mode. | +---------------------------+----------------------------------------------+ | :const:`WRITE_RESTRICTED` | Not writable in restricted mode. | @@ -1165,7 +1163,6 @@ .. index:: single: READONLY - single: RO single: READ_RESTRICTED single: WRITE_RESTRICTED single: RESTRICTED From python-checkins at python.org Fri Feb 27 18:11:24 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 27 Feb 2009 18:11:24 +0100 (CET) Subject: [Python-checkins] r70028 - in python/branches/py3k/Doc/extending: newtypes.rst windows.rst Message-ID: <20090227171124.37FB21E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 27 18:11:23 2009 New Revision: 70028 Log: #5360: replace PyObject_HEAD_INIT by PyVarObject_HEAD_INIT. Modified: python/branches/py3k/Doc/extending/newtypes.rst python/branches/py3k/Doc/extending/windows.rst Modified: python/branches/py3k/Doc/extending/newtypes.rst ============================================================================== --- python/branches/py3k/Doc/extending/newtypes.rst (original) +++ python/branches/py3k/Doc/extending/newtypes.rst Fri Feb 27 18:11:23 2009 @@ -72,7 +72,7 @@ Moving on, we come to the crunch --- the type object. :: 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 */ @@ -103,11 +103,11 @@ This is so important that we're going to pick the top of it apart still further:: - PyObject_HEAD_INIT(NULL) + PyVarObject_HEAD_INIT(NULL, 0) This line is a bit of a wart; what we'd like to write is:: - PyObject_HEAD_INIT(&PyType_Type) + PyVarObject_HEAD_INIT(&PyType_Type, 0) as the type of a type object is "type", but this isn't strictly conforming C and some compilers complain. Fortunately, this member will be filled in for us by @@ -1427,7 +1427,7 @@ The statically-declared type object for instances is defined this way:: PyTypeObject PyInstance_Type = { - PyObject_HEAD_INIT(&PyType_Type) + PyVarObject_HEAD_INIT(&PyType_Type, 0) 0, "module.instance", Modified: python/branches/py3k/Doc/extending/windows.rst ============================================================================== --- python/branches/py3k/Doc/extending/windows.rst (original) +++ python/branches/py3k/Doc/extending/windows.rst Fri Feb 27 18:11:23 2009 @@ -169,11 +169,11 @@ If your module creates a new type, you may have trouble with this line:: - PyObject_HEAD_INIT(&PyType_Type) + PyVarObject_HEAD_INIT(&PyType_Type, 0) Change it to:: - PyObject_HEAD_INIT(NULL) + PyVarObject_HEAD_INIT(NULL, 0) and add the following to the module initialization function:: From python-checkins at python.org Fri Feb 27 18:52:38 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 27 Feb 2009 18:52:38 +0100 (CET) Subject: [Python-checkins] r70029 - python/branches/py3k/Modules/python.c Message-ID: <20090227175238.BFFEB1E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 27 18:52:38 2009 New Revision: 70029 Log: another instance of #804543: use strdup() when saving the result of setlocale() because it could be overwritten by subsequent setlocale()s. Modified: python/branches/py3k/Modules/python.c Modified: python/branches/py3k/Modules/python.c ============================================================================== --- python/branches/py3k/Modules/python.c (original) +++ python/branches/py3k/Modules/python.c Fri Feb 27 18:52:38 2009 @@ -37,7 +37,7 @@ fprintf(stderr, "out of memory\n"); return 1; } - oldloc = setlocale(LC_ALL, NULL); + oldloc = strdup(setlocale(LC_ALL, NULL)); setlocale(LC_ALL, ""); for (i = 0; i < argc; i++) { #ifdef HAVE_BROKEN_MBSTOWCS @@ -67,6 +67,7 @@ } } setlocale(LC_ALL, oldloc); + free(oldloc); res = Py_Main(argc, argv_copy); for (i = 0; i < argc; i++) { PyMem_Free(argv_copy2[i]); From python-checkins at python.org Fri Feb 27 18:54:11 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 27 Feb 2009 18:54:11 +0100 (CET) Subject: [Python-checkins] r70030 - in python/branches/release30-maint: Modules/python.c Message-ID: <20090227175411.6C2821E4002@bag.python.org> Author: georg.brandl Date: Fri Feb 27 18:54:11 2009 New Revision: 70030 Log: Merged revisions 70029 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ........ r70029 | georg.brandl | 2009-02-27 18:52:38 +0100 (Fr, 27 Feb 2009) | 1 line another instance of #804543: use strdup() when saving the result of setlocale() because it could be overwritten by subsequent setlocale()s. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Modules/python.c Modified: python/branches/release30-maint/Modules/python.c ============================================================================== --- python/branches/release30-maint/Modules/python.c (original) +++ python/branches/release30-maint/Modules/python.c Fri Feb 27 18:54:11 2009 @@ -37,7 +37,7 @@ fprintf(stderr, "out of memory\n"); return 1; } - oldloc = setlocale(LC_ALL, NULL); + oldloc = strdup(setlocale(LC_ALL, NULL)); setlocale(LC_ALL, ""); for (i = 0; i < argc; i++) { #ifdef HAVE_BROKEN_MBSTOWCS @@ -67,6 +67,7 @@ } } setlocale(LC_ALL, oldloc); + free(oldloc); res = Py_Main(argc, argv_copy); for (i = 0; i < argc; i++) { PyMem_Free(argv_copy2[i]); From buildbot at python.org Fri Feb 27 19:19:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 27 Feb 2009 18:19:45 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090227181945.B14A81E4055@bag.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/337 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_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 27 19:42:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 27 Feb 2009 18:42:18 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090227184218.8B04E1E4002@bag.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/156 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: georg.brandl 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 Fri Feb 27 19:48:01 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 27 Feb 2009 18:48:01 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090227184801.E27941E4002@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/355 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 Feb 27 22:23:57 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 27 Feb 2009 22:23:57 +0100 (CET) Subject: [Python-checkins] r70031 - peps/trunk/pep-0372.txt Message-ID: <20090227212357.9C6A71E4002@bag.python.org> Author: raymond.hettinger Date: Fri Feb 27 22:23:56 2009 New Revision: 70031 Log: Update notes on integration with ConfigParser and json. Modified: peps/trunk/pep-0372.txt Modified: peps/trunk/pep-0372.txt ============================================================================== --- peps/trunk/pep-0372.txt (original) +++ peps/trunk/pep-0372.txt Fri Feb 27 22:23:56 2009 @@ -181,7 +181,7 @@ dbm) is likely a better fit. It would be a mistake to try to be all things to all users. -How well does odict work with the json module and PyYAML? +How well does odict work with the json module, PyYAML, and ConfigParser? For json, the good news is that json's encoder respects odict's iteration order: @@ -189,13 +189,15 @@ >>> json.dumps(OrderedDict(items)) '{"one": 1, "two": 2, "three": 3, "four": 4, "five": 5}' - The bad news is that the object_hook for json decoders will pass in an - already built dictionary so that the order is lost before the object - hook sees it: + In Py2.6, the object_hook for json decoders passes-in an already built + dictionary so order is lost before the object hook sees it. This + problem is being fixed for Python 2.7/3.1 by adding an new hook that + preserves order (see http://bugs.python.org/issue5381 ). + With the new hook, order can be preserved: >>> jtext = '{"one": 1, "two": 2, "three": 3, "four": 4, "five": 5}' - >>> json.loads(jtext, object_hook=OrderedDict) - OrderedDict({u'four': 4, u'three': 3, u'five': 5, u'two': 2, u'one': 1}) + >>> json.loads(jtext, object_pairs_hook=OrderedDict) + OrderedDict({'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5}) For PyYAML, a full round-trip is problem free: @@ -211,6 +213,14 @@ >>> yaml.load(ytext) OrderedDict({'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5}) + For the ConfigParser module, round-tripping is problem free. Custom + dicts were added in Py2.6 specifically to support ordered dictionaries: + + >>> config = ConfigParser(dict_type=OrderedDict) + >>> config.read('myconfig.ini') + >>> config.remove_option('Log', 'error') + >>> config.write(open('myconfig.ini', 'w')) + How does odict handle equality testing? Being a dict, one might expect equality tests to not care about order. For From python-checkins at python.org Fri Feb 27 22:36:22 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 27 Feb 2009 22:36:22 +0100 (CET) Subject: [Python-checkins] r70032 - peps/trunk/pep-0372.txt Message-ID: <20090227213622.D5EB01E4002@bag.python.org> Author: raymond.hettinger Date: Fri Feb 27 22:36:22 2009 New Revision: 70032 Log: Fix markup. Modified: peps/trunk/pep-0372.txt Modified: peps/trunk/pep-0372.txt ============================================================================== --- peps/trunk/pep-0372.txt (original) +++ peps/trunk/pep-0372.txt Fri Feb 27 22:36:22 2009 @@ -135,10 +135,10 @@ The same as for regular dicts: The latter item overrides the former. This has the side-effect that the position of the first - key is used because only the value is actually overwritten: + key is used because only the value is actually overwritten:: - >>> odict([('a', 1), ('b', 2), ('a', 3)]) - collections.odict([('a', 3), ('b', 2)]) + >>> odict([('a', 1), ('b', 2), ('a', 3)]) + collections.odict([('a', 3), ('b', 2)]) This behavior is consistent with existing implementations in Python, the PHP array and the hashmap in Ruby 1.9. @@ -183,7 +183,7 @@ How well does odict work with the json module, PyYAML, and ConfigParser? - For json, the good news is that json's encoder respects odict's iteration order: + For json, the good news is that json's encoder respects odict's iteration order:: >>> items = [('one', 1), ('two', 2), ('three',3), ('four',4), ('five',5)] >>> json.dumps(OrderedDict(items)) @@ -193,13 +193,13 @@ dictionary so order is lost before the object hook sees it. This problem is being fixed for Python 2.7/3.1 by adding an new hook that preserves order (see http://bugs.python.org/issue5381 ). - With the new hook, order can be preserved: + With the new hook, order can be preserved:: >>> jtext = '{"one": 1, "two": 2, "three": 3, "four": 4, "five": 5}' >>> json.loads(jtext, object_pairs_hook=OrderedDict) OrderedDict({'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5}) - For PyYAML, a full round-trip is problem free: + For PyYAML, a full round-trip is problem free:: >>> ytext = yaml.dump(OrderedDict(items)) >>> print ytext @@ -213,8 +213,8 @@ >>> yaml.load(ytext) OrderedDict({'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5}) - For the ConfigParser module, round-tripping is problem free. Custom - dicts were added in Py2.6 specifically to support ordered dictionaries: + For the ConfigParser module, round-tripping is problem free. Custom + dicts were added in Py2.6 specifically to support ordered dictionaries:: >>> config = ConfigParser(dict_type=OrderedDict) >>> config.read('myconfig.ini') From python-checkins at python.org Fri Feb 27 22:49:51 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 27 Feb 2009 22:49:51 +0100 (CET) Subject: [Python-checkins] r70033 - in python/branches/io-c: Lib/_pyio.py Lib/io.py Lib/test/test_io.py Modules/_bufferedio.c Modules/_bytesio.c Modules/_fileio.c Modules/_iobase.c Modules/_stringio.c Modules/_textio.c Modules/io.c Message-ID: <20090227214951.73A821E4002@bag.python.org> Author: antoine.pitrou Date: Fri Feb 27 22:49:50 2009 New Revision: 70033 Log: The base classes now are ABCs. Modified: python/branches/io-c/Lib/_pyio.py python/branches/io-c/Lib/io.py python/branches/io-c/Lib/test/test_io.py python/branches/io-c/Modules/_bufferedio.c python/branches/io-c/Modules/_bytesio.c python/branches/io-c/Modules/_fileio.c python/branches/io-c/Modules/_iobase.c python/branches/io-c/Modules/_stringio.c python/branches/io-c/Modules/_textio.c python/branches/io-c/Modules/io.c Modified: python/branches/io-c/Lib/_pyio.py ============================================================================== --- python/branches/io-c/Lib/_pyio.py (original) +++ python/branches/io-c/Lib/_pyio.py Fri Feb 27 22:49:50 2009 @@ -5,18 +5,22 @@ import os import abc import codecs -#import _fileio # Import _thread instead of threading to reduce startup cost try: from _thread import allocate_lock as Lock except ImportError: from _dummy_thread import allocate_lock as Lock +import io from io import __all__ # open() uses st_blksize whenever we can DEFAULT_BUFFER_SIZE = 8 * 1024 # bytes +# NOTE: Base classes defined here are registered with the "official" ABCs +# defined in io.py. We don't use real inheritance though, because we don't +# want to inherit the C implementations. + class BlockingIOError(IOError): @@ -496,6 +500,8 @@ for line in lines: self.write(line) +io.IOBase.register(IOBase) + class RawIOBase(IOBase): @@ -551,7 +557,7 @@ """ self._unsupported("write") - +io.RawIOBase.register(RawIOBase) from _io import FileIO RawIOBase.register(FileIO) @@ -627,6 +633,8 @@ """ self._unsupported("write") +io.BufferedIOBase.register(BufferedIOBase) + class _BufferedIOMixin(BufferedIOBase): @@ -1218,6 +1226,8 @@ """ return None +io.TextIOBase.register(TextIOBase) + class IncrementalNewlineDecoder(codecs.IncrementalDecoder): r"""Codec used when reading a file in universal newlines mode. It wraps Modified: python/branches/io-c/Lib/io.py ============================================================================== --- python/branches/io-c/Lib/io.py (original) +++ python/branches/io-c/Lib/io.py Fri Feb 27 22:49:50 2009 @@ -54,24 +54,47 @@ import _io +import abc +# open() uses st_blksize whenever we can DEFAULT_BUFFER_SIZE = _io.DEFAULT_BUFFER_SIZE BlockingIOError = _io.BlockingIOError UnsupportedOperation = _io.UnsupportedOperation open = _io.open OpenWrapper = _io.open -IOBase = _io.IOBase -RawIOBase = _io.RawIOBase + +# Declaring ABCs in C is tricky so we do it here. +# Method descriptions and default implementations are inherited from the C +# version however. +class IOBase(_io._IOBase, metaclass=abc.ABCMeta): + pass + +class RawIOBase(_io._RawIOBase, IOBase): + pass + +class BufferedIOBase(_io._BufferedIOBase, IOBase): + pass + +class TextIOBase(_io._TextIOBase, IOBase): + pass + FileIO = _io.FileIO -BufferedIOBase = _io.BufferedIOBase BytesIO = _io.BytesIO StringIO = _io.StringIO BufferedReader = _io.BufferedReader BufferedWriter = _io.BufferedWriter BufferedRWPair = _io.BufferedRWPair BufferedRandom = _io.BufferedRandom -TextIOBase = _io.TextIOBase IncrementalNewlineDecoder = _io.IncrementalNewlineDecoder TextIOWrapper = _io.TextIOWrapper -# open() uses st_blksize whenever we can -DEFAULT_BUFFER_SIZE = 8 * 1024 # bytes + +RawIOBase.register(FileIO) + +BufferedIOBase.register(BytesIO) +BufferedIOBase.register(BufferedReader) +BufferedIOBase.register(BufferedWriter) +BufferedIOBase.register(BufferedRandom) +BufferedIOBase.register(BufferedRWPair) + +TextIOBase.register(StringIO) +TextIOBase.register(TextIOWrapper) Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Fri Feb 27 22:49:50 2009 @@ -28,6 +28,7 @@ import unittest import weakref import gc +import abc from itertools import chain, cycle, count from collections import deque from test import support @@ -2043,23 +2044,38 @@ gc.collect() self.assert_(wr() is None, wr) - def test_abc_inheritance(self): - # Test implementations inherit (even virtually) from their respective ABCs + def test_abcs(self): + # Test the visible base classes are ABCs. + self.assertTrue(isinstance(self.IOBase, abc.ABCMeta)) + self.assertTrue(isinstance(self.RawIOBase, abc.ABCMeta)) + self.assertTrue(isinstance(self.BufferedIOBase, abc.ABCMeta)) + self.assertTrue(isinstance(self.TextIOBase, abc.ABCMeta)) + + def _check_abc_inheritance(self, abcmodule): f = self.open(support.TESTFN, "wb", buffering=0) - self.assertTrue(isinstance(f, self.IOBase)) - self.assertTrue(isinstance(f, self.RawIOBase)) - self.assertFalse(isinstance(f, self.BufferedIOBase)) - self.assertFalse(isinstance(f, self.TextIOBase)) + self.assertTrue(isinstance(f, abcmodule.IOBase)) + self.assertTrue(isinstance(f, abcmodule.RawIOBase)) + self.assertFalse(isinstance(f, abcmodule.BufferedIOBase)) + self.assertFalse(isinstance(f, abcmodule.TextIOBase)) f = self.open(support.TESTFN, "wb") - self.assertTrue(isinstance(f, self.IOBase)) - self.assertFalse(isinstance(f, self.RawIOBase)) - self.assertTrue(isinstance(f, self.BufferedIOBase)) - self.assertFalse(isinstance(f, self.TextIOBase)) + self.assertTrue(isinstance(f, abcmodule.IOBase)) + self.assertFalse(isinstance(f, abcmodule.RawIOBase)) + self.assertTrue(isinstance(f, abcmodule.BufferedIOBase)) + self.assertFalse(isinstance(f, abcmodule.TextIOBase)) f = self.open(support.TESTFN, "w") - self.assertTrue(isinstance(f, self.IOBase)) - self.assertFalse(isinstance(f, self.RawIOBase)) - self.assertFalse(isinstance(f, self.BufferedIOBase)) - self.assertTrue(isinstance(f, self.TextIOBase)) + self.assertTrue(isinstance(f, abcmodule.IOBase)) + self.assertFalse(isinstance(f, abcmodule.RawIOBase)) + self.assertFalse(isinstance(f, abcmodule.BufferedIOBase)) + self.assertTrue(isinstance(f, abcmodule.TextIOBase)) + + def test_abc_inheritance(self): + # Test implementations inherit from their respective ABCs + self._check_abc_inheritance(self) + + def test_abc_inheritance_official(self): + # Test implementations inherit from the official ABCs of the + # baseline "io" module. + self._check_abc_inheritance(io) class CMiscIOTest(MiscIOTest): io = io Modified: python/branches/io-c/Modules/_bufferedio.c ============================================================================== --- python/branches/io-c/Modules/_bufferedio.c (original) +++ python/branches/io-c/Modules/_bufferedio.c Fri Feb 27 22:49:50 2009 @@ -136,7 +136,7 @@ PyTypeObject PyBufferedIOBase_Type = { PyVarObject_HEAD_INIT(NULL, 0) - "BufferedIOBase", /*tp_name*/ + "_io._BufferedIOBase", /*tp_name*/ 0, /*tp_basicsize*/ 0, /*tp_itemsize*/ 0, /*tp_dealloc*/ @@ -1374,7 +1374,7 @@ PyTypeObject PyBufferedReader_Type = { PyVarObject_HEAD_INIT(NULL, 0) - "BufferedReader", /*tp_name*/ + "_io.BufferedReader", /*tp_name*/ sizeof(BufferedObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ (destructor)BufferedObject_dealloc, /*tp_dealloc*/ @@ -1712,7 +1712,7 @@ PyTypeObject PyBufferedWriter_Type = { PyVarObject_HEAD_INIT(NULL, 0) - "BufferedWriter", /*tp_name*/ + "_io.BufferedWriter", /*tp_name*/ sizeof(BufferedObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ (destructor)BufferedObject_dealloc, /*tp_dealloc*/ @@ -1957,8 +1957,8 @@ PyTypeObject PyBufferedRWPair_Type = { PyVarObject_HEAD_INIT(NULL, 0) - "BufferedRWPair", /*tp_name*/ - sizeof(BufferedRWPairObject), /*tp_basicsize*/ + "_io.BufferedRWPair", /*tp_name*/ + sizeof(BufferedRWPairObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ (destructor)BufferedRWPair_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ @@ -2088,7 +2088,7 @@ PyTypeObject PyBufferedRandom_Type = { PyVarObject_HEAD_INIT(NULL, 0) - "BufferedRandom", /*tp_name*/ + "_io.BufferedRandom", /*tp_name*/ sizeof(BufferedObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ (destructor)BufferedObject_dealloc, /*tp_dealloc*/ Modified: python/branches/io-c/Modules/_bytesio.c ============================================================================== --- python/branches/io-c/Modules/_bytesio.c (original) +++ python/branches/io-c/Modules/_bytesio.c Fri Feb 27 22:49:50 2009 @@ -716,7 +716,7 @@ PyTypeObject PyBytesIO_Type = { PyVarObject_HEAD_INIT(NULL, 0) - "_bytesio._BytesIO", /*tp_name*/ + "_io.BytesIO", /*tp_name*/ sizeof(BytesIOObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ (destructor)bytesio_dealloc, /*tp_dealloc*/ Modified: python/branches/io-c/Modules/_fileio.c ============================================================================== --- python/branches/io-c/Modules/_fileio.c (original) +++ python/branches/io-c/Modules/_fileio.c Fri Feb 27 22:49:50 2009 @@ -956,7 +956,7 @@ PyTypeObject PyFileIO_Type = { PyVarObject_HEAD_INIT(NULL, 0) - "FileIO", + "_io.FileIO", sizeof(PyFileIOObject), 0, (destructor)fileio_dealloc, /* tp_dealloc */ Modified: python/branches/io-c/Modules/_iobase.c ============================================================================== --- python/branches/io-c/Modules/_iobase.c (original) +++ python/branches/io-c/Modules/_iobase.c Fri Feb 27 22:49:50 2009 @@ -706,7 +706,7 @@ PyTypeObject PyIOBase_Type = { PyVarObject_HEAD_INIT(NULL, 0) - "IOBase", /*tp_name*/ + "_io._IOBase", /*tp_name*/ sizeof(IOBaseObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ (destructor)IOBase_dealloc, /*tp_dealloc*/ @@ -862,7 +862,7 @@ PyTypeObject PyRawIOBase_Type = { PyVarObject_HEAD_INIT(NULL, 0) - "RawIOBase", /*tp_name*/ + "_io._RawIOBase", /*tp_name*/ 0, /*tp_basicsize*/ 0, /*tp_itemsize*/ 0, /*tp_dealloc*/ Modified: python/branches/io-c/Modules/_stringio.c ============================================================================== --- python/branches/io-c/Modules/_stringio.c (original) +++ python/branches/io-c/Modules/_stringio.c Fri Feb 27 22:49:50 2009 @@ -728,7 +728,7 @@ PyTypeObject PyStringIO_Type = { PyVarObject_HEAD_INIT(NULL, 0) - "StringIO", /*tp_name*/ + "_io.StringIO", /*tp_name*/ sizeof(StringIOObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ (destructor)stringio_dealloc, /*tp_dealloc*/ Modified: python/branches/io-c/Modules/_textio.c ============================================================================== --- python/branches/io-c/Modules/_textio.c (original) +++ python/branches/io-c/Modules/_textio.c Fri Feb 27 22:49:50 2009 @@ -107,7 +107,7 @@ PyTypeObject PyTextIOBase_Type = { PyVarObject_HEAD_INIT(NULL, 0) - "TextIOBase", /*tp_name*/ + "_io._TextIOBase", /*tp_name*/ 0, /*tp_basicsize*/ 0, /*tp_itemsize*/ 0, /*tp_dealloc*/ @@ -526,7 +526,7 @@ PyTypeObject PyIncrementalNewlineDecoder_Type = { PyVarObject_HEAD_INIT(NULL, 0) - "IncrementalNewlineDecoder", /*tp_name*/ + "_io.IncrementalNewlineDecoder", /*tp_name*/ sizeof(PyNewLineDecoderObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ (destructor)IncrementalNewlineDecoder_dealloc, /*tp_dealloc*/ @@ -2348,7 +2348,7 @@ PyTypeObject PyTextIOWrapper_Type = { PyVarObject_HEAD_INIT(NULL, 0) - "TextIOWrapper", /*tp_name*/ + "_io.TextIOWrapper", /*tp_name*/ sizeof(PyTextIOWrapperObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ (destructor)TextIOWrapper_dealloc, /*tp_dealloc*/ Modified: python/branches/io-c/Modules/io.c ============================================================================== --- python/branches/io-c/Modules/io.c (original) +++ python/branches/io-c/Modules/io.c Fri Feb 27 22:49:50 2009 @@ -653,18 +653,15 @@ _PyExc_BlockingIOError.tp_base = (PyTypeObject *) PyExc_IOError; ADD_TYPE(&_PyExc_BlockingIOError, "BlockingIOError"); - /* IOBase */ - ADD_TYPE(&PyIOBase_Type, "IOBase"); - - /* RawIOBase */ - ADD_TYPE(&PyRawIOBase_Type, "RawIOBase"); - - /* BufferedIOBase */ - ADD_TYPE(&PyBufferedIOBase_Type, "BufferedIOBase"); - - /* TextIOBase */ - ADD_TYPE(&PyTextIOBase_Type,"TextIOBase"); + /* Concrete base types of the IO ABCs. + (the ABCs themselves are declared through inheritance in io.py) + */ + ADD_TYPE(&PyIOBase_Type, "_IOBase"); + ADD_TYPE(&PyRawIOBase_Type, "_RawIOBase"); + ADD_TYPE(&PyBufferedIOBase_Type, "_BufferedIOBase"); + ADD_TYPE(&PyTextIOBase_Type, "_TextIOBase"); + /* Implementation of concrete IO objects. */ /* FileIO */ PyFileIO_Type.tp_base = &PyRawIOBase_Type; ADD_TYPE(&PyFileIO_Type, "FileIO"); From python-checkins at python.org Fri Feb 27 22:52:57 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 27 Feb 2009 22:52:57 +0100 (CET) Subject: [Python-checkins] r70034 - peps/trunk/pep-0375.txt Message-ID: <20090227215257.E914B1E4002@bag.python.org> Author: benjamin.peterson Date: Fri Feb 27 22:52:57 2009 New Revision: 70034 Log: add some things and links Modified: peps/trunk/pep-0375.txt Modified: peps/trunk/pep-0375.txt ============================================================================== --- peps/trunk/pep-0375.txt (original) +++ peps/trunk/pep-0375.txt Fri Feb 27 22:52:57 2009 @@ -50,13 +50,22 @@ - importlib - io in C - A reworked email package -- Adding an IP Address library to the stdlib. +- Adding an IP Address library to the stdlib [#iplib]. +- Update simplejson to the latest external version [#simplejson]_. +- Ordered dictionary for collections [#ordered]_. -References -========== +Footnotes +========= + +.. [#iplib] + http://bugs.python.org/issue3959 + +.. [#simplejson] + http://bugs.python.org/issue4136 -None yet! +.. [#ordered] PEP 372 + http://www.python.org/dev/peps/pep-0372/ From python-checkins at python.org Fri Feb 27 22:57:41 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 27 Feb 2009 22:57:41 +0100 (CET) Subject: [Python-checkins] r70035 - python/branches/io-c/Lib/test/test_io.py Message-ID: <20090227215741.BBA751E4002@bag.python.org> Author: benjamin.peterson Date: Fri Feb 27 22:57:41 2009 New Revision: 70035 Log: good house keeping Modified: python/branches/io-c/Lib/test/test_io.py Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Fri Feb 27 22:57:41 2009 @@ -2052,21 +2052,21 @@ self.assertTrue(isinstance(self.TextIOBase, abc.ABCMeta)) def _check_abc_inheritance(self, abcmodule): - f = self.open(support.TESTFN, "wb", buffering=0) - self.assertTrue(isinstance(f, abcmodule.IOBase)) - self.assertTrue(isinstance(f, abcmodule.RawIOBase)) - self.assertFalse(isinstance(f, abcmodule.BufferedIOBase)) - self.assertFalse(isinstance(f, abcmodule.TextIOBase)) - f = self.open(support.TESTFN, "wb") - self.assertTrue(isinstance(f, abcmodule.IOBase)) - self.assertFalse(isinstance(f, abcmodule.RawIOBase)) - self.assertTrue(isinstance(f, abcmodule.BufferedIOBase)) - self.assertFalse(isinstance(f, abcmodule.TextIOBase)) - f = self.open(support.TESTFN, "w") - self.assertTrue(isinstance(f, abcmodule.IOBase)) - self.assertFalse(isinstance(f, abcmodule.RawIOBase)) - self.assertFalse(isinstance(f, abcmodule.BufferedIOBase)) - self.assertTrue(isinstance(f, abcmodule.TextIOBase)) + with self.open(support.TESTFN, "wb", buffering=0) as f: + self.assertTrue(isinstance(f, abcmodule.IOBase)) + self.assertTrue(isinstance(f, abcmodule.RawIOBase)) + self.assertFalse(isinstance(f, abcmodule.BufferedIOBase)) + self.assertFalse(isinstance(f, abcmodule.TextIOBase)) + with self.open(support.TESTFN, "wb") as f: + self.assertTrue(isinstance(f, abcmodule.IOBase)) + self.assertFalse(isinstance(f, abcmodule.RawIOBase)) + self.assertTrue(isinstance(f, abcmodule.BufferedIOBase)) + self.assertFalse(isinstance(f, abcmodule.TextIOBase)) + with self.open(support.TESTFN, "w") as f: + self.assertTrue(isinstance(f, abcmodule.IOBase)) + self.assertFalse(isinstance(f, abcmodule.RawIOBase)) + self.assertFalse(isinstance(f, abcmodule.BufferedIOBase)) + self.assertTrue(isinstance(f, abcmodule.TextIOBase)) def test_abc_inheritance(self): # Test implementations inherit from their respective ABCs From python-checkins at python.org Fri Feb 27 23:01:25 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 27 Feb 2009 23:01:25 +0100 (CET) Subject: [Python-checkins] r70036 - peps/trunk/pep-0372.txt Message-ID: <20090227220125.2329E1E4029@bag.python.org> Author: raymond.hettinger Date: Fri Feb 27 23:01:24 2009 New Revision: 70036 Log: More small edits. Modified: peps/trunk/pep-0372.txt Modified: peps/trunk/pep-0372.txt ============================================================================== --- peps/trunk/pep-0372.txt (original) +++ peps/trunk/pep-0372.txt Fri Feb 27 23:01:24 2009 @@ -122,18 +122,12 @@ What happens if an existing key is reassigned? The key is not moved but assigned a new value in place. This is - consistent with existing implementations and allows subclasses to - change the behavior easily:: - - class moving_odict(collections.odict): - def __setitem__(self, key, value): - self.pop(key, None) - collections.odict.__setitem__(self, key, value) + consistent with existing implementations. What happens if keys appear multiple times in the list passed to the constructor? - The same as for regular dicts: The latter item overrides the + The same as for regular dicts -- the latter item overrides the former. This has the side-effect that the position of the first key is used because only the value is actually overwritten:: @@ -145,17 +139,17 @@ Is the ordered dict a dict subclass? Why? - Yes. Like ``defaultdict``, ``odict`` subclasses ``dict``. - Being a dict subclass confers speed upon methods that aren't overridden - like ``__getitem__`` and ``__len__``. Also, being a dict gives the - most utility with tools that were expecting regular dicts (like the - json module). + Yes. Like ``defaultdict``, an ordered dictionary `` subclasses ``dict``. + Being a dict subclass make some of the methods faster (like + ``__getitem__`` and ``__len__``). More importantly, being a dict + subclass lets ordered dictionaries be usable with tools like json that + insist on having dict inputs by testing isinstance(d, dict). Do any limitations arise from subclassing dict? Yes. Since the API for dicts is different in Py2.x and Py3.x, the - odict API must also be different (i.e. Py2.6 needs to override - iterkeys, itervalues, and iteritems). + odict API must also be different. So, the Py2.7 version will need + to override iterkeys, itervalues, and iteritems. Does ``odict.popitem()`` return a particular key/value pair? @@ -164,22 +158,21 @@ exhibited by traditional push/pop pairs. It is semantically equivalent to ``k=list(od)[-1]; v=od[k]; del od[k]; return (k,v)``. The actual implementation is more efficient and pops directly - off of a sorted list of keys. + from a sorted list of keys. Does odict support indexing, slicing, and whatnot? As a matter of fact, ``odict`` does not implement the ``Sequence`` interface. Rather, it is a ``MutableMapping`` that remembers the order of key insertion. The only sequence-like addition is - automatic support for ``reversed``. + support for ``reversed``. Does odict support alternate sort orders such as alphabetical? No. Those wanting different sort orders really need to be using another technique. The odict is all about recording insertion order. If any other order is of interest, then another structure (like an in-memory - dbm) is likely a better fit. It would be a mistake to try to be all - things to all users. + dbm) is likely a better fit. How well does odict work with the json module, PyYAML, and ConfigParser? @@ -213,7 +206,7 @@ >>> yaml.load(ytext) OrderedDict({'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5}) - For the ConfigParser module, round-tripping is problem free. Custom + For the ConfigParser module, round-tripping is also problem free. Custom dicts were added in Py2.6 specifically to support ordered dictionaries:: >>> config = ConfigParser(dict_type=OrderedDict) @@ -224,21 +217,23 @@ How does odict handle equality testing? Being a dict, one might expect equality tests to not care about order. For - an odict to dict comparison, this would be a necessity and it's probably + an odict-to-dict comparison, this would be a necessity and it's probably not wise to silently switch comparison modes based on the input types. Also, some third-party tools that expect dict inputs may also expect the comparison to not care about order. Accordingly, we decided to punt and let the usual dict equality testing run without reference to internal ordering. This should be documented clearly since different people will - have different expectations. If a use case does arise, it's not hard to - explicitly craft an order based comparison: - ``list(od1.items())==list(od2.items())``. + have different expectations. If a use case does arise, it's not hard for + a user explicitly craft an order based comparison:: + + # Explict order-sensitive comparison + >>> list(od1.items())==list(od2.items()) What are the trade-offs of the possible underlying data structures? - * Keeping a sorted list of keys is very fast for all operations except - __delitem__() which becomes an O(n) exercise. This structure leads to - very simple code and little wasted space. + * Keeping a sorted list of keys is fast for all operations except + __delitem__() which becomes an O(n) exercise. This data structure leads + to very simple code and little wasted space. * Keeping a separate dictionary to record insertion sequence numbers makes the code a little bit more complex. All of the basic operations are O(1) From python-checkins at python.org Fri Feb 27 23:29:33 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 27 Feb 2009 23:29:33 +0100 (CET) Subject: [Python-checkins] r70037 - python/branches/py3k Message-ID: <20090227222933.AE3271E4002@bag.python.org> Author: benjamin.peterson Date: Fri Feb 27 23:29:33 2009 New Revision: 70037 Log: Blocked revisions 70011,70016 via svnmerge ........ r70011 | brett.cannon | 2009-02-26 21:38:28 -0600 (Thu, 26 Feb 2009) | 5 lines Fix a bug where code was trying to index an int. Left over from the situation from using str.rpartition to str.rindex. Closes Issue5213. ........ r70016 | raymond.hettinger | 2009-02-27 02:09:47 -0600 (Fri, 27 Feb 2009) | 1 line Give mapping views a usable repr. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat Feb 28 00:05:23 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 28 Feb 2009 00:05:23 +0100 (CET) Subject: [Python-checkins] r70038 - python/branches/io-c/Lib/test/test_io.py Message-ID: <20090227230523.B0A771E400C@bag.python.org> Author: antoine.pitrou Date: Sat Feb 28 00:05:23 2009 New Revision: 70038 Log: Make the buffer allocation overflow tests specific to the C implementation, since the Python implementation resizes its buffers when needed rather than allocating them up front. Modified: python/branches/io-c/Lib/test/test_io.py Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Sat Feb 28 00:05:23 2009 @@ -602,11 +602,6 @@ self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=0) self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-16) self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1) - if sys.maxsize > 0x7FFFFFFF: - # The allocation can succeed on 32-bit builds, e.g. with more - # than 2GB RAM and a 64-bit kernel. - self.assertRaises((OverflowError, MemoryError, ValueError), - bufio.__init__, rawio, sys.maxsize) rawio = self.MockRawIO([b"abc"]) bufio.__init__(rawio) self.assertEquals(b"abc", bufio.read()) @@ -744,6 +739,16 @@ class CBufferedReaderTest(BufferedReaderTest): tp = io.BufferedReader + def testConstructor(self): + BufferedReaderTest.testConstructor(self) + # The allocation can succeed on 32-bit builds, e.g. with more + # than 2GB RAM and a 64-bit kernel. + if sys.maxsize > 0x7FFFFFFF: + rawio = self.MockRawIO() + bufio = self.tp(rawio) + self.assertRaises((OverflowError, MemoryError, ValueError), + bufio.__init__, rawio, sys.maxsize) + def test_initialization(self): rawio = self.MockRawIO([b"abc"]) bufio = self.tp(rawio) @@ -790,11 +795,6 @@ self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=0) self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-16) self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1) - if sys.maxsize > 0x7FFFFFFF: - # The allocation can succeed on 32-bit builds, e.g. with more - # than 2GB RAM and a 64-bit kernel. - self.assertRaises((OverflowError, MemoryError, ValueError), - bufio.__init__, rawio, sys.maxsize) bufio.__init__(rawio) self.assertEquals(3, bufio.write(b"ghi")) bufio.flush() @@ -984,6 +984,16 @@ class CBufferedWriterTest(BufferedWriterTest): tp = io.BufferedWriter + def testConstructor(self): + BufferedWriterTest.testConstructor(self) + # The allocation can succeed on 32-bit builds, e.g. with more + # than 2GB RAM and a 64-bit kernel. + if sys.maxsize > 0x7FFFFFFF: + rawio = self.MockRawIO() + bufio = self.tp(rawio) + self.assertRaises((OverflowError, MemoryError, ValueError), + bufio.__init__, rawio, sys.maxsize) + def test_initialization(self): rawio = self.MockRawIO() bufio = self.tp(rawio) @@ -1160,6 +1170,16 @@ class CBufferedRandomTest(BufferedRandomTest): tp = io.BufferedRandom + def testConstructor(self): + BufferedRandomTest.testConstructor(self) + # The allocation can succeed on 32-bit builds, e.g. with more + # than 2GB RAM and a 64-bit kernel. + if sys.maxsize > 0x7FFFFFFF: + rawio = self.MockRawIO() + bufio = self.tp(rawio) + self.assertRaises((OverflowError, MemoryError, ValueError), + bufio.__init__, rawio, sys.maxsize) + def test_garbage_collection(self): CBufferedReaderTest.test_garbage_collection(self) CBufferedWriterTest.test_garbage_collection(self) From python-checkins at python.org Sat Feb 28 00:39:06 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 Feb 2009 00:39:06 +0100 (CET) Subject: [Python-checkins] r70039 - peps/trunk/pep-0375.txt Message-ID: <20090227233906.C0B321E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 28 00:39:06 2009 New Revision: 70039 Log: add contextlib problem Modified: peps/trunk/pep-0375.txt Modified: peps/trunk/pep-0375.txt ============================================================================== --- peps/trunk/pep-0375.txt (original) +++ peps/trunk/pep-0375.txt Sat Feb 28 00:39:06 2009 @@ -53,6 +53,7 @@ - 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]_. Footnotes @@ -67,6 +68,9 @@ .. [#ordered] PEP 372 http://www.python.org/dev/peps/pep-0372/ +.. [#contextlib] + http://bugs.python.org/issue5251 + Copyright From python-checkins at python.org Sat Feb 28 00:40:10 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 Feb 2009 00:40:10 +0100 (CET) Subject: [Python-checkins] r70040 - peps/trunk/pep-0375.txt Message-ID: <20090227234010.E7C2E1E4015@bag.python.org> Author: benjamin.peterson Date: Sat Feb 28 00:40:10 2009 New Revision: 70040 Log: fix reference Modified: peps/trunk/pep-0375.txt Modified: peps/trunk/pep-0375.txt ============================================================================== --- peps/trunk/pep-0375.txt (original) +++ peps/trunk/pep-0375.txt Sat Feb 28 00:40:10 2009 @@ -50,7 +50,7 @@ - importlib - io in C - A reworked email package -- Adding an IP Address library to the stdlib [#iplib]. +- 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]_. From python-checkins at python.org Sat Feb 28 01:26:13 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 Feb 2009 01:26:13 +0100 (CET) Subject: [Python-checkins] r70041 - python/branches/io-c/Lib/test/test_io.py Message-ID: <20090228002613.7D1AF1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 28 01:26:12 2009 New Revision: 70041 Log: kill java naming for sanity Modified: python/branches/io-c/Lib/test/test_io.py Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Sat Feb 28 01:26:12 2009 @@ -516,25 +516,25 @@ class CommonBufferedTests: # Tests common to BufferedReader, BufferedWriter and BufferedRandom - def testFileno(self): + def test_fileno(self): rawio = self.MockRawIO() bufio = self.tp(rawio) self.assertEquals(42, bufio.fileno()) - def testFilenoNoFileno(self): + def test_no_fileno(self): # XXX will we always have fileno() function? If so, kill # this test. Else, write it. pass - def testInvalidArgs(self): + def test_invalid_args(self): rawio = self.MockRawIO() bufio = self.tp(rawio) # Invalid whence self.assertRaises(ValueError, bufio.seek, 0, -1) self.assertRaises(ValueError, bufio.seek, 0, 3) - def testOverrideDestructor(self): + def test_override_destructor(self): tp = self.tp record = [] class MyBufferedIO(tp): @@ -561,7 +561,7 @@ else: self.assertEqual(record, [1, 2]) - def testContext(self): + def test_context_manager(self): # Test usability as a context manager rawio = self.MockRawIO() bufio = self.tp(rawio) @@ -573,7 +573,7 @@ # a ValueError. self.assertRaises(ValueError, _with) - def testErrorThroughDestructor(self): + def test_error_through_destructor(self): # Test that the exception state is not modified by a destructor, # even if close() fails. rawio = self.CloseFailureIO() @@ -592,7 +592,7 @@ class BufferedReaderTest(unittest.TestCase, CommonBufferedTests): read_mode = "rb" - def testConstructor(self): + def test_constructor(self): rawio = self.MockRawIO([b"abc"]) bufio = self.tp(rawio) bufio.__init__(rawio) @@ -606,14 +606,14 @@ bufio.__init__(rawio) self.assertEquals(b"abc", bufio.read()) - def testRead(self): + def test_read(self): rawio = self.MockRawIO((b"abc", b"d", b"efg")) bufio = self.tp(rawio) self.assertEquals(b"abcdef", bufio.read(6)) # Invalid args self.assertRaises(ValueError, bufio.read, -2) - def testRead1(self): + def test_read1(self): rawio = self.MockRawIO((b"abc", b"d", b"efg")) bufio = self.tp(rawio) self.assertEquals(b"a", bufio.read(1)) @@ -629,7 +629,7 @@ # Invalid args self.assertRaises(ValueError, bufio.read1, -1) - def testReadinto(self): + def test_readinto(self): rawio = self.MockRawIO((b"abc", b"d", b"efg")) bufio = self.tp(rawio) b = bytearray(2) @@ -644,7 +644,7 @@ self.assertEquals(bufio.readinto(b), 0) self.assertEquals(b, b"gf") - def testBuffering(self): + def test_buffering(self): data = b"abcdefghi" dlen = len(data) @@ -664,7 +664,7 @@ # this is mildly implementation-dependent self.assertEquals(rawio.read_history, raw_read_sizes) - def testReadNonBlocking(self): + def test_read_non_blocking(self): # Inject some None's in there to simulate EWOULDBLOCK rawio = self.MockRawIO((b"abc", b"d", None, b"efg", None, None, None)) bufio = self.tp(rawio) @@ -676,19 +676,19 @@ self.assert_(None is bufio.read()) self.assertEquals(b"", bufio.read()) - def testReadToEof(self): + def test_read_past_eof(self): rawio = self.MockRawIO((b"abc", b"d", b"efg")) bufio = self.tp(rawio) self.assertEquals(b"abcdefg", bufio.read(9000)) - def testReadNoArgs(self): + def test_read_all(self): rawio = self.MockRawIO((b"abc", b"d", b"efg")) bufio = self.tp(rawio) self.assertEquals(b"abcdefg", bufio.read()) - def testThreads(self): + def test_threads(self): try: # Write out many bytes with exactly the same number of 0's, # 1's... 255's. This will help us check that concurrent reading @@ -730,7 +730,7 @@ finally: support.unlink(support.TESTFN) - def testMisbehavedRawIO(self): + def test_misbehaved_io(self): rawio = self.MisbehavedRawIO((b"abc", b"d", b"efg")) bufio = self.tp(rawio) self.assertRaises(IOError, bufio.seek, 0) @@ -739,8 +739,8 @@ class CBufferedReaderTest(BufferedReaderTest): tp = io.BufferedReader - def testConstructor(self): - BufferedReaderTest.testConstructor(self) + def test_constructor(self): + BufferedReaderTest.test_constructor(self) # The allocation can succeed on 32-bit builds, e.g. with more # than 2GB RAM and a 64-bit kernel. if sys.maxsize > 0x7FFFFFFF: @@ -759,7 +759,7 @@ self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1) self.assertRaises(ValueError, bufio.read) - def testMisbehavedRawIORead(self): + def test_misbehaved_io_read(self): rawio = self.MisbehavedRawIO((b"abc", b"d", b"efg")) bufio = self.tp(rawio) # _pyio.BufferedReader seems to implement reading different, so that @@ -784,7 +784,7 @@ class BufferedWriterTest(unittest.TestCase, CommonBufferedTests): write_mode = "wb" - def testConstructor(self): + def test_constructor(self): rawio = self.MockRawIO() bufio = self.tp(rawio) bufio.__init__(rawio) @@ -800,14 +800,14 @@ bufio.flush() self.assertEquals(b"".join(rawio._write_stack), b"abcghi") - def testWrite(self): + def test_write(self): # Write to the buffered IO but don't overflow the buffer. writer = self.MockRawIO() bufio = self.tp(writer, 8) bufio.write(b"abc") self.assertFalse(writer._write_stack) - def testWriteOverflow(self): + def test_write_overflow(self): writer = self.MockRawIO() bufio = self.tp(writer, 8) contents = b"abcdefghijklmnop" @@ -838,13 +838,13 @@ bufio.flush() self.assertEquals(contents, b"".join(writer._write_stack)) - def testWrites(self): + def test_writes(self): self.check_writes(lambda bufio: None) - def testWritesAndFlushes(self): + def test_writes_and_flushes(self): self.check_writes(lambda bufio: bufio.flush()) - def testWritesAndSeeks(self): + def test_writes_and_seeks(self): def _seekabs(bufio): pos = bufio.tell() bufio.seek(pos + 1, 0) @@ -858,10 +858,10 @@ bufio.seek(pos, 0) self.check_writes(_seekrel) - def testWritesAndTruncates(self): + def test_writes_and_truncates(self): self.check_writes(lambda bufio: bufio.truncate(bufio.tell())) - def testWriteNonBlocking(self): + def test_write_non_blocking(self): raw = self.MockNonBlockWriterIO() bufio = self.tp(raw, 8, 8) @@ -888,7 +888,7 @@ # Previously buffered bytes were flushed self.assertTrue(s.startswith(b"01234567A"), s) - def testWriteAndRewind(self): + def test_write_and_rewind(self): raw = io.BytesIO() bufio = self.tp(raw, 4) self.assertEqual(bufio.write(b"abcdef"), 6) @@ -901,21 +901,21 @@ bufio.flush() self.assertEqual(raw.getvalue(), b"XYcdef123456") - def testFlush(self): + def test_flush(self): writer = self.MockRawIO() bufio = self.tp(writer, 8) bufio.write(b"abc") bufio.flush() self.assertEquals(b"abc", writer._write_stack[0]) - def testDestructor(self): + def test_destructor(self): writer = self.MockRawIO() bufio = self.tp(writer, 8) bufio.write(b"abc") del bufio self.assertEquals(b"abc", writer._write_stack[0]) - def testTruncate(self): + def test_truncate(self): # Truncate implicitly flushes the buffer. with io.open(support.TESTFN, self.write_mode, buffering=0) as raw: bufio = self.tp(raw, 8) @@ -925,7 +925,7 @@ with io.open(support.TESTFN, "rb", buffering=0) as f: self.assertEqual(f.read(), b"abc") - def testThreads(self): + def test_threads(self): try: # Write out many bytes from many threads and test they were # all flushed. @@ -974,7 +974,7 @@ finally: support.unlink(support.TESTFN) - def testMisbehavedRawIO(self): + def test_misbehaved_io(self): rawio = self.MisbehavedRawIO() bufio = self.tp(rawio, 5) self.assertRaises(IOError, bufio.seek, 0) @@ -984,8 +984,8 @@ class CBufferedWriterTest(BufferedWriterTest): tp = io.BufferedWriter - def testConstructor(self): - BufferedWriterTest.testConstructor(self) + def test_constructor(self): + BufferedWriterTest.test_constructor(self) # The allocation can succeed on 32-bit builds, e.g. with more # than 2GB RAM and a 64-bit kernel. if sys.maxsize > 0x7FFFFFFF: @@ -1025,7 +1025,7 @@ class BufferedRWPairTest(unittest.TestCase): - def testRWPair(self): + def test_basic(self): r = self.MockRawIO(()) w = self.MockRawIO() pair = self.tp(r, w) @@ -1044,11 +1044,11 @@ read_mode = "rb+" write_mode = "wb+" - def testConstructor(self): - BufferedReaderTest.testConstructor(self) - BufferedWriterTest.testConstructor(self) + def test_constructor(self): + BufferedReaderTest.test_constructor(self) + BufferedWriterTest.test_constructor(self) - def testReadAndWrite(self): + def test_read_and_write(self): raw = self.MockRawIO((b"asdf", b"ghjk")) rw = self.tp(raw, 8, 12) @@ -1059,7 +1059,7 @@ self.assertEqual(b"ghjk", rw.read()) self.assertEquals(b"dddeee", raw._write_stack[0]) - def testSeekAndTell(self): + def test_seek_and_tell(self): raw = self.BytesIO(b"asdfghjkl") rw = self.tp(raw) @@ -1097,17 +1097,17 @@ bufio.seek(0, 0) self.assertEquals(b"XYZ", read_func(bufio, 3)) - def testFlushAndRead(self): + def test_flush_and_read(self): self.check_flush_and_read(lambda bufio, *args: bufio.read(*args)) - def testFlushAndReadinto(self): + def test_flush_and_readinto(self): def _readinto(bufio, n=-1): b = bytearray(n if n >= 0 else 9999) n = bufio.readinto(b) return bytes(b[:n]) self.check_flush_and_read(_readinto) - def testFlushAndPeek(self): + def test_flush_and_peek(self): def _peek(bufio, n=-1): # This relies on the fact that the buffer can contain the whole # raw stream, otherwise peek() can return less. @@ -1118,7 +1118,7 @@ return b self.check_flush_and_read(_peek) - def testFlushAndWrite(self): + def test_flush_and_write(self): raw = self.BytesIO(b"abcdefghi") bufio = self.tp(raw) @@ -1130,11 +1130,11 @@ self.assertEquals(b"12345fghi", raw.getvalue()) self.assertEquals(b"12345fghi", bufio.read()) - def testThreads(self): - BufferedReaderTest.testThreads(self) - BufferedWriterTest.testThreads(self) + def test_threads(self): + BufferedReaderTest.test_threads(self) + BufferedWriterTest.test_threads(self) - def testWritesAndPeeks(self): + def test_writes_and_peek(self): def _peek(bufio): bufio.peek(1) self.check_writes(_peek) @@ -1145,33 +1145,33 @@ bufio.seek(pos, 0) self.check_writes(_peek) - def testWritesAndReads(self): + def test_writes_and_reads(self): def _read(bufio): bufio.seek(-1, 1) bufio.read(1) self.check_writes(_read) - def testWritesAndRead1s(self): + def test_writes_and_read1s(self): def _read1(bufio): bufio.seek(-1, 1) bufio.read1(1) self.check_writes(_read1) - def testWritesAndReadintos(self): + def test_writes_and_readintos(self): def _read(bufio): bufio.seek(-1, 1) bufio.readinto(bytearray(1)) self.check_writes(_read) - def testMisbehavedRawIO(self): - BufferedReaderTest.testMisbehavedRawIO(self) - BufferedWriterTest.testMisbehavedRawIO(self) + def test_misbehaved_io(self): + BufferedReaderTest.test_misbehaved_io(self) + BufferedWriterTest.test_misbehaved_io(self) class CBufferedRandomTest(BufferedRandomTest): tp = io.BufferedRandom - def testConstructor(self): - BufferedRandomTest.testConstructor(self) + def test_constructor(self): + BufferedRandomTest.test_constructor(self) # The allocation can succeed on 32-bit builds, e.g. with more # than 2GB RAM and a 64-bit kernel. if sys.maxsize > 0x7FFFFFFF: @@ -1321,7 +1321,7 @@ 'm--------------.') ] - def testDecoder(self): + def test_decoder(self): # Try a few one-shot test cases. for input, eof, output in self.test_cases: d = StatefulIncrementalDecoder() @@ -1342,7 +1342,7 @@ def tearDown(self): support.unlink(support.TESTFN) - def testConstructor(self): + def test_constructor(self): r = self.BytesIO(b"\xc3\xa9\n\n") b = self.BufferedReader(r, 1000) t = self.TextIOWrapper(b) @@ -1356,7 +1356,7 @@ self.assertRaises(TypeError, t.__init__, b, newline=42) self.assertRaises(ValueError, t.__init__, b, newline='xyzzy') - def testLineBuffering(self): + def test_line_buffering(self): r = self.BytesIO() b = self.BufferedWriter(r, 1000) t = self.TextIOWrapper(b, newline="\n", line_buffering=True) @@ -1367,7 +1367,7 @@ t.write("A\rB") self.assertEquals(r.getvalue(), b"XY\nZA\rB") - def testEncoding(self): + def test_encoding(self): # Check the encoding attribute is always set, and valid b = self.BytesIO() t = self.TextIOWrapper(b, encoding="utf8") @@ -1376,7 +1376,7 @@ self.assert_(t.encoding is not None) codecs.lookup(t.encoding) - def testEncodingErrorsReading(self): + def test_encoding_errors_reading(self): # (1) default b = self.BytesIO(b"abc\n\xff\n") t = self.TextIOWrapper(b, encoding="ascii") @@ -1394,7 +1394,7 @@ t = self.TextIOWrapper(b, encoding="ascii", errors="replace") self.assertEquals(t.read(), "abc\n\ufffd\n") - def testEncodingErrorsWriting(self): + def test_encoding_errors_writing(self): # (1) default b = self.BytesIO() t = self.TextIOWrapper(b, encoding="ascii") @@ -1418,7 +1418,7 @@ t.flush() self.assertEquals(b.getvalue(), b"abc?def\n") - def testNewlines(self): + def test_newlines(self): input_lines = [ "unix\n", "windows\r\n", "os9\r", "last\n", "nonl" ] tests = [ @@ -1460,7 +1460,7 @@ self.assertEquals(got_line, exp_line) self.assertEquals(len(got_lines), len(exp_lines)) - def testNewlinesInput(self): + def test_newlines_input(self): testdata = b"AAA\nBB\x00B\nCCC\rDDD\rEEE\r\nFFF\r\nGGG" normalized = testdata.replace(b"\r\n", b"\n").replace(b"\r", b"\n") for newline, expected in [ @@ -1476,7 +1476,7 @@ txt.seek(0) self.assertEquals(txt.read(), "".join(expected)) - def testNewlinesOutput(self): + def test_newlines_output(self): testdict = { "": b"AAA\nBBB\nCCC\nX\rY\r\nZ", "\n": b"AAA\nBBB\nCCC\nX\rY\r\nZ", @@ -1494,7 +1494,7 @@ self.assertEquals(buf.closed, False) self.assertEquals(buf.getvalue(), expected) - def testDestructor(self): + def test_destructor(self): l = [] base = self.BytesIO class MyBytesIO(base): @@ -1507,7 +1507,7 @@ del t self.assertEquals([b"abc"], l) - def testOverrideDestructor(self): + def test_override_destructor(self): record = [] class MyTextIO(self.TextIOWrapper): def __del__(self): @@ -1529,7 +1529,7 @@ del t self.assertEqual(record, [1, 2, 3]) - def testErrorThroughDestructor(self): + def test_error_through_destructor(self): # Test that the exception state is not modified by a destructor, # even if close() fails. rawio = self.CloseFailureIO() @@ -1546,7 +1546,7 @@ # Systematic tests of the text I/O API - def testBasicIO(self): + def test_basic_io(self): for chunksize in (1, 2, 3, 4, 5, 15, 16, 17, 31, 32, 33, 63, 64, 65): for enc in "ascii", "latin1", "utf8" :# , "utf-16-be", "utf-16-le": f = self.open(support.TESTFN, "w+", encoding=enc) @@ -1595,7 +1595,7 @@ rlines.append((pos, line)) self.assertEquals(rlines, wlines) - def testTelling(self): + def test_telling(self): f = self.open(support.TESTFN, "w+", encoding="utf8") p0 = f.tell() f.write("\xff\n") @@ -1615,7 +1615,7 @@ self.assertEquals(f.tell(), p2) f.close() - def testSeeking(self): + def test_seeking(self): chunk_size = _default_chunk_size() prefix_size = chunk_size - 2 u_prefix = "a" * prefix_size @@ -1633,7 +1633,7 @@ self.assertEquals(f.tell(), prefix_size) self.assertEquals(f.readline(), u_suffix) - def testSeekingToo(self): + def test_seeking_too(self): # Regression test for a specific bug data = b'\xe0\xbf\xbf\n' f = self.open(support.TESTFN, "wb") @@ -1645,7 +1645,7 @@ f.readline() f.tell() - def testSeekAndTell(self): + def test_seek_and_tell(self): #Test seek/tell using the StatefulIncrementalDecoder. # Make test faster by doing smaller seeks CHUNK_SIZE = 128 @@ -1692,7 +1692,7 @@ finally: StatefulIncrementalDecoder.codecEnabled = 0 - def testEncodedWrites(self): + def test_encoded_writes(self): data = "1234567890" tests = ("utf-16", "utf-16-le", @@ -1747,7 +1747,7 @@ print("Reading using readline(): %6.3f seconds" % (t3-t2)) print("Using readline()+tell(): %6.3f seconds" % (t4-t3)) - def testReadOneByOne(self): + def test_read_one_by_one(self): txt = self.TextIOWrapper(self.BytesIO(b"AA\r\nBB")) reads = "" while True: @@ -1758,7 +1758,7 @@ self.assertEquals(reads, "AA\nBB") # read in amounts equal to TextIOWrapper._CHUNK_SIZE which is 128. - def testReadByChunk(self): + def test_read_by_chunk(self): # make sure "\r\n" straddles 128 char boundary. txt = self.TextIOWrapper(self.BytesIO(b"A" * 127 + b"\r\nB")) reads = "" @@ -1966,7 +1966,7 @@ def tearDown(self): support.unlink(support.TESTFN) - def testImport__all__(self): + def test___all__(self): for name in self.io.__all__: obj = getattr(self.io, name, None) self.assert_(obj is not None, name) From python-checkins at python.org Sat Feb 28 01:28:53 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 Feb 2009 01:28:53 +0100 (CET) Subject: [Python-checkins] r70042 - python/branches/io-c/Lib/test/test_io.py Message-ID: <20090228002853.E27A81E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 28 01:28:53 2009 New Revision: 70042 Log: timingTest is superseded by iobench Modified: python/branches/io-c/Lib/test/test_io.py Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Sat Feb 28 01:28:53 2009 @@ -1710,43 +1710,6 @@ self.assertEquals(f.read(), data * 2) self.assertEquals(buf.getvalue(), (data * 2).encode(encoding)) - def timingTest(self): - timer = time.time - enc = "utf8" - line = "\0\x0f\xff\u0fff\uffff\U000fffff\U0010ffff"*3 + "\n" - nlines = 10000 - nchars = len(line) - nbytes = len(line.encode(enc)) - for chunk_size in (32, 64, 128, 256): - f = self.open(support.TESTFN, "w+", encoding=enc) - f._CHUNK_SIZE = chunk_size - t0 = timer() - for i in range(nlines): - f.write(line) - f.flush() - t1 = timer() - f.seek(0) - for line in f: - pass - t2 = timer() - f.seek(0) - while f.readline(): - pass - t3 = timer() - f.seek(0) - while f.readline(): - f.tell() - t4 = timer() - f.close() - if support.verbose: - print("\nTiming test: %d lines of %d characters (%d bytes)" % - (nlines, nchars, nbytes)) - print("File chunk size: %6s" % f._CHUNK_SIZE) - print("Writing: %6.3f seconds" % (t1-t0)) - print("Reading using iteration: %6.3f seconds" % (t2-t1)) - print("Reading using readline(): %6.3f seconds" % (t3-t2)) - print("Using readline()+tell(): %6.3f seconds" % (t4-t3)) - def test_read_one_by_one(self): txt = self.TextIOWrapper(self.BytesIO(b"AA\r\nBB")) reads = "" From python-checkins at python.org Sat Feb 28 02:13:51 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 28 Feb 2009 02:13:51 +0100 (CET) Subject: [Python-checkins] r70043 - python/branches/io-c/Lib/test/test_io.py Message-ID: <20090228011351.0A9CC1E402F@bag.python.org> Author: antoine.pitrou Date: Sat Feb 28 02:13:50 2009 New Revision: 70043 Log: Remove the last traces of java naming in test_io Modified: python/branches/io-c/Lib/test/test_io.py Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Sat Feb 28 02:13:50 2009 @@ -471,7 +471,7 @@ self.assertRaises(ValueError, self.open, support.TESTFN, 'w', closefd=False) - def testReadClosed(self): + def test_read_closed(self): with self.open(support.TESTFN, "w") as f: f.write("egg\n") with self.open(support.TESTFN, "r") as f: From python-checkins at python.org Sat Feb 28 02:18:34 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 28 Feb 2009 02:18:34 +0100 (CET) Subject: [Python-checkins] r70044 - python/branches/io-c/Lib/test/test_io.py Message-ID: <20090228011834.789FE1E4002@bag.python.org> Author: antoine.pitrou Date: Sat Feb 28 02:18:34 2009 New Revision: 70044 Log: Better resource cleanup Modified: python/branches/io-c/Lib/test/test_io.py Modified: python/branches/io-c/Lib/test/test_io.py ============================================================================== --- python/branches/io-c/Lib/test/test_io.py (original) +++ python/branches/io-c/Lib/test/test_io.py Sat Feb 28 02:18:34 2009 @@ -351,12 +351,10 @@ print("Use 'regrtest.py -u largefile test_io' to run it.", file=sys.stderr) return - f = self.open(support.TESTFN, "w+b", 0) - self.large_file_ops(f) - f.close() - f = self.open(support.TESTFN, "w+b") - self.large_file_ops(f) - f.close() + with self.open(support.TESTFN, "w+b", 0) as f: + self.large_file_ops(f) + with self.open(support.TESTFN, "w+b") as f: + self.large_file_ops(f) def test_with_open(self): for bufsize in (0, 1, 100): From python-checkins at python.org Sat Feb 28 02:29:01 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 28 Feb 2009 02:29:01 +0100 (CET) Subject: [Python-checkins] r70045 - python/branches/io-c/Lib/_pyio.py Message-ID: <20090228012901.04D0F1E4002@bag.python.org> Author: antoine.pitrou Date: Sat Feb 28 02:29:00 2009 New Revision: 70045 Log: Remove dubious uses of super(), and fix one test Modified: python/branches/io-c/Lib/_pyio.py Modified: python/branches/io-c/Lib/_pyio.py ============================================================================== --- python/branches/io-c/Lib/_pyio.py (original) +++ python/branches/io-c/Lib/_pyio.py Sat Feb 28 02:29:00 2009 @@ -938,7 +938,7 @@ min(n, len(self._read_buf) - self._read_pos)) def tell(self): - return super().tell() - len(self._read_buf) + self._read_pos + return _BufferedIOMixin.tell(self) - len(self._read_buf) + self._read_pos def seek(self, pos, whence=0): if not (0 <= whence <= 2): @@ -946,7 +946,7 @@ with self._read_lock: if whence == 1: pos -= len(self._read_buf) - self._read_pos - pos = super().seek(pos, whence) + pos = _BufferedIOMixin.seek(self, pos, whence) self._reset_read_buf() return pos @@ -1034,14 +1034,14 @@ raise BlockingIOError(e.errno, e.strerror, written) def tell(self): - return super().tell() + len(self._write_buf) + return _BufferedIOMixin.tell(self) + len(self._write_buf) def seek(self, pos, whence=0): if not (0 <= whence <= 2): raise ValueError("invalid whence") with self._write_lock: self._flush_unlocked() - return super().seek(pos, whence) + return _BufferedIOMixin.seek(self, pos, whence) class BufferedRWPair(BufferedIOBase): @@ -1141,7 +1141,7 @@ def tell(self): if self._write_buf: - return super().tell() + len(self._write_buf) + return BufferedWriter.tell(self) else: return BufferedReader.tell(self) From python-checkins at python.org Sat Feb 28 02:31:01 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 28 Feb 2009 02:31:01 +0100 (CET) Subject: [Python-checkins] r70046 - python/branches/io-c/Lib/_pyio.py Message-ID: <20090228013101.234A91E4002@bag.python.org> Author: antoine.pitrou Date: Sat Feb 28 02:31:00 2009 New Revision: 70046 Log: Bump up CHUNK_SIZE (no need to make the Python version look slower than it is) Modified: python/branches/io-c/Lib/_pyio.py Modified: python/branches/io-c/Lib/_pyio.py ============================================================================== --- python/branches/io-c/Lib/_pyio.py (original) +++ python/branches/io-c/Lib/_pyio.py Sat Feb 28 02:31:00 2009 @@ -1338,7 +1338,7 @@ write contains a newline character. """ - _CHUNK_SIZE = 128 + _CHUNK_SIZE = 2048 def __init__(self, buffer, encoding=None, errors=None, newline=None, line_buffering=False): From python-checkins at python.org Sat Feb 28 03:03:26 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 Feb 2009 03:03:26 +0100 (CET) Subject: [Python-checkins] r70047 - python/branches/io-c/Lib/_pyio.py Message-ID: <20090228020326.E82071E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 28 03:03:26 2009 New Revision: 70047 Log: fix typo Modified: python/branches/io-c/Lib/_pyio.py Modified: python/branches/io-c/Lib/_pyio.py ============================================================================== --- python/branches/io-c/Lib/_pyio.py (original) +++ python/branches/io-c/Lib/_pyio.py Sat Feb 28 03:03:26 2009 @@ -929,7 +929,7 @@ # Returns up to n bytes. If at least one byte is buffered, we # only return buffered bytes. Otherwise, we do one raw read. if n < 0: - raise ValueError("number of bytes ot read must be positive") + raise ValueError("number of bytes to read must be positive") if n == 0: return b"" with self._read_lock: From python-checkins at python.org Sat Feb 28 04:35:11 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 Feb 2009 04:35:11 +0100 (CET) Subject: [Python-checkins] r70048 - python/branches/io-c/Lib/_pyio.py Message-ID: <20090228033511.7B3901E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 28 04:35:11 2009 New Revision: 70048 Log: move code to a better place Modified: python/branches/io-c/Lib/_pyio.py Modified: python/branches/io-c/Lib/_pyio.py ============================================================================== --- python/branches/io-c/Lib/_pyio.py (original) +++ python/branches/io-c/Lib/_pyio.py Sat Feb 28 04:35:11 2009 @@ -1133,10 +1133,10 @@ # First do the raw seek, then empty the read buffer, so that # if the raw seek fails, we don't lose buffered data forever. pos = self.raw.seek(pos, whence) - if pos < 0: - raise IOError("seek() returned invalid position") with self._read_lock: self._reset_read_buf() + if pos < 0: + raise IOError("seek() returned invalid position") return pos def tell(self): From python-checkins at python.org Sat Feb 28 11:08:02 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 28 Feb 2009 11:08:02 +0100 (CET) Subject: [Python-checkins] r70049 - in python/trunk: Lib/distutils/command/bdist_rpm.py Lib/distutils/tests/test_bdist_rpm.py Misc/NEWS Message-ID: <20090228100802.947F71E4002@bag.python.org> Author: tarek.ziade Date: Sat Feb 28 11:08:02 2009 New Revision: 70049 Log: Issues #1533164 and #5378: Added quiet and force-optimize options to Distutils bdist_rpm command Added: python/trunk/Lib/distutils/tests/test_bdist_rpm.py (contents, props changed) Modified: python/trunk/Lib/distutils/command/bdist_rpm.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/command/bdist_rpm.py ============================================================================== --- python/trunk/Lib/distutils/command/bdist_rpm.py (original) +++ python/trunk/Lib/distutils/command/bdist_rpm.py Sat Feb 28 11:08:02 2009 @@ -123,10 +123,21 @@ # Allow a packager to explicitly force an architecture ('force-arch=', None, "Force an architecture onto the RPM build process"), - ] + + ('quiet', 'q', + "Run the INSTALL phase of RPM building in quiet mode"), + + # Forces the -O1 option when calling the install command, + # so the rpm contains all files needed for proper operation under + # SELinux. Some systems checks for this on build-time and will + # fail without this. + ('force-optimize', None, + "Forces the -O1 option when calling the install command"), + + ] boolean_options = ['keep-temp', 'use-rpm-opt-flags', 'rpm3-mode', - 'no-autoreq'] + 'no-autoreq', 'quiet', 'force-optimize'] negative_opt = {'no-keep-temp': 'keep-temp', 'no-rpm-opt-flags': 'use-rpm-opt-flags', @@ -176,6 +187,8 @@ self.no_autoreq = 0 self.force_arch = None + self.quiet = 0 + self.force_optimize = 1 # initialize_options() @@ -322,6 +335,7 @@ if os.path.exists('/usr/bin/rpmbuild') or \ os.path.exists('/bin/rpmbuild'): rpm_cmd = ['rpmbuild'] + if self.source_only: # what kind of RPMs? rpm_cmd.append('-bs') elif self.binary_only: @@ -333,6 +347,10 @@ '_topdir %s' % os.path.abspath(self.rpm_base)]) if not self.keep_temp: rpm_cmd.append('--clean') + + if self.quiet: + rpm_cmd.append('--quiet') + rpm_cmd.append(spec_path) # Determine the binary rpm names that should be built out of this spec # file @@ -486,13 +504,19 @@ # that we open and interpolate into the spec file, but the defaults # are just text that we drop in as-is. Hmmm. + # forcing -O1 if force-optimize + if self.force_optimize: + optimize = ' -O1' + else: + optimize = '' + + install_cmd = ('%s install%s --root=$RPM_BUILD_ROOT ' + '--record=INSTALLED_FILES') % (def_setup_call, optimize) + script_options = [ ('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"), ('build', 'build_script', def_build), - ('install', 'install_script', - ("%s install " - "--root=$RPM_BUILD_ROOT " - "--record=INSTALLED_FILES") % def_setup_call), + ('install', 'install_script', install_cmd), ('clean', 'clean_script', "rm -rf $RPM_BUILD_ROOT"), ('verifyscript', 'verify_script', None), ('pre', 'pre_install', None), Added: python/trunk/Lib/distutils/tests/test_bdist_rpm.py ============================================================================== --- (empty file) +++ python/trunk/Lib/distutils/tests/test_bdist_rpm.py Sat Feb 28 11:08:02 2009 @@ -0,0 +1,149 @@ +"""Tests for distutils.command.bdist_rpm.""" + +import unittest +import sys +import os +import tempfile +import shutil + +from distutils.core import Distribution +from distutils.command.bdist_rpm import bdist_rpm +from distutils.tests import support +from distutils.spawn import find_executable +from distutils import spawn +from distutils.errors import DistutilsExecError + +SETUP_PY = """\ +from distutils.core import setup +import foo + +setup(name='foo', version='0.1', py_modules=['foo'], + url='xxx', author='xxx', author_email='xxx') + +""" + +class BuildRpmTestCase(support.TempdirManager, + support.LoggingSilencer, + unittest.TestCase): + + def setUp(self): + super(BuildRpmTestCase, 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[:] + super(BuildRpmTestCase, self).tearDown() + + def test_quiet(self): + + # XXX I am unable yet to make this test work without + # spurious sdtout/stderr output under Mac OS X + if sys.platform != 'linux2': + return + + # this test will run only if the rpm commands are found + if (find_executable('rpm') is None or + find_executable('rpmbuild') is None): + return + + # let's create a package + tmp_dir = self.mkdtemp() + pkg_dir = os.path.join(tmp_dir, 'foo') + os.mkdir(pkg_dir) + self.write_file((pkg_dir, 'setup.py'), SETUP_PY) + self.write_file((pkg_dir, 'foo.py'), '#') + self.write_file((pkg_dir, 'MANIFEST.in'), 'include foo.py') + self.write_file((pkg_dir, 'README'), '') + + dist = Distribution({'name': 'foo', 'version': '0.1', + 'py_modules': ['foo'], + 'url': 'xxx', 'author': 'xxx', + 'author_email': 'xxx'}) + dist.script_name = 'setup.py' + os.chdir(pkg_dir) + + sys.argv = ['setup.py'] + cmd = bdist_rpm(dist) + cmd.fix_python = True + + # running in quiet mode + cmd.quiet = 1 + cmd.ensure_finalized() + cmd.run() + + dist_created = os.listdir(os.path.join(pkg_dir, 'dist')) + self.assert_('foo-0.1-1.noarch.rpm' in dist_created) + + def test_no_optimize_flag(self): + + # XXX I am unable yet to make this test work without + # spurious sdtout/stderr output under Mac OS X + if sys.platform != 'linux2': + return + + # http://bugs.python.org/issue1533164 + # this test will run only if the rpm command is found + if (find_executable('rpm') is None or + find_executable('rpmbuild') is None): + return + + # let's create a package that brakes bdist_rpm + tmp_dir = self.mkdtemp() + pkg_dir = os.path.join(tmp_dir, 'foo') + os.mkdir(pkg_dir) + self.write_file((pkg_dir, 'setup.py'), SETUP_PY) + self.write_file((pkg_dir, 'foo.py'), '#') + self.write_file((pkg_dir, 'MANIFEST.in'), 'include foo.py') + self.write_file((pkg_dir, 'README'), '') + + dist = Distribution({'name': 'foo', 'version': '0.1', + 'py_modules': ['foo'], + 'url': 'xxx', 'author': 'xxx', + 'author_email': 'xxx'}) + dist.script_name = 'setup.py' + os.chdir(pkg_dir) + + sys.argv = ['setup.py'] + cmd = bdist_rpm(dist) + cmd.fix_python = True + + # running with force-optimize = 1 + # and quiet = 1 + cmd.quiet = 1 + cmd.ensure_finalized() + cmd.run() + + dist_created = os.listdir(os.path.join(pkg_dir, 'dist')) + self.assert_('foo-0.1-1.noarch.rpm' in dist_created) + os.remove(os.path.join(pkg_dir, 'dist', 'foo-0.1-1.noarch.rpm')) + + # XXX I am unable yet to make this test work without + # spurious stderr output + # so returning until distutils.spawn acts better + return + + # running with force-optimize = 0 + cmd.force_optimize = 0 + try: + # XXX How to prevent the spawned + # rpmbuild command to display errors ? + # this can be a problem for buildbots + cmd.ensure_finalized() + cmd.run() + except DistutilsExecError: + # happens only under Fedora/RedHat + # and some flavors of Linux + # otherwise it's a bug + if sys.platform == 'linux2': + return + + dist_created = os.listdir(os.path.join(pkg_dir, 'dist')) + self.assert_('foo-0.1-1.noarch.rpm' in dist_created) + +def test_suite(): + return unittest.makeSuite(BuildRpmTestCase) + +if __name__ == '__main__': + test_support.run_unittest(test_suite()) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Feb 28 11:08:02 2009 @@ -166,6 +166,11 @@ Library ------- +- Issue #1533164: Installed but not listed *.pyo was breaking Distutils + bdist_rpm command. + +- Issue #5378: added --quiet option to Distutils bdist_rpm command. + - Issue #5052: make Distutils compatible with 2.3 again. - Deprecated methods of symtable.Symbol have been removed: is_keywordarg(), From python-checkins at python.org Sat Feb 28 11:12:45 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 28 Feb 2009 11:12:45 +0100 (CET) Subject: [Python-checkins] r70050 - python/branches/release26-maint Message-ID: <20090228101245.962181E4002@bag.python.org> Author: tarek.ziade Date: Sat Feb 28 11:12:45 2009 New Revision: 70050 Log: Blocked revisions 70049 via svnmerge ........ r70049 | tarek.ziade | 2009-02-28 11:08:02 +0100 (Sat, 28 Feb 2009) | 1 line Issues #1533164 and #5378: Added quiet and force-optimize options to Distutils bdist_rpm command ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sat Feb 28 11:16:43 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 28 Feb 2009 11:16:43 +0100 (CET) Subject: [Python-checkins] r70051 - in python/branches/py3k: Lib/distutils/command/bdist_rpm.py Lib/distutils/tests/test_bdist_rpm.py Misc/NEWS Message-ID: <20090228101643.8E4591E4002@bag.python.org> Author: tarek.ziade Date: Sat Feb 28 11:16:43 2009 New Revision: 70051 Log: Merged revisions 70049 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70049 | tarek.ziade | 2009-02-28 11:08:02 +0100 (Sat, 28 Feb 2009) | 1 line Issues #1533164 and #5378: Added quiet and force-optimize options to Distutils bdist_rpm command ........ Added: python/branches/py3k/Lib/distutils/tests/test_bdist_rpm.py - copied unchanged from r70049, /python/trunk/Lib/distutils/tests/test_bdist_rpm.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/command/bdist_rpm.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/distutils/command/bdist_rpm.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/bdist_rpm.py (original) +++ python/branches/py3k/Lib/distutils/command/bdist_rpm.py Sat Feb 28 11:16:43 2009 @@ -122,10 +122,21 @@ # Allow a packager to explicitly force an architecture ('force-arch=', None, "Force an architecture onto the RPM build process"), - ] + + ('quiet', 'q', + "Run the INSTALL phase of RPM building in quiet mode"), + + # Forces the -O1 option when calling the install command, + # so the rpm contains all files needed for proper operation under + # SELinux. Some systems checks for this on build-time and will + # fail without this. + ('force-optimize', None, + "Forces the -O1 option when calling the install command"), + + ] boolean_options = ['keep-temp', 'use-rpm-opt-flags', 'rpm3-mode', - 'no-autoreq'] + 'no-autoreq', 'quiet', 'force-optimize'] negative_opt = {'no-keep-temp': 'keep-temp', 'no-rpm-opt-flags': 'use-rpm-opt-flags', @@ -175,6 +186,8 @@ self.no_autoreq = 0 self.force_arch = None + self.quiet = 0 + self.force_optimize = 1 def finalize_options(self): self.set_undefined_options('bdist', ('bdist_base', 'bdist_base')) @@ -311,6 +324,7 @@ if os.path.exists('/usr/bin/rpmbuild') or \ os.path.exists('/bin/rpmbuild'): rpm_cmd = ['rpmbuild'] + if self.source_only: # what kind of RPMs? rpm_cmd.append('-bs') elif self.binary_only: @@ -322,6 +336,10 @@ '_topdir %s' % os.path.abspath(self.rpm_base)]) if not self.keep_temp: rpm_cmd.append('--clean') + + if self.quiet: + rpm_cmd.append('--quiet') + rpm_cmd.append(spec_path) # Determine the binary rpm names that should be built out of this spec # file @@ -474,13 +492,19 @@ # that we open and interpolate into the spec file, but the defaults # are just text that we drop in as-is. Hmmm. + # forcing -O1 if force-optimize + if self.force_optimize: + optimize = ' -O1' + else: + optimize = '' + + install_cmd = ('%s install%s --root=$RPM_BUILD_ROOT ' + '--record=INSTALLED_FILES') % (def_setup_call, optimize) + script_options = [ ('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"), ('build', 'build_script', def_build), - ('install', 'install_script', - ("%s install " - "--root=$RPM_BUILD_ROOT " - "--record=INSTALLED_FILES") % def_setup_call), + ('install', 'install_script', install_cmd), ('clean', 'clean_script', "rm -rf $RPM_BUILD_ROOT"), ('verifyscript', 'verify_script', None), ('pre', 'pre_install', None), Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Feb 28 11:16:43 2009 @@ -173,6 +173,11 @@ Library ------- +- Issue #1533164: Installed but not listed *.pyo was breaking Distutils + bdist_rpm command. + +- Issue #5378: added --quiet option to Distutils bdist_rpm command. + - Issue #5052: make Distutils compatible with 2.3 again. - Issue #5316: Fixed buildbot failures introduced by multiple inheritance From python-checkins at python.org Sat Feb 28 11:31:54 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 28 Feb 2009 11:31:54 +0100 (CET) Subject: [Python-checkins] r70052 - in python/trunk: Lib/test/test_mmap.py Misc/NEWS Modules/mmapmodule.c Message-ID: <20090228103154.C91271E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sat Feb 28 11:31:54 2009 New Revision: 70052 Log: Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer overrun. Modified: python/trunk/Lib/test/test_mmap.py python/trunk/Misc/NEWS python/trunk/Modules/mmapmodule.c Modified: python/trunk/Lib/test/test_mmap.py ============================================================================== --- python/trunk/Lib/test/test_mmap.py (original) +++ python/trunk/Lib/test/test_mmap.py Sat Feb 28 11:31:54 2009 @@ -467,6 +467,38 @@ self.assert_(issubclass(mmap.error, EnvironmentError)) self.assert_("mmap.error" in str(mmap.error)) + def test_io_methods(self): + data = "0123456789" + open(TESTFN, "wb").write("x"*len(data)) + f = open(TESTFN, "r+b") + m = mmap.mmap(f.fileno(), len(data)) + f.close() + # Test write_byte() + for i in xrange(len(data)): + self.assertEquals(m.tell(), i) + m.write_byte(data[i:i+1]) + self.assertEquals(m.tell(), i+1) + self.assertRaises(ValueError, m.write_byte, "x") + self.assertEquals(m[:], data) + # Test read_byte() + m.seek(0) + for i in xrange(len(data)): + self.assertEquals(m.tell(), i) + self.assertEquals(m.read_byte(), data[i:i+1]) + self.assertEquals(m.tell(), i+1) + self.assertRaises(ValueError, m.read_byte) + # Test read() + m.seek(3) + self.assertEquals(m.read(3), "345") + self.assertEquals(m.tell(), 6) + # Test write() + m.seek(3) + m.write("bar") + self.assertEquals(m.tell(), 6) + self.assertEquals(m[:], "012bar6789") + m.seek(8) + self.assertRaises(ValueError, m.write, "bar") + def test_main(): run_unittest(MmapTests) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Feb 28 11:31:54 2009 @@ -166,6 +166,9 @@ Library ------- +- Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer + overrun. + - Issue #1533164: Installed but not listed *.pyo was breaking Distutils bdist_rpm command. Modified: python/trunk/Modules/mmapmodule.c ============================================================================== --- python/trunk/Modules/mmapmodule.c (original) +++ python/trunk/Modules/mmapmodule.c Sat Feb 28 11:31:54 2009 @@ -365,10 +365,17 @@ if (!is_writeable(self)) return NULL; - *(self->data+self->pos) = value; - self->pos += 1; - Py_INCREF(Py_None); - return Py_None; + + if (self->pos < self->size) { + *(self->data+self->pos) = value; + self->pos += 1; + Py_INCREF(Py_None); + return Py_None; + } + else { + PyErr_SetString(PyExc_ValueError, "write byte out of range"); + return NULL; + } } static PyObject * From buildbot at python.org Sat Feb 28 11:51:32 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 28 Feb 2009 10:51:32 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090228105132.E05381E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/689 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sat Feb 28 11:56:50 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 28 Feb 2009 11:56:50 +0100 (CET) Subject: [Python-checkins] r70053 - in python/branches/py3k: Lib/test/test_mmap.py Misc/NEWS Modules/mmapmodule.c Message-ID: <20090228105650.E378F1E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sat Feb 28 11:56:50 2009 New Revision: 70053 Log: Merged revisions 70052 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70052 | hirokazu.yamamoto | 2009-02-28 19:31:54 +0900 | 2 lines Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer overrun. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_mmap.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/mmapmodule.c Modified: python/branches/py3k/Lib/test/test_mmap.py ============================================================================== --- python/branches/py3k/Lib/test/test_mmap.py (original) +++ python/branches/py3k/Lib/test/test_mmap.py Sat Feb 28 11:56:50 2009 @@ -466,6 +466,44 @@ self.assert_(issubclass(mmap.error, EnvironmentError)) self.assert_("mmap.error" in str(mmap.error)) + def test_io_methods(self): + data = b"0123456789" + open(TESTFN, "wb").write(b"x"*len(data)) + f = open(TESTFN, "r+b") + m = mmap.mmap(f.fileno(), len(data)) + f.close() + # Test write_byte() + for i in range(len(data)): + self.assertEquals(m.tell(), i) + m.write_byte(data[i:i+1]) + self.assertEquals(m.tell(), i+1) + self.assertRaises(ValueError, m.write_byte, b"x") + self.assertEquals(m[:], data) + # Test read_byte() + m.seek(0) + for i in range(len(data)): + self.assertEquals(m.tell(), i) + # XXX: Disable this test for now because it's not clear + # which type of object m.read_byte returns. Currently, it + # returns 1-length str (unicode). + if 0: + self.assertEquals(m.read_byte(), data[i:i+1]) + else: + m.read_byte() + self.assertEquals(m.tell(), i+1) + self.assertRaises(ValueError, m.read_byte) + # Test read() + m.seek(3) + self.assertEquals(m.read(3), b"345") + self.assertEquals(m.tell(), 6) + # Test write() + m.seek(3) + m.write(b"bar") + self.assertEquals(m.tell(), 6) + self.assertEquals(m[:], b"012bar6789") + m.seek(8) + self.assertRaises(ValueError, m.write, b"bar") + def test_main(): run_unittest(MmapTests) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Feb 28 11:56:50 2009 @@ -173,6 +173,9 @@ Library ------- +- Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer + overrun. + - Issue #1533164: Installed but not listed *.pyo was breaking Distutils bdist_rpm command. Modified: python/branches/py3k/Modules/mmapmodule.c ============================================================================== --- python/branches/py3k/Modules/mmapmodule.c (original) +++ python/branches/py3k/Modules/mmapmodule.c Sat Feb 28 11:56:50 2009 @@ -376,10 +376,17 @@ if (!is_writable(self)) return NULL; - *(self->data+self->pos) = value; - self->pos += 1; - Py_INCREF(Py_None); - return Py_None; + + if (self->pos < self->size) { + *(self->data+self->pos) = value; + self->pos += 1; + Py_INCREF(Py_None); + return Py_None; + } + else { + PyErr_SetString(PyExc_ValueError, "write byte out of range"); + return NULL; + } } static PyObject * From python-checkins at python.org Sat Feb 28 12:39:45 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 28 Feb 2009 12:39:45 +0100 (CET) Subject: [Python-checkins] r70054 - in python/branches/release26-maint: Lib/test/test_mmap.py Misc/NEWS Modules/mmapmodule.c Message-ID: <20090228113945.4C8751E402C@bag.python.org> Author: hirokazu.yamamoto Date: Sat Feb 28 12:39:45 2009 New Revision: 70054 Log: Merged revisions 70052 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70052 | hirokazu.yamamoto | 2009-02-28 19:31:54 +0900 | 2 lines Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer overrun. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_mmap.py python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/mmapmodule.c Modified: python/branches/release26-maint/Lib/test/test_mmap.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_mmap.py (original) +++ python/branches/release26-maint/Lib/test/test_mmap.py Sat Feb 28 12:39:45 2009 @@ -467,6 +467,38 @@ self.assert_(issubclass(mmap.error, EnvironmentError)) self.assert_("mmap.error" in str(mmap.error)) + def test_io_methods(self): + data = "0123456789" + open(TESTFN, "wb").write("x"*len(data)) + f = open(TESTFN, "r+b") + m = mmap.mmap(f.fileno(), len(data)) + f.close() + # Test write_byte() + for i in xrange(len(data)): + self.assertEquals(m.tell(), i) + m.write_byte(data[i:i+1]) + self.assertEquals(m.tell(), i+1) + self.assertRaises(ValueError, m.write_byte, "x") + self.assertEquals(m[:], data) + # Test read_byte() + m.seek(0) + for i in xrange(len(data)): + self.assertEquals(m.tell(), i) + self.assertEquals(m.read_byte(), data[i:i+1]) + self.assertEquals(m.tell(), i+1) + self.assertRaises(ValueError, m.read_byte) + # Test read() + m.seek(3) + self.assertEquals(m.read(3), "345") + self.assertEquals(m.tell(), 6) + # Test write() + m.seek(3) + m.write("bar") + self.assertEquals(m.tell(), 6) + self.assertEquals(m[:], "012bar6789") + m.seek(8) + self.assertRaises(ValueError, m.write, "bar") + def test_main(): run_unittest(MmapTests) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sat Feb 28 12:39:45 2009 @@ -89,6 +89,9 @@ Library ------- +- Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer + overrun. + - Issue #5292: Fixed mmap crash on its boundary access m[len(m)]. - Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0, Modified: python/branches/release26-maint/Modules/mmapmodule.c ============================================================================== --- python/branches/release26-maint/Modules/mmapmodule.c (original) +++ python/branches/release26-maint/Modules/mmapmodule.c Sat Feb 28 12:39:45 2009 @@ -365,10 +365,17 @@ if (!is_writeable(self)) return NULL; - *(self->data+self->pos) = value; - self->pos += 1; - Py_INCREF(Py_None); - return Py_None; + + if (self->pos < self->size) { + *(self->data+self->pos) = value; + self->pos += 1; + Py_INCREF(Py_None); + return Py_None; + } + else { + PyErr_SetString(PyExc_ValueError, "write byte out of range"); + return NULL; + } } static PyObject * From buildbot at python.org Sat Feb 28 12:43:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 28 Feb 2009 11:43:52 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090228114353.0384F1E4002@bag.python.org> The Buildbot has detected a new failure of OS X x86 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/192 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Abort trap sincerely, -The Buildbot From python-checkins at python.org Sat Feb 28 12:50:11 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 28 Feb 2009 12:50:11 +0100 (CET) Subject: [Python-checkins] r70055 - in python/branches/release30-maint: Lib/test/test_mmap.py Misc/NEWS Modules/mmapmodule.c Message-ID: <20090228115011.7F8411E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sat Feb 28 12:50:11 2009 New Revision: 70055 Log: Merged revisions 70053 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r70053 | hirokazu.yamamoto | 2009-02-28 19:56:50 +0900 | 10 lines Merged revisions 70052 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70052 | hirokazu.yamamoto | 2009-02-28 19:31:54 +0900 | 2 lines Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer overrun. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_mmap.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/mmapmodule.c Modified: python/branches/release30-maint/Lib/test/test_mmap.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_mmap.py (original) +++ python/branches/release30-maint/Lib/test/test_mmap.py Sat Feb 28 12:50:11 2009 @@ -466,6 +466,44 @@ self.assert_(issubclass(mmap.error, EnvironmentError)) self.assert_("mmap.error" in str(mmap.error)) + def test_io_methods(self): + data = b"0123456789" + open(TESTFN, "wb").write(b"x"*len(data)) + f = open(TESTFN, "r+b") + m = mmap.mmap(f.fileno(), len(data)) + f.close() + # Test write_byte() + for i in range(len(data)): + self.assertEquals(m.tell(), i) + m.write_byte(data[i:i+1]) + self.assertEquals(m.tell(), i+1) + self.assertRaises(ValueError, m.write_byte, b"x") + self.assertEquals(m[:], data) + # Test read_byte() + m.seek(0) + for i in range(len(data)): + self.assertEquals(m.tell(), i) + # XXX: Disable this test for now because it's not clear + # which type of object m.read_byte returns. Currently, it + # returns 1-length str (unicode). + if 0: + self.assertEquals(m.read_byte(), data[i:i+1]) + else: + m.read_byte() + self.assertEquals(m.tell(), i+1) + self.assertRaises(ValueError, m.read_byte) + # Test read() + m.seek(3) + self.assertEquals(m.read(3), b"345") + self.assertEquals(m.tell(), 6) + # Test write() + m.seek(3) + m.write(b"bar") + self.assertEquals(m.tell(), 6) + self.assertEquals(m[:], b"012bar6789") + m.seek(8) + self.assertRaises(ValueError, m.write, b"bar") + def test_main(): run_unittest(MmapTests) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat Feb 28 12:50:11 2009 @@ -147,6 +147,9 @@ Library ------- +- Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer + overrun. + - Issue #4998: The memory saving effect of __slots__ had been lost on Fractions which inherited from numbers.py which did not have __slots__ defined. The numbers hierarchy now has its own __slots__ declarations. Modified: python/branches/release30-maint/Modules/mmapmodule.c ============================================================================== --- python/branches/release30-maint/Modules/mmapmodule.c (original) +++ python/branches/release30-maint/Modules/mmapmodule.c Sat Feb 28 12:50:11 2009 @@ -376,10 +376,17 @@ if (!is_writable(self)) return NULL; - *(self->data+self->pos) = value; - self->pos += 1; - Py_INCREF(Py_None); - return Py_None; + + if (self->pos < self->size) { + *(self->data+self->pos) = value; + self->pos += 1; + Py_INCREF(Py_None); + return Py_None; + } + else { + PyErr_SetString(PyExc_ValueError, "write byte out of range"); + return NULL; + } } static PyObject * From buildbot at python.org Sat Feb 28 13:06:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 28 Feb 2009 12:06:28 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090228120629.1E3C11E4002@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/357 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 buildbot at python.org Sat Feb 28 13:07:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 28 Feb 2009 12:07:20 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090228120720.B92F01E4002@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/435 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: sincerely, -The Buildbot From buildbot at python.org Sat Feb 28 13:10:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 28 Feb 2009 12:10:09 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090228121009.2E2581E4002@bag.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/340 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 test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Feb 28 13:13:07 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 28 Feb 2009 13:13:07 +0100 (CET) Subject: [Python-checkins] r70056 - in python/trunk: Lib/test/test_mmap.py Misc/NEWS Modules/mmapmodule.c Message-ID: <20090228121307.9C91E1E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sat Feb 28 13:13:07 2009 New Revision: 70056 Log: Issue #1733986: Fixed mmap crash in accessing elements of second map object with same tagname but larger size than first map. (Windows) Modified: python/trunk/Lib/test/test_mmap.py python/trunk/Misc/NEWS python/trunk/Modules/mmapmodule.c Modified: python/trunk/Lib/test/test_mmap.py ============================================================================== --- python/trunk/Lib/test/test_mmap.py (original) +++ python/trunk/Lib/test/test_mmap.py Sat Feb 28 13:13:07 2009 @@ -499,6 +499,34 @@ m.seek(8) self.assertRaises(ValueError, m.write, "bar") + if os.name == 'nt': + def test_tagname(self): + data1 = "0123456789" + data2 = "abcdefghij" + assert len(data1) == len(data2) + # Test same tag + m1 = mmap.mmap(-1, len(data1), tagname="foo") + m1[:] = data1 + m2 = mmap.mmap(-1, len(data2), tagname="foo") + m2[:] = data2 + self.assertEquals(m1[:], data2) + self.assertEquals(m2[:], data2) + # Test differnt tag + m1 = mmap.mmap(-1, len(data1), tagname="foo") + m1[:] = data1 + m2 = mmap.mmap(-1, len(data2), tagname="boo") + m2[:] = data2 + self.assertEquals(m1[:], data1) + self.assertEquals(m2[:], data2) + + def test_tagname_crash(self): + # Should not crash (Issue 1733986) + m = mmap.mmap(-1, 1000, tagname="foo") + try: + mmap.mmap(-1, 5000, tagname="foo")[:] # same tagname, but larger size + except: + pass + def test_main(): run_unittest(MmapTests) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Feb 28 13:13:07 2009 @@ -166,6 +166,9 @@ Library ------- +- Issue #1733986: Fixed mmap crash in accessing elements of second map object + with same tagname but larger size than first map. (Windows) + - Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer overrun. Modified: python/trunk/Modules/mmapmodule.c ============================================================================== --- python/trunk/Modules/mmapmodule.c (original) +++ python/trunk/Modules/mmapmodule.c Sat Feb 28 13:13:07 2009 @@ -1373,7 +1373,7 @@ dwDesiredAccess, off_hi, off_lo, - 0); + m_obj->size); if (m_obj->data != NULL) return (PyObject *)m_obj; else From python-checkins at python.org Sat Feb 28 13:21:53 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 28 Feb 2009 13:21:53 +0100 (CET) Subject: [Python-checkins] r70057 - in python/branches/py3k: Lib/test/test_mmap.py Misc/NEWS Modules/mmapmodule.c Message-ID: <20090228122153.D94971E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sat Feb 28 13:21:53 2009 New Revision: 70057 Log: Merged revisions 70056 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70056 | hirokazu.yamamoto | 2009-02-28 21:13:07 +0900 | 2 lines Issue #1733986: Fixed mmap crash in accessing elements of second map object with same tagname but larger size than first map. (Windows) ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_mmap.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/mmapmodule.c Modified: python/branches/py3k/Lib/test/test_mmap.py ============================================================================== --- python/branches/py3k/Lib/test/test_mmap.py (original) +++ python/branches/py3k/Lib/test/test_mmap.py Sat Feb 28 13:21:53 2009 @@ -504,6 +504,34 @@ m.seek(8) self.assertRaises(ValueError, m.write, b"bar") + if os.name == 'nt': + def test_tagname(self): + data1 = b"0123456789" + data2 = b"abcdefghij" + assert len(data1) == len(data2) + # Test same tag + m1 = mmap.mmap(-1, len(data1), tagname="foo") + m1[:] = data1 + m2 = mmap.mmap(-1, len(data2), tagname="foo") + m2[:] = data2 + self.assertEquals(m1[:], data2) + self.assertEquals(m2[:], data2) + # Test differnt tag + m1 = mmap.mmap(-1, len(data1), tagname="foo") + m1[:] = data1 + m2 = mmap.mmap(-1, len(data2), tagname="boo") + m2[:] = data2 + self.assertEquals(m1[:], data1) + self.assertEquals(m2[:], data2) + + def test_tagname_crash(self): + # Should not crash (Issue 1733986) + m = mmap.mmap(-1, 1000, tagname="foo") + try: + mmap.mmap(-1, 5000, tagname="foo")[:] # same tagname, but larger size + except: + pass + def test_main(): run_unittest(MmapTests) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Feb 28 13:21:53 2009 @@ -173,6 +173,9 @@ Library ------- +- Issue #1733986: Fixed mmap crash in accessing elements of second map object + with same tagname but larger size than first map. (Windows) + - Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer overrun. Modified: python/branches/py3k/Modules/mmapmodule.c ============================================================================== --- python/branches/py3k/Modules/mmapmodule.c (original) +++ python/branches/py3k/Modules/mmapmodule.c Sat Feb 28 13:21:53 2009 @@ -1297,7 +1297,7 @@ dwDesiredAccess, off_hi, off_lo, - 0); + m_obj->size); if (m_obj->data != NULL) return (PyObject *)m_obj; else From python-checkins at python.org Sat Feb 28 13:33:03 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 28 Feb 2009 13:33:03 +0100 (CET) Subject: [Python-checkins] r70058 - in python/branches/release30-maint: Lib/test/test_mmap.py Misc/NEWS Modules/mmapmodule.c Message-ID: <20090228123303.93A141E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sat Feb 28 13:33:03 2009 New Revision: 70058 Log: Merged revisions 70057 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r70057 | hirokazu.yamamoto | 2009-02-28 21:21:53 +0900 | 10 lines Merged revisions 70056 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70056 | hirokazu.yamamoto | 2009-02-28 21:13:07 +0900 | 2 lines Issue #1733986: Fixed mmap crash in accessing elements of second map object with same tagname but larger size than first map. (Windows) ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_mmap.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/mmapmodule.c Modified: python/branches/release30-maint/Lib/test/test_mmap.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_mmap.py (original) +++ python/branches/release30-maint/Lib/test/test_mmap.py Sat Feb 28 13:33:03 2009 @@ -504,6 +504,34 @@ m.seek(8) self.assertRaises(ValueError, m.write, b"bar") + if os.name == 'nt': + def test_tagname(self): + data1 = b"0123456789" + data2 = b"abcdefghij" + assert len(data1) == len(data2) + # Test same tag + m1 = mmap.mmap(-1, len(data1), tagname="foo") + m1[:] = data1 + m2 = mmap.mmap(-1, len(data2), tagname="foo") + m2[:] = data2 + self.assertEquals(m1[:], data2) + self.assertEquals(m2[:], data2) + # Test differnt tag + m1 = mmap.mmap(-1, len(data1), tagname="foo") + m1[:] = data1 + m2 = mmap.mmap(-1, len(data2), tagname="boo") + m2[:] = data2 + self.assertEquals(m1[:], data1) + self.assertEquals(m2[:], data2) + + def test_tagname_crash(self): + # Should not crash (Issue 1733986) + m = mmap.mmap(-1, 1000, tagname="foo") + try: + mmap.mmap(-1, 5000, tagname="foo")[:] # same tagname, but larger size + except: + pass + def test_main(): run_unittest(MmapTests) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat Feb 28 13:33:03 2009 @@ -147,6 +147,9 @@ Library ------- +- Issue #1733986: Fixed mmap crash in accessing elements of second map object + with same tagname but larger size than first map. (Windows) + - Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer overrun. Modified: python/branches/release30-maint/Modules/mmapmodule.c ============================================================================== --- python/branches/release30-maint/Modules/mmapmodule.c (original) +++ python/branches/release30-maint/Modules/mmapmodule.c Sat Feb 28 13:33:03 2009 @@ -1297,7 +1297,7 @@ dwDesiredAccess, off_hi, off_lo, - 0); + m_obj->size); if (m_obj->data != NULL) return (PyObject *)m_obj; else From python-checkins at python.org Sat Feb 28 13:42:17 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 28 Feb 2009 13:42:17 +0100 (CET) Subject: [Python-checkins] r70059 - in python/branches/release26-maint: Lib/test/test_mmap.py Misc/NEWS Modules/mmapmodule.c Message-ID: <20090228124217.054BA1E4002@bag.python.org> Author: hirokazu.yamamoto Date: Sat Feb 28 13:42:16 2009 New Revision: 70059 Log: Merged revisions 70056 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70056 | hirokazu.yamamoto | 2009-02-28 21:13:07 +0900 | 2 lines Issue #1733986: Fixed mmap crash in accessing elements of second map object with same tagname but larger size than first map. (Windows) ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_mmap.py python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/mmapmodule.c Modified: python/branches/release26-maint/Lib/test/test_mmap.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_mmap.py (original) +++ python/branches/release26-maint/Lib/test/test_mmap.py Sat Feb 28 13:42:16 2009 @@ -499,6 +499,34 @@ m.seek(8) self.assertRaises(ValueError, m.write, "bar") + if os.name == 'nt': + def test_tagname(self): + data1 = "0123456789" + data2 = "abcdefghij" + assert len(data1) == len(data2) + # Test same tag + m1 = mmap.mmap(-1, len(data1), tagname="foo") + m1[:] = data1 + m2 = mmap.mmap(-1, len(data2), tagname="foo") + m2[:] = data2 + self.assertEquals(m1[:], data2) + self.assertEquals(m2[:], data2) + # Test differnt tag + m1 = mmap.mmap(-1, len(data1), tagname="foo") + m1[:] = data1 + m2 = mmap.mmap(-1, len(data2), tagname="boo") + m2[:] = data2 + self.assertEquals(m1[:], data1) + self.assertEquals(m2[:], data2) + + def test_tagname_crash(self): + # Should not crash (Issue 1733986) + m = mmap.mmap(-1, 1000, tagname="foo") + try: + mmap.mmap(-1, 5000, tagname="foo")[:] # same tagname, but larger size + except: + pass + def test_main(): run_unittest(MmapTests) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sat Feb 28 13:42:16 2009 @@ -89,6 +89,9 @@ Library ------- +- Issue #1733986: Fixed mmap crash in accessing elements of second map object + with same tagname but larger size than first map. (Windows) + - Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer overrun. Modified: python/branches/release26-maint/Modules/mmapmodule.c ============================================================================== --- python/branches/release26-maint/Modules/mmapmodule.c (original) +++ python/branches/release26-maint/Modules/mmapmodule.c Sat Feb 28 13:42:16 2009 @@ -1373,7 +1373,7 @@ dwDesiredAccess, off_hi, off_lo, - 0); + m_obj->size); if (m_obj->data != NULL) return (PyObject *)m_obj; else From buildbot at python.org Sat Feb 28 14:59:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 28 Feb 2009 13:59:56 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090228135957.57CA11E4002@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/382 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: sincerely, -The Buildbot From python-checkins at python.org Sat Feb 28 15:22:03 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 28 Feb 2009 15:22:03 +0100 (CET) Subject: [Python-checkins] r70060 - peps/trunk/pep-0376.txt Message-ID: <20090228142203.058741E4027@bag.python.org> Author: georg.brandl Date: Sat Feb 28 15:22:01 2009 New Revision: 70060 Log: Fix a few formal and grammatical issues. Modified: peps/trunk/pep-0376.txt Modified: peps/trunk/pep-0376.txt ============================================================================== --- peps/trunk/pep-0376.txt (original) +++ peps/trunk/pep-0376.txt Sat Feb 28 15:22:01 2009 @@ -10,7 +10,6 @@ Python-Version: 2.7, 3.1 Post-History: -.. contents:: Abstract ======== @@ -21,19 +20,18 @@ - An install script to install a package in Python. - An uninstall script to uninstall a package in Python. + Rationale ========= There are three problems right now in the way packages are installed in Python: -- There are too many ways to install a package in - Python. +- There are too many ways to install a package in Python. - There is no way to uninstall a package. -- There is no API to get the metadata of installed - packages. +- There is no API to get the metadata of installed packages. How packages are installed -------------------------- @@ -56,14 +54,14 @@ the `sdist` command. The problem is that many people use `easy_install` (setuptools) or `pip` -to install their packages. And these third-party tool does not install -the packages the same way Distutils does. +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, amongst other files. - `pip` creates an `.egg-info` directory inside the site-packages directory - besides the package, and adds an `PKG-INFO` file inside it. + besides the package, and adds a `PKG-INFO` file inside it. They both add other files in the `EGG-INFO` or `.egg-info` directory, and create or modify `.pth` files. `pip` also creates one `.pth` file @@ -77,11 +75,11 @@ 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 is that you depend on the way the packager created his package. +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 (distutils or setuptools). -But there's a common behavior : files are copied in your installation. +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. Installing a package @@ -93,7 +91,7 @@ - using `easy_install`, the script provided by setuptools - using `pip` -The problem is: they do no install the package the same way, +The problem is: they do not install the package the same way, and Python should provide one and only one way to do it. What this PEP proposes @@ -104,20 +102,21 @@ - a new `.egg-info` structure using a directory; - a list of elements this directory holds; - some new functions in `pkgutil` -- adding an install and an uninstall script +- addition of an install and an uninstall script + .egg-info becomes a directory ============================= -The first change would be to make `.egg-info` become a directory and +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. 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. -Although, it will impact the `setuptools` and `pip` project, but given -the fact that they already works with a directory that contains a +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. For example, if the `zlib` package is installed, two elements @@ -130,6 +129,7 @@ To be able to implement this change, the impacted code in Distutils is the `install_egg_info` command. + Adding MANIFEST and RECORD in the .egg-info directory ===================================================== @@ -137,12 +137,12 @@ time. They will all be UPPERCASE files. - the `MANIFEST` file built by the `sdist` command. Notice that - some fixes were made lately on the default files added in `MANIFEST` + some fixes were made lately on the default file names added in `MANIFEST` when `MANIFEST.in` is not provided (see #2279 for instance). - 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, like + command, and will always be generated. This will allow uninstall, as explained later in this PEP. The `install` command will record by default installed files in the @@ -168,6 +168,7 @@ XXX See if we want to keep the 2.5.2-py2.6 part + New functions in pkgutil ======================== @@ -178,10 +179,10 @@ - get_egg_info(pkg_name) -> path or None - Scans all site-packages directories and look for all `pkg_name.egg-info` - directory. Returns the directory path that contains a PKG-INFO that matches + Scans all site-packages directories and looks for all `pkg_name.egg-info` + directories. Returns the directory path that contains a PKG-INFO that matches `pkg_name` for the `name` metadata. Notice that there should be at most - one result. If moe that one path matches the pkg_name, a DistutilsError + one result. If more than one path matches the pkg_name, a DistutilsError is raised. If the directory is not found, returns None. @@ -197,9 +198,9 @@ Uses `get_egg_info` and gets any file inside the directory, pointed by filename. - filename is any value founded in `distutils.sdist.EGG_INFO_FILES` + filename can be any value found in `distutils.sdist.EGG_INFO_FILES`. -Let's use it over our `zlib` example:: +Let's use it with our `zlib` example:: >>> from pkgutil import get_egg_info, get_metadata, get_egg_info_file >>> get_egg_info('zlib') @@ -213,6 +214,7 @@ ... files + Adding an install and an uninstall script ========================================= @@ -225,24 +227,26 @@ - they add an entry in a .pth file A new script called `install.py` is added in a new directory called `scripts` -in Distutils, and let people run an installation using:: +in Distutils, and lets people run an installation using:: - $ python -m 'distutils.scripts.install' zlib + $ python -m distutils.scripts.install zlib -An uninstall command is added as well, that removes the files recorded -in the RECORD file. This removal will warn on file that no longer exists +An uninstall command is added as well that removes the files recorded +in the RECORD file. This removal will warn on files that no longer exist and will not take care of side effects, like the removal of a file used by another element of the system. XXX work to be done here : specification of the two commands (probably a mix of easy_install and pip) + Copyright ========= This document has been placed in the public domain. + .. Local Variables: mode: indented-text @@ -251,4 +255,3 @@ fill-column: 70 coding: utf-8 End: - From buildbot at python.org Sat Feb 28 16:06:10 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 28 Feb 2009 15:06:10 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 trunk Message-ID: <20090228150610.CDC601E4002@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%20trunk/builds/691 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sat Feb 28 16:24:00 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 28 Feb 2009 16:24:00 +0100 (CET) Subject: [Python-checkins] r70061 - python/trunk/Doc/library/mmap.rst Message-ID: <20090228152400.D60221E4034@bag.python.org> Author: hirokazu.yamamoto Date: Sat Feb 28 16:24:00 2009 New Revision: 70061 Log: Binary flag is needed on windows. Modified: python/trunk/Doc/library/mmap.rst Modified: python/trunk/Doc/library/mmap.rst ============================================================================== --- python/trunk/Doc/library/mmap.rst (original) +++ python/trunk/Doc/library/mmap.rst Sat Feb 28 16:24:00 2009 @@ -99,10 +99,10 @@ import mmap # write a simple example file - with open("hello.txt", "w") as f: + with open("hello.txt", "wb") as f: f.write("Hello Python!\n") - with open("hello.txt", "r+") as f: + with open("hello.txt", "r+b") as f: # memory-map the file, size 0 means whole file map = mmap.mmap(f.fileno(), 0) # read content via standard file methods From buildbot at python.org Sat Feb 28 16:32:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 28 Feb 2009 15:32:18 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090228153218.7392E1E4025@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/145 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: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sat Feb 28 16:50:40 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 28 Feb 2009 16:50:40 +0100 (CET) Subject: [Python-checkins] r70062 - python/trunk/Modules/cmathmodule.c Message-ID: <20090228155040.E6D001E4002@bag.python.org> Author: mark.dickinson Date: Sat Feb 28 16:50:40 2009 New Revision: 70062 Log: Issue #5393: typo in cmath.cos and cmath.cosh docstring Modified: python/trunk/Modules/cmathmodule.c Modified: python/trunk/Modules/cmathmodule.c ============================================================================== --- python/trunk/Modules/cmathmodule.c (original) +++ python/trunk/Modules/cmathmodule.c Sat Feb 28 16:50:40 2009 @@ -368,7 +368,7 @@ PyDoc_STRVAR(c_cos_doc, "cos(x)\n" -"n" +"\n" "Return the cosine of x."); @@ -427,7 +427,7 @@ PyDoc_STRVAR(c_cosh_doc, "cosh(x)\n" -"n" +"\n" "Return the hyperbolic cosine of x."); From python-checkins at python.org Sat Feb 28 16:53:25 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 28 Feb 2009 16:53:25 +0100 (CET) Subject: [Python-checkins] r70063 - in python/branches/py3k: Modules/cmathmodule.c Message-ID: <20090228155325.430CF1E4033@bag.python.org> Author: mark.dickinson Date: Sat Feb 28 16:53:24 2009 New Revision: 70063 Log: Merged revisions 70062 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70062 | mark.dickinson | 2009-02-28 15:50:40 +0000 (Sat, 28 Feb 2009) | 2 lines Issue #5393: typo in cmath.cos and cmath.cosh docstring ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Modules/cmathmodule.c Modified: python/branches/py3k/Modules/cmathmodule.c ============================================================================== --- python/branches/py3k/Modules/cmathmodule.c (original) +++ python/branches/py3k/Modules/cmathmodule.c Sat Feb 28 16:53:24 2009 @@ -368,7 +368,7 @@ PyDoc_STRVAR(c_cos_doc, "cos(x)\n" -"n" +"\n" "Return the cosine of x."); @@ -427,7 +427,7 @@ PyDoc_STRVAR(c_cosh_doc, "cosh(x)\n" -"n" +"\n" "Return the hyperbolic cosine of x."); From python-checkins at python.org Sat Feb 28 16:54:47 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 28 Feb 2009 16:54:47 +0100 (CET) Subject: [Python-checkins] r70064 - in python/branches/release30-maint: Modules/cmathmodule.c Message-ID: <20090228155447.7FB491E4002@bag.python.org> Author: mark.dickinson Date: Sat Feb 28 16:54:47 2009 New Revision: 70064 Log: Merged revisions 70063 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r70063 | mark.dickinson | 2009-02-28 15:53:24 +0000 (Sat, 28 Feb 2009) | 9 lines Merged revisions 70062 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70062 | mark.dickinson | 2009-02-28 15:50:40 +0000 (Sat, 28 Feb 2009) | 2 lines Issue #5393: typo in cmath.cos and cmath.cosh docstring ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Modules/cmathmodule.c Modified: python/branches/release30-maint/Modules/cmathmodule.c ============================================================================== --- python/branches/release30-maint/Modules/cmathmodule.c (original) +++ python/branches/release30-maint/Modules/cmathmodule.c Sat Feb 28 16:54:47 2009 @@ -368,7 +368,7 @@ PyDoc_STRVAR(c_cos_doc, "cos(x)\n" -"n" +"\n" "Return the cosine of x."); @@ -427,7 +427,7 @@ PyDoc_STRVAR(c_cosh_doc, "cosh(x)\n" -"n" +"\n" "Return the hyperbolic cosine of x."); From python-checkins at python.org Sat Feb 28 16:56:35 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 28 Feb 2009 16:56:35 +0100 (CET) Subject: [Python-checkins] r70065 - in python/branches/release26-maint: Modules/cmathmodule.c Message-ID: <20090228155635.3FA681E4002@bag.python.org> Author: mark.dickinson Date: Sat Feb 28 16:56:34 2009 New Revision: 70065 Log: Merged revisions 70062 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70062 | mark.dickinson | 2009-02-28 15:50:40 +0000 (Sat, 28 Feb 2009) | 2 lines Issue #5393: typo in cmath.cos and cmath.cosh docstring ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Modules/cmathmodule.c Modified: python/branches/release26-maint/Modules/cmathmodule.c ============================================================================== --- python/branches/release26-maint/Modules/cmathmodule.c (original) +++ python/branches/release26-maint/Modules/cmathmodule.c Sat Feb 28 16:56:34 2009 @@ -368,7 +368,7 @@ PyDoc_STRVAR(c_cos_doc, "cos(x)\n" -"n" +"\n" "Return the cosine of x."); @@ -427,7 +427,7 @@ PyDoc_STRVAR(c_cosh_doc, "cosh(x)\n" -"n" +"\n" "Return the hyperbolic cosine of x."); From buildbot at python.org Sat Feb 28 17:18:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 28 Feb 2009 16:18:48 +0000 Subject: [Python-checkins] buildbot failure in OS X x86 trunk Message-ID: <20090228161848.5BFEB1E4002@bag.python.org> The Buildbot has detected a new failure of OS X x86 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/194 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: noller-osx86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: hirokazu.yamamoto,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/bsddb/test/test_thread.py", line 306, in readerThread rec = dbutils.DeadlockWrap(c.next, max_retries=10) File "/Users/buildbot/buildarea/trunk.noller-osx86/build/Lib/bsddb/dbutils.py", line 68, in DeadlockWrap return function(*_args, **_kwargs) DBLockDeadlockError: (-30995, 'DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock') 1 test failed: test_poll make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 28 17:26:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 28 Feb 2009 16:26:38 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090228162638.DB5E51E4002@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/346 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: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sat Feb 28 17:38:22 2009 From: python-checkins at python.org (alexandre.vassalotti) Date: Sat, 28 Feb 2009 17:38:22 +0100 (CET) Subject: [Python-checkins] r70066 - peps/trunk/pep-0374.txt Message-ID: <20090228163822.BC63F1E4002@bag.python.org> Author: alexandre.vassalotti Date: Sat Feb 28 17:38:22 2009 New Revision: 70066 Log: Fix issue dependency example for Mercurial. The previous example was removing the temporary branch before merging the changes in it to somewhere more permanent. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Sat Feb 28 17:38:22 2009 @@ -1063,8 +1063,11 @@ hg unshelve # Complete initial fix. hg commit - cd .. - rm -rf issue0000 + 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. From python-checkins at python.org Sat Feb 28 17:43:20 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 Feb 2009 17:43:20 +0100 (CET) Subject: [Python-checkins] r70067 - python/branches/io-c/Lib/_pyio.py Message-ID: <20090228164320.EB8C41E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 28 17:43:20 2009 New Revision: 70067 Log: 1. make sure to undo buffered read aheads in BufferedRandom.seek() 2. refill the buffer if have <= 0 3. fix the last failing test_io test! Modified: python/branches/io-c/Lib/_pyio.py Modified: python/branches/io-c/Lib/_pyio.py ============================================================================== --- python/branches/io-c/Lib/_pyio.py (original) +++ python/branches/io-c/Lib/_pyio.py Sat Feb 28 17:43:20 2009 @@ -916,7 +916,7 @@ def _peek_unlocked(self, n=0): want = min(n, self.buffer_size) have = len(self._read_buf) - self._read_pos - if have < want: + if have < want or have <= 0: to_read = self.buffer_size - have current = self.raw.read(to_read) if current: @@ -1130,6 +1130,10 @@ if not (0 <= whence <= 2): raise ValueError("invalid whence") self.flush() + if self._read_buf: + # Undo read ahead. + with self._read_lock: + self.raw.seek(self._read_pos - len(self._read_buf), 1) # First do the raw seek, then empty the read buffer, so that # if the raw seek fails, we don't lose buffered data forever. pos = self.raw.seek(pos, whence) From python-checkins at python.org Sat Feb 28 17:57:50 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 Feb 2009 17:57:50 +0100 (CET) Subject: [Python-checkins] r70068 - python/branches/io-c/Lib/_pyio.py Message-ID: <20090228165750.8E8041E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 28 17:57:50 2009 New Revision: 70068 Log: define read1() on the python implementation's BufferedIOBase Modified: python/branches/io-c/Lib/_pyio.py Modified: python/branches/io-c/Lib/_pyio.py ============================================================================== --- python/branches/io-c/Lib/_pyio.py (original) +++ python/branches/io-c/Lib/_pyio.py Sat Feb 28 17:57:50 2009 @@ -599,6 +599,10 @@ """ self._unsupported("read") + def read1(self, n: int=None) -> bytes: + """Read up to n bytes with at most one read() system call.""" + self._unsupported("read1") + def readinto(self, b: bytearray) -> int: """Read up to len(b) bytes into b. From python-checkins at python.org Sat Feb 28 18:01:17 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 Feb 2009 18:01:17 +0100 (CET) Subject: [Python-checkins] r70069 - python/branches/io-c/Doc/library/io.rst Message-ID: <20090228170117.70C691E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 28 18:01:17 2009 New Revision: 70069 Log: document read1() in BufferedIOBase Modified: python/branches/io-c/Doc/library/io.rst Modified: python/branches/io-c/Doc/library/io.rst ============================================================================== --- python/branches/io-c/Doc/library/io.rst (original) +++ python/branches/io-c/Doc/library/io.rst Sat Feb 28 18:01:17 2009 @@ -364,6 +364,11 @@ A :exc:`BlockingIOError` is raised if the underlying raw stream has no data at the moment. + .. method:: read1([n]) + + Read and return up to *n* bytes, with at most one call to the underlying + raw stream's :meth:`~RawIOBase.read` method. + .. method:: readinto(b) Read up to len(b) bytes into bytearray *b* and return the number of bytes From python-checkins at python.org Sat Feb 28 18:06:43 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 Feb 2009 18:06:43 +0100 (CET) Subject: [Python-checkins] r70070 - in python/branches/io-c: Doc/library/io.rst Lib/io.py Message-ID: <20090228170643.97D9F1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 28 18:06:42 2009 New Revision: 70070 Log: give credit where credit is due Modified: python/branches/io-c/Doc/library/io.rst python/branches/io-c/Lib/io.py Modified: python/branches/io-c/Doc/library/io.rst ============================================================================== --- python/branches/io-c/Doc/library/io.rst (original) +++ python/branches/io-c/Doc/library/io.rst Sat Feb 28 18:06:42 2009 @@ -6,6 +6,8 @@ .. moduleauthor:: Guido van Rossum .. moduleauthor:: Mike Verdone .. moduleauthor:: Mark Russell +.. moduleauthor:: Antoine Pitrou +.. moduleauthor:: Amaury Forgeotdarc .. sectionauthor:: Benjamin Peterson The :mod:`io` module provides the Python interfaces to stream handling. The Modified: python/branches/io-c/Lib/io.py ============================================================================== --- python/branches/io-c/Lib/io.py (original) +++ python/branches/io-c/Lib/io.py Sat Feb 28 18:06:42 2009 @@ -45,7 +45,9 @@ __author__ = ("Guido van Rossum , " "Mike Verdone , " - "Mark Russell ") + "Mark Russell , " + "Antoine Pitrou , " + "Amaury Forgeotdarc ") __all__ = ["BlockingIOError", "open", "IOBase", "RawIOBase", "FileIO", "BytesIO", "StringIO", "BufferedIOBase", From buildbot at python.org Sat Feb 28 18:25:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 28 Feb 2009 17:25:30 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090228172530.9720E1E4002@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/186 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: hirokazu.yamamoto 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 Sat Feb 28 18:34:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 28 Feb 2009 17:34:20 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.6 Message-ID: <20090228173421.9E88C1E4002@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/118 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: a DOS box should flash briefly ... sincerely, -The Buildbot From buildbot at python.org Sat Feb 28 18:47:04 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 28 Feb 2009 17:47:04 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090228174704.B394E1E4063@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/153 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: Traceback (most recent call last): File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/threading.py", line 522, in __bootstrap_inner self.run() File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/test/test_ftplib.py", line 203, in run asyncore.loop(timeout=0.1, count=1) File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/asyncore.py", line 204, in loop poll_fun(timeout, map) File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/asyncore.py", line 141, in poll read(obj) File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/asyncore.py", line 78, in read obj.handle_error() File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/asyncore.py", line 74, in read obj.handle_read_event() File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/asyncore.py", line 413, in handle_read_event self.handle_read() File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/test/test_ssl.py", line 408, in handle_read self.send(data.lower()) File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/asyncore.py", line 519, in send self.initiate_send() File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/asyncore.py", line 506, in initiate_send num_sent = dispatcher.send(self, self.out_buffer[:512]) File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/asyncore.py", line 349, in send result = self.socket.send(data) File "/Users/buildbot/buildarea/2.6.heller-x86-osx5/build/Lib/socket.py", line 165, in _dummy raise error(EBADF, 'Bad file descriptor') error: [Errno 9] Bad file descriptor 1 test failed: test_ftplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 28 19:16:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 28 Feb 2009 18:16:11 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090228181612.821991E404A@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/359 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 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 98, 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 Sat Feb 28 20:03:21 2009 From: python-checkins at python.org (jeffrey.yasskin) Date: Sat, 28 Feb 2009 20:03:21 +0100 (CET) Subject: [Python-checkins] r70071 - in python/trunk: Doc/library/dis.rst Include/opcode.h Lib/compiler/pyassem.py Lib/compiler/pycodegen.py Lib/opcode.py Lib/test/test_dis.py Lib/test/test_peepholer.py Python/ceval.c Python/compile.c Python/import.c Python/peephole.c Message-ID: <20090228190321.E5E251E4011@bag.python.org> Author: jeffrey.yasskin Date: Sat Feb 28 20:03:21 2009 New Revision: 70071 Log: Backport r69961 to trunk, replacing JUMP_IF_{TRUE,FALSE} with POP_JUMP_IF_{TRUE,FALSE} and JUMP_IF_{TRUE,FALSE}_OR_POP. This avoids executing a POP_TOP on each conditional and sometimes allows the peephole optimizer to skip a JUMP_ABSOLUTE entirely. It speeds up list comprehensions significantly. Modified: python/trunk/Doc/library/dis.rst python/trunk/Include/opcode.h python/trunk/Lib/compiler/pyassem.py python/trunk/Lib/compiler/pycodegen.py python/trunk/Lib/opcode.py python/trunk/Lib/test/test_dis.py python/trunk/Lib/test/test_peepholer.py python/trunk/Python/ceval.c python/trunk/Python/compile.c python/trunk/Python/import.c python/trunk/Python/peephole.c Modified: python/trunk/Doc/library/dis.rst ============================================================================== --- python/trunk/Doc/library/dis.rst (original) +++ python/trunk/Doc/library/dis.rst Sat Feb 28 20:03:21 2009 @@ -664,16 +664,26 @@ Increments bytecode counter by *delta*. -.. opcode:: JUMP_IF_TRUE (delta) +.. opcode:: POP_JUMP_IF_TRUE (target) - If TOS is true, increment the bytecode counter by *delta*. TOS is left on the - stack. + If TOS is true, sets the bytecode counter to *target*. TOS is popped. -.. opcode:: JUMP_IF_FALSE (delta) +.. opcode:: POP_JUMP_IF_FALSE (target) - If TOS is false, increment the bytecode counter by *delta*. TOS is not - changed. + If TOS is false, sets the bytecode counter to *target*. TOS is popped. + + +.. opcode:: JUMP_IF_TRUE_OR_POP (target) + + If TOS is true, sets the bytecode counter to *target* and leaves TOS + on the stack. Otherwise (TOS is false), TOS is popped. + + +.. opcode:: JUMP_IF_FALSE_OR_POP (target) + + If TOS is false, sets the bytecode counter to *target* and leaves + TOS on the stack. Otherwise (TOS is true), TOS is popped. .. opcode:: JUMP_ABSOLUTE (target) Modified: python/trunk/Include/opcode.h ============================================================================== --- python/trunk/Include/opcode.h (original) +++ python/trunk/Include/opcode.h Sat Feb 28 20:03:21 2009 @@ -106,9 +106,12 @@ #define IMPORT_FROM 108 /* Index in name list */ #define JUMP_FORWARD 110 /* Number of bytes to skip */ -#define JUMP_IF_FALSE 111 /* "" */ -#define JUMP_IF_TRUE 112 /* "" */ -#define JUMP_ABSOLUTE 113 /* Target byte offset from beginning of code */ +#define JUMP_IF_FALSE_OR_POP 111 /* Target byte offset from beginning + of code */ +#define JUMP_IF_TRUE_OR_POP 112 /* "" */ +#define JUMP_ABSOLUTE 113 /* "" */ +#define POP_JUMP_IF_FALSE 114 /* "" */ +#define POP_JUMP_IF_TRUE 115 /* "" */ #define LOAD_GLOBAL 116 /* Index in name list */ Modified: python/trunk/Lib/compiler/pyassem.py ============================================================================== --- python/trunk/Lib/compiler/pyassem.py (original) +++ python/trunk/Lib/compiler/pyassem.py Sat Feb 28 20:03:21 2009 @@ -122,6 +122,9 @@ for b in remaining: if __debug__ and b.next: assert b is b.next[0].prev[0], (b, b.next) + # Make sure every block appears in dominators, even if no + # other block must precede it. + dominators.setdefault(b, set()) # preceeding blocks dominate following blocks for c in b.get_followers(): while 1: Modified: python/trunk/Lib/compiler/pycodegen.py ============================================================================== --- python/trunk/Lib/compiler/pycodegen.py (original) +++ python/trunk/Lib/compiler/pycodegen.py Sat Feb 28 20:03:21 2009 @@ -421,13 +421,11 @@ self.set_lineno(test) self.visit(test) nextTest = self.newBlock() - self.emit('JUMP_IF_FALSE', nextTest) + self.emit('POP_JUMP_IF_FALSE', nextTest) self.nextBlock() - self.emit('POP_TOP') self.visit(suite) self.emit('JUMP_FORWARD', end) self.startBlock(nextTest) - self.emit('POP_TOP') if node.else_: self.visit(node.else_) self.nextBlock(end) @@ -446,15 +444,13 @@ self.set_lineno(node, force=True) self.visit(node.test) - self.emit('JUMP_IF_FALSE', else_ or after) + self.emit('POP_JUMP_IF_FALSE', else_ or after) self.nextBlock() - self.emit('POP_TOP') self.visit(node.body) self.emit('JUMP_ABSOLUTE', loop) self.startBlock(else_) # or just the POPs if not else clause - self.emit('POP_TOP') self.emit('POP_BLOCK') self.setups.pop() if node.else_: @@ -525,26 +521,23 @@ self.visit(child) self.emit(jump, end) self.nextBlock() - self.emit('POP_TOP') self.visit(node.nodes[-1]) self.nextBlock(end) def visitAnd(self, node): - self.visitTest(node, 'JUMP_IF_FALSE') + self.visitTest(node, 'JUMP_IF_FALSE_OR_POP') def visitOr(self, node): - self.visitTest(node, 'JUMP_IF_TRUE') + self.visitTest(node, 'JUMP_IF_TRUE_OR_POP') def visitIfExp(self, node): endblock = self.newBlock() elseblock = self.newBlock() self.visit(node.test) - self.emit('JUMP_IF_FALSE', elseblock) - self.emit('POP_TOP') + self.emit('POP_JUMP_IF_FALSE', elseblock) self.visit(node.then) self.emit('JUMP_FORWARD', endblock) self.nextBlock(elseblock) - self.emit('POP_TOP') self.visit(node.else_) self.nextBlock(endblock) @@ -556,9 +549,8 @@ self.emit('DUP_TOP') self.emit('ROT_THREE') self.emit('COMPARE_OP', op) - self.emit('JUMP_IF_FALSE', cleanup) + self.emit('JUMP_IF_FALSE_OR_POP', cleanup) self.nextBlock() - self.emit('POP_TOP') # now do the last comparison if node.ops: op, code = node.ops[-1] @@ -593,11 +585,7 @@ for start, cont, anchor in stack: if cont: - skip_one = self.newBlock() - self.emit('JUMP_FORWARD', skip_one) - self.startBlock(cont) - self.emit('POP_TOP') - self.nextBlock(skip_one) + self.nextBlock(cont) self.emit('JUMP_ABSOLUTE', start) self.startBlock(anchor) @@ -617,9 +605,8 @@ def visitListCompIf(self, node, branch): self.set_lineno(node, force=True) self.visit(node.test) - self.emit('JUMP_IF_FALSE', branch) + self.emit('POP_JUMP_IF_FALSE', branch) self.newBlock() - self.emit('POP_TOP') def _makeClosure(self, gen, args): frees = gen.scope.get_free_vars() @@ -665,11 +652,7 @@ for start, cont, anchor, end in stack: if cont: - skip_one = self.newBlock() - self.emit('JUMP_FORWARD', skip_one) - self.startBlock(cont) - self.emit('POP_TOP') - self.nextBlock(skip_one) + self.nextBlock(cont) self.emit('JUMP_ABSOLUTE', start) self.startBlock(anchor) self.emit('POP_BLOCK') @@ -702,9 +685,8 @@ def visitGenExprIf(self, node, branch): self.set_lineno(node, force=True) self.visit(node.test) - self.emit('JUMP_IF_FALSE', branch) + self.emit('POP_JUMP_IF_FALSE', branch) self.newBlock() - self.emit('POP_TOP') # exception related @@ -719,9 +701,8 @@ # is a sort of renaming op. self.nextBlock() self.visit(node.test) - self.emit('JUMP_IF_TRUE', end) + self.emit('POP_JUMP_IF_TRUE', end) self.nextBlock() - self.emit('POP_TOP') self.emit('LOAD_GLOBAL', 'AssertionError') if node.fail: self.visit(node.fail) @@ -729,7 +710,6 @@ else: self.emit('RAISE_VARARGS', 1) self.nextBlock(end) - self.emit('POP_TOP') def visitRaise(self, node): self.set_lineno(node) @@ -772,9 +752,8 @@ self.visit(expr) self.emit('COMPARE_OP', 'exception match') next = self.newBlock() - self.emit('JUMP_IF_FALSE', next) + self.emit('POP_JUMP_IF_FALSE', next) self.nextBlock() - self.emit('POP_TOP') self.emit('POP_TOP') if target: self.visit(target) @@ -787,8 +766,6 @@ self.nextBlock(next) else: self.nextBlock() - if expr: # XXX - self.emit('POP_TOP') self.emit('END_FINALLY') if node.else_: self.nextBlock(lElse) Modified: python/trunk/Lib/opcode.py ============================================================================== --- python/trunk/Lib/opcode.py (original) +++ python/trunk/Lib/opcode.py Sat Feb 28 20:03:21 2009 @@ -146,9 +146,11 @@ name_op('IMPORT_FROM', 108) # Index in name list jrel_op('JUMP_FORWARD', 110) # Number of bytes to skip -jrel_op('JUMP_IF_FALSE', 111) # "" -jrel_op('JUMP_IF_TRUE', 112) # "" -jabs_op('JUMP_ABSOLUTE', 113) # Target byte offset from beginning of code +jabs_op('JUMP_IF_FALSE_OR_POP', 111) # Target byte offset from beginning of code +jabs_op('JUMP_IF_TRUE_OR_POP', 112) # "" +jabs_op('JUMP_ABSOLUTE', 113) # "" +jabs_op('POP_JUMP_IF_FALSE', 114) # "" +jabs_op('POP_JUMP_IF_TRUE', 115) # "" name_op('LOAD_GLOBAL', 116) # Index in name list Modified: python/trunk/Lib/test/test_dis.py ============================================================================== --- python/trunk/Lib/test/test_dis.py (original) +++ python/trunk/Lib/test/test_dis.py Sat Feb 28 20:03:21 2009 @@ -54,25 +54,23 @@ dis_bug1333982 = """\ %-4d 0 LOAD_CONST 1 (0) - 3 JUMP_IF_TRUE 33 (to 39) - 6 POP_TOP - 7 LOAD_GLOBAL 0 (AssertionError) - 10 BUILD_LIST 0 - 13 LOAD_FAST 0 (x) - 16 GET_ITER - >> 17 FOR_ITER 12 (to 32) - 20 STORE_FAST 1 (s) - 23 LOAD_FAST 1 (s) - 26 LIST_APPEND 2 - 29 JUMP_ABSOLUTE 17 - - %-4d >> 32 LOAD_CONST 2 (1) - 35 BINARY_ADD - 36 RAISE_VARARGS 2 - >> 39 POP_TOP + 3 POP_JUMP_IF_TRUE 38 + 6 LOAD_GLOBAL 0 (AssertionError) + 9 BUILD_LIST 0 + 12 LOAD_FAST 0 (x) + 15 GET_ITER + >> 16 FOR_ITER 12 (to 31) + 19 STORE_FAST 1 (s) + 22 LOAD_FAST 1 (s) + 25 LIST_APPEND 2 + 28 JUMP_ABSOLUTE 16 + + %-4d >> 31 LOAD_CONST 2 (1) + 34 BINARY_ADD + 35 RAISE_VARARGS 2 - %-4d 40 LOAD_CONST 0 (None) - 43 RETURN_VALUE + %-4d >> 38 LOAD_CONST 0 (None) + 41 RETURN_VALUE """%(bug1333982.func_code.co_firstlineno + 1, bug1333982.func_code.co_firstlineno + 2, bug1333982.func_code.co_firstlineno + 3) Modified: python/trunk/Lib/test/test_peepholer.py ============================================================================== --- python/trunk/Lib/test/test_peepholer.py (original) +++ python/trunk/Lib/test/test_peepholer.py Sat Feb 28 20:03:21 2009 @@ -19,15 +19,14 @@ class TestTranforms(unittest.TestCase): def test_unot(self): - # UNARY_NOT JUMP_IF_FALSE POP_TOP --> JUMP_IF_TRUE POP_TOP' + # UNARY_NOT POP_JUMP_IF_FALSE --> POP_JUMP_IF_TRUE def unot(x): if not x == 2: del x asm = disassemble(unot) - for elem in ('UNARY_NOT', 'JUMP_IF_FALSE'): + for elem in ('UNARY_NOT', 'POP_JUMP_IF_FALSE'): self.assert_(elem not in asm) - for elem in ('JUMP_IF_TRUE', 'POP_TOP'): - self.assert_(elem in asm) + self.assert_('POP_JUMP_IF_TRUE' in asm) def test_elim_inversion_of_is_or_in(self): for line, elem in ( @@ -56,13 +55,13 @@ self.assert_('LOAD_GLOBAL' not in disassemble(f)) def test_while_one(self): - # Skip over: LOAD_CONST trueconst JUMP_IF_FALSE xx POP_TOP + # Skip over: LOAD_CONST trueconst POP_JUMP_IF_FALSE xx def f(): while 1: pass return list asm = disassemble(f) - for elem in ('LOAD_CONST', 'JUMP_IF_FALSE'): + for elem in ('LOAD_CONST', 'POP_JUMP_IF_FALSE'): self.assert_(elem not in asm) for elem in ('JUMP_ABSOLUTE',): self.assert_(elem in asm) Modified: python/trunk/Python/ceval.c ============================================================================== --- python/trunk/Python/ceval.c (original) +++ python/trunk/Python/ceval.c Sat Feb 28 20:03:21 2009 @@ -764,8 +764,8 @@ /* OpCode prediction macros Some opcodes tend to come in pairs thus making it possible to predict the second code when the first is run. For example, - COMPARE_OP is often followed by JUMP_IF_FALSE or JUMP_IF_TRUE. And, - those opcodes are often followed by a POP_TOP. + GET_ITER is often followed by FOR_ITER. And FOR_ITER is often + followed by STORE_FAST or UNPACK_SEQUENCE. Verifying the prediction costs a single high-speed test of a register variable against a constant. If the pairing was good, then the @@ -1110,7 +1110,6 @@ SETLOCAL(oparg, v); goto fast_next_opcode; - PREDICTED(POP_TOP); case POP_TOP: v = POP(); Py_DECREF(v); @@ -2220,8 +2219,8 @@ Py_DECREF(w); SET_TOP(x); if (x == NULL) break; - PREDICT(JUMP_IF_FALSE); - PREDICT(JUMP_IF_TRUE); + PREDICT(POP_JUMP_IF_FALSE); + PREDICT(POP_JUMP_IF_TRUE); continue; case IMPORT_NAME: @@ -2298,41 +2297,45 @@ JUMPBY(oparg); goto fast_next_opcode; - PREDICTED_WITH_ARG(JUMP_IF_FALSE); - case JUMP_IF_FALSE: - w = TOP(); + PREDICTED_WITH_ARG(POP_JUMP_IF_FALSE); + case POP_JUMP_IF_FALSE: + w = POP(); if (w == Py_True) { - PREDICT(POP_TOP); + Py_DECREF(w); goto fast_next_opcode; } if (w == Py_False) { - JUMPBY(oparg); + Py_DECREF(w); + JUMPTO(oparg); goto fast_next_opcode; } err = PyObject_IsTrue(w); + Py_DECREF(w); if (err > 0) err = 0; else if (err == 0) - JUMPBY(oparg); + JUMPTO(oparg); else break; continue; - PREDICTED_WITH_ARG(JUMP_IF_TRUE); - case JUMP_IF_TRUE: - w = TOP(); + PREDICTED_WITH_ARG(POP_JUMP_IF_TRUE); + case POP_JUMP_IF_TRUE: + w = POP(); if (w == Py_False) { - PREDICT(POP_TOP); + Py_DECREF(w); goto fast_next_opcode; } if (w == Py_True) { - JUMPBY(oparg); + Py_DECREF(w); + JUMPTO(oparg); goto fast_next_opcode; } err = PyObject_IsTrue(w); + Py_DECREF(w); if (err > 0) { err = 0; - JUMPBY(oparg); + JUMPTO(oparg); } else if (err == 0) ; @@ -2340,6 +2343,53 @@ break; continue; + case JUMP_IF_FALSE_OR_POP: + w = TOP(); + if (w == Py_True) { + STACKADJ(-1); + Py_DECREF(w); + goto fast_next_opcode; + } + if (w == Py_False) { + JUMPTO(oparg); + goto fast_next_opcode; + } + err = PyObject_IsTrue(w); + if (err > 0) { + STACKADJ(-1); + Py_DECREF(w); + err = 0; + } + else if (err == 0) + JUMPTO(oparg); + else + break; + continue; + + case JUMP_IF_TRUE_OR_POP: + w = TOP(); + if (w == Py_False) { + STACKADJ(-1); + Py_DECREF(w); + goto fast_next_opcode; + } + if (w == Py_True) { + JUMPTO(oparg); + goto fast_next_opcode; + } + err = PyObject_IsTrue(w); + if (err > 0) { + err = 0; + JUMPTO(oparg); + } + else if (err == 0) { + STACKADJ(-1); + Py_DECREF(w); + } + else + break; + continue; + PREDICTED_WITH_ARG(JUMP_ABSOLUTE); case JUMP_ABSOLUTE: JUMPTO(oparg); Modified: python/trunk/Python/compile.c ============================================================================== --- python/trunk/Python/compile.c (original) +++ python/trunk/Python/compile.c Sat Feb 28 20:03:21 2009 @@ -836,11 +836,15 @@ return 1; case JUMP_FORWARD: - case JUMP_IF_FALSE: - case JUMP_IF_TRUE: + case JUMP_IF_TRUE_OR_POP: /* -1 if jump not taken */ + case JUMP_IF_FALSE_OR_POP: /* "" */ case JUMP_ABSOLUTE: return 0; + case POP_JUMP_IF_FALSE: + case POP_JUMP_IF_TRUE: + return -1; + case LOAD_GLOBAL: return 1; @@ -1499,12 +1503,10 @@ if (next == NULL) return 0; VISIT(c, expr, e->v.IfExp.test); - ADDOP_JREL(c, JUMP_IF_FALSE, next); - ADDOP(c, POP_TOP); + ADDOP_JABS(c, POP_JUMP_IF_FALSE, next); VISIT(c, expr, e->v.IfExp.body); ADDOP_JREL(c, JUMP_FORWARD, end); compiler_use_next_block(c, next); - ADDOP(c, POP_TOP); VISIT(c, expr, e->v.IfExp.orelse); compiler_use_next_block(c, end); return 1; @@ -1597,9 +1599,6 @@ end = compiler_new_block(c); if (end == NULL) return 0; - next = compiler_new_block(c); - if (next == NULL) - return 0; constant = expr_constant(s->v.If.test); /* constant = 0: "if 0" @@ -1611,15 +1610,21 @@ } else if (constant == 1) { VISIT_SEQ(c, stmt, s->v.If.body); } else { + if (s->v.If.orelse) { + next = compiler_new_block(c); + if (next == NULL) + return 0; + } + else + next = end; VISIT(c, expr, s->v.If.test); - ADDOP_JREL(c, JUMP_IF_FALSE, next); - ADDOP(c, POP_TOP); + ADDOP_JABS(c, POP_JUMP_IF_FALSE, next); VISIT_SEQ(c, stmt, s->v.If.body); ADDOP_JREL(c, JUMP_FORWARD, end); - compiler_use_next_block(c, next); - ADDOP(c, POP_TOP); - if (s->v.If.orelse) + if (s->v.If.orelse) { + compiler_use_next_block(c, next); VISIT_SEQ(c, stmt, s->v.If.orelse); + } } compiler_use_next_block(c, end); return 1; @@ -1693,8 +1698,7 @@ so we need to set an extra line number. */ c->u->u_lineno_set = false; VISIT(c, expr, s->v.While.test); - ADDOP_JREL(c, JUMP_IF_FALSE, anchor); - ADDOP(c, POP_TOP); + ADDOP_JABS(c, POP_JUMP_IF_FALSE, anchor); } VISIT_SEQ(c, stmt, s->v.While.body); ADDOP_JABS(c, JUMP_ABSOLUTE, loop); @@ -1705,7 +1709,6 @@ if (constant == -1) { compiler_use_next_block(c, anchor); - ADDOP(c, POP_TOP); ADDOP(c, POP_BLOCK); } compiler_pop_fblock(c, LOOP, loop); @@ -1826,20 +1829,17 @@ [tb, val, exc] L1: DUP ) [tb, val, exc, exc] ) [tb, val, exc, exc, E1] COMPARE_OP EXC_MATCH ) only if E1 - [tb, val, exc, 1-or-0] JUMP_IF_FALSE L2 ) - [tb, val, exc, 1] POP ) + [tb, val, exc, 1-or-0] POP_JUMP_IF_FALSE L2 ) [tb, val, exc] POP [tb, val] (or POP if no V1) [tb] POP [] JUMP_FORWARD L0 - [tb, val, exc, 0] L2: POP - [tb, val, exc] DUP + [tb, val, exc] L2: DUP .............................etc....................... - [tb, val, exc, 0] Ln+1: POP - [tb, val, exc] END_FINALLY # re-raise exception + [tb, val, exc] Ln+1: END_FINALLY # re-raise exception [] L0: @@ -1881,8 +1881,7 @@ ADDOP(c, DUP_TOP); VISIT(c, expr, handler->v.ExceptHandler.type); ADDOP_I(c, COMPARE_OP, PyCmp_EXC_MATCH); - ADDOP_JREL(c, JUMP_IF_FALSE, except); - ADDOP(c, POP_TOP); + ADDOP_JABS(c, POP_JUMP_IF_FALSE, except); } ADDOP(c, POP_TOP); if (handler->v.ExceptHandler.name) { @@ -1895,8 +1894,6 @@ VISIT_SEQ(c, stmt, handler->v.ExceptHandler.body); ADDOP_JREL(c, JUMP_FORWARD, end); compiler_use_next_block(c, except); - if (handler->v.ExceptHandler.type) - ADDOP(c, POP_TOP); } ADDOP(c, END_FINALLY); compiler_use_next_block(c, orelse); @@ -2084,8 +2081,7 @@ end = compiler_new_block(c); if (end == NULL) return 0; - ADDOP_JREL(c, JUMP_IF_TRUE, end); - ADDOP(c, POP_TOP); + ADDOP_JABS(c, POP_JUMP_IF_TRUE, end); ADDOP_O(c, LOAD_GLOBAL, assertion_error, names); if (s->v.Assert.msg) { VISIT(c, expr, s->v.Assert.msg); @@ -2095,7 +2091,6 @@ ADDOP_I(c, RAISE_VARARGS, 1); } compiler_use_next_block(c, end); - ADDOP(c, POP_TOP); return 1; } @@ -2473,9 +2468,9 @@ assert(e->kind == BoolOp_kind); if (e->v.BoolOp.op == And) - jumpi = JUMP_IF_FALSE; + jumpi = JUMP_IF_FALSE_OR_POP; else - jumpi = JUMP_IF_TRUE; + jumpi = JUMP_IF_TRUE_OR_POP; end = compiler_new_block(c); if (end == NULL) return 0; @@ -2484,8 +2479,7 @@ assert(n >= 0); for (i = 0; i < n; ++i) { VISIT(c, expr, (expr_ty)asdl_seq_GET(s, i)); - ADDOP_JREL(c, jumpi, end); - ADDOP(c, POP_TOP) + ADDOP_JABS(c, jumpi, end); } VISIT(c, expr, (expr_ty)asdl_seq_GET(s, n)); compiler_use_next_block(c, end); @@ -2543,9 +2537,8 @@ ADDOP_I(c, COMPARE_OP, cmpop((cmpop_ty)(asdl_seq_GET( e->v.Compare.ops, i - 1)))); - ADDOP_JREL(c, JUMP_IF_FALSE, cleanup); + ADDOP_JABS(c, JUMP_IF_FALSE_OR_POP, cleanup); NEXT_BLOCK(c); - ADDOP(c, POP_TOP); if (i < (n - 1)) VISIT(c, expr, (expr_ty)asdl_seq_GET(e->v.Compare.comparators, i)); @@ -2636,9 +2629,8 @@ for (i = 0; i < n; i++) { expr_ty e = (expr_ty)asdl_seq_GET(l->ifs, i); VISIT(c, expr, e); - ADDOP_JREL(c, JUMP_IF_FALSE, if_cleanup); + ADDOP_JABS(c, POP_JUMP_IF_FALSE, if_cleanup); NEXT_BLOCK(c); - ADDOP(c, POP_TOP); } if (++gen_index < asdl_seq_LEN(generators)) @@ -2652,12 +2644,7 @@ compiler_use_next_block(c, skip); } - for (i = 0; i < n; i++) { - ADDOP_I(c, JUMP_FORWARD, 1); - if (i == 0) - compiler_use_next_block(c, if_cleanup); - ADDOP(c, POP_TOP); - } + compiler_use_next_block(c, if_cleanup); ADDOP_JABS(c, JUMP_ABSOLUTE, start); compiler_use_next_block(c, anchor); @@ -2720,10 +2707,9 @@ for (i = 0; i < n; i++) { expr_ty e = (expr_ty)asdl_seq_GET(ge->ifs, i); VISIT(c, expr, e); - ADDOP_JREL(c, JUMP_IF_FALSE, if_cleanup); + ADDOP_JABS(c, POP_JUMP_IF_FALSE, if_cleanup); NEXT_BLOCK(c); - ADDOP(c, POP_TOP); - } + } if (++gen_index < asdl_seq_LEN(generators)) if (!compiler_genexp_generator(c, generators, gen_index, elt)) @@ -2737,13 +2723,7 @@ compiler_use_next_block(c, skip); } - for (i = 0; i < n; i++) { - ADDOP_I(c, JUMP_FORWARD, 1); - if (i == 0) - compiler_use_next_block(c, if_cleanup); - - ADDOP(c, POP_TOP); - } + compiler_use_next_block(c, if_cleanup); ADDOP_JABS(c, JUMP_ABSOLUTE, start); compiler_use_next_block(c, anchor); ADDOP(c, POP_BLOCK); Modified: python/trunk/Python/import.c ============================================================================== --- python/trunk/Python/import.c (original) +++ python/trunk/Python/import.c Sat Feb 28 20:03:21 2009 @@ -72,9 +72,11 @@ Python 2.6a0: 62151 (peephole optimizations and STORE_MAP opcode) Python 2.6a1: 62161 (WITH_CLEANUP optimization) 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) . */ -#define MAGIC (62171 | ((long)'\r'<<16) | ((long)'\n'<<24)) +#define MAGIC (62181 | ((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 Modified: python/trunk/Python/peephole.c ============================================================================== --- python/trunk/Python/peephole.c (original) +++ python/trunk/Python/peephole.c Sat Feb 28 20:03:21 2009 @@ -13,7 +13,12 @@ #define GETARG(arr, i) ((int)((arr[i+2]<<8) + arr[i+1])) #define UNCONDITIONAL_JUMP(op) (op==JUMP_ABSOLUTE || op==JUMP_FORWARD) -#define ABSOLUTE_JUMP(op) (op==JUMP_ABSOLUTE || op==CONTINUE_LOOP) +#define CONDITIONAL_JUMP(op) (op==POP_JUMP_IF_FALSE || op==POP_JUMP_IF_TRUE \ + || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP) +#define ABSOLUTE_JUMP(op) (op==JUMP_ABSOLUTE || op==CONTINUE_LOOP \ + || op==POP_JUMP_IF_FALSE || op==POP_JUMP_IF_TRUE \ + || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP) +#define JUMPS_ON_TRUE(op) (op==POP_JUMP_IF_TRUE || op==JUMP_IF_TRUE_OR_POP) #define GETJUMPTGT(arr, i) (GETARG(arr,i) + (ABSOLUTE_JUMP(arr[i]) ? 0 : i+3)) #define SETARG(arr, i, val) arr[i+2] = val>>8; arr[i+1] = val & 255 #define CODESIZE(op) (HAS_ARG(op) ? 3 : 1) @@ -245,8 +250,10 @@ switch (opcode) { case FOR_ITER: case JUMP_FORWARD: - case JUMP_IF_FALSE: - case JUMP_IF_TRUE: + case JUMP_IF_FALSE_OR_POP: + case JUMP_IF_TRUE_OR_POP: + case POP_JUMP_IF_FALSE: + case POP_JUMP_IF_TRUE: case JUMP_ABSOLUTE: case CONTINUE_LOOP: case SETUP_LOOP: @@ -338,29 +345,24 @@ assert(PyList_Check(consts)); for (i=0 ; i a is not b not a in b --> a not in b @@ -400,16 +402,16 @@ break; /* Skip over LOAD_CONST trueconst - JUMP_IF_FALSE xx POP_TOP */ + POP_JUMP_IF_FALSE xx. This improves + "while 1" performance. */ case LOAD_CONST: cumlc = lastlc + 1; j = GETARG(codestr, i); - if (codestr[i+3] != JUMP_IF_FALSE || - codestr[i+6] != POP_TOP || - !ISBASICBLOCK(blocks,i,7) || + if (codestr[i+3] != POP_JUMP_IF_FALSE || + !ISBASICBLOCK(blocks,i,6) || !PyObject_IsTrue(PyList_GET_ITEM(consts, j))) continue; - memset(codestr+i, NOP, 7); + memset(codestr+i, NOP, 6); cumlc = 0; break; @@ -498,27 +500,49 @@ "if a or b:" "a and b or c" "(a and b) and c" - x:JUMP_IF_FALSE y y:JUMP_IF_FALSE z --> x:JUMP_IF_FALSE z - x:JUMP_IF_FALSE y y:JUMP_IF_TRUE z --> x:JUMP_IF_FALSE y+3 + x:JUMP_IF_FALSE_OR_POP y y:JUMP_IF_FALSE_OR_POP z + --> x:JUMP_IF_FALSE_OR_POP z + x:JUMP_IF_FALSE_OR_POP y y:JUMP_IF_TRUE_OR_POP z + --> x:POP_JUMP_IF_FALSE y+3 where y+3 is the instruction following the second test. */ - case JUMP_IF_FALSE: - case JUMP_IF_TRUE: + case JUMP_IF_FALSE_OR_POP: + case JUMP_IF_TRUE_OR_POP: tgt = GETJUMPTGT(codestr, i); j = codestr[tgt]; - if (j == JUMP_IF_FALSE || j == JUMP_IF_TRUE) { - if (j == opcode) { - tgttgt = GETJUMPTGT(codestr, tgt) - i - 3; + if (CONDITIONAL_JUMP(j)) { + /* NOTE: all possible jumps here are + absolute! */ + if (JUMPS_ON_TRUE(j) == JUMPS_ON_TRUE(opcode)) { + /* The second jump will be + taken iff the first is. */ + tgttgt = GETJUMPTGT(codestr, tgt); + /* The current opcode inherits + its target's stack behaviour */ + codestr[i] = j; SETARG(codestr, i, tgttgt); + goto reoptimize_current; } else { - tgt -= i; - SETARG(codestr, i, tgt); + /* The second jump is not taken + if the first is (so jump past + it), and all conditional + jumps pop their argument when + they're not taken (so change + the first jump to pop its + argument when it's taken). */ + if (JUMPS_ON_TRUE(opcode)) + codestr[i] = POP_JUMP_IF_TRUE; + else + codestr[i] = POP_JUMP_IF_FALSE; + SETARG(codestr, i, (tgt + 3)); + goto reoptimize_current; } - break; } - /* Intentional fallthrough */ + /* Intentional fallthrough */ /* Replace jumps to unconditional jumps */ + case POP_JUMP_IF_FALSE: + case POP_JUMP_IF_TRUE: case FOR_ITER: case JUMP_FORWARD: case JUMP_ABSOLUTE: @@ -591,14 +615,16 @@ case JUMP_ABSOLUTE: case CONTINUE_LOOP: + case POP_JUMP_IF_FALSE: + case POP_JUMP_IF_TRUE: + case JUMP_IF_FALSE_OR_POP: + case JUMP_IF_TRUE_OR_POP: j = addrmap[GETARG(codestr, i)]; SETARG(codestr, i, j); break; case FOR_ITER: case JUMP_FORWARD: - case JUMP_IF_FALSE: - case JUMP_IF_TRUE: case SETUP_LOOP: case SETUP_EXCEPT: case SETUP_FINALLY: From python-checkins at python.org Sat Feb 28 20:06:55 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 Feb 2009 20:06:55 +0100 (CET) Subject: [Python-checkins] r70072 - python/branches/py3k/Modules/_ssl.c Message-ID: <20090228190655.0D73F1E4002@bag.python.org> Author: benjamin.peterson Date: Sat Feb 28 20:06:54 2009 New Revision: 70072 Log: #4967 fix buggy read() Modified: python/branches/py3k/Modules/_ssl.c Modified: python/branches/py3k/Modules/_ssl.c ============================================================================== --- python/branches/py3k/Modules/_ssl.c (original) +++ python/branches/py3k/Modules/_ssl.c Sat Feb 28 20:06:54 2009 @@ -1244,9 +1244,12 @@ static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args) { - PyObject *buf = NULL; + PyObject *dest = NULL; + Py_buffer buf; int buf_passed = 0; int count = -1; + char *mem; + /* XXX this should use Py_ssize_t */ int len = 1024; int sockstate; int err; @@ -1260,19 +1263,22 @@ return NULL; } - if (!PyArg_ParseTuple(args, "|Oi:read", &buf, &count)) + if (!PyArg_ParseTuple(args, "|Oi:read", &dest, &count)) return NULL; - if ((buf == NULL) || (buf == Py_None)) { - if (!(buf = PyByteArray_FromStringAndSize((char *) 0, len))) + if ((dest == NULL) || (dest == Py_None)) { + if (!(dest = PyByteArray_FromStringAndSize((char *) 0, len))) return NULL; - } else if (PyLong_Check(buf)) { - len = PyLong_AS_LONG(buf); - if (!(buf = PyByteArray_FromStringAndSize((char *) 0, len))) + mem = PyByteArray_AS_STRING(dest); + } else if (PyLong_Check(dest)) { + len = PyLong_AS_LONG(dest); + if (!(dest = PyByteArray_FromStringAndSize((char *) 0, len))) return NULL; + mem = PyByteArray_AS_STRING(dest); } else { - if (!PyByteArray_Check(buf)) + if (PyObject_GetBuffer(dest, &buf, PyBUF_CONTIG) < 0) return NULL; - len = PyByteArray_Size(buf); + mem = buf.buf; + len = buf.len; if ((count > 0) && (count <= len)) len = count; buf_passed = 1; @@ -1293,18 +1299,11 @@ if (sockstate == SOCKET_HAS_TIMED_OUT) { PyErr_SetString(PySSLErrorObject, "The read operation timed out"); - if (!buf_passed) { - Py_DECREF(buf); - } - return NULL; + goto error; } else if (sockstate == SOCKET_TOO_LARGE_FOR_SELECT) { PyErr_SetString(PySSLErrorObject, "Underlying socket too large for select()."); - if (!buf_passed) { - Py_DECREF(buf); - } - Py_DECREF(buf); - return NULL; + goto error; } else if (sockstate == SOCKET_HAS_BEEN_CLOSED) { count = 0; goto done; @@ -1313,15 +1312,11 @@ do { err = 0; PySSL_BEGIN_ALLOW_THREADS - count = SSL_read(self->ssl, PyByteArray_AsString(buf), len); + count = SSL_read(self->ssl, mem, len); err = SSL_get_error(self->ssl, count); PySSL_END_ALLOW_THREADS - if(PyErr_CheckSignals()) { - if (!buf_passed) { - Py_DECREF(buf); - } - return NULL; - } + if (PyErr_CheckSignals()) + goto error; if (err == SSL_ERROR_WANT_READ) { sockstate = check_socket_and_wait_for_timeout(sock, 0); @@ -1340,29 +1335,31 @@ if (sockstate == SOCKET_HAS_TIMED_OUT) { PyErr_SetString(PySSLErrorObject, "The read operation timed out"); - if (!buf_passed) { - Py_DECREF(buf); - } - return NULL; + goto error; } else if (sockstate == SOCKET_IS_NONBLOCKING) { break; } } while (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE); if (count <= 0) { - if (!buf_passed) { - Py_DECREF(buf); - } - return PySSL_SetError(self, count, __FILE__, __LINE__); + PySSL_SetError(self, count, __FILE__, __LINE__); + goto error; } done: if (!buf_passed) { - PyObject *res = PyBytes_FromStringAndSize( - PyByteArray_AS_STRING(buf), count); - Py_DECREF(buf); + PyObject *res = PyBytes_FromStringAndSize(mem, count); + Py_DECREF(dest); return res; } else { + PyBuffer_Release(&buf); return PyLong_FromLong(count); } + error: + if (!buf_passed) { + Py_DECREF(dest); + } else { + PyBuffer_Release(&buf); + } + return NULL; } PyDoc_STRVAR(PySSL_SSLread_doc, From python-checkins at python.org Sat Feb 28 20:15:55 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 Feb 2009 20:15:55 +0100 (CET) Subject: [Python-checkins] r70073 - in python/branches/release30-maint: Modules/_ssl.c Message-ID: <20090228191555.857F41E400C@bag.python.org> Author: benjamin.peterson Date: Sat Feb 28 20:15:55 2009 New Revision: 70073 Log: Merged revisions 70072 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r70072 | benjamin.peterson | 2009-02-28 13:06:54 -0600 (Sat, 28 Feb 2009) | 1 line #4967 fix buggy read() ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Modules/_ssl.c Modified: python/branches/release30-maint/Modules/_ssl.c ============================================================================== --- python/branches/release30-maint/Modules/_ssl.c (original) +++ python/branches/release30-maint/Modules/_ssl.c Sat Feb 28 20:15:55 2009 @@ -1244,9 +1244,12 @@ static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args) { - PyObject *buf = NULL; + PyObject *dest = NULL; + Py_buffer buf; int buf_passed = 0; int count = -1; + char *mem; + /* XXX this should use Py_ssize_t */ int len = 1024; int sockstate; int err; @@ -1260,19 +1263,22 @@ return NULL; } - if (!PyArg_ParseTuple(args, "|Oi:read", &buf, &count)) + if (!PyArg_ParseTuple(args, "|Oi:read", &dest, &count)) return NULL; - if ((buf == NULL) || (buf == Py_None)) { - if (!(buf = PyByteArray_FromStringAndSize((char *) 0, len))) + if ((dest == NULL) || (dest == Py_None)) { + if (!(dest = PyByteArray_FromStringAndSize((char *) 0, len))) return NULL; - } else if (PyLong_Check(buf)) { - len = PyLong_AS_LONG(buf); - if (!(buf = PyByteArray_FromStringAndSize((char *) 0, len))) + mem = PyByteArray_AS_STRING(dest); + } else if (PyLong_Check(dest)) { + len = PyLong_AS_LONG(dest); + if (!(dest = PyByteArray_FromStringAndSize((char *) 0, len))) return NULL; + mem = PyByteArray_AS_STRING(dest); } else { - if (!PyByteArray_Check(buf)) + if (PyObject_GetBuffer(dest, &buf, PyBUF_CONTIG) < 0) return NULL; - len = PyByteArray_Size(buf); + mem = buf.buf; + len = buf.len; if ((count > 0) && (count <= len)) len = count; buf_passed = 1; @@ -1293,18 +1299,11 @@ if (sockstate == SOCKET_HAS_TIMED_OUT) { PyErr_SetString(PySSLErrorObject, "The read operation timed out"); - if (!buf_passed) { - Py_DECREF(buf); - } - return NULL; + goto error; } else if (sockstate == SOCKET_TOO_LARGE_FOR_SELECT) { PyErr_SetString(PySSLErrorObject, "Underlying socket too large for select()."); - if (!buf_passed) { - Py_DECREF(buf); - } - Py_DECREF(buf); - return NULL; + goto error; } else if (sockstate == SOCKET_HAS_BEEN_CLOSED) { count = 0; goto done; @@ -1313,15 +1312,11 @@ do { err = 0; PySSL_BEGIN_ALLOW_THREADS - count = SSL_read(self->ssl, PyByteArray_AsString(buf), len); + count = SSL_read(self->ssl, mem, len); err = SSL_get_error(self->ssl, count); PySSL_END_ALLOW_THREADS - if(PyErr_CheckSignals()) { - if (!buf_passed) { - Py_DECREF(buf); - } - return NULL; - } + if (PyErr_CheckSignals()) + goto error; if (err == SSL_ERROR_WANT_READ) { sockstate = check_socket_and_wait_for_timeout(sock, 0); @@ -1340,29 +1335,31 @@ if (sockstate == SOCKET_HAS_TIMED_OUT) { PyErr_SetString(PySSLErrorObject, "The read operation timed out"); - if (!buf_passed) { - Py_DECREF(buf); - } - return NULL; + goto error; } else if (sockstate == SOCKET_IS_NONBLOCKING) { break; } } while (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE); if (count <= 0) { - if (!buf_passed) { - Py_DECREF(buf); - } - return PySSL_SetError(self, count, __FILE__, __LINE__); + PySSL_SetError(self, count, __FILE__, __LINE__); + goto error; } done: if (!buf_passed) { - PyObject *res = PyBytes_FromStringAndSize( - PyByteArray_AS_STRING(buf), count); - Py_DECREF(buf); + PyObject *res = PyBytes_FromStringAndSize(mem, count); + Py_DECREF(dest); return res; } else { + PyBuffer_Release(&buf); return PyLong_FromLong(count); } + error: + if (!buf_passed) { + Py_DECREF(dest); + } else { + PyBuffer_Release(&buf); + } + return NULL; } PyDoc_STRVAR(PySSL_SSLread_doc, From python-checkins at python.org Sat Feb 28 20:21:02 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 Feb 2009 20:21:02 +0100 (CET) Subject: [Python-checkins] r70074 - in python/branches/io-c: Doc/c-api/intro.rst Doc/c-api/veryhigh.rst Doc/distutils/setupscript.rst Doc/distutils/uploading.rst Doc/extending/newtypes.rst Doc/extending/windows.rst Doc/howto/webservers.rst Doc/library/2to3.rst Doc/library/abc.rst Doc/library/cgi.rst Doc/library/cgitb.rst Doc/library/collections.rst Doc/library/functions.rst Doc/library/stdtypes.rst Doc/library/urllib.request.rst Doc/library/xml.etree.elementtree.rst Doc/whatsnew/2.5.rst Lib/_abcoll.py Lib/distutils/README Lib/distutils/command/bdist_rpm.py Lib/distutils/command/build_ext.py Lib/distutils/command/install.py Lib/distutils/command/upload.py Lib/distutils/tests/test_bdist_rpm.py Lib/distutils/tests/test_build_ext.py Lib/distutils/tests/test_config.py Lib/distutils/tests/test_install.py Lib/distutils/tests/test_sdist.py Lib/socketserver.py Lib/test/test_mmap.py Lib/test/test_opcodes.py Misc/NEWS Modules/_ssl.c Modules/cmathmodule.c Modules/mmapmodule.c Modules/python.c Objects/longobject.c Python/ceval.c README Tools/scripts/README Tools/scripts/analyze_dxp.py Message-ID: <20090228192102.CE2661E4030@bag.python.org> Author: benjamin.peterson Date: Sat Feb 28 20:20:42 2009 New Revision: 70074 Log: Merged revisions 69975,69977,69982,69986,69989-69990,69995-69996,70001,70005,70009,70015,70019,70024,70027-70029,70037,70051,70053,70057,70063,70072 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r69975 | mark.dickinson | 2009-02-25 14:33:49 -0600 (Wed, 25 Feb 2009) | 10 lines Merged revisions 69974 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69974 | mark.dickinson | 2009-02-25 20:29:50 +0000 (Wed, 25 Feb 2009) | 3 lines Replace long with twodigits, to avoid depending on sizeof(digit) < sizeof(long) ........ ................ r69977 | tarek.ziade | 2009-02-25 16:31:38 -0600 (Wed, 25 Feb 2009) | 9 lines Merged revisions 69976 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69976 | tarek.ziade | 2009-02-25 23:29:27 +0100 (Wed, 25 Feb 2009) | 1 line Fixed #5316 : test failure in test_site ........ ................ r69982 | raymond.hettinger | 2009-02-25 16:51:40 -0600 (Wed, 25 Feb 2009) | 1 line Sync-up 3.1 docs with 2.7 for collections.Counter(). ................ r69986 | raymond.hettinger | 2009-02-25 18:27:18 -0600 (Wed, 25 Feb 2009) | 1 line Fix typo. ................ r69989 | benjamin.peterson | 2009-02-25 20:44:26 -0600 (Wed, 25 Feb 2009) | 36 lines Blocked revisions 69937,69946,69952-69953,69955,69959,69981,69983 via svnmerge ........ r69937 | raymond.hettinger | 2009-02-24 06:23:23 -0600 (Tue, 24 Feb 2009) | 3 lines Backport 69934: Register xrange() as a Sequence. ........ r69946 | brett.cannon | 2009-02-24 16:01:02 -0600 (Tue, 24 Feb 2009) | 2 lines Expand upon test_site.test_s_option to try to debug its failure. ........ r69952 | raymond.hettinger | 2009-02-24 18:37:57 -0600 (Tue, 24 Feb 2009) | 1 line Sync-up py3.1 doc updates for super(). ........ r69953 | raymond.hettinger | 2009-02-24 18:39:47 -0600 (Tue, 24 Feb 2009) | 1 line Restore Py2.x version of sample call to super(). ........ r69955 | raymond.hettinger | 2009-02-24 18:52:37 -0600 (Tue, 24 Feb 2009) | 1 line More markup and spelling fixes. ........ r69959 | raymond.hettinger | 2009-02-24 19:06:52 -0600 (Tue, 24 Feb 2009) | 1 line Remove reference to zero argument form of super() in 2.x docs. ........ r69981 | raymond.hettinger | 2009-02-25 16:48:24 -0600 (Wed, 25 Feb 2009) | 1 line Clarify Counter() docs. ........ r69983 | raymond.hettinger | 2009-02-25 18:05:24 -0600 (Wed, 25 Feb 2009) | 1 line Fix typo. ........ ................ r69990 | benjamin.peterson | 2009-02-25 21:38:59 -0600 (Wed, 25 Feb 2009) | 45 lines Merged revisions 69803-69805,69840,69901,69905,69907,69924,69927,69987 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69803 | georg.brandl | 2009-02-20 01:48:21 -0600 (Fri, 20 Feb 2009) | 1 line #5327: fix a broken link by joining it. ........ r69804 | georg.brandl | 2009-02-20 02:22:21 -0600 (Fri, 20 Feb 2009) | 1 line At least separate imports from other statements. ........ r69805 | georg.brandl | 2009-02-20 02:45:47 -0600 (Fri, 20 Feb 2009) | 2 lines Fix punctuation. ........ r69840 | georg.brandl | 2009-02-21 13:09:40 -0600 (Sat, 21 Feb 2009) | 1 line #5338, #5339: two types in the API manual. ........ r69901 | georg.brandl | 2009-02-23 05:24:46 -0600 (Mon, 23 Feb 2009) | 2 lines #5349: C++ pure virtuals can also have an implementation. ........ r69905 | georg.brandl | 2009-02-23 09:51:27 -0600 (Mon, 23 Feb 2009) | 2 lines #5352: str.count() counts non-overlapping instances. ........ r69907 | georg.brandl | 2009-02-23 12:33:48 -0600 (Mon, 23 Feb 2009) | 1 line Fix grammar. ........ r69924 | benjamin.peterson | 2009-02-23 20:45:35 -0600 (Mon, 23 Feb 2009) | 1 line update README on running tests ........ r69927 | neil.schemenauer | 2009-02-23 22:23:25 -0600 (Mon, 23 Feb 2009) | 1 line Fix call to os.waitpid, it does not take keyword args. ........ r69987 | benjamin.peterson | 2009-02-25 18:30:11 -0600 (Wed, 25 Feb 2009) | 1 line fix str.format()'s first arg #5371 ........ ................ r69995 | benjamin.peterson | 2009-02-26 12:39:03 -0600 (Thu, 26 Feb 2009) | 8 lines Blocked revisions 69994 via svnmerge ........ r69994 | georg.brandl | 2009-02-26 11:36:26 -0600 (Thu, 26 Feb 2009) | 1 line Document that setting sys.py3kwarning wont do anything. ........ ................ r69996 | benjamin.peterson | 2009-02-26 12:55:48 -0600 (Thu, 26 Feb 2009) | 14 lines Merged revisions 69811,69947 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r69811 | collin.winter | 2009-02-20 13:30:41 -0600 (Fri, 20 Feb 2009) | 2 lines Issue 5176: special-case string formatting in BINARY_MODULO implementation. This shows a modest (1-3%) speed-up in templating systems, for example. ........ r69947 | jeffrey.yasskin | 2009-02-24 16:48:34 -0600 (Tue, 24 Feb 2009) | 3 lines Tools/scripts/analyze_dxp.py, a module with some helper functions to analyze the output of sys.getdxp(). ........ ................ r70001 | benjamin.peterson | 2009-02-26 13:17:12 -0600 (Thu, 26 Feb 2009) | 8 lines Blocked revisions 70000 via svnmerge ........ r70000 | benjamin.peterson | 2009-02-26 13:07:18 -0600 (Thu, 26 Feb 2009) | 1 line remove deprecated symtable.Symbol methods ........ ................ r70005 | tarek.ziade | 2009-02-26 17:47:00 -0600 (Thu, 26 Feb 2009) | 9 lines Merged revisions 70003 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70003 | tarek.ziade | 2009-02-27 00:44:00 +0100 (Fri, 27 Feb 2009) | 1 line removed unused import ........ ................ r70009 | tarek.ziade | 2009-02-26 20:22:25 -0600 (Thu, 26 Feb 2009) | 9 lines Merged revisions 70007 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70007 | tarek.ziade | 2009-02-27 03:14:35 +0100 (Fri, 27 Feb 2009) | 1 line more info on long_description ........ ................ r70015 | raymond.hettinger | 2009-02-27 01:47:32 -0600 (Fri, 27 Feb 2009) | 1 line Give mapping views a usable repr. ................ r70019 | tarek.ziade | 2009-02-27 06:58:56 -0600 (Fri, 27 Feb 2009) | 9 lines Merged revisions 70017 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70017 | tarek.ziade | 2009-02-27 13:53:34 +0100 (Fri, 27 Feb 2009) | 1 line Issue #5052: make Distutils compatible with 2.3 again. ........ ................ r70024 | georg.brandl | 2009-02-27 10:46:46 -0600 (Fri, 27 Feb 2009) | 1 line #5357: fix incomprehensible paragraph in urlopen() doc. ................ r70027 | georg.brandl | 2009-02-27 11:03:38 -0600 (Fri, 27 Feb 2009) | 1 line #5360: remove RO which has been kicked from 3k. ................ r70028 | georg.brandl | 2009-02-27 11:11:23 -0600 (Fri, 27 Feb 2009) | 1 line #5360: replace PyObject_HEAD_INIT by PyVarObject_HEAD_INIT. ................ r70029 | georg.brandl | 2009-02-27 11:52:38 -0600 (Fri, 27 Feb 2009) | 1 line another instance of #804543: use strdup() when saving the result of setlocale() because it could be overwritten by subsequent setlocale()s. ................ r70037 | benjamin.peterson | 2009-02-27 16:29:33 -0600 (Fri, 27 Feb 2009) | 15 lines Blocked revisions 70011,70016 via svnmerge ........ r70011 | brett.cannon | 2009-02-26 21:38:28 -0600 (Thu, 26 Feb 2009) | 5 lines Fix a bug where code was trying to index an int. Left over from the situation from using str.rpartition to str.rindex. Closes Issue5213. ........ r70016 | raymond.hettinger | 2009-02-27 02:09:47 -0600 (Fri, 27 Feb 2009) | 1 line Give mapping views a usable repr. ........ ................ r70051 | tarek.ziade | 2009-02-28 04:16:43 -0600 (Sat, 28 Feb 2009) | 9 lines Merged revisions 70049 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70049 | tarek.ziade | 2009-02-28 11:08:02 +0100 (Sat, 28 Feb 2009) | 1 line Issues #1533164 and #5378: Added quiet and force-optimize options to Distutils bdist_rpm command ........ ................ r70053 | hirokazu.yamamoto | 2009-02-28 04:56:50 -0600 (Sat, 28 Feb 2009) | 10 lines Merged revisions 70052 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70052 | hirokazu.yamamoto | 2009-02-28 19:31:54 +0900 | 2 lines Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer overrun. ........ ................ r70057 | hirokazu.yamamoto | 2009-02-28 06:21:53 -0600 (Sat, 28 Feb 2009) | 10 lines Merged revisions 70056 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70056 | hirokazu.yamamoto | 2009-02-28 21:13:07 +0900 | 2 lines Issue #1733986: Fixed mmap crash in accessing elements of second map object with same tagname but larger size than first map. (Windows) ........ ................ r70063 | mark.dickinson | 2009-02-28 09:53:24 -0600 (Sat, 28 Feb 2009) | 9 lines Merged revisions 70062 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70062 | mark.dickinson | 2009-02-28 15:50:40 +0000 (Sat, 28 Feb 2009) | 2 lines Issue #5393: typo in cmath.cos and cmath.cosh docstring ........ ................ r70072 | benjamin.peterson | 2009-02-28 13:06:54 -0600 (Sat, 28 Feb 2009) | 1 line #4967 fix buggy read() ................ Added: python/branches/io-c/Lib/distutils/tests/test_bdist_rpm.py - copied unchanged from r70072, /python/branches/py3k/Lib/distutils/tests/test_bdist_rpm.py python/branches/io-c/Tools/scripts/analyze_dxp.py - copied unchanged from r70072, /python/branches/py3k/Tools/scripts/analyze_dxp.py Modified: python/branches/io-c/ (props changed) python/branches/io-c/Doc/c-api/intro.rst python/branches/io-c/Doc/c-api/veryhigh.rst python/branches/io-c/Doc/distutils/setupscript.rst python/branches/io-c/Doc/distutils/uploading.rst python/branches/io-c/Doc/extending/newtypes.rst python/branches/io-c/Doc/extending/windows.rst python/branches/io-c/Doc/howto/webservers.rst python/branches/io-c/Doc/library/2to3.rst python/branches/io-c/Doc/library/abc.rst python/branches/io-c/Doc/library/cgi.rst python/branches/io-c/Doc/library/cgitb.rst python/branches/io-c/Doc/library/collections.rst python/branches/io-c/Doc/library/functions.rst python/branches/io-c/Doc/library/stdtypes.rst python/branches/io-c/Doc/library/urllib.request.rst python/branches/io-c/Doc/library/xml.etree.elementtree.rst python/branches/io-c/Doc/whatsnew/2.5.rst python/branches/io-c/Lib/_abcoll.py python/branches/io-c/Lib/distutils/README python/branches/io-c/Lib/distutils/command/bdist_rpm.py python/branches/io-c/Lib/distutils/command/build_ext.py python/branches/io-c/Lib/distutils/command/install.py python/branches/io-c/Lib/distutils/command/upload.py python/branches/io-c/Lib/distutils/tests/test_build_ext.py python/branches/io-c/Lib/distutils/tests/test_config.py python/branches/io-c/Lib/distutils/tests/test_install.py python/branches/io-c/Lib/distutils/tests/test_sdist.py python/branches/io-c/Lib/socketserver.py python/branches/io-c/Lib/test/test_mmap.py python/branches/io-c/Lib/test/test_opcodes.py python/branches/io-c/Misc/NEWS python/branches/io-c/Modules/_ssl.c python/branches/io-c/Modules/cmathmodule.c python/branches/io-c/Modules/mmapmodule.c python/branches/io-c/Modules/python.c python/branches/io-c/Objects/longobject.c python/branches/io-c/Python/ceval.c python/branches/io-c/README python/branches/io-c/Tools/scripts/README Modified: python/branches/io-c/Doc/c-api/intro.rst ============================================================================== --- python/branches/io-c/Doc/c-api/intro.rst (original) +++ python/branches/io-c/Doc/c-api/intro.rst Sat Feb 28 20:20:42 2009 @@ -187,7 +187,7 @@ the caller is said to *borrow* the reference. Nothing needs to be done for a borrowed reference. -Conversely, when a calling function passes it a reference to an object, there +Conversely, when a calling function passes in a reference to an object, there are two possibilities: the function *steals* a reference to the object, or it does not. *Stealing a reference* means that when you pass a reference to a function, that function assumes that it now owns that reference, and you are not Modified: python/branches/io-c/Doc/c-api/veryhigh.rst ============================================================================== --- python/branches/io-c/Doc/c-api/veryhigh.rst (original) +++ python/branches/io-c/Doc/c-api/veryhigh.rst Sat Feb 28 20:20:42 2009 @@ -16,7 +16,7 @@ :const:`Py_file_input`, and :const:`Py_single_input`. These are described following the functions which accept them as parameters. -Note also that several of these functions take :ctype:`FILE\*` parameters. On +Note also that several of these functions take :ctype:`FILE\*` parameters. One particular issue which needs to be handled carefully is that the :ctype:`FILE` structure for different C libraries can be different and incompatible. Under Windows (at least), it is possible for dynamically linked extensions to actually Modified: python/branches/io-c/Doc/distutils/setupscript.rst ============================================================================== --- python/branches/io-c/Doc/distutils/setupscript.rst (original) +++ python/branches/io-c/Doc/distutils/setupscript.rst Sat Feb 28 20:20:42 2009 @@ -19,18 +19,18 @@ distributions. The Distutils' own setup script, shown here, is used to install the package into Python 1.5.2.) :: - #!/usr/bin/env python + #!/usr/bin/env python - from distutils.core import setup + from distutils.core import setup - setup(name='Distutils', - version='1.0', - description='Python Distribution Utilities', - author='Greg Ward', - author_email='gward at python.net', - url='http://www.python.org/sigs/distutils-sig/', - packages=['distutils', 'distutils.command'], - ) + setup(name='Distutils', + version='1.0', + description='Python Distribution Utilities', + author='Greg Ward', + author_email='gward at python.net', + url='http://www.python.org/sigs/distutils-sig/', + packages=['distutils', 'distutils.command'], + ) There are only two differences between this and the trivial one-file distribution presented in section :ref:`distutils-simple-example`: more metadata, and the @@ -53,8 +53,8 @@ :func:`os.listdir` to specify files, you should be careful to write portable code instead of hardcoding path separators:: - glob.glob(os.path.join('mydir', 'subdir', '*.html')) - os.listdir(os.path.join('mydir', 'subdir')) + glob.glob(os.path.join('mydir', 'subdir', '*.html')) + os.listdir(os.path.join('mydir', 'subdir')) .. _listing-packages: @@ -81,7 +81,7 @@ package at all) are in :file:`lib`, modules in the :mod:`foo` package are in :file:`lib/foo`, and so forth. Then you would put :: - package_dir = {'': 'lib'} + package_dir = {'': 'lib'} in your setup script. The keys to this dictionary are package names, and an empty package name stands for the root package. The values are directory names @@ -92,7 +92,7 @@ :file:`lib`, the :mod:`foo.bar` package in :file:`lib/bar`, etc. This would be written in the setup script as :: - package_dir = {'foo': 'lib'} + package_dir = {'foo': 'lib'} A ``package: dir`` entry in the :option:`package_dir` dictionary implicitly applies to all packages below *package*, so the :mod:`foo.bar` case is @@ -114,7 +114,7 @@ "root package" (i.e., no package at all). This simplest case was shown in section :ref:`distutils-simple-example`; here is a slightly more involved example:: - py_modules = ['mod1', 'pkg.mod2'] + py_modules = ['mod1', 'pkg.mod2'] This describes two modules, one of them in the "root" package, the other in the :mod:`pkg` package. Again, the default package/directory layout implies that @@ -144,17 +144,17 @@ implemented by :file:`foo.c`. If no additional instructions to the compiler/linker are needed, describing this extension is quite simple:: - Extension('foo', ['foo.c']) + Extension('foo', ['foo.c']) The :class:`Extension` class can be imported from :mod:`distutils.core` along with :func:`setup`. Thus, the setup script for a module distribution that contains only this one extension and nothing else might be:: - from distutils.core import setup, Extension - setup(name='foo', - version='1.0', - ext_modules=[Extension('foo', ['foo.c'])], - ) + from distutils.core import setup, Extension + setup(name='foo', + version='1.0', + ext_modules=[Extension('foo', ['foo.c'])], + ) The :class:`Extension` class (actually, the underlying extension-building machinery implemented by the :command:`build_ext` command) supports a great deal @@ -168,11 +168,11 @@ The first argument to the :class:`Extension` constructor is always the name of the extension, including any package names. For example, :: - Extension('foo', ['src/foo1.c', 'src/foo2.c']) + Extension('foo', ['src/foo1.c', 'src/foo2.c']) describes an extension that lives in the root package, while :: - Extension('pkg.foo', ['src/foo1.c', 'src/foo2.c']) + Extension('pkg.foo', ['src/foo1.c', 'src/foo2.c']) describes the same extension in the :mod:`pkg` package. The source files and resulting object code are identical in both cases; the only difference is where @@ -183,11 +183,11 @@ same base package), use the :option:`ext_package` keyword argument to :func:`setup`. For example, :: - setup(..., - ext_package='pkg', - ext_modules=[Extension('foo', ['foo.c']), - Extension('subpkg.bar', ['bar.c'])], - ) + setup(..., + ext_package='pkg', + ext_modules=[Extension('foo', ['foo.c']), + Extension('subpkg.bar', ['bar.c'])], + ) will compile :file:`foo.c` to the extension :mod:`pkg.foo`, and :file:`bar.c` to :mod:`pkg.subpkg.bar`. @@ -212,15 +212,15 @@ This warning notwithstanding, options to SWIG can be currently passed like this:: - setup(..., - ext_modules=[Extension('_foo', ['foo.i'], - swig_opts=['-modern', '-I../include'])], - py_modules=['foo'], - ) + setup(..., + ext_modules=[Extension('_foo', ['foo.i'], + swig_opts=['-modern', '-I../include'])], + py_modules=['foo'], + ) Or on the commandline like this:: - > python setup.py build_ext --swig-opts="-modern -I../include" + > python setup.py build_ext --swig-opts="-modern -I../include" On some platforms, you can include non-source files that are processed by the compiler and included in your extension. Currently, this just means Windows @@ -239,18 +239,18 @@ For example, if your extension requires header files in the :file:`include` directory under your distribution root, use the ``include_dirs`` option:: - Extension('foo', ['foo.c'], include_dirs=['include']) + Extension('foo', ['foo.c'], include_dirs=['include']) You can specify absolute directories there; if you know that your extension will only be built on Unix systems with X11R6 installed to :file:`/usr`, you can get away with :: - Extension('foo', ['foo.c'], include_dirs=['/usr/include/X11']) + Extension('foo', ['foo.c'], include_dirs=['/usr/include/X11']) You should avoid this sort of non-portable usage if you plan to distribute your code: it's probably better to write C code like :: - #include + #include If you need to include header files from some other Python extension, you can take advantage of the fact that header files are installed in a consistent way @@ -262,17 +262,17 @@ included in the search path when building Python extensions, the best approach is to write C code like :: - #include + #include If you must put the :file:`Numerical` include directory right into your header search path, though, you can find that directory using the Distutils :mod:`distutils.sysconfig` module:: - from distutils.sysconfig import get_python_inc - incdir = os.path.join(get_python_inc(plat_specific=1), 'Numerical') - setup(..., - Extension(..., include_dirs=[incdir]), - ) + from distutils.sysconfig import get_python_inc + incdir = os.path.join(get_python_inc(plat_specific=1), 'Numerical') + setup(..., + Extension(..., include_dirs=[incdir]), + ) Even though this is quite portable---it will work on any Python installation, regardless of platform---it's probably easier to just write your C code in the @@ -288,17 +288,17 @@ For example:: - Extension(..., - define_macros=[('NDEBUG', '1'), - ('HAVE_STRFTIME', None)], - undef_macros=['HAVE_FOO', 'HAVE_BAR']) + Extension(..., + define_macros=[('NDEBUG', '1'), + ('HAVE_STRFTIME', None)], + undef_macros=['HAVE_FOO', 'HAVE_BAR']) is the equivalent of having this at the top of every C source file:: - #define NDEBUG 1 - #define HAVE_STRFTIME - #undef HAVE_FOO - #undef HAVE_BAR + #define NDEBUG 1 + #define HAVE_STRFTIME + #undef HAVE_FOO + #undef HAVE_BAR Library options @@ -313,15 +313,15 @@ For example, if you need to link against libraries known to be in the standard library search path on target systems :: - Extension(..., - libraries=['_gdbm', 'readline']) + Extension(..., + libraries=['gdbm', 'readline']) If you need to link with libraries in a non-standard location, you'll have to include the location in ``library_dirs``:: - Extension(..., - library_dirs=['/usr/X11R6/lib'], - libraries=['X11', 'Xt']) + Extension(..., + library_dirs=['/usr/X11R6/lib'], + libraries=['X11', 'Xt']) (Again, this sort of non-portable construct should be avoided if you intend to distribute your code.) @@ -379,8 +379,8 @@ parentheses. Each qualifier may consist of a comparison operator and a version number. The accepted comparison operators are:: - < > == - <= >= != + < > == + <= >= != These can be combined by using multiple qualifiers separated by commas (and optional whitespace). In this case, all of the qualifiers must be matched; a @@ -446,13 +446,13 @@ The :option:`scripts` option simply is a list of files to be handled in this way. From the PyXML setup script:: - setup(..., - scripts=['scripts/xmlproc_parse', 'scripts/xmlproc_val'] - ) + setup(..., + scripts=['scripts/xmlproc_parse', 'scripts/xmlproc_val'] + ) .. versionchanged:: 2.7 - All the scripts will also be added to the ``MANIFEST`` - file if no template is provided. See :ref:`manifest`. + All the scripts will also be added to the ``MANIFEST`` + file if no template is provided. See :ref:`manifest`. .. _distutils-installing-package-data: @@ -478,28 +478,28 @@ For example, if a package should contain a subdirectory with several data files, the files can be arranged like this in the source tree:: - setup.py - src/ - mypkg/ - __init__.py - module.py - data/ - tables.dat - spoons.dat - forks.dat + setup.py + src/ + mypkg/ + __init__.py + module.py + data/ + tables.dat + spoons.dat + forks.dat The corresponding call to :func:`setup` might be:: - setup(..., - packages=['mypkg'], - package_dir={'mypkg': 'src/mypkg'}, - package_data={'mypkg': ['data/*.dat']}, - ) + setup(..., + packages=['mypkg'], + package_dir={'mypkg': 'src/mypkg'}, + package_data={'mypkg': ['data/*.dat']}, + ) .. versionchanged:: 2.7 - All the files that match ``package_data`` will be added to the ``MANIFEST`` - file if no template is provided. See :ref:`manifest`. + All the files that match ``package_data`` will be added to the ``MANIFEST`` + file if no template is provided. See :ref:`manifest`. .. _distutils-additional-files: @@ -514,11 +514,11 @@ :option:`data_files` specifies a sequence of (*directory*, *files*) pairs in the following way:: - setup(..., - data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']), - ('config', ['cfg/data.cfg']), - ('/etc/init.d', ['init-script'])] - ) + setup(..., + data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']), + ('config', ['cfg/data.cfg']), + ('/etc/init.d', ['init-script'])] + ) Note that you can specify the directory names where the data files will be installed, but you cannot rename the data files themselves. @@ -539,8 +539,8 @@ directory. .. versionchanged:: 2.7 - All the files that match ``data_files`` will be added to the ``MANIFEST`` - file if no template is provided. See :ref:`manifest`. + All the files that match ``data_files`` will be added to the ``MANIFEST`` + file if no template is provided. See :ref:`manifest`. @@ -575,7 +575,7 @@ | | description of the | | | | | package | | | +----------------------+---------------------------+-----------------+--------+ -| ``long_description`` | longer description of the | long string | | +| ``long_description`` | longer description of the | long string | \(5) | | | package | | | +----------------------+---------------------------+-----------------+--------+ | ``download_url`` | location where the | URL | \(4) | @@ -589,28 +589,32 @@ Notes: (1) - These fields are required. + These fields are required. (2) - It is recommended that versions take the form *major.minor[.patch[.sub]]*. + It is recommended that versions take the form *major.minor[.patch[.sub]]*. (3) - Either the author or the maintainer must be identified. + Either the author or the maintainer must be identified. (4) - These fields should not be used if your package is to be compatible with Python - versions prior to 2.2.3 or 2.3. The list is available from the `PyPI website - `_. + These fields should not be used if your package is to be compatible with Python + versions prior to 2.2.3 or 2.3. The list is available from the `PyPI website + `_. + +(5) + The ``long_description`` field is used by PyPI when you are registering a + package, to build its home page. 'short string' - A single line of text, not more than 200 characters. + A single line of text, not more than 200 characters. 'long string' - Multiple lines of plain text in reStructuredText format (see - http://docutils.sf.net/). + Multiple lines of plain text in reStructuredText format (see + http://docutils.sf.net/). 'list of strings' - See below. + See below. Encoding the version information is an art in itself. Python packages generally adhere to the version format *major.minor[.patch][sub]*. The major number is 0 @@ -624,44 +628,44 @@ (for final pre-release release testing). Some examples: 0.1.0 - the first, experimental release of a package + the first, experimental release of a package 1.0.1a2 - the second alpha release of the first patch version of 1.0 + the second alpha release of the first patch version of 1.0 :option:`classifiers` are specified in a python list:: - setup(..., - classifiers=[ - 'Development Status :: 4 - Beta', - 'Environment :: Console', - 'Environment :: Web Environment', - 'Intended Audience :: End Users/Desktop', - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'License :: OSI Approved :: Python Software Foundation License', - 'Operating System :: MacOS :: MacOS X', - 'Operating System :: Microsoft :: Windows', - 'Operating System :: POSIX', - 'Programming Language :: Python', - 'Topic :: Communications :: Email', - 'Topic :: Office/Business', - 'Topic :: Software Development :: Bug Tracking', - ], - ) + setup(..., + classifiers=[ + 'Development Status :: 4 - Beta', + 'Environment :: Console', + 'Environment :: Web Environment', + 'Intended Audience :: End Users/Desktop', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Python Software Foundation License', + 'Operating System :: MacOS :: MacOS X', + 'Operating System :: Microsoft :: Windows', + 'Operating System :: POSIX', + 'Programming Language :: Python', + 'Topic :: Communications :: Email', + 'Topic :: Office/Business', + 'Topic :: Software Development :: Bug Tracking', + ], + ) If you wish to include classifiers in your :file:`setup.py` file and also wish to remain backwards-compatible with Python releases prior to 2.2.3, then you can include the following code fragment in your :file:`setup.py` before the :func:`setup` call. :: - # patch distutils if it can't cope with the "classifiers" or - # "download_url" keywords - from sys import version - if version < '2.2.3': - from distutils.dist import DistributionMetadata - DistributionMetadata.classifiers = None - DistributionMetadata.download_url = None + # patch distutils if it can't cope with the "classifiers" or + # "download_url" keywords + from sys import version + if version < '2.2.3': + from distutils.dist import DistributionMetadata + DistributionMetadata.classifiers = None + DistributionMetadata.download_url = None Debugging the setup script @@ -683,5 +687,3 @@ to anything except an empty string, and distutils will now print detailed information what it is doing, and prints the full traceback in case an exception occurs. - - Modified: python/branches/io-c/Doc/distutils/uploading.rst ============================================================================== --- python/branches/io-c/Doc/distutils/uploading.rst (original) +++ python/branches/io-c/Doc/distutils/uploading.rst Sat Feb 28 20:20:42 2009 @@ -41,3 +41,32 @@ *section* the name of the section in :file:`$HOME/.pypirc`, and :option:`--show-response` (which displays the full response text from the PyPI server for help in debugging upload problems). + +PyPI package display +==================== + +The ``long_description`` field plays a special role at PyPI. It is used by +the server to display a home page for the registered package. + +If you use the `reStructuredText `_ +syntax for this field, PyPI will parse it and display an HTML output for +the package home page. + +The ``long_description`` field can be attached to a text file located +in the package:: + + from distutils.core import setup + + setup(name='Distutils', + long_description=open('README.txt')) + +In that case, `README.txt` is a regular reStructuredText text file located +in the root of the package besides `setup.py`. + +To prevent registering broken reStructuredText content, you can use the +:program:`rst2html` program that is provided by the `docutils` package +and check the ``long_description`` from the command line:: + + $ python setup.py --long-description | rst2html.py > output.html + +`docutils` will display a warning if there's something wrong with your syntax. Modified: python/branches/io-c/Doc/extending/newtypes.rst ============================================================================== --- python/branches/io-c/Doc/extending/newtypes.rst (original) +++ python/branches/io-c/Doc/extending/newtypes.rst Sat Feb 28 20:20:42 2009 @@ -72,7 +72,7 @@ Moving on, we come to the crunch --- the type object. :: 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 */ @@ -103,11 +103,11 @@ This is so important that we're going to pick the top of it apart still further:: - PyObject_HEAD_INIT(NULL) + PyVarObject_HEAD_INIT(NULL, 0) This line is a bit of a wart; what we'd like to write is:: - PyObject_HEAD_INIT(&PyType_Type) + PyVarObject_HEAD_INIT(&PyType_Type, 0) as the type of a type object is "type", but this isn't strictly conforming C and some compilers complain. Fortunately, this member will be filled in for us by @@ -1154,8 +1154,6 @@ +===========================+==============================================+ | :const:`READONLY` | Never writable. | +---------------------------+----------------------------------------------+ -| :const:`RO` | Shorthand for :const:`READONLY`. | -+---------------------------+----------------------------------------------+ | :const:`READ_RESTRICTED` | Not readable in restricted mode. | +---------------------------+----------------------------------------------+ | :const:`WRITE_RESTRICTED` | Not writable in restricted mode. | @@ -1165,7 +1163,6 @@ .. index:: single: READONLY - single: RO single: READ_RESTRICTED single: WRITE_RESTRICTED single: RESTRICTED @@ -1430,7 +1427,7 @@ The statically-declared type object for instances is defined this way:: PyTypeObject PyInstance_Type = { - PyObject_HEAD_INIT(&PyType_Type) + PyVarObject_HEAD_INIT(&PyType_Type, 0) 0, "module.instance", Modified: python/branches/io-c/Doc/extending/windows.rst ============================================================================== --- python/branches/io-c/Doc/extending/windows.rst (original) +++ python/branches/io-c/Doc/extending/windows.rst Sat Feb 28 20:20:42 2009 @@ -169,11 +169,11 @@ If your module creates a new type, you may have trouble with this line:: - PyObject_HEAD_INIT(&PyType_Type) + PyVarObject_HEAD_INIT(&PyType_Type, 0) Change it to:: - PyObject_HEAD_INIT(NULL) + PyVarObject_HEAD_INIT(NULL, 0) and add the following to the module initialization function:: Modified: python/branches/io-c/Doc/howto/webservers.rst ============================================================================== --- python/branches/io-c/Doc/howto/webservers.rst (original) +++ python/branches/io-c/Doc/howto/webservers.rst Sat Feb 28 20:20:42 2009 @@ -99,7 +99,8 @@ # -*- coding: UTF-8 -*- # enable debugging - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() print("Content-Type: text/plain;charset=utf-8") print() Modified: python/branches/io-c/Doc/library/2to3.rst ============================================================================== --- python/branches/io-c/Doc/library/2to3.rst (original) +++ python/branches/io-c/Doc/library/2to3.rst Sat Feb 28 20:20:42 2009 @@ -38,9 +38,9 @@ $ 2to3 example.py A diff against the original source file is printed. 2to3 can also write the -needed modifications right back to the source file. (Of course, a backup of the -original is also be made unless :option:`-n` is also given.) Writing the -changes back is enabled with the :option:`-w` flag:: +needed modifications right back to the source file. (A backup of the original +file is made unless :option:`-n` is also given.) Writing the changes back is +enabled with the :option:`-w` flag:: $ 2to3 -w example.py Modified: python/branches/io-c/Doc/library/abc.rst ============================================================================== --- python/branches/io-c/Doc/library/abc.rst (original) +++ python/branches/io-c/Doc/library/abc.rst Sat Feb 28 20:20:42 2009 @@ -150,7 +150,7 @@ .. note:: - Unlike C++'s pure virtual functions, or Java abstract methods, these abstract + Unlike Java abstract methods, these abstract methods may have an implementation. This implementation can be called via the :func:`super` mechanism from the class that overrides it. This could be useful as an end-point for a Modified: python/branches/io-c/Doc/library/cgi.rst ============================================================================== --- python/branches/io-c/Doc/library/cgi.rst (original) +++ python/branches/io-c/Doc/library/cgi.rst Sat Feb 28 20:20:42 2009 @@ -65,16 +65,18 @@ Begin by writing ``import cgi``. -When you write a new script, consider adding the line:: +When you write a new script, consider adding these lines:: - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() This activates a special exception handler that will display detailed reports in the Web browser if any errors occur. If you'd rather not show the guts of your program to users of your script, you can have the reports saved to files -instead, with a line like this:: +instead, with code like this:: - import cgitb; cgitb.enable(display=0, logdir="/tmp") + import cgitb + cgitb.enable(display=0, logdir="/tmp") It's very helpful to use this feature during script development. The reports produced by :mod:`cgitb` provide information that can save you a lot of time in @@ -445,9 +447,10 @@ Fortunately, once you have managed to get your script to execute *some* code, you can easily send tracebacks to the Web browser using the :mod:`cgitb` module. -If you haven't done so already, just add the line:: +If you haven't done so already, just add the lines:: - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() to the top of your script. Then try running it again; when a problem occurs, you should see a detailed report that will likely make apparent the cause of the Modified: python/branches/io-c/Doc/library/cgitb.rst ============================================================================== --- python/branches/io-c/Doc/library/cgitb.rst (original) +++ python/branches/io-c/Doc/library/cgitb.rst Sat Feb 28 20:20:42 2009 @@ -24,9 +24,10 @@ functions, to help you debug the problem. Optionally, you can save this information to a file instead of sending it to the browser. -To enable this feature, simply add one line to the top of your CGI script:: +To enable this feature, simply add this to the top of your CGI script:: - import cgitb; cgitb.enable() + import cgitb + cgitb.enable() The options to the :func:`enable` function control whether the report is displayed in the browser and whether the report is logged to a file for later Modified: python/branches/io-c/Doc/library/collections.rst ============================================================================== --- python/branches/io-c/Doc/library/collections.rst (original) +++ python/branches/io-c/Doc/library/collections.rst Sat Feb 28 20:20:42 2009 @@ -236,13 +236,12 @@ c.most_common()[:-n:-1] # n least common elements c += Counter() # remove zero and negative counts -Several multiset mathematical operations are provided for combining -:class:`Counter` objects. Multisets are like regular sets but are allowed to -contain repeated elements (with counts of one or more). Addition and -subtraction combine counters by adding or subtracting the counts of -corresponding elements. Intersection and union return the minimum and maximum -of corresponding counts. Each operation can accept inputs with signed counts, -but the output excludes results with counts less than one. +Several mathematical operations are provided for combining :class:`Counter` +objects to produce multisets (counters that have counts greater than zero). +Addition and subtraction combine counters by adding or subtracting the counts +of corresponding elements. Intersection and union return the minimum and +maximum of corresponding counts. Each operation can accept inputs with signed +counts, but the output will exclude results with counts of zero or less. >>> c = Counter(a=3, b=1) >>> d = Counter(a=1, b=2) Modified: python/branches/io-c/Doc/library/functions.rst ============================================================================== --- python/branches/io-c/Doc/library/functions.rst (original) +++ python/branches/io-c/Doc/library/functions.rst Sat Feb 28 20:20:42 2009 @@ -1067,7 +1067,7 @@ The second use case is to support cooperative multiple inheritance in a dynamic execution environment. This use case is unique to Python and is not found in statically compiled languages or languages that only support - single inheritance. This makes in possible to implement "diamond diagrams" + single inheritance. This makes it possible to implement "diamond diagrams" where multiple base classes implement the same method. Good design dictates that this method have the same calling signature in every case (because the order of calls is determined at runtime, because that order adapts Modified: python/branches/io-c/Doc/library/stdtypes.rst ============================================================================== --- python/branches/io-c/Doc/library/stdtypes.rst (original) +++ python/branches/io-c/Doc/library/stdtypes.rst Sat Feb 28 20:20:42 2009 @@ -793,9 +793,9 @@ .. method:: str.count(sub[, start[, end]]) - Return the number of occurrences of substring *sub* in the range [*start*, - *end*]. Optional arguments *start* and *end* are interpreted as in slice - notation. + Return the number of non-overlapping occurrences of substring *sub* in the + range [*start*, *end*]. Optional arguments *start* and *end* are + interpreted as in slice notation. .. method:: str.encode([encoding[, errors]]) @@ -835,7 +835,7 @@ found. -.. method:: str.format(format_string, *args, **kwargs) +.. method:: str.format(*args, **kwargs) Perform a string formatting operation. The *format_string* argument can contain literal text or replacement fields delimited by braces ``{}``. Each Modified: python/branches/io-c/Doc/library/urllib.request.rst ============================================================================== --- python/branches/io-c/Doc/library/urllib.request.rst (original) +++ python/branches/io-c/Doc/library/urllib.request.rst Sat Feb 28 20:20:42 2009 @@ -37,20 +37,20 @@ * :meth:`geturl` --- return the URL of the resource retrieved, commonly used to determine if a redirect was followed - * :meth:`info` --- return the meta-information of the page, such as headers, in - the form of an ``http.client.HTTPMessage`` instance - (see `Quick Reference to HTTP Headers `_) + * :meth:`info` --- return the meta-information of the page, such as headers, + in the form of an ``http.client.HTTPMessage`` instance (see `Quick + Reference to HTTP Headers `_) Raises :exc:`URLError` on errors. - Note that ``None`` may be returned if no handler handles the request (though the - default installed global :class:`OpenerDirector` uses :class:`UnknownHandler` to - ensure this never happens). - The urlopen function from the previous version, Python 2.6 and earlier, of - the module urllib has been discontinued as urlopen can return the - file-object as the previous. The proxy handling, which in earlier was passed - as a dict parameter to urlopen can be availed by the use of - :class:`ProxyHandler` objects. + Note that ``None`` may be returned if no handler handles the request (though + the default installed global :class:`OpenerDirector` uses + :class:`UnknownHandler` to ensure this never happens). + + The legacy ``urllib.urlopen`` function from Python 2.6 and earlier has been + discontinued; :func:`urlopen` corresponds to the old ``urllib2.urlopen``. + Proxy handling, which was done by passing a dictionary parameter to + ``urllib.urlopen``, can be obtained by using :class:`ProxyHandler` objects. .. function:: install_opener(opener) Modified: python/branches/io-c/Doc/library/xml.etree.elementtree.rst ============================================================================== --- python/branches/io-c/Doc/library/xml.etree.elementtree.rst (original) +++ python/branches/io-c/Doc/library/xml.etree.elementtree.rst Sat Feb 28 20:20:42 2009 @@ -529,5 +529,5 @@ .. [#] The encoding string included in XML output should conform to the appropriate standards. For example, "UTF-8" is valid, but "UTF8" is not. See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl - and http://www.iana.org/assignments/character-sets . + and http://www.iana.org/assignments/character-sets. Modified: python/branches/io-c/Doc/whatsnew/2.5.rst ============================================================================== --- python/branches/io-c/Doc/whatsnew/2.5.rst (original) +++ python/branches/io-c/Doc/whatsnew/2.5.rst Sat Feb 28 20:20:42 2009 @@ -1761,8 +1761,8 @@ included. The rest of this section will provide a brief overview of using ElementTree. -Full documentation for ElementTree is available at http://effbot.org/zone -/element-index.htm. +Full documentation for ElementTree is available at +http://effbot.org/zone/element-index.htm. ElementTree represents an XML document as a tree of element nodes. The text content of the document is stored as the :attr:`.text` and :attr:`.tail` Modified: python/branches/io-c/Lib/_abcoll.py ============================================================================== --- python/branches/io-c/Lib/_abcoll.py (original) +++ python/branches/io-c/Lib/_abcoll.py Sat Feb 28 20:20:42 2009 @@ -392,6 +392,9 @@ def __len__(self): return len(self._mapping) + def __repr__(self): + return '{0.__class__.__name__}({0._mapping!r})'.format(self) + class KeysView(MappingView, Set): Modified: python/branches/io-c/Lib/distutils/README ============================================================================== --- python/branches/io-c/Lib/distutils/README (original) +++ python/branches/io-c/Lib/distutils/README Sat Feb 28 20:20:42 2009 @@ -8,4 +8,6 @@ http://www.python.org/sigs/distutils-sig/ +WARNING : Distutils must remain compatible with 2.3 + $Id$ Modified: python/branches/io-c/Lib/distutils/command/bdist_rpm.py ============================================================================== --- python/branches/io-c/Lib/distutils/command/bdist_rpm.py (original) +++ python/branches/io-c/Lib/distutils/command/bdist_rpm.py Sat Feb 28 20:20:42 2009 @@ -122,10 +122,21 @@ # Allow a packager to explicitly force an architecture ('force-arch=', None, "Force an architecture onto the RPM build process"), - ] + + ('quiet', 'q', + "Run the INSTALL phase of RPM building in quiet mode"), + + # Forces the -O1 option when calling the install command, + # so the rpm contains all files needed for proper operation under + # SELinux. Some systems checks for this on build-time and will + # fail without this. + ('force-optimize', None, + "Forces the -O1 option when calling the install command"), + + ] boolean_options = ['keep-temp', 'use-rpm-opt-flags', 'rpm3-mode', - 'no-autoreq'] + 'no-autoreq', 'quiet', 'force-optimize'] negative_opt = {'no-keep-temp': 'keep-temp', 'no-rpm-opt-flags': 'use-rpm-opt-flags', @@ -175,6 +186,8 @@ self.no_autoreq = 0 self.force_arch = None + self.quiet = 0 + self.force_optimize = 1 def finalize_options(self): self.set_undefined_options('bdist', ('bdist_base', 'bdist_base')) @@ -311,6 +324,7 @@ if os.path.exists('/usr/bin/rpmbuild') or \ os.path.exists('/bin/rpmbuild'): rpm_cmd = ['rpmbuild'] + if self.source_only: # what kind of RPMs? rpm_cmd.append('-bs') elif self.binary_only: @@ -322,6 +336,10 @@ '_topdir %s' % os.path.abspath(self.rpm_base)]) if not self.keep_temp: rpm_cmd.append('--clean') + + if self.quiet: + rpm_cmd.append('--quiet') + rpm_cmd.append(spec_path) # Determine the binary rpm names that should be built out of this spec # file @@ -474,13 +492,19 @@ # that we open and interpolate into the spec file, but the defaults # are just text that we drop in as-is. Hmmm. + # forcing -O1 if force-optimize + if self.force_optimize: + optimize = ' -O1' + else: + optimize = '' + + install_cmd = ('%s install%s --root=$RPM_BUILD_ROOT ' + '--record=INSTALLED_FILES') % (def_setup_call, optimize) + script_options = [ ('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"), ('build', 'build_script', def_build), - ('install', 'install_script', - ("%s install " - "--root=$RPM_BUILD_ROOT " - "--record=INSTALLED_FILES") % def_setup_call), + ('install', 'install_script', install_cmd), ('clean', 'clean_script', "rm -rf $RPM_BUILD_ROOT"), ('verifyscript', 'verify_script', None), ('pre', 'pre_install', None), Modified: python/branches/io-c/Lib/distutils/command/build_ext.py ============================================================================== --- python/branches/io-c/Lib/distutils/command/build_ext.py (original) +++ python/branches/io-c/Lib/distutils/command/build_ext.py Sat Feb 28 20:20:42 2009 @@ -7,7 +7,6 @@ __revision__ = "$Id$" import sys, os, re -from site import USER_BASE, USER_SITE from distutils.core import Command from distutils.errors import * from distutils.sysconfig import customize_compiler, get_python_version @@ -16,6 +15,14 @@ from distutils.util import get_platform from distutils import log +# this keeps compatibility from 2.3 to 2.5 +if sys.version < "2.6": + USER_BASE = None + HAS_USER_SITE = False +else: + from site import USER_BASE + HAS_USER_SITE = True + if os.name == 'nt': from distutils.msvccompiler import get_build_version MSVC_VERSION = int(get_build_version()) @@ -91,11 +98,14 @@ "list of SWIG command line options"), ('swig=', None, "path to the SWIG executable"), - ('user', None, - "add user include, library and rpath"), ] - boolean_options = ['inplace', 'debug', 'force', 'swig-cpp', 'user'] + boolean_options = ['inplace', 'debug', 'force', 'swig-cpp'] + + if HAS_USER_SITE: + user_options.append(('user', None, + "add user include, library and rpath")) + boolean_options.append('user') help_options = [ ('help-compiler', None, Modified: python/branches/io-c/Lib/distutils/command/install.py ============================================================================== --- python/branches/io-c/Lib/distutils/command/install.py (original) +++ python/branches/io-c/Lib/distutils/command/install.py Sat Feb 28 20:20:42 2009 @@ -15,9 +15,16 @@ from distutils.util import convert_path, subst_vars, change_root from distutils.util import get_platform from distutils.errors import DistutilsOptionError -from site import USER_BASE -from site import USER_SITE +# this keeps compatibility from 2.3 to 2.5 +if sys.version < "2.6": + USER_BASE = None + USER_SITE = None + HAS_USER_SITE = False +else: + from site import USER_BASE + from site import USER_SITE + HAS_USER_SITE = True if sys.version < "2.2": WINDOWS_SCHEME = { @@ -51,21 +58,7 @@ 'scripts': '$base/bin', 'data' : '$base', }, - 'unix_user': { - 'purelib': '$usersite', - 'platlib': '$usersite', - 'headers': '$userbase/include/python$py_version_short/$dist_name', - 'scripts': '$userbase/bin', - 'data' : '$userbase', - }, 'nt': WINDOWS_SCHEME, - 'nt_user': { - 'purelib': '$usersite', - 'platlib': '$usersite', - 'headers': '$userbase/Python$py_version_nodot/Include/$dist_name', - 'scripts': '$userbase/Scripts', - 'data' : '$userbase', - }, 'mac': { 'purelib': '$base/Lib/site-packages', 'platlib': '$base/Lib/site-packages', @@ -73,13 +66,7 @@ 'scripts': '$base/Scripts', 'data' : '$base', }, - 'mac_user': { - 'purelib': '$usersite', - 'platlib': '$usersite', - 'headers': '$userbase/$py_version_short/include/$dist_name', - 'scripts': '$userbase/bin', - 'data' : '$userbase', - }, + 'os2': { 'purelib': '$base/Lib/site-packages', 'platlib': '$base/Lib/site-packages', @@ -87,14 +74,41 @@ 'scripts': '$base/Scripts', 'data' : '$base', }, - 'os2_home': { + } + +# user site schemes +if HAS_USER_SITE: + INSTALL_SCHEMES['nt_user'] = { + 'purelib': '$usersite', + 'platlib': '$usersite', + 'headers': '$userbase/Python$py_version_nodot/Include/$dist_name', + 'scripts': '$userbase/Scripts', + 'data' : '$userbase', + } + + INSTALL_SCHEMES['unix_user'] = { 'purelib': '$usersite', 'platlib': '$usersite', 'headers': '$userbase/include/python$py_version_short/$dist_name', 'scripts': '$userbase/bin', 'data' : '$userbase', - }, - } + } + + INSTALL_SCHEMES['mac_user'] = { + 'purelib': '$usersite', + 'platlib': '$usersite', + 'headers': '$userbase/$py_version_short/include/$dist_name', + 'scripts': '$userbase/bin', + 'data' : '$userbase', + } + + INSTALL_SCHEMES['os2_home'] = { + 'purelib': '$usersite', + 'platlib': '$usersite', + 'headers': '$userbase/include/python$py_version_short/$dist_name', + 'scripts': '$userbase/bin', + 'data' : '$userbase', + } # The keys to an installation scheme; if any new types of files are to be # installed, be sure to add an entry to every installation scheme above, @@ -114,8 +128,6 @@ "(Unix only) prefix for platform-specific files"), ('home=', None, "(Unix only) home directory to install under"), - ('user', None, - "install in user site-package '%s'" % USER_SITE), # Or, just set the base director(y|ies) ('install-base=', None, @@ -167,7 +179,13 @@ "filename in which to record list of installed files"), ] - boolean_options = ['compile', 'force', 'skip-build', 'user'] + boolean_options = ['compile', 'force', 'skip-build'] + + if HAS_USER_SITE: + user_options.append(('user', None, + "install in user site-package '%s'" % USER_SITE)) + boolean_options.append('user') + negative_opt = {'no-compile' : 'compile'} @@ -319,9 +337,12 @@ 'prefix': prefix, 'sys_exec_prefix': exec_prefix, 'exec_prefix': exec_prefix, - 'userbase': self.install_userbase, - 'usersite': self.install_usersite, } + + if HAS_USER_SITE: + self.config_vars['userbase'] = self.install_userbase + self.config_vars['usersite'] = self.install_usersite + self.expand_basedirs() self.dump_dirs("post-expand_basedirs()") Modified: python/branches/io-c/Lib/distutils/command/upload.py ============================================================================== --- python/branches/io-c/Lib/distutils/command/upload.py (original) +++ python/branches/io-c/Lib/distutils/command/upload.py Sat Feb 28 20:20:42 2009 @@ -6,7 +6,7 @@ from distutils.core import PyPIRCCommand from distutils.spawn import spawn from distutils import log -from hashlib import md5 +import sys import os, io import socket import platform @@ -15,6 +15,12 @@ import base64 import urllib.parse +# this keeps compatibility for 2.3 and 2.4 +if sys.version < "2.5": + from md5 import md5 +else: + from hashlib import md5 + class upload(PyPIRCCommand): description = "upload binary package to PyPI" Modified: python/branches/io-c/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/io-c/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/io-c/Lib/distutils/tests/test_build_ext.py Sat Feb 28 20:20:42 2009 @@ -24,11 +24,17 @@ def setUp(self): # Create a simple test environment # Note that we're making changes to sys.path - TempdirManager.setUp(self) + super(BuildExtTestCase, self).setUp() self.tmp_dir = self.mkdtemp() self.sys_path = sys.path[:] sys.path.append(self.tmp_dir) shutil.copy(_get_source_filename(), self.tmp_dir) + if sys.version > "2.6": + import site + self.old_user_base = site.USER_BASE + site.USER_BASE = self.mkdtemp() + from distutils.command import build_ext + build_ext.USER_BASE = site.USER_BASE def test_build_ext(self): global ALREADY_TESTED @@ -76,7 +82,12 @@ # Get everything back to normal support.unload('xx') sys.path = self.sys_path - TempdirManager.tearDown(self) + if sys.version > "2.6": + import site + site.USER_BASE = self.old_user_base + from distutils.command import build_ext + build_ext.USER_BASE = self.old_user_base + super(BuildExtTestCase, self).tearDown() def test_solaris_enable_shared(self): dist = Distribution({'name': 'xx'}) @@ -99,6 +110,37 @@ # make sur we get some lobrary dirs under solaris self.assert_(len(cmd.library_dirs) > 0) + def test_user_site(self): + # site.USER_SITE was introduced in 2.6 + if sys.version < '2.6': + return + + import site + dist = Distribution({'name': 'xx'}) + cmd = build_ext(dist) + + # making sure the suer option is there + options = [name for name, short, lable in + cmd.user_options] + self.assert_('user' in options) + + # setting a value + cmd.user = 1 + + # setting user based lib and include + lib = os.path.join(site.USER_BASE, 'lib') + incl = os.path.join(site.USER_BASE, 'include') + os.mkdir(lib) + os.mkdir(incl) + + # let's run finalize + cmd.ensure_finalized() + + # see if include_dirs and library_dirs + # were set + self.assert_(lib in cmd.library_dirs) + self.assert_(incl in cmd.include_dirs) + def test_suite(): src = _get_source_filename() if not os.path.exists(src): Modified: python/branches/io-c/Lib/distutils/tests/test_config.py ============================================================================== --- python/branches/io-c/Lib/distutils/tests/test_config.py (original) +++ python/branches/io-c/Lib/distutils/tests/test_config.py Sat Feb 28 20:20:42 2009 @@ -50,7 +50,7 @@ def setUp(self): """Patches the environment.""" - support.TempdirManager.setUp(self) + super(PyPIRCCommandTestCase, self).setUp() if 'HOME' in os.environ: self._old_home = os.environ['HOME'] @@ -78,7 +78,7 @@ else: os.environ['HOME'] = self._old_home set_threshold(self.old_threshold) - support.TempdirManager.tearDown(self) + super(PyPIRCCommandTestCase, self).tearDown() def test_server_registration(self): # This test makes sure PyPIRCCommand knows how to: Modified: python/branches/io-c/Lib/distutils/tests/test_install.py ============================================================================== --- python/branches/io-c/Lib/distutils/tests/test_install.py (original) +++ python/branches/io-c/Lib/distutils/tests/test_install.py Sat Feb 28 20:20:42 2009 @@ -1,9 +1,14 @@ """Tests for distutils.command.install.""" import os +import os.path +import sys import unittest +import site from distutils.command.install import install +from distutils.command import install as install_module +from distutils.command.install import INSTALL_SCHEMES from distutils.core import Distribution from distutils.tests import support @@ -47,6 +52,65 @@ check_path(cmd.install_scripts, os.path.join(destination, "bin")) check_path(cmd.install_data, destination) + def test_user_site(self): + # site.USER_SITE was introduced in 2.6 + if sys.version < '2.6': + return + + # preparing the environement for the test + self.old_user_base = site.USER_BASE + self.old_user_site = site.USER_SITE + self.tmpdir = self.mkdtemp() + self.user_base = os.path.join(self.tmpdir, 'B') + self.user_site = os.path.join(self.tmpdir, 'S') + site.USER_BASE = self.user_base + site.USER_SITE = self.user_site + install_module.USER_BASE = self.user_base + install_module.USER_SITE = self.user_site + + def _expanduser(path): + return self.tmpdir + self.old_expand = os.path.expanduser + os.path.expanduser = _expanduser + + try: + # this is the actual test + self._test_user_site() + finally: + site.USER_BASE = self.old_user_base + site.USER_SITE = self.old_user_site + install_module.USER_BASE = self.old_user_base + install_module.USER_SITE = self.old_user_site + os.path.expanduser = self.old_expand + + def _test_user_site(self): + for key in ('nt_user', 'unix_user', 'os2_home'): + self.assert_(key in INSTALL_SCHEMES) + + dist = Distribution({'name': 'xx'}) + cmd = install(dist) + + # making sure the user option is there + options = [name for name, short, lable in + cmd.user_options] + self.assert_('user' in options) + + # setting a value + cmd.user = 1 + + # user base and site shouldn't be created yet + self.assert_(not os.path.exists(self.user_base)) + self.assert_(not os.path.exists(self.user_site)) + + # let's run finalize + cmd.ensure_finalized() + + # now they should + self.assert_(os.path.exists(self.user_base)) + self.assert_(os.path.exists(self.user_site)) + + self.assert_('userbase' in cmd.config_vars) + self.assert_('usersite' in cmd.config_vars) def test_suite(): return unittest.makeSuite(InstallTestCase) Modified: python/branches/io-c/Lib/distutils/tests/test_sdist.py ============================================================================== --- python/branches/io-c/Lib/distutils/tests/test_sdist.py (original) +++ python/branches/io-c/Lib/distutils/tests/test_sdist.py Sat Feb 28 20:20:42 2009 @@ -37,10 +37,9 @@ class sdistTestCase(support.LoggingSilencer, PyPIRCCommandTestCase): def setUp(self): - support.LoggingSilencer.setUp(self) # PyPIRCCommandTestCase creates a temp dir already # and put it in self.tmp_dir - PyPIRCCommandTestCase.setUp(self) + super(sdistTestCase, self).setUp() # setting up an environment self.old_path = os.getcwd() os.mkdir(join(self.tmp_dir, 'somecode')) @@ -54,8 +53,7 @@ def tearDown(self): # back to normal os.chdir(self.old_path) - PyPIRCCommandTestCase.tearDown(self) - support.LoggingSilencer.tearDown(self) + super(sdistTestCase, self).tearDown() def get_cmd(self, metadata=None): """Returns a cmd""" Modified: python/branches/io-c/Lib/socketserver.py ============================================================================== --- python/branches/io-c/Lib/socketserver.py (original) +++ python/branches/io-c/Lib/socketserver.py Sat Feb 28 20:20:42 2009 @@ -487,7 +487,7 @@ # libraries that expect to be able to wait for their own # children. try: - pid, status = os.waitpid(0, options=0) + pid, status = os.waitpid(0, 0) except os.error: pid = None if pid not in self.active_children: continue Modified: python/branches/io-c/Lib/test/test_mmap.py ============================================================================== --- python/branches/io-c/Lib/test/test_mmap.py (original) +++ python/branches/io-c/Lib/test/test_mmap.py Sat Feb 28 20:20:42 2009 @@ -466,6 +466,72 @@ self.assert_(issubclass(mmap.error, EnvironmentError)) self.assert_("mmap.error" in str(mmap.error)) + def test_io_methods(self): + data = b"0123456789" + open(TESTFN, "wb").write(b"x"*len(data)) + f = open(TESTFN, "r+b") + m = mmap.mmap(f.fileno(), len(data)) + f.close() + # Test write_byte() + for i in range(len(data)): + self.assertEquals(m.tell(), i) + m.write_byte(data[i:i+1]) + self.assertEquals(m.tell(), i+1) + self.assertRaises(ValueError, m.write_byte, b"x") + self.assertEquals(m[:], data) + # Test read_byte() + m.seek(0) + for i in range(len(data)): + self.assertEquals(m.tell(), i) + # XXX: Disable this test for now because it's not clear + # which type of object m.read_byte returns. Currently, it + # returns 1-length str (unicode). + if 0: + self.assertEquals(m.read_byte(), data[i:i+1]) + else: + m.read_byte() + self.assertEquals(m.tell(), i+1) + self.assertRaises(ValueError, m.read_byte) + # Test read() + m.seek(3) + self.assertEquals(m.read(3), b"345") + self.assertEquals(m.tell(), 6) + # Test write() + m.seek(3) + m.write(b"bar") + self.assertEquals(m.tell(), 6) + self.assertEquals(m[:], b"012bar6789") + m.seek(8) + self.assertRaises(ValueError, m.write, b"bar") + + if os.name == 'nt': + def test_tagname(self): + data1 = b"0123456789" + data2 = b"abcdefghij" + assert len(data1) == len(data2) + # Test same tag + m1 = mmap.mmap(-1, len(data1), tagname="foo") + m1[:] = data1 + m2 = mmap.mmap(-1, len(data2), tagname="foo") + m2[:] = data2 + self.assertEquals(m1[:], data2) + self.assertEquals(m2[:], data2) + # Test differnt tag + m1 = mmap.mmap(-1, len(data1), tagname="foo") + m1[:] = data1 + m2 = mmap.mmap(-1, len(data2), tagname="boo") + m2[:] = data2 + self.assertEquals(m1[:], data1) + self.assertEquals(m2[:], data2) + + def test_tagname_crash(self): + # Should not crash (Issue 1733986) + m = mmap.mmap(-1, 1000, tagname="foo") + try: + mmap.mmap(-1, 5000, tagname="foo")[:] # same tagname, but larger size + except: + pass + def test_main(): run_unittest(MmapTests) Modified: python/branches/io-c/Lib/test/test_opcodes.py ============================================================================== --- python/branches/io-c/Lib/test/test_opcodes.py (original) +++ python/branches/io-c/Lib/test/test_opcodes.py Sat Feb 28 20:20:42 2009 @@ -98,6 +98,12 @@ g = eval('lambda a=1: None') self.assertNotEquals(f, g) + def test_modulo_of_string_subclasses(self): + class MyString(str): + def __mod__(self, value): + return 42 + self.assertEqual(MyString() % 3, 42) + def test_main(): run_unittest(OpcodeTest) Modified: python/branches/io-c/Misc/NEWS ============================================================================== --- python/branches/io-c/Misc/NEWS (original) +++ python/branches/io-c/Misc/NEWS Sat Feb 28 20:20:42 2009 @@ -173,6 +173,22 @@ Library ------- +- Issue #1733986: Fixed mmap crash in accessing elements of second map object + with same tagname but larger size than first map. (Windows) + +- Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer + overrun. + +- Issue #1533164: Installed but not listed *.pyo was breaking Distutils + bdist_rpm command. + +- Issue #5378: added --quiet option to Distutils bdist_rpm command. + +- Issue #5052: make Distutils compatible with 2.3 again. + +- Issue #5316: Fixed buildbot failures introduced by multiple inheritance + in Distutils tests. + - Issue #5287: Add exception handling around findCaller() call to help out IronPython. Modified: python/branches/io-c/Modules/_ssl.c ============================================================================== --- python/branches/io-c/Modules/_ssl.c (original) +++ python/branches/io-c/Modules/_ssl.c Sat Feb 28 20:20:42 2009 @@ -1244,9 +1244,12 @@ static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args) { - PyObject *buf = NULL; + PyObject *dest = NULL; + Py_buffer buf; int buf_passed = 0; int count = -1; + char *mem; + /* XXX this should use Py_ssize_t */ int len = 1024; int sockstate; int err; @@ -1260,19 +1263,22 @@ return NULL; } - if (!PyArg_ParseTuple(args, "|Oi:read", &buf, &count)) + if (!PyArg_ParseTuple(args, "|Oi:read", &dest, &count)) return NULL; - if ((buf == NULL) || (buf == Py_None)) { - if (!(buf = PyByteArray_FromStringAndSize((char *) 0, len))) + if ((dest == NULL) || (dest == Py_None)) { + if (!(dest = PyByteArray_FromStringAndSize((char *) 0, len))) return NULL; - } else if (PyLong_Check(buf)) { - len = PyLong_AS_LONG(buf); - if (!(buf = PyByteArray_FromStringAndSize((char *) 0, len))) + mem = PyByteArray_AS_STRING(dest); + } else if (PyLong_Check(dest)) { + len = PyLong_AS_LONG(dest); + if (!(dest = PyByteArray_FromStringAndSize((char *) 0, len))) return NULL; + mem = PyByteArray_AS_STRING(dest); } else { - if (!PyByteArray_Check(buf)) + if (PyObject_GetBuffer(dest, &buf, PyBUF_CONTIG) < 0) return NULL; - len = PyByteArray_Size(buf); + mem = buf.buf; + len = buf.len; if ((count > 0) && (count <= len)) len = count; buf_passed = 1; @@ -1293,18 +1299,11 @@ if (sockstate == SOCKET_HAS_TIMED_OUT) { PyErr_SetString(PySSLErrorObject, "The read operation timed out"); - if (!buf_passed) { - Py_DECREF(buf); - } - return NULL; + goto error; } else if (sockstate == SOCKET_TOO_LARGE_FOR_SELECT) { PyErr_SetString(PySSLErrorObject, "Underlying socket too large for select()."); - if (!buf_passed) { - Py_DECREF(buf); - } - Py_DECREF(buf); - return NULL; + goto error; } else if (sockstate == SOCKET_HAS_BEEN_CLOSED) { count = 0; goto done; @@ -1313,15 +1312,11 @@ do { err = 0; PySSL_BEGIN_ALLOW_THREADS - count = SSL_read(self->ssl, PyByteArray_AsString(buf), len); + count = SSL_read(self->ssl, mem, len); err = SSL_get_error(self->ssl, count); PySSL_END_ALLOW_THREADS - if(PyErr_CheckSignals()) { - if (!buf_passed) { - Py_DECREF(buf); - } - return NULL; - } + if (PyErr_CheckSignals()) + goto error; if (err == SSL_ERROR_WANT_READ) { sockstate = check_socket_and_wait_for_timeout(sock, 0); @@ -1340,29 +1335,31 @@ if (sockstate == SOCKET_HAS_TIMED_OUT) { PyErr_SetString(PySSLErrorObject, "The read operation timed out"); - if (!buf_passed) { - Py_DECREF(buf); - } - return NULL; + goto error; } else if (sockstate == SOCKET_IS_NONBLOCKING) { break; } } while (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE); if (count <= 0) { - if (!buf_passed) { - Py_DECREF(buf); - } - return PySSL_SetError(self, count, __FILE__, __LINE__); + PySSL_SetError(self, count, __FILE__, __LINE__); + goto error; } done: if (!buf_passed) { - PyObject *res = PyBytes_FromStringAndSize( - PyByteArray_AS_STRING(buf), count); - Py_DECREF(buf); + PyObject *res = PyBytes_FromStringAndSize(mem, count); + Py_DECREF(dest); return res; } else { + PyBuffer_Release(&buf); return PyLong_FromLong(count); } + error: + if (!buf_passed) { + Py_DECREF(dest); + } else { + PyBuffer_Release(&buf); + } + return NULL; } PyDoc_STRVAR(PySSL_SSLread_doc, Modified: python/branches/io-c/Modules/cmathmodule.c ============================================================================== --- python/branches/io-c/Modules/cmathmodule.c (original) +++ python/branches/io-c/Modules/cmathmodule.c Sat Feb 28 20:20:42 2009 @@ -368,7 +368,7 @@ PyDoc_STRVAR(c_cos_doc, "cos(x)\n" -"n" +"\n" "Return the cosine of x."); @@ -427,7 +427,7 @@ PyDoc_STRVAR(c_cosh_doc, "cosh(x)\n" -"n" +"\n" "Return the hyperbolic cosine of x."); Modified: python/branches/io-c/Modules/mmapmodule.c ============================================================================== --- python/branches/io-c/Modules/mmapmodule.c (original) +++ python/branches/io-c/Modules/mmapmodule.c Sat Feb 28 20:20:42 2009 @@ -376,10 +376,17 @@ if (!is_writable(self)) return NULL; - *(self->data+self->pos) = value; - self->pos += 1; - Py_INCREF(Py_None); - return Py_None; + + if (self->pos < self->size) { + *(self->data+self->pos) = value; + self->pos += 1; + Py_INCREF(Py_None); + return Py_None; + } + else { + PyErr_SetString(PyExc_ValueError, "write byte out of range"); + return NULL; + } } static PyObject * @@ -1290,7 +1297,7 @@ dwDesiredAccess, off_hi, off_lo, - 0); + m_obj->size); if (m_obj->data != NULL) return (PyObject *)m_obj; else Modified: python/branches/io-c/Modules/python.c ============================================================================== --- python/branches/io-c/Modules/python.c (original) +++ python/branches/io-c/Modules/python.c Sat Feb 28 20:20:42 2009 @@ -37,7 +37,7 @@ fprintf(stderr, "out of memory\n"); return 1; } - oldloc = setlocale(LC_ALL, NULL); + oldloc = strdup(setlocale(LC_ALL, NULL)); setlocale(LC_ALL, ""); for (i = 0; i < argc; i++) { #ifdef HAVE_BROKEN_MBSTOWCS @@ -67,6 +67,7 @@ } } setlocale(LC_ALL, oldloc); + free(oldloc); res = Py_Main(argc, argv_copy); for (i = 0; i < argc; i++) { PyMem_Free(argv_copy2[i]); Modified: python/branches/io-c/Objects/longobject.c ============================================================================== --- python/branches/io-c/Objects/longobject.c (original) +++ python/branches/io-c/Objects/longobject.c Sat Feb 28 20:20:42 2009 @@ -1557,7 +1557,7 @@ digit powbase = base; /* powbase == base ** power */ int power = 1; for (;;) { - unsigned long newpow = powbase * (unsigned long)base; + twodigits newpow = powbase * (twodigits)base; if (newpow >> PyLong_SHIFT) /* doesn't fit in a digit */ break; powbase = (digit)newpow; Modified: python/branches/io-c/Python/ceval.c ============================================================================== --- python/branches/io-c/Python/ceval.c (original) +++ python/branches/io-c/Python/ceval.c Sat Feb 28 20:20:42 2009 @@ -1446,7 +1446,10 @@ TARGET(BINARY_MODULO) w = POP(); v = TOP(); - x = PyNumber_Remainder(v, w); + if (PyUnicode_CheckExact(v)) + x = PyUnicode_Format(v, w); + else + x = PyNumber_Remainder(v, w); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); Modified: python/branches/io-c/README ============================================================================== --- python/branches/io-c/README (original) +++ python/branches/io-c/README Sat Feb 28 20:20:42 2009 @@ -88,6 +88,33 @@ used, and backported versions of certain key Python 3.x features. +Testing +------- + +To test the interpreter, type "make test" in the top-level directory. +This runs the test set twice (once with no compiled files, once with +the compiled files left by the previous test run). The test set +produces some output. You can generally ignore the messages about +skipped tests due to optional features which can't be imported. +If a message is printed about a failed test or a traceback or core +dump is produced, something is wrong. On some Linux systems (those +that are not yet using glibc 6), test_strftime fails due to a +non-standard implementation of strftime() in the C library. Please +ignore this, or upgrade to glibc version 6. + +By default, tests are prevented from overusing resources like disk space and +memory. To enable these tests, run "make testall". + +IMPORTANT: If the tests fail and you decide to mail a bug report, +*don't* include the output of "make test". It is useless. Run the +failing test manually, as follows: + + ./python Lib/test/regrtest.py -v test_whatever + +(substituting the top of the source tree for '.' if you built in a +different directory). This runs the test in verbose mode. + + Installing multiple versions ---------------------------- Modified: python/branches/io-c/Tools/scripts/README ============================================================================== --- python/branches/io-c/Tools/scripts/README (original) +++ python/branches/io-c/Tools/scripts/README Sat Feb 28 20:20:42 2009 @@ -4,6 +4,7 @@ See also the Demo/scripts directory! +analyze_dxp.py Analyzes the result of sys.getdxp() byext.py Print lines/words/chars stats of files by extension byteyears.py Print product of a file's size and age checkappend.py Search for multi-argument .append() calls From python-checkins at python.org Sat Feb 28 20:34:59 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 28 Feb 2009 20:34:59 +0100 (CET) Subject: [Python-checkins] r70075 - in python/branches/io-c: Doc/library/io.rst Lib/io.py Message-ID: <20090228193459.5566A1E4002@bag.python.org> Author: antoine.pitrou Date: Sat Feb 28 20:34:59 2009 New Revision: 70075 Log: Amaury's name Modified: python/branches/io-c/Doc/library/io.rst python/branches/io-c/Lib/io.py Modified: python/branches/io-c/Doc/library/io.rst ============================================================================== --- python/branches/io-c/Doc/library/io.rst (original) +++ python/branches/io-c/Doc/library/io.rst Sat Feb 28 20:34:59 2009 @@ -7,7 +7,7 @@ .. moduleauthor:: Mike Verdone .. moduleauthor:: Mark Russell .. moduleauthor:: Antoine Pitrou -.. moduleauthor:: Amaury Forgeotdarc +.. moduleauthor:: Amaury Forgeot d'Arc .. sectionauthor:: Benjamin Peterson The :mod:`io` module provides the Python interfaces to stream handling. The Modified: python/branches/io-c/Lib/io.py ============================================================================== --- python/branches/io-c/Lib/io.py (original) +++ python/branches/io-c/Lib/io.py Sat Feb 28 20:34:59 2009 @@ -47,7 +47,7 @@ "Mike Verdone , " "Mark Russell , " "Antoine Pitrou , " - "Amaury Forgeotdarc ") + "Amaury Forgeot d'Arc ") __all__ = ["BlockingIOError", "open", "IOBase", "RawIOBase", "FileIO", "BytesIO", "StringIO", "BufferedIOBase", From buildbot at python.org Sat Feb 28 20:44:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 28 Feb 2009 19:44:22 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090228194423.331B21E4002@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/4690 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: jeffrey.yasskin BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sat Feb 28 20:49:44 2009 From: python-checkins at python.org (jeffrey.yasskin) Date: Sat, 28 Feb 2009 20:49:44 +0100 (CET) Subject: [Python-checkins] r70076 - python/branches/py3k/Python/peephole.c Message-ID: <20090228194944.56AB91E4002@bag.python.org> Author: jeffrey.yasskin Date: Sat Feb 28 20:49:43 2009 New Revision: 70076 Log: Fix 2 oversights from r69961. Modified: python/branches/py3k/Python/peephole.c Modified: python/branches/py3k/Python/peephole.c ============================================================================== --- python/branches/py3k/Python/peephole.c (original) +++ python/branches/py3k/Python/peephole.c Sat Feb 28 20:49:43 2009 @@ -425,7 +425,7 @@ cumlc = lastlc + 1; j = GETARG(codestr, i); if (codestr[i+3] != POP_JUMP_IF_FALSE || - !ISBASICBLOCK(blocks,i,7) || + !ISBASICBLOCK(blocks,i,6) || !PyObject_IsTrue(PyList_GET_ITEM(consts, j))) continue; memset(codestr+i, NOP, 6); @@ -516,8 +516,10 @@ "if a or b:" "a and b or c" "(a and b) and c" - x:POP_OR_JUMP y y:POP_OR_JUMP z --> x:POP_OR_JUMP z - x:POP_OR_JUMP y y:JUMP_OR_POP z --> x:POP_JUMP_IF_FALSE y+3 + x:JUMP_IF_FALSE_OR_POP y y:JUMP_IF_FALSE_OR_POP z + --> x:JUMP_IF_FALSE_OR_POP z + x:JUMP_IF_FALSE_OR_POP y y:JUMP_IF_TRUE_OR_POP z + --> x:POP_JUMP_IF_FALSE y+3 where y+3 is the instruction following the second test. */ case JUMP_IF_FALSE_OR_POP: From python-checkins at python.org Sat Feb 28 20:52:09 2009 From: python-checkins at python.org (jeffrey.yasskin) Date: Sat, 28 Feb 2009 20:52:09 +0100 (CET) Subject: [Python-checkins] r70077 - python/branches/py3k Message-ID: <20090228195209.B5A481E4002@bag.python.org> Author: jeffrey.yasskin Date: Sat Feb 28 20:52:09 2009 New Revision: 70077 Log: Blocked revisions 70071 via svnmerge ........ r70071 | jeffrey.yasskin | 2009-02-28 11:03:21 -0800 (Sat, 28 Feb 2009) | 5 lines Backport r69961 to trunk, replacing JUMP_IF_{TRUE,FALSE} with POP_JUMP_IF_{TRUE,FALSE} and JUMP_IF_{TRUE,FALSE}_OR_POP. This avoids executing a POP_TOP on each conditional and sometimes allows the peephole optimizer to skip a JUMP_ABSOLUTE entirely. It speeds up list comprehensions significantly. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat Feb 28 22:33:10 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 28 Feb 2009 22:33:10 +0100 (CET) Subject: [Python-checkins] r70078 - python/trunk/Lib/abc.py Message-ID: <20090228213310.879371E4002@bag.python.org> Author: georg.brandl Date: Sat Feb 28 22:33:10 2009 New Revision: 70078 Log: Fix 3k-style metaclass syntax in docstrings. Modified: python/trunk/Lib/abc.py Modified: python/trunk/Lib/abc.py ============================================================================== --- python/trunk/Lib/abc.py (original) +++ python/trunk/Lib/abc.py Sat Feb 28 22:33:10 2009 @@ -15,7 +15,8 @@ Usage: - class C(metaclass=ABCMeta): + class C: + __metaclass__ = ABCMeta @abstractmethod def my_abstract_method(self, ...): ... @@ -35,7 +36,8 @@ Usage: - class C(metaclass=ABCMeta): + class C: + __metaclass__ = ABCMeta @abstractproperty def my_abstract_property(self): ... @@ -43,7 +45,8 @@ This defines a read-only property; you can also define a read-write abstract property using the 'long' form of property declaration: - class C(metaclass=ABCMeta): + class C: + __metaclass__ = ABCMeta def getx(self): ... def setx(self, value): ... x = abstractproperty(getx, setx) From python-checkins at python.org Sat Feb 28 22:34:14 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 28 Feb 2009 22:34:14 +0100 (CET) Subject: [Python-checkins] r70079 - python/branches/py3k Message-ID: <20090228213414.C3C371E4002@bag.python.org> Author: georg.brandl Date: Sat Feb 28 22:34:14 2009 New Revision: 70079 Log: Blocked revisions 70078 via svnmerge ........ r70078 | georg.brandl | 2009-02-28 22:33:10 +0100 (Sa, 28 Feb 2009) | 2 lines Fix 3k-style metaclass syntax in docstrings. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat Feb 28 22:35:59 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 28 Feb 2009 22:35:59 +0100 (CET) Subject: [Python-checkins] r70080 - in python/branches/release26-maint: Lib/abc.py Message-ID: <20090228213559.933011E4002@bag.python.org> Author: georg.brandl Date: Sat Feb 28 22:35:59 2009 New Revision: 70080 Log: Merged revisions 70078 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70078 | georg.brandl | 2009-02-28 22:33:10 +0100 (Sa, 28 Feb 2009) | 2 lines Fix 3k-style metaclass syntax in docstrings. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/abc.py Modified: python/branches/release26-maint/Lib/abc.py ============================================================================== --- python/branches/release26-maint/Lib/abc.py (original) +++ python/branches/release26-maint/Lib/abc.py Sat Feb 28 22:35:59 2009 @@ -15,7 +15,8 @@ Usage: - class C(metaclass=ABCMeta): + class C: + __metaclass__ = ABCMeta @abstractmethod def my_abstract_method(self, ...): ... @@ -35,7 +36,8 @@ Usage: - class C(metaclass=ABCMeta): + class C: + __metaclass__ = ABCMeta @abstractproperty def my_abstract_property(self): ... @@ -43,7 +45,8 @@ This defines a read-only property; you can also define a read-write abstract property using the 'long' form of property declaration: - class C(metaclass=ABCMeta): + class C: + __metaclass__ = ABCMeta def getx(self): ... def setx(self, value): ... x = abstractproperty(getx, setx) From buildbot at python.org Sat Feb 28 23:12:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 28 Feb 2009 22:12:14 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090228221214.232DD1E4002@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/188 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 buildbot at python.org Sat Feb 28 23:12:21 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 28 Feb 2009 22:12:21 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090228221221.CA7591E4002@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/361 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: The web-page 'force build' button was pressed by 'ertan': use it Build Source Stamp: [branch chemistry] HEAD Blamelist: BUILD FAILED: failed svn sincerely, -The Buildbot